setup

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2021 License: GPL-3.0 Imports: 27 Imported by: 10

Documentation

Overview

setup package generates config files following the given deployment options. It creates the given number of genesis.json and nodekeys

Source Files

Each file contains the following contents

  • cmd.go : Provides functions to generate config files with given deployment configuration
  • flags.go : Defines command line flags which can be used in `setup` command
  • klaytn_config.go : Defines `KlaytnConfig` and provides a template to build it
  • prometheus_config.go : Defines `PrometheusConfig` and provides a template to build it

Index

Constants

View Source
const (
	DefaultTcpPort uint16 = 32323
	TypeNotDefined        = -1
	TypeDocker            = 0
	TypeLocal             = 1
	TypeRemote            = 2
	TypeDeploy            = 3
	DirScript             = "scripts"
	DirKeys               = "keys"
	DirPnScript           = "scripts_pn"
	DirPnKeys             = "keys_pn"
	DirTestKeys           = "keys_test"
	CNIpNetwork           = "10.11.2"
	PNIpNetwork1          = "10.11.10"
	PNIpNetwork2          = "10.11.11"
)

Variables

View Source
var GrafanaFiles = [...]GrafanaFile{
	{
		// contains filtered or unexported fields
	},
	{
		// contains filtered or unexported fields
	},
}
View Source
var (
	SetupCommand = cli.Command{
		Name:  "setup",
		Usage: "Generate klaytn CN's init files",
		Description: `This tool helps generate:
		* Genesis Block (genesis.json)
		* Static nodes for all CNs(Consensus Node)
		* CN details
		* Docker-compose

		for Klaytn Consensus Node.

Args :
		type : [local | remote | deploy | docker (default)]
`,
		Action: gen,
		Flags: []cli.Flag{
			cypressTestFlag,
			cypressFlag,
			baobabTestFlag,
			baobabFlag,
			serviceChainFlag,
			serviceChainTestFlag,
			cliqueFlag,
			numOfCNsFlag,
			numOfValidatorsFlag,
			numOfPNsFlag,
			numOfENsFlag,
			numOfSCNsFlag,
			numOfSPNsFlag,
			numOfSENsFlag,
			numOfTestKeyFlag,
			chainIDFlag,
			serviceChainIDFlag,
			unitPriceFlag,
			deriveShaImplFlag,
			fundingAddrFlag,
			outputPathFlag,
			dockerImageIdFlag,
			fasthttpFlag,
			networkIdFlag,
			nografanaFlag,
			useTxGenFlag,
			txGenRateFlag,
			txGenThFlag,
			txGenConnFlag,
			txGenDurFlag,
			rpcPortFlag,
			wsPortFlag,
			p2pPortFlag,
			dataDirFlag,
			logDirFlag,
			governanceFlag,
			govModeFlag,
			governingNodeFlag,
			rewardMintAmountFlag,
			rewardRatioFlag,
			rewardGiniCoeffFlag,
			rewardStakingFlag,
			rewardProposerFlag,
			rewardMinimumStakeFlag,
			rewardDeferredTxFeeFlag,
			istEpochFlag,
			istProposerPolicyFlag,
			istSubGroupFlag,
			cliqueEpochFlag,
			cliquePeriodFlag,
		},
		ArgsUsage: "type",
	}
)
View Source
var Types = [4]string{"docker", "local", "remote", "deploy"}

Functions

func RandStringRunes

func RandStringRunes(n int) string

func WriteFile added in v1.1.0

func WriteFile(content []byte, parentFolder string, fileName string)

Types

type GrafanaFile

type GrafanaFile struct {
	// contains filtered or unexported fields
}

type KlaytnConfig

type KlaytnConfig struct {
	NetworkId int
	RPCPort   int
	WSPort    int
	P2PPort   int
	DataDir   string
	LogDir    string
	RunDir    string
	NodeType  string
}

func New

func New(rpcPort int, wsPort int, p2pPort int, dataDir string, logDir string, runDir string, nodeType string) *KlaytnConfig

func (KlaytnConfig) String

func (k KlaytnConfig) String() string

type PrometheusConfig

type PrometheusConfig struct {
	CnIps []string
	PnIps []string
}

func NewPrometheusConfig

func NewPrometheusConfig(cnNum int, cnNetworkIp string, pnNum int, pnNetworkId1 string, pnNetworkId2 string) PrometheusConfig

func (PrometheusConfig) String

func (pConfig PrometheusConfig) String() string

type ValidatorInfo

type ValidatorInfo struct {
	Address  common.Address
	Nodekey  string
	NodeInfo string
}

Jump to

Keyboard shortcuts

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