Documentation ¶
Index ¶
- type Address
- type AddressTxes
- type ByRaftId
- type InvalidRaftOrdering
- type Peer
- type ProtocolManager
- func (pm *ProtocolManager) IsIDRemoved(id uint64) bool
- func (pm *ProtocolManager) NodeInfo() *RaftNodeInfo
- func (pm *ProtocolManager) Process(ctx context.Context, m raftpb.Message) error
- func (pm *ProtocolManager) ProposeNewPeer(enodeId string) (uint16, error)
- func (pm *ProtocolManager) ProposePeerRemoval(raftId uint16)
- func (pm *ProtocolManager) ReportSnapshot(id uint64, status etcdRaft.SnapshotStatus)
- func (pm *ProtocolManager) ReportUnreachable(id uint64)
- func (pm *ProtocolManager) Start(p2pServer *p2p.Server)
- func (pm *ProtocolManager) Stop()
- func (pm *ProtocolManager) WriteMsg(msg p2p.Msg) error
- type PublicRaftAPI
- type RaftNodeInfo
- type RaftService
- func (service *RaftService) APIs() []rpc.API
- 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) Protocols() []p2p.Protocol
- func (service *RaftService) Start(p2pServer *p2p.Server) error
- func (service *RaftService) Stop() error
- func (service *RaftService) TxPool() *core.TxPool
- type Snapshot
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Address ¶
type Address struct {
// contains filtered or unexported fields
}
Serializable information about a Peer. Sufficient to build `etcdRaft.Peer` or `discover.Node`.
type AddressTxes ¶
type AddressTxes map[common.Address]types.Transactions
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 []*discover.Node, joinExisting bool, datadir string, electionTick int, minter *minter, downloader *downloader.Downloader) (*ProtocolManager, error)
func (*ProtocolManager) IsIDRemoved ¶
func (pm *ProtocolManager) IsIDRemoved(id uint64) bool
func (*ProtocolManager) NodeInfo ¶
func (pm *ProtocolManager) NodeInfo() *RaftNodeInfo
func (*ProtocolManager) ProposeNewPeer ¶
func (pm *ProtocolManager) ProposeNewPeer(enodeId string) (uint16, error)
func (*ProtocolManager) ProposePeerRemoval ¶
func (pm *ProtocolManager) ProposePeerRemoval(raftId uint16)
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(p2pServer *p2p.Server)
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) RemovePeer ¶
func (s *PublicRaftAPI) RemovePeer(raftId uint16)
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 New ¶
func New(ctx *node.ServiceContext, chainConfig *params.ChainConfig, raftId, raftPort uint16, joinExisting bool, blockTime time.Duration, electionTick int, rewardTime time.Duration, maxTxsPerBlock int, maxTxsPerAccount int, e *eth.Ethereum, startPeers []*discover.Node, datadir string) (*RaftService, error)
func (*RaftService) APIs ¶
func (service *RaftService) APIs() []rpc.API
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) Protocols ¶
func (service *RaftService) Protocols() []p2p.Protocol
func (*RaftService) Start ¶
func (service *RaftService) Start(p2pServer *p2p.Server) 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
Click to show internal directories.
Click to hide internal directories.