diff --git a/README.md b/README.md index 544c9ff3e..2773c55d5 100644 --- a/README.md +++ b/README.md @@ -184,14 +184,16 @@ Command **create** creates Bee infrastructure. It has two subcommands: ``` --cluster-name string cluster name (default "default") + --geth-url string Endpoint to chain node. Required. --help help for bee-cluster --timeout duration timeout (default 30m0s) - --with-funding fund nodes (default true) + --wallet-key string Hex-encoded private key for the Bee node wallet. Required. ``` + It is required to specify *geth-url* and *wallet-key* flags for funding Bee nodes with usage of flags or config file. example: ``` - beekeeper create bee-cluster default + beekeeper create bee-cluster --cluster-name=default ``` * k8s-namespace - creates Kubernetes namespace diff --git a/cmd/beekeeper/cmd/cluster.go b/cmd/beekeeper/cmd/cluster.go index ae4cf0341..1934836b9 100644 --- a/cmd/beekeeper/cmd/cluster.go +++ b/cmd/beekeeper/cmd/cluster.go @@ -109,28 +109,22 @@ func (c *command) deleteCluster(ctx context.Context, clusterName string, cfg *co } func (c *command) setupCluster(ctx context.Context, clusterName string, cfg *config.Config, startCluster bool) (cluster orchestration.Cluster, err error) { - const ( - optionNameChainNodeEndpoint = "geth-url" - optionNameWalletKey = "wallet-key" - ) - clusterConfig, ok := cfg.Clusters[clusterName] if !ok { return nil, fmt.Errorf("cluster %s not defined", clusterName) } var chainNodeEndpoint string - if chainNodeEndpoint = c.globalConfig.GetString(optionNameChainNodeEndpoint); chainNodeEndpoint == "" { - return nil, errors.New("chain node endpoint (geth-url) not provided") - } - var walletKey string - if walletKey = c.globalConfig.GetString(optionNameWalletKey); walletKey == "" { - return nil, errors.New("wallet key not provided") - } - var fundOpts orchestration.FundingOptions + if startCluster { + if chainNodeEndpoint = c.globalConfig.GetString(optionNameChainNodeEndpoint); chainNodeEndpoint == "" { + return nil, errors.New("chain node endpoint (geth-url) not provided") + } + if walletKey = c.globalConfig.GetString(optionNameWalletKey); walletKey == "" { + return nil, errors.New("wallet key not provided") + } fundOpts = ensureFundingDefaults(clusterConfig.Funding.Export(), c.log) } diff --git a/cmd/beekeeper/cmd/create_bee_cluster.go b/cmd/beekeeper/cmd/create_bee_cluster.go index 39c24252b..abe9566db 100644 --- a/cmd/beekeeper/cmd/create_bee_cluster.go +++ b/cmd/beekeeper/cmd/create_bee_cluster.go @@ -7,12 +7,14 @@ import ( "github.com/spf13/cobra" ) -func (c *command) initCreateBeeCluster() *cobra.Command { - const ( - optionNameClusterName = "cluster-name" - optionNameTimeout = "timeout" - ) +const ( + optionNameClusterName = "cluster-name" + optionNameChainNodeEndpoint = "geth-url" + optionNameWalletKey = "wallet-key" + optionNameTimeout = "timeout" +) +func (c *command) initCreateBeeCluster() *cobra.Command { cmd := &cobra.Command{ Use: "bee-cluster", Short: "creates Bee cluster", @@ -29,6 +31,8 @@ func (c *command) initCreateBeeCluster() *cobra.Command { } cmd.Flags().String(optionNameClusterName, "default", "cluster name") + cmd.Flags().String(optionNameChainNodeEndpoint, "", "Endpoint to chain node. Required.") + cmd.Flags().String(optionNameWalletKey, "", "Hex-encoded private key for the Bee node wallet. Required.") cmd.Flags().Duration(optionNameTimeout, 30*time.Minute, "timeout") return cmd diff --git a/version.go b/version.go index 34dbb7278..8609288a2 100644 --- a/version.go +++ b/version.go @@ -1,8 +1,8 @@ package beekeeper var ( - version = "0.13.4" // manually set semantic version number - commit string // automatically set git commit hash + version = "0.13.11" // manually set semantic version number + commit string // automatically set git commit hash // Version TODO Version = func() string {