consensus

package
v0.14.2 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2020 License: Apache-2.0 Imports: 26 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"`
	Governance GovernanceState    `json:"governance"`
	Chain      ChainState         `json:"state"`
	Balances   []BalanceState     `json:"balances"`
	Staking    []Stake            `json:"staking"`
	Domains    []DomainState      `json:"domains"`
	Trackers   []Tracker          `json:"trackers"`
	Fees       []BalanceState     `json:"fees"`
}

func GenerateState added in v0.14.0

func GenerateState(rawState []byte) (*AppState, error)

func NewAppState added in v0.12.0

func NewAppState(currencies balance.Currencies,
	balances []BalanceState,
	staking []Stake,
	domains []DomainState,
	fees []BalanceState,
	governance GovernanceState,
) *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 {
	Owner            keys.Address    `json:"ownerAddress"`
	Beneficiary      keys.Address    `json:"beneficiary"`
	Name             string          `json:"name"`
	CreationHeight   int64           `json:"creationHeight"`
	LastUpdateHeight int64           `json:"lastUpdateHeight"`
	ExpireHeight     int64           `json:"expireHeight"`
	ActiveFlag       bool            `json:"activeFlag"`
	OnSaleFlag       bool            `json:"onSaleFlag"`
	URI              string          `json:"uri"`
	SalePrice        *balance.Amount `json:"salePrice"`
}

type GenesisDoc

type GenesisDoc = types.GenesisDoc

func NewGenesisDoc

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

type GenesisValidator

type GenesisValidator = types.GenesisValidator

type GovernanceState added in v0.14.0

type GovernanceState struct {
	FeeOption   fees.FeeOption             `json:"feeOption"`
	ETHCDOption ethchain.ChainDriverOption `json:"ethchaindriverOption"`
	BTCCDOption bitcoin.ChainDriverOption  `json:"bitcoinChainDriverOption"`
	ONSOptions  ons.Options                `json:"onsOptions"`
}

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

type Tracker added in v0.14.0

type Tracker struct {
	Type          ethData.ProcessType  `json:"type"`
	State         ethData.TrackerState `json:"state"`
	TrackerName   ethchain.TrackerName `json:"trackerName"`
	SignedETHTx   []byte               `json:"signedEthTx"`
	Witnesses     []keys.Address       `json:"witnesses"`
	ProcessOwner  keys.Address         `json:"processOwner"`
	FinalityVotes []ethData.Vote       `json:"finalityVotes"`
	To            []byte               `json:"to"`
}

TODO: Create More Generic Struct to contain all tracker types.

Jump to

Keyboard shortcuts

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