consensus

package
v0.18.15 Latest Latest
Warning

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

Go to latest
Published: May 17, 2022 License: Apache-2.0 Imports: 29 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 HackWrapDBProvider added in v0.18.15

func HackWrapDBProvider(loadedBlockStore chan<- *store.BlockStore) func(ctx *tmnode.DBContext) (dbm.DB, error)

HackWrapDBProvider replace default db provider to get block store befor replay

func NewGenesisDoc

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

func NewNode

func NewNode(application abcitypes.Application, nodecfg NodeConfig, loadedBlockStore chan<- *store.BlockStore) (*tmnode.Node, error)

Types

type AppState

type AppState struct {
	Currencies    balance.Currencies             `json:"currencies"`
	Governance    governance.GovernanceState     `json:"governance"`
	Chain         ChainState                     `json:"state"`
	Balances      []BalanceState                 `json:"balances"`
	Staking       []Stake                        `json:"staking"`
	Witness       []Stake                        `json:"witness"`
	Delegation    delegation.DelegationState     `json:"delegation"`
	Rewards       rewards.RewardMasterState      `json:"rewards"`
	Domains       []DomainState                  `json:"domains"`
	Trackers      []Tracker                      `json:"trackers"`
	Fees          []BalanceState                 `json:"fees"`
	Proposals     []governance.GovProposal       `json:"proposals"`
	NetDelegators network_delegation.State       `json:"net_delegators"`
	DelegatorRew  network_delegation.RewardState `json:"delegator_rewards"`
}

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,
	witness []Stake,
	delegation delegation.DelegationState,
	rewards rewards.RewardMasterState,
	domains []DomainState,
	fees []BalanceState,
	governance 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 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() (*config.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