tendermint

package
v0.0.0-...-5d85a61 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2023 License: GPL-3.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrUnauthorizedAddress is returned when given address cannot be found in
	// 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 ligochain
	VerbosityFlag = cli.IntFlag{
		Name:  "verbosity",
		Usage: "Verbosity of ligochain",
	}

	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://@ligochainrpcunixsock",
		Usage: "RPC listen address. Port required",
	}
)
View Source
var DefaultConfig = &Config{
	RequestTimeout: 10000,
	BlockPeriod:    1,
	ProposerPolicy: RoundRobin,
	Epoch:          30000,
}

Functions

func ConcatCopyPreAllocate

func ConcatCopyPreAllocate(slices [][]byte) []byte

func DefaultDataDir

func DefaultDataDir() string

func GetBackend

func GetBackend() backend

func GetTendermintConfig

func GetTendermintConfig(chainId string, ctx *cli.Context) cfg.Config

func HomeDir

func HomeDir() string

func New

func New(chainConfig *params.ChainConfig, cliCtx *cli.Context,
	privateKey *ecdsa.PrivateKey, cch core.CrossChainHelper) consensus.Tendermint

New creates an Ethereum backend for Tendermint core engine.

func ProtocolAndAddress

func ProtocolAndAddress(listenAddr string) (string, string)

func SetEventSwitch

func SetEventSwitch(evsw types.EventSwitch, eventables ...types.Eventable)

Types

type API

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

func (*API) CreateValidator

func (api *API) CreateValidator(from common.Address) (*tdmTypes.PrivV, error)

CreateValidator

func (*API) DecodeExtraData

func (api *API) DecodeExtraData(extra string) (extraApi *tdmTypes.TendermintExtraApi, err error)

decode extra data

func (*API) GetBannedList

func (api *API) GetBannedList() (*tdmTypes.BannedApi, error)

func (*API) GetCandidateList

func (api *API) GetCandidateList() (*tdmTypes.CandidateApi, error)

func (*API) GetConsensusPublicKey

func (api *API) GetConsensusPublicKey(extra string) ([]string, error)

get consensus publickey of the block

func (*API) GetCurrentEpochNumber

func (api *API) GetCurrentEpochNumber() (hexutil.Uint64, error)

func (*API) GetEpoch

func (api *API) GetEpoch(num hexutil.Uint64) (*tdmTypes.EpochApiForConsole, error)

func (*API) GetNextEpochValidators

func (api *API) GetNextEpochValidators() ([]*tdmTypes.EpochValidatorForConsole, error)

func (*API) GetNextEpochVote

func (api *API) GetNextEpochVote() (*tdmTypes.EpochVotesApiForConsole, error)

func (*API) GetValidatorStatus

func (api *API) GetValidatorStatus(from common.Address) (*tdmTypes.ValidatorStatus, error)

func (*API) GetVoteHash

func (api *API) GetVoteHash(from common.Address, pubkey crypto.BLSPubKey, amount *hexutil.Big, salt string) common.Hash

type Config

type Config struct {
	RequestTimeout uint64         `toml:",omitempty"`
	BlockPeriod    uint64         `toml:",omitempty"`
	ProposerPolicy ProposerPolicy `toml:",omitempty"`
	Epoch          uint64         `toml:",omitempty"`
}

type Node

type Node struct {
	cmn.BaseService
	// contains filtered or unexported fields
}

func MakeTendermintNode

func MakeTendermintNode(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) OnStart

func (n *Node) OnStart() error

func (*Node) OnStop

func (n *Node) OnStop()

func (*Node) PrivValidator

func (n *Node) PrivValidator() *types.PrivValidator

func (*Node) RunForever

func (n *Node) RunForever()

type ProposerPolicy

type ProposerPolicy uint64
const (
	RoundRobin ProposerPolicy = iota
	Sticky
)

Directories

Path Synopsis
config

Jump to

Keyboard shortcuts

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