Documentation
¶
Index ¶
- Variables
- func GetPublicKeyAndVerifier(signer crypto.Signer) ([]byte, crypto.Verifier, error)
- func NewGenesis(partitions []*genesis.PartitionRecord, rootSigner crypto.Signer, ...) (*genesis.RootGenesis, []*genesis.PartitionGenesis, error)
- func NewGenesisFromPartitionNodes(nodes []*genesis.PartitionNode, rootSigner crypto.Signer, ...) (*genesis.RootGenesis, []*genesis.PartitionGenesis, error)
- type Net
- type Option
- type RootChain
- type State
- func (s *State) CopyOldInputRecords(identifier string)
- func (s *State) CreateUnicityCertificates() ([]string, error)
- func (s *State) GetLatestUnicityCertificate(systemID string) *certificates.UnicityCertificate
- func (s *State) GetRoundNumber() uint64
- func (s *State) HandleBlockCertificationRequest(req *certification.BlockCertificationRequest) (*certificates.UnicityCertificate, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrSignerIsNil = errors.New("signer is nil")
Functions ¶
func GetPublicKeyAndVerifier ¶
func NewGenesis ¶
func NewGenesis(partitions []*genesis.PartitionRecord, rootSigner crypto.Signer, encPubKey crypto.Verifier) (*genesis.RootGenesis, []*genesis.PartitionGenesis, error)
NewGenesis creates a new genesis for the root chain and each partition.
func NewGenesisFromPartitionNodes ¶
func NewGenesisFromPartitionNodes(nodes []*genesis.PartitionNode, rootSigner crypto.Signer, encPubKey crypto.Verifier) (*genesis.RootGenesis, []*genesis.PartitionGenesis, error)
NewGenesisFromPartitionNodes creates a new genesis for the root chain and partitions.
Types ¶
type Net ¶
type Net interface {
Send(msg network.OutputMessage, receivers []peer.ID) error
ReceivedChannel() <-chan network.ReceivedMessage
}
Net provides an interface for sending messages to and receiving messages from other nodes in the network.
type RootChain ¶
type RootChain struct {
// contains filtered or unexported fields
}
type State ¶
type State struct {
// contains filtered or unexported fields
}
State holds the State of the root chain.
func NewStateFromGenesis ¶
func NewStateFromPartitionRecords ¶
func NewStateFromPartitionRecords(partitions []*genesis.PartitionRecord, signer crypto.Signer, hashAlgorithm gocrypto.Hash) (*State, error)
NewStateFromPartitionRecords creates the State from the genesis.PartitionRecord array. The State returned by this method is usually used to generate genesis file.
func (*State) CopyOldInputRecords ¶
CopyOldInputRecords copies input records from the latest unicity certificates to inputRecords.
func (*State) CreateUnicityCertificates ¶
func (*State) GetLatestUnicityCertificate ¶
func (s *State) GetLatestUnicityCertificate(systemID string) *certificates.UnicityCertificate
func (*State) GetRoundNumber ¶
func (*State) HandleBlockCertificationRequest ¶
func (s *State) HandleBlockCertificationRequest(req *certification.BlockCertificationRequest) (*certificates.UnicityCertificate, error)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.