Documentation
¶
Index ¶
- Constants
- func BlockFromPeer(clog *ctxlog.ContextLog, block *blockchain.Block)
- func GetBlockByHeight(chainId, height int64) *blockchain.Header
- func GetMainChain() *blockchain.BlockChain
- func GetVoteResults(chainId int64, hash string) blockchain.Votes
- func Init(env string)
- func SuggestFee() int64
- func VoteFromPeer(vote blockchain.PeerBlockVote)
- func VoteResultFromPeer(votes blockchain.Votes)
- type DelegateNode
- func (delegate DelegateNode) BlockFromPeer(clog *ctxlog.ContextLog, block *blockchain.Block)
- func (delegate DelegateNode) GetBlockByHeight(chainId, height int64) *blockchain.Block
- func (delegate DelegateNode) GetBlockChain() *blockchain.BlockChain
- func (delegate DelegateNode) GetHeaderByHeight(chainId, height int64) *blockchain.Header
- func (delegate DelegateNode) GetVoteResults(chainId int64, hash string) blockchain.Votes
- func (delegate DelegateNode) RecoverFromDB()
- func (delegate DelegateNode) StartNode()
- func (delegate DelegateNode) VoteFromPeer(vote blockchain.PeerBlockVote)
- func (delegate DelegateNode) VoteResultFromPeer(votes blockchain.Votes)
- type ForkNode
- func (node ForkNode) BlockFromPeer(clog *ctxlog.ContextLog, block *blockchain.Block)
- func (node ForkNode) GetBlockByHeight(chainId, height int64) *blockchain.Block
- func (node ForkNode) GetBlockChain() *blockchain.BlockChain
- func (node ForkNode) GetHeaderByHeight(chainId, height int64) *blockchain.Header
- func (node ForkNode) GetVoteResults(chainId int64, hash string) blockchain.Votes
- func (node ForkNode) StartNode()
- func (node ForkNode) VoteFromPeer(vote blockchain.PeerBlockVote)
- func (node ForkNode) VoteResultFromPeer(votes blockchain.Votes)
- type FullNode
- func (node FullNode) BlockFromPeer(clog *ctxlog.ContextLog, block *blockchain.Block)
- func (node FullNode) GetBlockByHeight(chainId, height int64) *blockchain.Block
- func (node FullNode) GetBlockChain() *blockchain.BlockChain
- func (node FullNode) GetHeaderByHeight(chainId, height int64) *blockchain.Header
- func (node FullNode) GetVoteResults(chainId int64, hash string) blockchain.Votes
- func (node FullNode) StartNode()
- func (node FullNode) VoteFromPeer(vote blockchain.PeerBlockVote)
- func (node FullNode) VoteResultFromPeer(votes blockchain.Votes)
- type Node
Constants ¶
View Source
const ( NODE_ENV_FULL_SYNC = "full" NODE_ENV_DELEGETE = "delegate" FORK_ENV = "fork" Adaptive = "adaptive" )
Variables ¶
This section is empty.
Functions ¶
func BlockFromPeer ¶
func BlockFromPeer(clog *ctxlog.ContextLog, block *blockchain.Block)
for delegate node
func GetBlockByHeight ¶
func GetBlockByHeight(chainId, height int64) *blockchain.Header
func GetMainChain ¶
func GetMainChain() *blockchain.BlockChain
func GetVoteResults ¶
func GetVoteResults(chainId int64, hash string) blockchain.Votes
func SuggestFee ¶
func SuggestFee() int64
func VoteFromPeer ¶
func VoteFromPeer(vote blockchain.PeerBlockVote)
func VoteResultFromPeer ¶
func VoteResultFromPeer(votes blockchain.Votes)
Types ¶
type DelegateNode ¶
type DelegateNode struct {
// contains filtered or unexported fields
}
func NewDelegateNode ¶
func NewDelegateNode() *DelegateNode
func (DelegateNode) BlockFromPeer ¶
func (delegate DelegateNode) BlockFromPeer(clog *ctxlog.ContextLog, block *blockchain.Block)
func (DelegateNode) GetBlockByHeight ¶
func (delegate DelegateNode) GetBlockByHeight(chainId, height int64) *blockchain.Block
func (DelegateNode) GetBlockChain ¶
func (delegate DelegateNode) GetBlockChain() *blockchain.BlockChain
func (DelegateNode) GetHeaderByHeight ¶
func (delegate DelegateNode) GetHeaderByHeight(chainId, height int64) *blockchain.Header
func (DelegateNode) GetVoteResults ¶
func (delegate DelegateNode) GetVoteResults(chainId int64, hash string) blockchain.Votes
func (DelegateNode) RecoverFromDB ¶
func (delegate DelegateNode) RecoverFromDB()
func (DelegateNode) StartNode ¶
func (delegate DelegateNode) StartNode()
func (DelegateNode) VoteFromPeer ¶
func (delegate DelegateNode) VoteFromPeer(vote blockchain.PeerBlockVote)
func (DelegateNode) VoteResultFromPeer ¶
func (delegate DelegateNode) VoteResultFromPeer(votes blockchain.Votes)
type ForkNode ¶
type ForkNode struct {
// contains filtered or unexported fields
}
func NewForkNode ¶
func NewForkNode() *ForkNode
func (ForkNode) BlockFromPeer ¶
func (node ForkNode) BlockFromPeer(clog *ctxlog.ContextLog, block *blockchain.Block)
func (ForkNode) GetBlockByHeight ¶
func (node ForkNode) GetBlockByHeight(chainId, height int64) *blockchain.Block
func (ForkNode) GetBlockChain ¶
func (node ForkNode) GetBlockChain() *blockchain.BlockChain
func (ForkNode) GetHeaderByHeight ¶
func (node ForkNode) GetHeaderByHeight(chainId, height int64) *blockchain.Header
func (ForkNode) GetVoteResults ¶
func (node ForkNode) GetVoteResults(chainId int64, hash string) blockchain.Votes
func (ForkNode) VoteFromPeer ¶
func (node ForkNode) VoteFromPeer(vote blockchain.PeerBlockVote)
func (ForkNode) VoteResultFromPeer ¶
func (node ForkNode) VoteResultFromPeer(votes blockchain.Votes)
type FullNode ¶
type FullNode struct {
// contains filtered or unexported fields
}
func NewFullMode ¶
func NewFullMode() *FullNode
func (FullNode) BlockFromPeer ¶
func (node FullNode) BlockFromPeer(clog *ctxlog.ContextLog, block *blockchain.Block)
func (FullNode) GetBlockByHeight ¶
func (node FullNode) GetBlockByHeight(chainId, height int64) *blockchain.Block
func (FullNode) GetBlockChain ¶
func (node FullNode) GetBlockChain() *blockchain.BlockChain
func (FullNode) GetHeaderByHeight ¶
func (node FullNode) GetHeaderByHeight(chainId, height int64) *blockchain.Header
func (FullNode) GetVoteResults ¶
func (node FullNode) GetVoteResults(chainId int64, hash string) blockchain.Votes
func (FullNode) VoteFromPeer ¶
func (node FullNode) VoteFromPeer(vote blockchain.PeerBlockVote)
func (FullNode) VoteResultFromPeer ¶
func (node FullNode) VoteResultFromPeer(votes blockchain.Votes)
type Node ¶
type Node interface { StartNode() GetBlockChain() *blockchain.BlockChain GetVoteResults(chainId int64, hash string) blockchain.Votes GetHeaderByHeight(chainId, height int64) *blockchain.Header GetBlockByHeight(chainId, height int64) *blockchain.Block BlockFromPeer(clog *ctxlog.ContextLog, block *blockchain.Block) VoteFromPeer(vote blockchain.PeerBlockVote) VoteResultFromPeer(votes blockchain.Votes) }
Click to show internal directories.
Click to hide internal directories.