config

package
v0.0.0-...-3ea6778 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2020 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenFilePV

func GenFilePV(keyFilePath, stateFilePath string) *privval.FilePV

GenFilePV generates a new validator with randomly generated private key and sets the filePaths, but does not call Save().

func GenerateNodeKeyFile

func GenerateNodeKeyFile(cdc *codec.Codec, filePath string) (*p2p.NodeKey, error)

func GenesisFileToGenDoc

func GenesisFileToGenDoc(genFile string) *tmtypes.GenesisDoc

func GenesisStateFromGenDoc

func GenesisStateFromGenDoc(cdc *codec.Codec, genDoc tmtypes.GenesisDoc) (genesisState map[string]json.RawMessage)

func LoadFilePV

func LoadFilePV(privValKeyFile, privValStateFile string) *privval.FilePV

LoadFilePV loads the private validator file and generates the FilePV object

func LoadNodeKeyFile

func LoadNodeKeyFile(cdc *codec.Codec, filePath string) (*p2p.NodeKey, error)

func LoadOrGenFilePV

func LoadOrGenFilePV(keyFilePath, stateFilePath string) *privval.FilePV

LoadOrGenFilePV loads a FilePV from the given filePaths or else generates a new one and saves it to the filePaths.

func LoadOrGenerateNodeKeyFile

func LoadOrGenerateNodeKeyFile(cdc *codec.Codec, filePath string) error

func NewClient

func NewClient(ctx Config, appCreator AppCreator) (*node.Node, error)

func ResetAll

func ResetAll(dbDir, addrBookFile, privValKeyFile, privValStateFile string, keepAddrBook bool, logger log.Logger)

ResetAll removes address book files plus all data, and resets the privValdiator data. Exported so other CLI tools can use it.

func UpgradeOldPrivValFile

func UpgradeOldPrivValFile(config *cfg.Config)

UpgradeOldPrivValFile converts old priv_validator.json file (prior to Tendermint 0.28) to the new priv_validator_key.json and priv_validator_state.json files.

Types

type AppCreator

type AppCreator func(log.Logger, dbm.DB, io.Writer) abci.Application

AppCreator is a function that allows us to lazily initialize an application using various configurations.

type Config

type Config struct {
	TmConfig    *cfg.Config
	Logger      log.Logger
	TraceWriter string
}

func NewConfig

func NewConfig(rootDir, datadir, nodekey, privValKey, privValState, persistentPeers, seeds, listenAddr string, createEmptyBlocks bool, createEmptyBlocksInterval time.Duration,
	MaxNumberInboundPeers, MaxNumberOutboundPeers int, logger log.Logger, traceWriterPath string) *Config

func NewDefaultConfig

func NewDefaultConfig() *Config

type GenesisState

type GenesisState map[string]json.RawMessage

func GenesisStateFromFile

func GenesisStateFromFile(cdc *codec.Codec, genFile string) GenesisState
 expected usage
 func (app *nameServiceApp) InitChainer(ctx sdk.Ctx, req abci.RequestInitChain) abci.ResponseInitChain {
	genesisState := GetGensisFromFile(app.cdc, "genesis.go")
	return app.mm.InitGenesis(ctx, genesisState)
}

type InitConfig

type InitConfig struct {
	ChainID   string
	GenTxsDir string
	Name      string
	NodeID    string
	ValPubKey crypto.PublicKey
}

InitConfig common config options for init

func NewInitConfig

func NewInitConfig(chainID, genTxsDir, name, nodeID string, valPubKey crypto.PublicKey) InitConfig

NewInitConfig creates a new InitConfig object

Jump to

Keyboard shortcuts

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