notary

package
v0.102.0 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2023 License: MIT Imports: 24 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 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) Name added in v0.99.0

func (n *Notary) Name() string

Name returns service name.

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
)

Jump to

Keyboard shortcuts

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