notary

package
v0.98.5 Latest Latest
Warning

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

Go to latest
Published: May 13, 2022 License: MIT Imports: 22 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   Ledger
	Log     *zap.Logger
}

Config represents external configuration for Notary module.

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 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) Shutdown added in v0.98.1

func (n *Notary) Shutdown()

Shutdown stops Notary module.

func (*Notary) Start added in v0.98.1

func (n *Notary) Start()

Start runs Notary module 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
)

Jump to

Keyboard shortcuts

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