Documentation ¶
Index ¶
- Constants
- Variables
- func ComputeRoundHash(nodeId crypto.Hash, number uint64, snapshots []*common.Snapshot) (uint64, uint64, crypto.Hash)
- type CacheRound
- type FinalRound
- type Genesis
- type Node
- func (node *Node) AddNeighborsFromConfig() error
- func (node *Node) Authenticate(msg []byte) (crypto.Hash, string, error)
- func (node *Node) BuildAuthenticationMessage() []byte
- func (node *Node) BuildGraph() []*network.SyncPoint
- func (node *Node) CachePutTransaction(peerId crypto.Hash, tx *common.VersionedTransaction) error
- func (node *Node) CacheVerify(snap crypto.Hash, sig crypto.Signature, pub crypto.Key) bool
- func (node *Node) CheckBroadcastedToPeers() bool
- func (node *Node) CheckCatchUpWithPeers() bool
- func (node *Node) ConsumeMempool() error
- func (node *Node) ConsumeQueue() error
- func (node *Node) ElectionLoop() error
- func (node *Node) GetCacheStore() *fastcache.Cache
- func (node *Node) ListenNeighbors() error
- func (node *Node) LoadCacheToQueue() error
- func (node *Node) LoadConsensusNodes() error
- func (node *Node) LoadGenesis(configDir string) error
- func (node *Node) LoadNodeConfig()
- func (node *Node) Loop() error
- func (node *Node) MintLoop() error
- func (node *Node) NetworkId() crypto.Hash
- func (node *Node) QueueAppendSnapshot(peerId crypto.Hash, s *common.Snapshot, final bool) error
- func (node *Node) QueueTransaction(tx *common.VersionedTransaction) (string, error)
- func (node *Node) ReadSnapshotsForNodeRound(nodeIdWithNetwork crypto.Hash, round uint64) ([]*common.SnapshotWithTopologicalOrder, error)
- func (node *Node) ReadSnapshotsSinceTopology(offset, count uint64) ([]*common.SnapshotWithTopologicalOrder, error)
- func (node *Node) SendTransactionToPeer(peerId, hash crypto.Hash) error
- func (node *Node) TopologicalOrder() uint64
- func (node *Node) UpdateSyncPoint(peerId crypto.Hash, points []*network.SyncPoint)
- func (node *Node) Uptime() time.Duration
- func (node *Node) VerifyAndQueueAppendSnapshot(peerId crypto.Hash, s *common.Snapshot) error
- type RoundGraph
- type TopologicalSequence
Constants ¶
View Source
const ( MinimumNodeCount = 7 PledgeAmount = 10000 )
View Source
const (
MempoolSize = 8192
)
Variables ¶
View Source
var ( MintPool common.Integer MintYearBatches int )
Functions ¶
Types ¶
type CacheRound ¶
type CacheRound struct { NodeId crypto.Hash Number uint64 Timestamp uint64 References *common.RoundLink Snapshots []*common.Snapshot `msgpack:"-"` }
func (*CacheRound) Copy ¶
func (c *CacheRound) Copy() *CacheRound
func (*CacheRound) Gap ¶
func (c *CacheRound) Gap() (uint64, uint64)
func (*CacheRound) ValidateSnapshot ¶
func (c *CacheRound) ValidateSnapshot(s *common.Snapshot, add bool) bool
type FinalRound ¶
type FinalRound struct { NodeId crypto.Hash Number uint64 Start uint64 End uint64 Hash crypto.Hash }
func (*FinalRound) Copy ¶
func (f *FinalRound) Copy() *FinalRound
type Genesis ¶
type Genesis struct { Epoch int64 `json:"epoch"` Nodes []struct { Signer common.Address `json:"signer"` Payee common.Address `json:"payee"` Balance common.Integer `json:"balance"` } `json:"nodes"` Domains []struct { Signer common.Address `json:"signer"` Balance common.Integer `json:"balance"` } `json:"domains"` }
type Node ¶
type Node struct { IdForNetwork crypto.Hash Signer common.Address Graph *RoundGraph TopoCounter *TopologicalSequence SnapshotsPool map[crypto.Hash][]*crypto.Signature SignaturesPool map[crypto.Hash]*crypto.Signature CachePool map[crypto.Hash][]*common.Snapshot Peer *network.Peer SyncPoints *syncMap Listener string ConsensusNodes map[crypto.Hash]*common.Node ConsensusBase int ConsensusPledging *common.Node // contains filtered or unexported fields }
func (*Node) AddNeighborsFromConfig ¶
func (*Node) BuildAuthenticationMessage ¶
func (*Node) BuildGraph ¶
func (*Node) CachePutTransaction ¶
func (*Node) CacheVerify ¶
func (*Node) CheckBroadcastedToPeers ¶ added in v0.2.12
func (*Node) CheckCatchUpWithPeers ¶ added in v0.2.12
func (*Node) ConsumeMempool ¶
func (*Node) ConsumeQueue ¶
func (*Node) ElectionLoop ¶ added in v0.3.5
func (*Node) GetCacheStore ¶ added in v0.2.18
func (*Node) ListenNeighbors ¶
func (*Node) LoadCacheToQueue ¶
func (*Node) LoadConsensusNodes ¶
func (*Node) LoadGenesis ¶
func (*Node) LoadNodeConfig ¶ added in v0.2.15
func (node *Node) LoadNodeConfig()
func (*Node) QueueAppendSnapshot ¶
func (*Node) QueueTransaction ¶ added in v0.1.2
func (node *Node) QueueTransaction(tx *common.VersionedTransaction) (string, error)
func (*Node) ReadSnapshotsForNodeRound ¶
func (*Node) ReadSnapshotsSinceTopology ¶
func (node *Node) ReadSnapshotsSinceTopology(offset, count uint64) ([]*common.SnapshotWithTopologicalOrder, error)
func (*Node) SendTransactionToPeer ¶
func (*Node) TopologicalOrder ¶ added in v0.1.2
func (*Node) UpdateSyncPoint ¶
type RoundGraph ¶
type RoundGraph struct { Nodes []*crypto.Hash CacheRound map[crypto.Hash]*CacheRound FinalRound map[crypto.Hash]*FinalRound RoundHistory map[crypto.Hash][]*FinalRound GraphTimestamp uint64 FinalCache []*network.SyncPoint MyCacheRound *CacheRound MyFinalNumber uint64 }
func LoadRoundGraph ¶
func (*RoundGraph) Print ¶
func (g *RoundGraph) Print() string
func (*RoundGraph) UpdateFinalCache ¶
func (g *RoundGraph) UpdateFinalCache(idForNetwork crypto.Hash)
type TopologicalSequence ¶
func (*TopologicalSequence) Next ¶
func (c *TopologicalSequence) Next() uint64
Click to show internal directories.
Click to hide internal directories.