From 1a7e306cb840afaec49f26559c9dac1c872926ba Mon Sep 17 00:00:00 2001 From: litai Date: Sat, 30 Jul 2022 10:47:09 +0800 Subject: [PATCH] =?UTF-8?q?add=20MaketToken=20config=20,=20if=20MaketToken?= =?UTF-8?q?=20is=20not=20empty=EF=BC=8CSupport=20local=20maket=20token?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- venus-sector-manager/dep/sealer_constructor.go | 6 +++++- venus-sector-manager/modules/config.go | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/venus-sector-manager/dep/sealer_constructor.go b/venus-sector-manager/dep/sealer_constructor.go index 3804c59b0..56f09a652 100644 --- a/venus-sector-manager/dep/sealer_constructor.go +++ b/venus-sector-manager/dep/sealer_constructor.go @@ -465,7 +465,11 @@ type MarketAPIRelatedComponets struct { func BuildMarketAPI(gctx GlobalContext, lc fx.Lifecycle, scfg *modules.SafeConfig, infoAPI core.MinerInfoAPI) (market.API, error) { scfg.Lock() - api, token := scfg.Common.API.Market, scfg.Common.API.Token + marketToken := scfg.Common.API.Token + if scfg.Common.API.MarketToken != "" { + marketToken = scfg.Common.API.MarketToken + } + api, token := scfg.Common.API.Market, marketToken defer scfg.Unlock() if api == "" { diff --git a/venus-sector-manager/modules/config.go b/venus-sector-manager/modules/config.go index 7e0fb0ca5..c9615dc0c 100644 --- a/venus-sector-manager/modules/config.go +++ b/venus-sector-manager/modules/config.go @@ -63,6 +63,7 @@ type CommonAPIConfig struct { Gateway []string Token string ChainEventInterval Duration + MarketToken string } func defaultCommonAPIConfig(example bool) CommonAPIConfig { @@ -75,6 +76,7 @@ func defaultCommonAPIConfig(example bool) CommonAPIConfig { cfg.Market = "/ip4/{api_host}/tcp/{api_port}" cfg.Gateway = []string{"/ip4/{api_host}/tcp/{api_port}"} cfg.Token = "{some token}" + cfg.MarketToken = "{some token}" } return cfg }