diff --git a/ioctl/config/config.go b/ioctl/config/config.go index 99a140561c..db8d687c51 100644 --- a/ioctl/config/config.go +++ b/ioctl/config/config.go @@ -117,6 +117,12 @@ func init() { } if ReadConfig.Nsv2height == 0 { ReadConfig.Nsv2height = genesis.Default.FairbankBlockHeight + completeness = false + } + if ReadConfig.Endpoint == "" { + ReadConfig.Endpoint = _defaultEndpoint + ReadConfig.SecureConnect = true + 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"