Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { MainCfg config.P2PNotary Chain blockchainer.Blockchainer Log *zap.Logger }
Config represents external configuration for Notary module.
type Notary ¶
type Notary struct { Config Config Network netmode.Magic // contains filtered or unexported fields }
Notary represents Notary module.
func NewNotary ¶
func NewNotary(cfg Config, net netmode.Magic, mp *mempool.Pool, onTransaction func(tx *transaction.Transaction) error) (*Notary, error)
NewNotary returns new Notary module.
func (*Notary) OnNewRequest ¶
func (n *Notary) OnNewRequest(payload *payload.P2PNotaryRequest)
OnNewRequest is a callback method which is called after 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 new block event is received. PostPersist must not be called under the blockchain lock, because it uses finalization function.
func (*Notary) Run ¶
func (n *Notary) Run()
Run runs Notary module and should be called in a separate goroutine.
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 the 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 )