Documentation ¶
Index ¶
- Constants
- Variables
- func MakeChainRecordDbKey(chainID *isc.ChainID) []byte
- type AuxChainRecord
- type ChainRecord
- type ChainRecordRegistryProvider
- type Config
- type DKShareRegistryProvider
- type Impl
- func (r *Impl) ActivateChainRecord(chainID *isc.ChainID) (*ChainRecord, error)
- func (r *Impl) DeactivateChainRecord(chainID *isc.ChainID) (*ChainRecord, error)
- func (r *Impl) DistrustPeer(pubKey *cryptolib.PublicKey) (*peering.TrustedPeer, error)
- func (r *Impl) GetBlob(h hashing.HashValue) ([]byte, bool, error)
- func (r *Impl) GetChainRecordByChainID(chainID *isc.ChainID) (*ChainRecord, error)
- func (r *Impl) GetChainRecords() ([]*ChainRecord, error)
- func (r *Impl) GetNodeIdentity() *cryptolib.KeyPair
- func (r *Impl) GetNodePublicKey() *cryptolib.PublicKey
- func (r *Impl) HasBlob(h hashing.HashValue) (bool, error)
- func (r *Impl) IsTrustedPeer(pubKey *cryptolib.PublicKey) error
- func (r *Impl) LoadConsensusJournal(id journal.ID) (journal.LogIndex, journal.LocalView, error)
- func (r *Impl) LoadDKShare(sharedAddress iotago.Address) (tcrypto.DKShare, error)
- func (r *Impl) PutBlob(data []byte, ttl ...time.Duration) (hashing.HashValue, error)
- func (r *Impl) SaveChainRecord(rec *ChainRecord) error
- func (r *Impl) SaveConsensusJournalLocalView(id journal.ID, localView journal.LocalView) error
- func (r *Impl) SaveConsensusJournalLogIndex(id journal.ID, logIndex journal.LogIndex) error
- func (r *Impl) SaveDKShare(dkShare tcrypto.DKShare) error
- func (r *Impl) TrustPeer(pubKey *cryptolib.PublicKey, netID string) (*peering.TrustedPeer, error)
- func (r *Impl) TrustedPeers() ([]*peering.TrustedPeer, error)
- func (r *Impl) UpdateChainRecord(chainID *isc.ChainID, f func(*ChainRecord) bool) (*ChainRecord, error)
- type NodeIdentityProvider
- type Provider
- type Registry
Constants ¶
const BlobCacheDefaultTTL = 1 * time.Hour
Variables ¶
Functions ¶
func MakeChainRecordDbKey ¶ added in v0.2.0
Types ¶
type AuxChainRecord ¶ added in v0.3.3
type ChainRecord ¶ added in v0.1.0
ChainRecord represents chain the node is participating in TODO optimize, no need for a persistent structure, simple activity tag is enough
func ChainRecordFromBytes ¶ added in v0.2.0
func ChainRecordFromBytes(data []byte) (*ChainRecord, error)
CommitteeRecordFromBytes
func FromMarshalUtil ¶ added in v0.2.0
func FromMarshalUtil(mu *marshalutil.MarshalUtil) (*ChainRecord, error)
func (*ChainRecord) Bytes ¶ added in v0.2.0
func (rec *ChainRecord) Bytes() []byte
func (*ChainRecord) String ¶ added in v0.1.0
func (rec *ChainRecord) String() string
type ChainRecordRegistryProvider ¶ added in v0.2.0
type ChainRecordRegistryProvider interface { GetChainRecordByChainID(chainID *isc.ChainID) (*ChainRecord, error) GetChainRecords() ([]*ChainRecord, error) UpdateChainRecord(chainID *isc.ChainID, f func(*ChainRecord) bool) (*ChainRecord, error) ActivateChainRecord(chainID *isc.ChainID) (*ChainRecord, error) DeactivateChainRecord(chainID *isc.ChainID) (*ChainRecord, error) SaveChainRecord(rec *ChainRecord) error }
ChainRecordRegistryProvider stands for a partial registry interface, needed for this package.
type Config ¶ added in v0.3.0
func DefaultConfig ¶ added in v0.3.0
func DefaultConfig() *Config
type DKShareRegistryProvider ¶ added in v0.2.0
type DKShareRegistryProvider interface {}
DKShareRegistryProvider stands for a partial registry interface, needed for this package. It should be implemented by registry.impl
type Impl ¶ added in v0.1.0
type Impl struct {
// contains filtered or unexported fields
}
Impl is just a placeholder to implement all interfaces needed by different components. Each of the interfaces are implemented in the corresponding file in this package.
func NewRegistry ¶ added in v0.1.0
New creates new instance of the registry implementation.
func (*Impl) ActivateChainRecord ¶ added in v0.2.0
func (r *Impl) ActivateChainRecord(chainID *isc.ChainID) (*ChainRecord, error)
func (*Impl) DeactivateChainRecord ¶ added in v0.2.0
func (r *Impl) DeactivateChainRecord(chainID *isc.ChainID) (*ChainRecord, error)
func (*Impl) DistrustPeer ¶ added in v0.2.0
DistrustPeer implements TrustedNetworkManager interface. Get is kind of optional, so we ignore errors related to it.
func (*Impl) GetChainRecordByChainID ¶ added in v0.2.0
func (r *Impl) GetChainRecordByChainID(chainID *isc.ChainID) (*ChainRecord, error)
func (*Impl) GetChainRecords ¶ added in v0.2.0
func (r *Impl) GetChainRecords() ([]*ChainRecord, error)
func (*Impl) GetNodeIdentity ¶ added in v0.1.0
GetNodeIdentity implements NodeIdentityProvider.
func (*Impl) GetNodePublicKey ¶ added in v0.1.0
GetNodePublicKey implements NodeIdentityProvider.
func (*Impl) IsTrustedPeer ¶ added in v0.2.0
IsTrustedPeer implements TrustedNetworkManager interface.
func (*Impl) LoadConsensusJournal ¶ added in v0.3.0
func (*Impl) LoadDKShare ¶ added in v0.1.0
LoadDKShare implements dkg.DKShareRegistryProvider.
func (*Impl) PutBlob ¶ added in v0.1.0
PutBlob Writes data into the registry with the key of its hash Also stores TTL if provided
func (*Impl) SaveChainRecord ¶ added in v0.2.0
func (r *Impl) SaveChainRecord(rec *ChainRecord) error
func (*Impl) SaveConsensusJournalLocalView ¶ added in v0.3.0
func (*Impl) SaveConsensusJournalLogIndex ¶ added in v0.3.0
func (*Impl) SaveDKShare ¶ added in v0.1.0
SaveDKShare implements dkg.DKShareRegistryProvider.
func (*Impl) TrustedPeers ¶ added in v0.2.0
func (r *Impl) TrustedPeers() ([]*peering.TrustedPeer, error)
TrustedPeers implements TrustedNetworkManager interface.
func (*Impl) UpdateChainRecord ¶ added in v0.2.0
func (r *Impl) UpdateChainRecord(chainID *isc.ChainID, f func(*ChainRecord) bool) (*ChainRecord, error)
type NodeIdentityProvider ¶ added in v0.1.0
type Registry ¶ added in v0.3.3
type Registry interface { NodeIdentityProvider DKShareRegistryProvider ChainRecordRegistryProvider journal.Registry peering.TrustedNetworkManager }