Skip to content

Commit

Permalink
Remove core space pub/sub client usage (#215)
Browse files Browse the repository at this point in the history
  • Loading branch information
wanliqun authored Aug 8, 2024
1 parent c52f7b5 commit e55c5df
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 14 deletions.
6 changes: 0 additions & 6 deletions cmd/util/data_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ type SyncContext struct {
StoreContext

SyncCfx *sdk.Client
SubCfx *sdk.Client
SyncEth *web3go.Client
}

Expand All @@ -84,7 +83,6 @@ func MustInitSyncContext(storeCtx StoreContext) SyncContext {

if storeCtx.CfxDB != nil || storeCtx.CfxCache != nil {
sc.SyncCfx = rpc.MustNewCfxClientFromViper(rpc.WithClientHookMetrics(true))
sc.SubCfx = rpc.MustNewCfxWsClientFromViper()
}

if storeCtx.EthDB != nil {
Expand All @@ -102,10 +100,6 @@ func (ctx *SyncContext) Close() {
ctx.SyncCfx.Close()
}

if ctx.SubCfx != nil {
ctx.SubCfx.Close()
}

if ctx.SyncEth != nil {
ctx.SyncEth.Close()
}
Expand Down
2 changes: 0 additions & 2 deletions config/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ ethrpc:

# Core space SDK client configurations
cfx:
# Fullnode websocket endpoint
ws: ws://test.confluxrpc.com/ws
# Fullnode HTTP endpoint
http: http://test.confluxrpc.com
# Retry times if failure, if 0 never
Expand Down
2 changes: 1 addition & 1 deletion util/rate/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ func (r *Registry) genDefaultGroupAndKey(

stg, ok := r.strategies[DefaultStrategy]
if !ok { // no default strategy
logrus.WithField("resource", resource).Info("Default strategy not configured")
logrus.WithField("resource", resource).Debug("Default rate limit strategy not configured")
return
}

Expand Down
4 changes: 0 additions & 4 deletions util/rpc/client_cfx.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@ func MustNewCfxClientFromViper(options ...ClientOption) *sdk.Client {
return MustNewCfxClient(cfxClientCfg.Http, options...)
}

func MustNewCfxWsClientFromViper(options ...ClientOption) *sdk.Client {
return MustNewCfxClient(cfxClientCfg.WS, options...)
}

func MustNewCfxClient(url string, options ...ClientOption) *sdk.Client {
cfx, err := NewCfxClient(url, options...)
if err != nil {
Expand Down
1 change: 0 additions & 1 deletion util/rpc/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ type circuitBreakerConfig struct {
}

type clientConfig struct {
WS string
Http string
Retry int
RetryInterval time.Duration `default:"1s"`
Expand Down

0 comments on commit e55c5df

Please sign in to comment.