Documentation ¶
Index ¶
- type Config
- type Ledger
- type Notary
- func (n *Notary) Name() string
- func (n *Notary) OnNewRequest(payload *payload.P2PNotaryRequest)
- func (n *Notary) OnRequestRemoval(pld *payload.P2PNotaryRequest)
- func (n *Notary) PostPersist()
- func (n *Notary) Shutdown()
- func (n *Notary) Start()
- func (n *Notary) UpdateNotaryNodes(notaryNodes keys.PublicKeys)
- type RequestType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Ledger ¶ added in v0.98.1
type Ledger interface { BlockHeight() uint32 GetMaxVerificationGAS() int64 GetNotaryContractScriptHash() util.Uint160 SubscribeForBlocks(ch chan *block.Block) UnsubscribeFromBlocks(ch chan *block.Block) VerifyWitness(util.Uint160, hash.Hashable, *transaction.Witness, int64) (int64, error) }
Ledger is the interface to Blockchain sufficient for Notary.
type Notary ¶
type Notary struct { Config Config Network netmode.Magic // contains filtered or unexported fields }
Notary represents a Notary module.
func NewNotary ¶
func NewNotary(cfg Config, net netmode.Magic, mp *mempool.Pool, onTransaction func(tx *transaction.Transaction) error) (*Notary, error)
NewNotary returns a new Notary module.
func (*Notary) OnNewRequest ¶
func (n *Notary) OnNewRequest(payload *payload.P2PNotaryRequest)
OnNewRequest is a callback method which is called after a new notary request is added to the notary request pool.
func (*Notary) OnRequestRemoval ¶
func (n *Notary) OnRequestRemoval(pld *payload.P2PNotaryRequest)
OnRequestRemoval is a callback which is called after fallback transaction is removed from the notary payload pool due to expiration, main tx appliance or any other reason.
func (*Notary) PostPersist ¶
func (n *Notary) PostPersist()
PostPersist is a callback which is called after a new block event is received. PostPersist must not be called under the blockchain lock, because it uses finalization function.
func (*Notary) Shutdown ¶ added in v0.98.1
func (n *Notary) Shutdown()
Shutdown stops the Notary module. It can only be called once, subsequent calls to Shutdown on the same instance are no-op. The instance that was stopped can not be started again by calling Start (use a new instance if needed).
func (*Notary) Start ¶ added in v0.98.1
func (n *Notary) Start()
Start runs a Notary module in a separate goroutine. The Notary only starts once, subsequent calls to Start are no-op.
func (*Notary) UpdateNotaryNodes ¶
func (n *Notary) UpdateNotaryNodes(notaryNodes keys.PublicKeys)
UpdateNotaryNodes implements Notary interface and updates current notary account.
type RequestType ¶
type RequestType byte
RequestType represents type of Notary request.
const ( // Signature represents standard single signature request type. Signature RequestType = 0x01 // MultiSignature represents m out of n multisignature request type. MultiSignature RequestType = 0x02 // Contract represents contract witness type. Contract RequestType = 0x03 )