Documentation ¶
Index ¶
- func NewSecretTCPTransport(bindAddr string, advertise net.Addr, maxPool int, timeout time.Duration, ...) (*raft.NetworkTransport, error)
- type AddPeerResult
- type BlockChainFSM
- type BlockChainSnapshot
- type ClusterConfig
- func (c *ClusterConfig) AddPeer(peer Peer) bool
- func (c *ClusterConfig) FindByBindAddress(bind string) *Peer
- func (c *ClusterConfig) LocalServer() raft.Server
- func (c *ClusterConfig) Remove(pubKey crypto.PubKey) bool
- func (c *ClusterConfig) Save() error
- func (c *ClusterConfig) Server() ([]raft.Server, error)
- func (c *ClusterConfig) String() string
- type ConsensusState
- func (cs *ConsensusState) GetValidators() (int64, []*types.Validator)
- func (cs *ConsensusState) NewPublicAPI() *PublicAPI
- func (cs *ConsensusState) OnStart() error
- func (cs *ConsensusState) OnStop()
- func (cs *ConsensusState) SetEventSwitch(evsw types.EventSwitch)
- func (cs *ConsensusState) ValidateBlock(b *types.Block) error
- type LeaderResult
- type Peer
- type PublicAPI
- func (p *PublicAPI) API() map[string]*rpcserver.RPCFunc
- func (p *PublicAPI) AddPeer(addr, rpc string, pubKey string) (*AddPeerResult, error)
- func (p *PublicAPI) Leader() (*LeaderResult, error)
- func (p *PublicAPI) RemovePeer(pubKey string) (*RemovePeerResult, error)
- func (p *PublicAPI) Role() (string, error)
- func (p *PublicAPI) Stats() (string, error)
- type RemovePeerResult
- type SecretTCPStreamLayer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewSecretTCPTransport ¶
func NewSecretTCPTransport( bindAddr string, advertise net.Addr, maxPool int, timeout time.Duration, logOutput io.Writer, privKey crypto.PrivKey, ) (*raft.NetworkTransport, error)
NewTCPTransport returns a NetworkTransport that is built on top of a Secret TCP streaming transport layer.
Types ¶
type AddPeerResult ¶
type AddPeerResult struct{}
type BlockChainFSM ¶
type BlockChainFSM struct {
// contains filtered or unexported fields
}
func (*BlockChainFSM) AppliedCh ¶
func (b *BlockChainFSM) AppliedCh() <-chan *types.Block
func (*BlockChainFSM) Apply ¶
func (b *BlockChainFSM) Apply(l *raft.Log) interface{}
func (*BlockChainFSM) Restore ¶
func (b *BlockChainFSM) Restore(r io.ReadCloser) error
func (*BlockChainFSM) SetEventSwitch ¶
func (b *BlockChainFSM) SetEventSwitch(evsw types.EventSwitch)
func (*BlockChainFSM) Snapshot ¶
func (b *BlockChainFSM) Snapshot() (raft.FSMSnapshot, error)
type BlockChainSnapshot ¶
func (*BlockChainSnapshot) Persist ¶
func (s *BlockChainSnapshot) Persist(sink raft.SnapshotSink) error
func (*BlockChainSnapshot) Release ¶
func (s *BlockChainSnapshot) Release()
type ClusterConfig ¶
type ClusterConfig struct { Local Peer `json:"local"` Advertise string `json:"advertise"` Peers []Peer `json:"peers"` // contains filtered or unexported fields }
func NewClusterConfig ¶
func NewClusterConfig(filename string) (*ClusterConfig, error)
func (*ClusterConfig) AddPeer ¶
func (c *ClusterConfig) AddPeer(peer Peer) bool
func (*ClusterConfig) FindByBindAddress ¶
func (c *ClusterConfig) FindByBindAddress(bind string) *Peer
func (*ClusterConfig) LocalServer ¶
func (c *ClusterConfig) LocalServer() raft.Server
func (*ClusterConfig) Remove ¶
func (c *ClusterConfig) Remove(pubKey crypto.PubKey) bool
func (*ClusterConfig) Save ¶
func (c *ClusterConfig) Save() error
func (*ClusterConfig) String ¶
func (c *ClusterConfig) String() string
type ConsensusState ¶
type ConsensusState struct { *common.BaseService // contains filtered or unexported fields }
func NewConsensusState ¶
func NewConsensusState(vconf *viper.Viper, evsw types.EventSwitch, blockStore *blockchain.BlockStore, state *state.State, mempool types.TxPool, privValidator *types.PrivValidator) (*ConsensusState, error)
func (*ConsensusState) GetValidators ¶
func (cs *ConsensusState) GetValidators() (int64, []*types.Validator)
func (*ConsensusState) NewPublicAPI ¶
func (cs *ConsensusState) NewPublicAPI() *PublicAPI
func (*ConsensusState) OnStart ¶
func (cs *ConsensusState) OnStart() error
func (*ConsensusState) OnStop ¶
func (cs *ConsensusState) OnStop()
func (*ConsensusState) SetEventSwitch ¶
func (cs *ConsensusState) SetEventSwitch(evsw types.EventSwitch)
func (*ConsensusState) ValidateBlock ¶
func (cs *ConsensusState) ValidateBlock(b *types.Block) error
type LeaderResult ¶
type PublicAPI ¶
type PublicAPI struct {
*ConsensusState
}
func (*PublicAPI) AddPeer ¶
func (p *PublicAPI) AddPeer(addr, rpc string, pubKey string) (*AddPeerResult, error)
func (*PublicAPI) Leader ¶
func (p *PublicAPI) Leader() (*LeaderResult, error)
func (*PublicAPI) RemovePeer ¶
func (p *PublicAPI) RemovePeer(pubKey string) (*RemovePeerResult, error)
type RemovePeerResult ¶
type RemovePeerResult struct{}
type SecretTCPStreamLayer ¶
type SecretTCPStreamLayer struct {
// contains filtered or unexported fields
}
func (*SecretTCPStreamLayer) Addr ¶
func (t *SecretTCPStreamLayer) Addr() net.Addr
func (*SecretTCPStreamLayer) Close ¶
func (t *SecretTCPStreamLayer) Close() error
func (*SecretTCPStreamLayer) Dial ¶
func (t *SecretTCPStreamLayer) Dial(address raft.ServerAddress, timeout time.Duration) (conn net.Conn, err error)
Click to show internal directories.
Click to hide internal directories.