raft

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 27, 2017 License: GPL-3.0 Imports: 45 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddressTxes

type AddressTxes map[common.Address]types.Transactions

type InvalidRaftOrdering

type InvalidRaftOrdering struct {
	// contains filtered or unexported fields
}

type ProtocolManager

type ProtocolManager struct {
	// contains filtered or unexported fields
}

func NewProtocolManager

func NewProtocolManager(id int, blockchain *core.BlockChain, mux *event.TypeMux, peers []*discover.Node, datadir string, minter *minter) (*ProtocolManager, error)

func (*ProtocolManager) IsIDRemoved

func (pm *ProtocolManager) IsIDRemoved(id uint64) bool

func (*ProtocolManager) NodeInfo

func (pm *ProtocolManager) NodeInfo() *RaftNodeInfo

func (*ProtocolManager) Process

func (pm *ProtocolManager) Process(ctx context.Context, m raftpb.Message) 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()

func (*ProtocolManager) WriteMsg

func (pm *ProtocolManager) WriteMsg(msg p2p.Msg) error

type PublicRaftAPI

type PublicRaftAPI struct {
	// contains filtered or unexported fields
}

func NewPublicRaftAPI

func NewPublicRaftAPI(raftService *RaftService) *PublicRaftAPI

func (*PublicRaftAPI) Role

func (s *PublicRaftAPI) Role() string

type RaftNodeInfo

type RaftNodeInfo struct {
	ClusterSize int         `json:"clusterSize"`
	Genesis     common.Hash `json:"genesis"` // SHA3 hash of the host's genesis block
	Head        common.Hash `json:"head"`    // SHA3 hash of the host's best owned block
	Role        string      `json:"role"`
}

type RaftService

type RaftService struct {
	// contains filtered or unexported fields
}

func New

func New(ctx *node.ServiceContext, chainConfig *core.ChainConfig, id int, blockTime time.Duration, 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(*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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL