Documentation
¶
Index ¶
- func GenerateNodeDir(rootDir string, genesis *config.GenesisConfig, node *config.Config, ...) error
- func GenerateNodeRoot(ncfg *NodeGenConfig) error
- func GenerateTestnetConfigs(cfg *TestnetConfig, opts *ConfigOpts, gencfg *config.GenesisConfig) error
- func GenerateTestnetDir(testnetDir string, genesis *config.GenesisConfig, nodes []*TestnetNodeConfig, ...) error
- func GenesisCmd() *cobra.Command
- func GenesisHashCmd() *cobra.Command
- func InitCmd() *cobra.Command
- func ResetCmd() *cobra.Command
- func SetupCmd() *cobra.Command
- func TestnetCmd() *cobra.Command
- type ConfigOpts
- type NodeGenConfig
- type TestnetConfig
- type TestnetNodeConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateNodeDir ¶
func GenerateNodeDir(rootDir string, genesis *config.GenesisConfig, node *config.Config, privateKey *crypto.Secp256k1PrivateKey, snapshot string) error
GenerateNodeDir generates a node configuration directory. It is a minimal function that takes a full configuration. Most users should use GenerateNodeRoot instead.
func GenerateNodeRoot ¶
func GenerateNodeRoot(ncfg *NodeGenConfig) error
func GenerateTestnetConfigs ¶
func GenerateTestnetConfigs(cfg *TestnetConfig, opts *ConfigOpts, gencfg *config.GenesisConfig) error
func GenerateTestnetDir ¶
func GenerateTestnetDir(testnetDir string, genesis *config.GenesisConfig, nodes []*TestnetNodeConfig, snapshot string) error
GenerateTestnetDir generates a testnet configuration for multiple nodes. It is a minimal function that takes full configurations. Most users should use GenerateTestnetConfigs instead. copies the snapshot file to each node directory if it is not empty.
func GenesisCmd ¶
func GenesisHashCmd ¶
func TestnetCmd ¶
Types ¶
type ConfigOpts ¶
type ConfigOpts struct {
// UniquePorts is a flag to generate unique listening addresses
// (JSON-RPC, HTTP, Admin, P2P, node RPC) for each node.
// This is useful for testing multiple nodes on the same machine.
// If it is used for generating a single config, it has no effect.
UniquePorts bool
// DnsHost is a flag to use DNS hostname as host in the config
// instead of ip. It will be used together with DnsNamePrefix to generate
// hostnames.
// This is useful for testing nodes inside docker containers.
DnsHost bool
}
type NodeGenConfig ¶
type TestnetConfig ¶
type TestnetNodeConfig ¶
type TestnetNodeConfig struct {
// Config is the node configuration.
Config *config.Config
// DirName is the directory name of the node.
// If the testnetDir is "testnet" and the DirName is "node0",
// the full path of the node is "testnet/node0".
DirName string
// PrivateKey is the private key of the node.
PrivateKey *crypto.Secp256k1PrivateKey
}
Click to show internal directories.
Click to hide internal directories.