Documentation ¶
Index ¶
- type Address
- type AddressTxes
- type AddressWithoutHostname
- type ByRaftId
- type ClusterInfo
- type InvalidRaftOrdering
- type Peer
- type ProtocolManager
- func (pm *ProtocolManager) FetchRaftId(enodeId string) (uint16, error)
- func (pm *ProtocolManager) IsIDRemoved(id uint64) bool
- func (pm *ProtocolManager) LeaderAddress() (*Address, error)
- func (pm *ProtocolManager) NodeInfo() *RaftNodeInfo
- func (pm *ProtocolManager) Process(ctx context.Context, m raftpb.Message) error
- func (pm *ProtocolManager) PromoteToPeer(raftId uint16) (bool, error)
- func (pm *ProtocolManager) ProposeNewPeer(enodeURL string, isLearner bool) (uint16, error)
- func (pm *ProtocolManager) ProposePeerRemoval(raftId uint16) error
- func (pm *ProtocolManager) ReportSnapshot(id uint64, status etcdRaft.SnapshotStatus)
- func (pm *ProtocolManager) ReportUnreachable(id uint64)
- func (pm *ProtocolManager) Start()
- func (pm *ProtocolManager) Stop()
- func (pm *ProtocolManager) WriteMsg(msg p2p.Msg) error
- type PublicRaftAPI
- func (s *PublicRaftAPI) AddLearner(enodeId string) (uint16, error)
- func (s *PublicRaftAPI) AddPeer(enodeId string) (uint16, error)
- func (s *PublicRaftAPI) Cluster() ([]ClusterInfo, error)
- func (s *PublicRaftAPI) GetRaftId(enodeId string) (uint16, error)
- func (s *PublicRaftAPI) Leader() (string, error)
- func (s *PublicRaftAPI) PromoteToPeer(raftId uint16) (bool, error)
- func (s *PublicRaftAPI) RemovePeer(raftId uint16) error
- func (s *PublicRaftAPI) Role() string
- type RaftNodeInfo
- type RaftService
- func (service *RaftService) AccountManager() *accounts.Manager
- func (service *RaftService) BlockChain() *core.BlockChain
- func (service *RaftService) ChainDb() ethdb.Database
- func (service *RaftService) DappDb() ethdb.Database
- func (service *RaftService) EventMux() *event.TypeMux
- func (service *RaftService) Start() error
- func (service *RaftService) Stop() error
- func (service *RaftService) TxPool() *core.TxPool
- type SnapshotWithHostnames
- type SnapshotWithoutHostnames
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Address ¶
type Address struct { RaftId uint16 `json:"raftId"` NodeId enode.EnodeID `json:"nodeId"` Ip net.IP `json:"-"` P2pPort enr.TCP `json:"p2pPort"` RaftPort enr.RaftPort `json:"raftPort"` Hostname string `json:"hostname"` // Ignore additional fields (for forward compatibility). Rest []rlp.RawValue `json:"-" rlp:"tail"` }
Serializable information about a Peer. Sufficient to build `etcdRaft.Peer` or `enode.Node`. As NodeId is mainly used to derive the `ecdsa.pubkey` to build `enode.Node` it is kept as [64]byte instead of ID [32]byte used by `enode.Node`.
type AddressTxes ¶
type AddressTxes map[common.Address]types.Transactions
type AddressWithoutHostname ¶
type ClusterInfo ¶
type InvalidRaftOrdering ¶
type InvalidRaftOrdering struct {
// contains filtered or unexported fields
}
type Peer ¶
type Peer struct {
// contains filtered or unexported fields
}
A peer that we're connected to via both raft's http transport, and ethereum p2p
type ProtocolManager ¶
type ProtocolManager struct {
// contains filtered or unexported fields
}
func NewProtocolManager ¶
func NewProtocolManager(raftId uint16, raftPort uint16, blockchain *core.BlockChain, mux *event.TypeMux, bootstrapNodes []*enode.Node, joinExisting bool, raftLogDir string, minter *minter, downloader *downloader.Downloader, useDns bool, p2pServer *p2p.Server) (*ProtocolManager, error)
func (*ProtocolManager) FetchRaftId ¶
func (pm *ProtocolManager) FetchRaftId(enodeId string) (uint16, error)
Returns the raft id for a given enodeId
func (*ProtocolManager) IsIDRemoved ¶
func (pm *ProtocolManager) IsIDRemoved(id uint64) bool
func (*ProtocolManager) LeaderAddress ¶
func (pm *ProtocolManager) LeaderAddress() (*Address, error)
The Address for the current leader, or an error if no leader is elected.
func (*ProtocolManager) NodeInfo ¶
func (pm *ProtocolManager) NodeInfo() *RaftNodeInfo
func (*ProtocolManager) PromoteToPeer ¶
func (pm *ProtocolManager) PromoteToPeer(raftId uint16) (bool, error)
func (*ProtocolManager) ProposeNewPeer ¶
func (pm *ProtocolManager) ProposeNewPeer(enodeURL string, isLearner bool) (uint16, error)
func (*ProtocolManager) ProposePeerRemoval ¶
func (pm *ProtocolManager) ProposePeerRemoval(raftId uint16) error
func (*ProtocolManager) ReportSnapshot ¶
func (pm *ProtocolManager) ReportSnapshot(id uint64, status etcdRaft.SnapshotStatus)
func (*ProtocolManager) ReportUnreachable ¶
func (pm *ProtocolManager) ReportUnreachable(id uint64)
func (*ProtocolManager) Start ¶
func (pm *ProtocolManager) Start()
func (*ProtocolManager) Stop ¶
func (pm *ProtocolManager) Stop()
type PublicRaftAPI ¶
type PublicRaftAPI struct {
// contains filtered or unexported fields
}
func NewPublicRaftAPI ¶
func NewPublicRaftAPI(raftService *RaftService) *PublicRaftAPI
func (*PublicRaftAPI) AddLearner ¶
func (s *PublicRaftAPI) AddLearner(enodeId string) (uint16, error)
func (*PublicRaftAPI) Cluster ¶
func (s *PublicRaftAPI) Cluster() ([]ClusterInfo, error)
func (*PublicRaftAPI) Leader ¶
func (s *PublicRaftAPI) Leader() (string, error)
func (*PublicRaftAPI) PromoteToPeer ¶
func (s *PublicRaftAPI) PromoteToPeer(raftId uint16) (bool, error)
func (*PublicRaftAPI) RemovePeer ¶
func (s *PublicRaftAPI) RemovePeer(raftId uint16) error
func (*PublicRaftAPI) Role ¶
func (s *PublicRaftAPI) Role() string
type RaftNodeInfo ¶
type RaftNodeInfo struct { ClusterSize int `json:"clusterSize"` Role string `json:"role"` Address *Address `json:"address"` PeerAddresses []*Address `json:"peerAddresses"` RemovedPeerIds []uint16 `json:"removedPeerIds"` AppliedIndex uint64 `json:"appliedIndex"` SnapshotIndex uint64 `json:"snapshotIndex"` }
type RaftService ¶
type RaftService struct {
// contains filtered or unexported fields
}
func (*RaftService) AccountManager ¶
func (service *RaftService) AccountManager() *accounts.Manager
func (*RaftService) BlockChain ¶
func (service *RaftService) BlockChain() *core.BlockChain
func (*RaftService) ChainDb ¶
func (service *RaftService) ChainDb() ethdb.Database
func (*RaftService) DappDb ¶
func (service *RaftService) DappDb() ethdb.Database
func (*RaftService) EventMux ¶
func (service *RaftService) EventMux() *event.TypeMux
func (*RaftService) Start ¶
func (service *RaftService) Start() error
Start implements node.Service, starting the background data propagation thread of the protocol.
func (*RaftService) Stop ¶
func (service *RaftService) Stop() error
Stop implements node.Service, stopping the background data propagation thread of the protocol.
func (*RaftService) TxPool ¶
func (service *RaftService) TxPool() *core.TxPool
type SnapshotWithHostnames ¶
type SnapshotWithoutHostnames ¶
type SnapshotWithoutHostnames struct { Addresses []AddressWithoutHostname RemovedRaftIds []uint16 // Raft IDs for permanently removed peers HeadBlockHash common.Hash }
Click to show internal directories.
Click to hide internal directories.