Skip to content
This repository has been archived by the owner on Jan 19, 2022. It is now read-only.

[qctl] support external nodes #106

Merged
merged 4 commits into from
Oct 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions qctl/configyaml.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"os"

log "github.com/sirupsen/logrus"
"gopkg.in/yaml.v2"
yaml "gopkg.in/yaml.v2"
)

var (
Expand Down Expand Up @@ -48,6 +48,17 @@ type NodeEntry struct {
GethEntry GethEntry `yaml:"geth"`
}

type ExternalNodeEntry struct {
NodeUserIdent string `yaml:"Node_UserIdent"`
EnodeUrl string `yaml:"Enode_Url"`
TmUrl string `yaml:"Tm_Url"`
// must be set in the yaml without quotes.
// The hex number will be evaluted to a BigNum and
// template/istanbul-validator.toml.erb will convert back to hex
// https://github.com/mikefarah/yq/issues/19
NodekeyAddress string `yaml:"Node_Acct_Addr,omitempty"`
}

type Prometheus struct {
//#monitor_params_geth: --metrics --metrics.expensive --pprof --pprofaddr=0.0.0.0
//monitorParamsGeth string `yaml:"monitor_params_geth"`
Expand Down Expand Up @@ -87,7 +98,8 @@ type QConfig struct {
Cakeshop Cakeshop `yaml:"cakeshop,omitempty"`
K8s K8s `yaml:"k8s,omitempty"`

Nodes []NodeEntry
Nodes []NodeEntry
ExternalNodes []ExternalNodeEntry `yaml:"external_nodes,omitempty"`
}

func GetYamlConfig() QConfig {
Expand Down
10 changes: 5 additions & 5 deletions qctl/networkcmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ var (
Usage: "delete a quorum k8s network given the dir holding the k8s yaml resources.",
Flags: []cli.Flag{
&cli.StringFlag{
Name: "k8s-dir",
Name: "k8sdir",
Usage: "the path of the dir containing the K8s resource yaml.",
EnvVars: []string{"QUBE_K8S_DIR"},
Required: true,
Expand All @@ -32,7 +32,7 @@ var (
Usage: "create a quorum k8s network given the dir holding the k8s yaml resources.",
Flags: []cli.Flag{
&cli.StringFlag{
Name: "k8s-dir",
Name: "k8sdir",
Usage: "the path of the dir containing the K8s resource yaml.",
EnvVars: []string{"QUBE_K8S_DIR"},
Required: true,
Expand Down Expand Up @@ -74,7 +74,7 @@ var (
Usage: "list the status of the running network.",
Flags: []cli.Flag{
&cli.StringFlag{
Name: "k8s-dir",
Name: "k8sdir",
Usage: "the path of the dir containing the K8s resource yaml.",
EnvVars: []string{"QUBE_K8S_DIR"},
Required: true,
Expand Down Expand Up @@ -294,10 +294,10 @@ var (
)

func k8sCreateDeleteCluster(c *cli.Context, action string) error {
k8sdir := c.String("k8s-dir")
k8sdir := c.String("k8sdir")
// if the passed in k8s dir does not exit, tell the user and do not proceed.
if _, err := os.Stat(k8sdir); os.IsNotExist(err) {
log.Error("the --k8s-dir [%v] does not exist!", k8sdir)
log.Error("the --k8sdir [%v] does not exist!", k8sdir)
return err
}
namespace := c.String("namespace")
Expand Down
Loading