From ae187855404518fb34641160fb65646393033557 Mon Sep 17 00:00:00 2001 From: arturrez <56270896+arturrez@users.noreply.github.com> Date: Thu, 1 Aug 2024 10:48:45 -0700 Subject: [PATCH] add subnet alias (#1987) * add api for fuji * put old code back * add subnet alias * avoid github api if custom version is set * add publicAPI to network * fixes * fix golang template newline * switch to host network * fix template * rm host mode for monitoring * add e2e support back to template * fix e2e indent * make sure that all API hosts can receive traffic on IP and not localhost * lint * change subnet-alias implementation after join refactor * mv public access config to clusterconf and address other felipe feedback * lint * check for err * fix wiz * additional subnet aliases * address felipe feedback * add helperfunc to template * fix * fix text/template instead of html * use text/template --- cmd/nodecmd/deploy.go | 6 +- cmd/nodecmd/sync.go | 13 ++++ cmd/nodecmd/wiz.go | 1 + pkg/constants/constants.go | 1 + pkg/docker/compose.go | 2 +- pkg/remoteconfig/avalanche.go | 27 ++++++-- .../templates/avalanche-aliases.tmpl | 3 + pkg/ssh/ssh.go | 65 ++++++++++++++++++- pkg/utils/e2e.go | 2 +- 9 files changed, 111 insertions(+), 9 deletions(-) create mode 100644 pkg/remoteconfig/templates/avalanche-aliases.tmpl diff --git a/cmd/nodecmd/deploy.go b/cmd/nodecmd/deploy.go index c5936b50e..1ba839e58 100644 --- a/cmd/nodecmd/deploy.go +++ b/cmd/nodecmd/deploy.go @@ -15,8 +15,9 @@ import ( ) var ( - subnetOnly bool - avoidChecks bool + subnetOnly bool + avoidChecks bool + subnetAliases []string ) func newDeployCmd() *cobra.Command { @@ -33,6 +34,7 @@ It saves the deploy info both locally and remotely. } cmd.Flags().BoolVar(&subnetOnly, "subnet-only", false, "only create a subnet") cmd.Flags().BoolVar(&avoidChecks, "no-checks", false, "do not check for healthy status or rpc compatibility of nodes against subnet") + cmd.Flags().StringSliceVar(&subnetAliases, "subnet-aliases", nil, "additional subnet aliases to be used for RPC calls in addition to subnet blockchain name") return cmd } diff --git a/cmd/nodecmd/sync.go b/cmd/nodecmd/sync.go index 54b3f1bb0..d1ef13e7b 100644 --- a/cmd/nodecmd/sync.go +++ b/cmd/nodecmd/sync.go @@ -30,6 +30,7 @@ You can check the subnet bootstrap status by calling avalanche node status