consensus

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2020 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GenesisFilename            = "genesis.json"
	NodeKeyFilename            = "node_key.json"
	PrivValidatorKeyFilename   = "priv_validator_key.json"
	PrivValidatorStateFilename = "priv_validator_state.json"
	AddrBookFilename           = "addrbook.json"

	RootDirName   = "consensus"
	ConfigDirName = "config"
	DataDirName   = "data"
)

Common file names & directories

Variables

This section is empty.

Functions

func Dir

func Dir(rootDir string) string

Dir returns the root folder for consensus files

func NewNode

func NewNode(application abcitypes.Application, nodecfg NodeConfig) (*tmnode.Node, error)

Types

type AppState

type AppState struct {
	Currencies  balance.Currencies         `json:"currencies"`
	FeeOption   fees.FeeOption             `json:"feeOption"`
	ETHCDOption ethchain.ChainDriverOption `json:"ethchaindriverOption"`
	Chain       ChainState                 `json:"state"`
	Balances    []BalanceState             `json:"balances"`
	Staking     []Stake                    `json:"staking"`
	Domains     []DomainState              `json:"domains"`
	Fees        []BalanceState             `json:"fees"`
}

func NewAppState added in v0.12.0

func NewAppState(currencies balance.Currencies,
	feeOpt fees.FeeOption,
	balances []BalanceState,
	staking []Stake,
	domains []DomainState,
	fees []BalanceState,
	ethoptions ethchain.ChainDriverOption,
) *AppState

func (AppState) RawJSON

func (a AppState) RawJSON() ([]byte, error)

type Application

type Application = abci.Application

type BalanceState added in v0.12.0

type BalanceState struct {
	Address  keys.Address   `json:"address"`
	Currency string         `json:"currency"`
	Amount   balance.Amount `json:"amount"`
}

type ChainState added in v0.13.0

type ChainState struct {
	Version int64
	Hash    []byte
}

type Config

type Config = tmconfig.Config

type DomainState added in v0.12.0

type DomainState struct {
	OwnerAddress   keys.Address `json:"ownerAddress"`
	AccountAddress keys.Address `json:"accountAddress"`
	Name           string       `json:"name"`
}

type GenesisDoc

type GenesisDoc = types.GenesisDoc

func NewGenesisDoc

func NewGenesisDoc(chainID string, states AppState) (*GenesisDoc, error)

type GenesisValidator

type GenesisValidator = types.GenesisValidator

type Node

type Node = tmnode.Node

type NodeConfig

type NodeConfig struct {
	CFG tmconfig.Config
	// contains filtered or unexported fields
}

config is used to provider the right arguments for spinning up a new consensus.Node

func ParseConfig

func ParseConfig(cfg *config.Server) (NodeConfig, error)

func (NodeConfig) GetGenesisDoc added in v0.12.0

func (nc NodeConfig) GetGenesisDoc() (*types.GenesisDoc, error)

type Stake added in v0.12.0

type Stake identity.Stake

Jump to

Keyboard shortcuts

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