Documentation ¶
Index ¶
- Variables
- func ConcatCopyPreAllocate(slices [][]byte) []byte
- func DefaultDataDir() string
- func GetBackend() backend
- func GetNeatConConfig(chainId string, ctx *cli.Context) cfg.Config
- func HomeDir() string
- func New(chainConfig *params.ChainConfig, cliCtx *cli.Context, ...) consensus.NeatCon
- func ProtocolAndAddress(listenAddr string) (string, string)
- func SetEventSwitch(evsw types.EventSwitch, eventables ...types.Eventable)
- type API
- func (api *API) CreateValidator(from common.Address) (*ntcTypes.PrivV, error)
- func (api *API) DecodeExtraData(extra string) (extraApi *ntcTypes.NeatConExtraApi, err error)
- func (api *API) GetCandidateList() (*ntcTypes.CandidateApi, error)
- func (api *API) GetConsensusPublicKey(extra string) ([]string, error)
- func (api *API) GetCurrentEpochNumber() (hexutil.Uint64, error)
- func (api *API) GetEpoch(num hexutil.Uint64) (*ntcTypes.EpochApiForConsole, error)
- func (api *API) GetForbiddenList() (*ntcTypes.ForbiddenApi, error)
- func (api *API) GetNextEpochValidators() ([]*ntcTypes.EpochValidatorForConsole, error)
- func (api *API) GetNextEpochVote() (*ntcTypes.EpochVotesApiForConsole, error)
- func (api *API) GetValidatorStatus(from common.Address) (*ntcTypes.ValidatorStatus, error)
- func (api *API) GetVoteHash(from common.Address, pubkey crypto.BLSPubKey, amount *hexutil.Big, salt string) common.Hash
- type Config
- type Node
- func (n *Node) ConsensusReactor() *consensus.ConsensusReactor
- func (n *Node) ConsensusState() *consensus.ConsensusState
- func (n *Node) EventSwitch() types.EventSwitch
- func (n *Node) OnStart() error
- func (n *Node) OnStop()
- func (n *Node) PrivValidator() *types.PrivValidator
- func (n *Node) RunForever()
- type ProposerPolicy
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // current validator set. ErrUnauthorizedAddress = errors.New("unauthorized address") // ErrStoppedEngine is returned if the engine is stopped ErrStoppedEngine = errors.New("stopped engine") // ErrStartedEngine is returned if the engine is already started ErrStartedEngine = errors.New("started engine") // ErrNoPrivValidator is returned if private validator is not set during the start of the node ErrNoPrivValidator = errors.New("cannot start node without private validator") )
View Source
var ( // So we can control the DefaultDir DataDirFlag = cli.StringFlag{ Name: "datadir", Usage: "Data directory for the databases and keystore", Value: DefaultDataDir(), } // Not exposed by neatchain VerbosityFlag = cli.IntFlag{ Name: "verbosity", Usage: "Verbosity of neatchain", } MonikerFlag = cli.StringFlag{ Name: "moniker", Value: "", Usage: "Node's moniker", } NodeLaddrFlag = cli.StringFlag{ Name: "node_laddr", Value: "tcp://0.0.0.0:46656", Usage: "Node listen address. (0.0.0.0:0 means any interface, any port)", } SeedsFlag = cli.StringFlag{ Name: "seeds", Value: "", Usage: "Comma delimited host:port seed nodes", } FastSyncFlag = cli.BoolFlag{ Name: "fast_sync", Usage: "Fast blockchain syncing", } SkipUpnpFlag = cli.BoolFlag{ Name: "skip_upnp", Usage: "Skip UPNP configuration", } RpcLaddrFlag = cli.StringFlag{ Name: "rpc_laddr", Value: "unix://@neatchainrpcunixsock", Usage: "RPC listen address. Port required", } )
View Source
var DefaultConfig = &Config{ RequestTimeout: 10000, BlockPeriod: 1, ProposerPolicy: RoundRobin, Epoch: 30000, }
Functions ¶
func ConcatCopyPreAllocate ¶
func DefaultDataDir ¶
func DefaultDataDir() string
func GetBackend ¶
func GetBackend() backend
func GetNeatConConfig ¶
func New ¶
func New(chainConfig *params.ChainConfig, cliCtx *cli.Context, privateKey *ecdsa.PrivateKey, cch core.CrossChainHelper) consensus.NeatCon
New creates an Ethereum backend for NeatCon core engine.
func ProtocolAndAddress ¶
Defaults to tcp
func SetEventSwitch ¶
func SetEventSwitch(evsw types.EventSwitch, eventables ...types.Eventable)
Add the event switch to reactors, mempool, etc.
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
API is a user facing RPC API of NeatCon
func (*API) CreateValidator ¶
CreateValidator
func (*API) DecodeExtraData ¶
func (api *API) DecodeExtraData(extra string) (extraApi *ntcTypes.NeatConExtraApi, err error)
decode extra data
func (*API) GetCandidateList ¶
func (api *API) GetCandidateList() (*ntcTypes.CandidateApi, error)
func (*API) GetConsensusPublicKey ¶
get consensus publickey of the block
func (*API) GetCurrentEpochNumber ¶
GetCurrentEpochNumber retrieves the current epoch number.
func (*API) GetForbiddenList ¶
func (api *API) GetForbiddenList() (*ntcTypes.ForbiddenApi, error)
func (*API) GetNextEpochValidators ¶
func (api *API) GetNextEpochValidators() ([]*ntcTypes.EpochValidatorForConsole, error)
func (*API) GetNextEpochVote ¶
func (api *API) GetNextEpochVote() (*ntcTypes.EpochVotesApiForConsole, error)
GetEpochVote
func (*API) GetValidatorStatus ¶
type Config ¶
type Config struct { RequestTimeout uint64 `toml:",omitempty"` // The timeout for each Istanbul round in milliseconds. BlockPeriod uint64 `toml:",omitempty"` // Default minimum difference between two consecutive block's timestamps in second ProposerPolicy ProposerPolicy `toml:",omitempty"` // The policy for proposer selection Epoch uint64 `toml:",omitempty"` // The number of blocks after which to checkpoint and reset the pending votes }
type Node ¶
type Node struct { cmn.BaseService // contains filtered or unexported fields }
func MakeNeatConNode ¶
func MakeNeatConNode(backend *backend, config cfg.Config, chainConfig *params.ChainConfig, cch core.CrossChainHelper) *Node
func NewNodeNotStart ¶
func NewNodeNotStart(backend *backend, config cfg.Config, chainConfig *params.ChainConfig, cch core.CrossChainHelper, genDoc *types.GenesisDoc) *Node
func (*Node) ConsensusReactor ¶
func (n *Node) ConsensusReactor() *consensus.ConsensusReactor
func (*Node) ConsensusState ¶
func (n *Node) ConsensusState() *consensus.ConsensusState
func (*Node) EventSwitch ¶
func (n *Node) EventSwitch() types.EventSwitch
func (*Node) PrivValidator ¶
func (n *Node) PrivValidator() *types.PrivValidator
XXX: for convenience
func (*Node) RunForever ¶
func (n *Node) RunForever()
Source Files ¶
Click to show internal directories.
Click to hide internal directories.