Documentation ¶
Index ¶
- Variables
- type Broker
- type Commander
- type Config
- type Notary
- func (n *Notary) IsSigned(ctx context.Context, resource string, kind commandspb.NodeSignatureKind) ([]commandspb.NodeSignature, bool)
- func (n *Notary) OnDefaultValidatorsVoteRequiredUpdate(ctx context.Context, d num.Decimal) error
- func (n *Notary) OnTick(_ context.Context, t time.Time)
- func (n *Notary) RegisterSignature(ctx context.Context, pubKey string, ns commandspb.NodeSignature) error
- func (n *Notary) ReloadConf(cfg Config)
- func (n *Notary) StartAggregate(resource string, kind commandspb.NodeSignatureKind, signature []byte)
- type SnapshotNotary
- func (n *SnapshotNotary) GetState(k string) ([]byte, []types.StateProvider, error)
- func (n *SnapshotNotary) HasChanged(k string) bool
- func (n *SnapshotNotary) Keys() []string
- func (n *SnapshotNotary) LoadState(ctx context.Context, payload *types.Payload) ([]types.StateProvider, error)
- func (n *SnapshotNotary) Namespace() types.SnapshotNamespace
- func (n *SnapshotNotary) OfferSignatures(kind types.NodeSignatureKind, f func(resource string) []byte)
- func (n *SnapshotNotary) RegisterSignature(ctx context.Context, pubKey string, ns v1.NodeSignature) error
- func (n *SnapshotNotary) StartAggregate(resource string, kind v1.NodeSignatureKind, signature []byte)
- func (n *SnapshotNotary) Stopped() bool
- type ValidatorTopology
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Config ¶
Config represents governance specific configuration.
func NewDefaultConfig ¶
func NewDefaultConfig() Config
NewDefaultConfig creates an instance of the package specific configuration.
type Notary ¶
type Notary struct {
// contains filtered or unexported fields
}
Notary will aggregate all signatures of a node for a specific Command e.g: asset withdrawal, asset allowlisting, etc.
func (*Notary) IsSigned ¶
func (n *Notary) IsSigned( ctx context.Context, resource string, kind commandspb.NodeSignatureKind, ) ([]commandspb.NodeSignature, bool)
func (*Notary) OnDefaultValidatorsVoteRequiredUpdate ¶
func (*Notary) RegisterSignature ¶
func (n *Notary) RegisterSignature( ctx context.Context, pubKey string, ns commandspb.NodeSignature, ) error
func (*Notary) ReloadConf ¶
ReloadConf updates the internal configuration.
func (*Notary) StartAggregate ¶
func (n *Notary) StartAggregate( resource string, kind commandspb.NodeSignatureKind, signature []byte, )
StartAggregate will register a new signature to be sent for a validator, or just ignore the signature and start aggregating signature for now validators, nil for the signature is OK for non-validators.
type SnapshotNotary ¶
type SnapshotNotary struct { *Notary // contains filtered or unexported fields }
func NewWithSnapshot ¶
func NewWithSnapshot( log *logging.Logger, cfg Config, top ValidatorTopology, broker Broker, cmd Commander, ) *SnapshotNotary
NewWithSnapshot returns an "extended" Notary type which contains the ability to take engine snapshots.
func (*SnapshotNotary) GetState ¶
func (n *SnapshotNotary) GetState(k string) ([]byte, []types.StateProvider, error)
func (*SnapshotNotary) HasChanged ¶
func (n *SnapshotNotary) HasChanged(k string) bool
func (*SnapshotNotary) Keys ¶
func (n *SnapshotNotary) Keys() []string
func (*SnapshotNotary) LoadState ¶
func (n *SnapshotNotary) LoadState(ctx context.Context, payload *types.Payload) ([]types.StateProvider, error)
func (*SnapshotNotary) Namespace ¶
func (n *SnapshotNotary) Namespace() types.SnapshotNamespace
func (*SnapshotNotary) OfferSignatures ¶
func (n *SnapshotNotary) OfferSignatures( kind types.NodeSignatureKind, f func(resource string) []byte, )
func (*SnapshotNotary) RegisterSignature ¶
func (n *SnapshotNotary) RegisterSignature( ctx context.Context, pubKey string, ns v1.NodeSignature, ) error
RegisterSignature is a wrapper to Notary's RegisterSignature which also manages the snapshot state.
func (*SnapshotNotary) StartAggregate ¶
func (n *SnapshotNotary) StartAggregate( resource string, kind v1.NodeSignatureKind, signature []byte, )
StartAggregate is a wrapper to Notary's StartAggregate which also manages the snapshot state.
func (*SnapshotNotary) Stopped ¶
func (n *SnapshotNotary) Stopped() bool