registry

package
v1.4.0-alpha.5 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2024 License: Apache-2.0 Imports: 22 Imported by: 1

Documentation

Overview

Copyright 2020 IOTA Stiftung SPDX-License-Identifier: Apache-2.0

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChainRecord added in v0.1.0

type ChainRecord struct {
	Active      bool
	AccessNodes []*cryptolib.PublicKey
	// contains filtered or unexported fields
}

ChainRecord represents chain the node is participating in.

func NewChainRecord added in v1.0.3

func NewChainRecord(chainID isc.ChainID, active bool, accessNodes []*cryptolib.PublicKey) *ChainRecord

func (*ChainRecord) AddAccessNode added in v1.0.3

func (r *ChainRecord) AddAccessNode(pubKey *cryptolib.PublicKey) (modified bool)

func (*ChainRecord) ChainID added in v0.1.0

func (r *ChainRecord) ChainID() isc.ChainID

func (*ChainRecord) Clone added in v1.0.3

func (*ChainRecord) ID added in v1.0.3

func (r *ChainRecord) ID() isc.ChainID

func (*ChainRecord) MarshalJSON added in v1.0.3

func (r *ChainRecord) MarshalJSON() ([]byte, error)

func (*ChainRecord) RemoveAccessNode added in v1.0.3

func (r *ChainRecord) RemoveAccessNode(pubKey *cryptolib.PublicKey) (modified bool)

func (*ChainRecord) UnmarshalJSON added in v1.0.3

func (r *ChainRecord) UnmarshalJSON(bytes []byte) error

type ChainRecordModifiedEvent added in v1.0.3

type ChainRecordModifiedEvent struct {
	ChainRecord *ChainRecord
}

ChainRecordModifiedEvent contains the updated information of a chain record.

type ChainRecordRegistryEvents added in v1.0.3

type ChainRecordRegistryEvents struct {
	// A ChainRecordModified event is triggered, when a chain record was modified.
	ChainRecordModified *event.Event1[*ChainRecordModifiedEvent]
}

ChainRecordRegistryEvents contain all events of the ChainRecordRegistry.

type ChainRecordRegistryImpl added in v1.0.3

type ChainRecordRegistryImpl struct {
	// contains filtered or unexported fields
}

func NewChainRecordRegistryImpl added in v1.0.3

func NewChainRecordRegistryImpl(filePath string) (*ChainRecordRegistryImpl, error)

NewChainRecordRegistryImpl creates new instance of the chain registry implementation.

func (*ChainRecordRegistryImpl) ActivateChainRecord added in v1.0.3

func (p *ChainRecordRegistryImpl) ActivateChainRecord(chainID isc.ChainID) (*ChainRecord, error)

func (*ChainRecordRegistryImpl) AddChainRecord added in v1.0.3

func (p *ChainRecordRegistryImpl) AddChainRecord(chainRecord *ChainRecord) error

func (*ChainRecordRegistryImpl) ChainRecord added in v1.0.3

func (p *ChainRecordRegistryImpl) ChainRecord(chainID isc.ChainID) (*ChainRecord, error)

func (*ChainRecordRegistryImpl) ChainRecords added in v1.0.3

func (p *ChainRecordRegistryImpl) ChainRecords() ([]*ChainRecord, error)

func (*ChainRecordRegistryImpl) DeactivateChainRecord added in v1.0.3

func (p *ChainRecordRegistryImpl) DeactivateChainRecord(chainID isc.ChainID) (*ChainRecord, error)

func (*ChainRecordRegistryImpl) DeleteChainRecord added in v1.0.3

func (p *ChainRecordRegistryImpl) DeleteChainRecord(chainID isc.ChainID) error

func (*ChainRecordRegistryImpl) Events added in v1.0.3

func (*ChainRecordRegistryImpl) ForEachActiveChainRecord added in v1.0.3

func (p *ChainRecordRegistryImpl) ForEachActiveChainRecord(consumer func(*ChainRecord) bool) error

func (*ChainRecordRegistryImpl) UpdateChainRecord added in v1.0.3

func (p *ChainRecordRegistryImpl) UpdateChainRecord(chainID isc.ChainID, callback func(*ChainRecord) bool) (*ChainRecord, error)

UpdateChainRecord modifies a ChainRecord in the Registry.

type ChainRecordRegistryProvider added in v0.2.0

type ChainRecordRegistryProvider interface {
	Events() *ChainRecordRegistryEvents
	ChainRecord(chainID isc.ChainID) (*ChainRecord, error)
	ChainRecords() ([]*ChainRecord, error)
	ForEachActiveChainRecord(consumer func(*ChainRecord) bool) error
	AddChainRecord(chainRecord *ChainRecord) error
	DeleteChainRecord(chainID isc.ChainID) error
	UpdateChainRecord(chainID isc.ChainID, f func(*ChainRecord) bool) (*ChainRecord, error)
	ActivateChainRecord(chainID isc.ChainID) (*ChainRecord, error)
	DeactivateChainRecord(chainID isc.ChainID) (*ChainRecord, error)
}

type ConsensusStateRegistry added in v1.0.3

type ConsensusStateRegistry struct {
	// contains filtered or unexported fields
}

func NewConsensusStateRegistry added in v1.0.3

func NewConsensusStateRegistry(folderPath string, networkPrefix iotago.NetworkPrefix) (*ConsensusStateRegistry, error)

NewConsensusStateRegistry creates new instance of the consensus state registry implementation.

func (*ConsensusStateRegistry) Get added in v1.0.3

func (p *ConsensusStateRegistry) Get(chainID isc.ChainID, committeeAddress iotago.Address) (*cmt_log.State, error)

Can return cmtLog.ErrCmtLogStateNotFound.

func (*ConsensusStateRegistry) Set added in v1.0.3

func (p *ConsensusStateRegistry) Set(chainID isc.ChainID, committeeAddress iotago.Address, state *cmt_log.State) error

type DKShareRegistryProvider added in v0.2.0

type DKShareRegistryProvider interface {
	SaveDKShare(dkShare tcrypto.DKShare) error
	LoadDKShare(sharedAddress iotago.Address) (tcrypto.DKShare, error)
}

type DKSharesRegistry added in v1.0.3

type DKSharesRegistry struct {
	// contains filtered or unexported fields
}

func NewDKSharesRegistry added in v1.0.3

func NewDKSharesRegistry(folderPath string, nodePrivKey *cryptolib.PrivateKey, networkPrefix iotago.NetworkPrefix) (*DKSharesRegistry, error)

NewDKSharesRegistry creates new instance of the DKShare registry implementation.

func (*DKSharesRegistry) LoadDKShare added in v1.0.3

func (p *DKSharesRegistry) LoadDKShare(sharedAddress iotago.Address) (tcrypto.DKShare, error)

func (*DKSharesRegistry) SaveDKShare added in v1.0.3

func (p *DKSharesRegistry) SaveDKShare(dkShare tcrypto.DKShare) error

type NodeIdentity added in v1.0.3

type NodeIdentity struct {
	// contains filtered or unexported fields
}

func NewNodeIdentity added in v1.0.3

func NewNodeIdentity(nodeIdentity *cryptolib.KeyPair) *NodeIdentity

func (*NodeIdentity) NodeIdentity added in v1.0.3

func (p *NodeIdentity) NodeIdentity() *cryptolib.KeyPair

func (*NodeIdentity) NodePublicKey added in v1.0.3

func (p *NodeIdentity) NodePublicKey() *cryptolib.PublicKey

type NodeIdentityProvider added in v0.1.0

type NodeIdentityProvider interface {
	NodeIdentity() *cryptolib.KeyPair
	NodePublicKey() *cryptolib.PublicKey
}

type TrustedPeersRegistryImpl added in v1.0.3

type TrustedPeersRegistryImpl struct {
	// contains filtered or unexported fields
}

func NewTrustedPeersRegistryImpl added in v1.0.3

func NewTrustedPeersRegistryImpl(filePath string) (*TrustedPeersRegistryImpl, error)

NewTrustedPeersRegistryImpl creates new instance of the trusted peers registry implementation.

func (*TrustedPeersRegistryImpl) DistrustPeer added in v1.0.3

func (*TrustedPeersRegistryImpl) IsTrustedPeer added in v1.0.3

func (p *TrustedPeersRegistryImpl) IsTrustedPeer(pubKey *cryptolib.PublicKey) error

func (*TrustedPeersRegistryImpl) TrustPeer added in v1.0.3

func (p *TrustedPeersRegistryImpl) TrustPeer(name string, pubKey *cryptolib.PublicKey, peeringURL string) (*peering.TrustedPeer, error)

func (*TrustedPeersRegistryImpl) TrustedPeers added in v1.0.3

func (p *TrustedPeersRegistryImpl) TrustedPeers() ([]*peering.TrustedPeer, error)

func (*TrustedPeersRegistryImpl) TrustedPeersByPubKeyOrName added in v1.0.3

func (p *TrustedPeersRegistryImpl) TrustedPeersByPubKeyOrName(pubKeysOrNames []string) ([]*peering.TrustedPeer, error)

func (*TrustedPeersRegistryImpl) TrustedPeersListener added in v1.0.3

func (p *TrustedPeersRegistryImpl) TrustedPeersListener(callback func([]*peering.TrustedPeer)) context.CancelFunc

type TrustedPeersRegistryProvider added in v1.0.3

type TrustedPeersRegistryProvider interface {
	IsTrustedPeer(pubKey *cryptolib.PublicKey) error
	TrustPeer(name string, pubKey *cryptolib.PublicKey, accountURL string) (*peering.TrustedPeer, error)
	DistrustPeer(pubKey *cryptolib.PublicKey) (*peering.TrustedPeer, error)
	TrustedPeers() ([]*peering.TrustedPeer, error)
	TrustedPeersByPubKeyOrName(pubKeysOrNames []string) ([]*peering.TrustedPeer, error)
	TrustedPeersListener(callback func([]*peering.TrustedPeer)) context.CancelFunc
}

Jump to

Keyboard shortcuts

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