Documentation ¶
Index ¶
- func NewRaftCluster(cfg *types.Consensus, sub []byte) queue.Module
- func NewRaftNode(id int, join bool, peers []string, readOnlyPeers []string, addPeers []string, ...) (<-chan *types.Block, <-chan error, <-chan *snap.Snapshotter, <-chan bool, ...)
- type Client
- func (client *Client) CheckBlock(parent *types.Block, current *types.BlockDetail) error
- func (client *Client) Close()
- func (client *Client) CreateBlock()
- func (client *Client) CreateGenesisTx() (ret []*types.Transaction)
- func (client *Client) GetGenesisBlockTime() int64
- func (client *Client) ProcEvent(msg *queue.Message) bool
- func (client *Client) SetQueueClient(c queue.Client)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRaftCluster ¶
NewRaftCluster create raft cluster
func NewRaftNode ¶
func NewRaftNode(id int, join bool, peers []string, readOnlyPeers []string, addPeers []string, getSnapshot func() ([]byte, error), proposeC <-chan *types.Block, confChangeC <-chan raftpb.ConfChange) (<-chan *types.Block, <-chan error, <-chan *snap.Snapshotter, <-chan bool, chan<- struct{})
NewRaftNode create raft node
Types ¶
type Client ¶
type Client struct { *drivers.BaseClient // contains filtered or unexported fields }
Client Raft implementation
func NewBlockstore ¶
func NewBlockstore(cfg *types.Consensus, snapshotter *snap.Snapshotter, proposeC chan<- *types.Block, commitC <-chan *types.Block, errorC <-chan error, validatorC <-chan bool, stopC chan<- struct{}) *Client
NewBlockstore create Raft Client
func (*Client) CheckBlock ¶
CheckBlock method
func (*Client) CreateGenesisTx ¶
func (client *Client) CreateGenesisTx() (ret []*types.Transaction)
CreateGenesisTx get genesis tx
func (*Client) GetGenesisBlockTime ¶
GetGenesisBlockTime get genesis blocktime
func (*Client) SetQueueClient ¶
SetQueueClient method
Click to show internal directories.
Click to hide internal directories.