From 55ab8a66ada8689bc441d0f05092446a9bde99a1 Mon Sep 17 00:00:00 2001 From: Dustin Xie Date: Wed, 10 Jan 2024 14:43:48 -0800 Subject: [PATCH 1/2] [ioctl] set default endpoint to iotex mainnet --- ioctl/config/config.go | 5 +++++ ioctl/config/configsetget.go | 1 + 2 files changed, 6 insertions(+) diff --git a/ioctl/config/config.go b/ioctl/config/config.go index 99a140561c..4c000aa873 100644 --- a/ioctl/config/config.go +++ b/ioctl/config/config.go @@ -117,6 +117,11 @@ func init() { } if ReadConfig.Nsv2height == 0 { ReadConfig.Nsv2height = genesis.Default.FairbankBlockHeight + completeness = false + } + if ReadConfig.Endpoint == "" { + ReadConfig.Endpoint = _defaultEndpoint + completeness = false } if ReadConfig.AnalyserEndpoint == "" { ReadConfig.AnalyserEndpoint = _defaultAnalyserEndpoint diff --git a/ioctl/config/configsetget.go b/ioctl/config/configsetget.go index 2e2043dcad..1f56d2e448 100644 --- a/ioctl/config/configsetget.go +++ b/ioctl/config/configsetget.go @@ -26,6 +26,7 @@ const ( _urlPattern = `[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)` _localPattern = "localhost" _endpointPattern = "(" + _ipPattern + "|(" + _domainPattern + ")" + "|(" + _localPattern + "))" + `(:\d{1,5})?` + _defaultEndpoint = "api.iotex.one:443" _defaultAnalyserEndpoint = "https://iotex-analyser-api-mainnet.chainanalytics.org" // _defaultWsEndpoint default w3bstream endpoint _defaultWsEndpoint = "sprout-staging.w3bstream.com:9000" From 611e6b56a29943f8ee19ca7aafb36bf9927d470a Mon Sep 17 00:00:00 2001 From: Dustin Xie Date: Wed, 10 Jan 2024 23:12:23 -0800 Subject: [PATCH 2/2] set default secureConnect --- ioctl/config/config.go | 1 + 1 file changed, 1 insertion(+) diff --git a/ioctl/config/config.go b/ioctl/config/config.go index 4c000aa873..db8d687c51 100644 --- a/ioctl/config/config.go +++ b/ioctl/config/config.go @@ -121,6 +121,7 @@ func init() { } if ReadConfig.Endpoint == "" { ReadConfig.Endpoint = _defaultEndpoint + ReadConfig.SecureConnect = true completeness = false } if ReadConfig.AnalyserEndpoint == "" {