notary

package
v0.97.3-pre Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 18, 2021 License: MIT Imports: 23 Imported by: 0

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) Stop

func (n *Notary) Stop()

Stop shutdowns Notary module.

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 (
	// Unknown represents unknown request type which means that main tx witnesses are invalid.
	Unknown RequestType = 0x00
	// Signature represents standard single signature request type.
	Signature RequestType = 0x01
	// MultiSignature represents m out of n multisignature request type.
	MultiSignature RequestType = 0x02
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL