Skip to content

Commit

Permalink
update cfg option
Browse files Browse the repository at this point in the history
  • Loading branch information
libangzhu authored and vipwzw committed Aug 17, 2022
1 parent fa356f1 commit bd02053
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions rpc/ethrpc/rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ var (

type subConfig struct {
//ethereum json rpc bindaddr
Enable bool `json:"enable,omitempty"`
HTTPAddr string `json:"httpAddr,omitempty"`
HTTPAPI []string `json:"httpApi,omitempty"` //eth,admin,net,web3/personal
WsAddr string `json:"wsAddr,omitempty"`
WsAPI []string `json:"wsApi,omitempty"` //eth,admin,net,web3/personal
Web3ClientVer string `json:"web3Clientver,omitempty"`
Enable bool `json:"enable,omitempty"`
HTTPAddr string `json:"httpAddr,omitempty"`
HTTPAPI []string `json:"httpApi,omitempty"` //eth,admin,net,web3/personal
WsAddr string `json:"wsAddr,omitempty"`
WsAPI []string `json:"wsApi,omitempty"` //eth,admin,net,web3/personal
Web3CliVer string `json:"web3Cliver,omitempty"`
}

//ServerAPI ...
Expand Down
4 changes: 2 additions & 2 deletions rpc/ethrpc/web3/web3.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ func (w *web3Handler) Sha3(input string) (string, error) {
//web3_clientVersion
func (w *web3Handler) ClientVersion() (string, error) {
var subcfg struct {
Web3ClientVer string `json:"web3Clientver,omitempty"`
Web3CliVer string `json:"web3Cliver,omitempty"`
}

ctypes.MustDecode(w.cfg.GetSubConfig().RPC["eth"], &subcfg)
return subcfg.Web3ClientVer, nil
return subcfg.Web3CliVer, nil
}
2 changes: 1 addition & 1 deletion types/defaultcfg.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ jrpcFuncWhitelist=["*"]
grpcFuncWhitelist=["*"]
[rpc.sub.eth]
enable=false
web3Clientver="Geth/v1.8.15-omnibus-255989da/linux-amd64/go1.10.1"
web3Cliver="Geth/v1.8.15-omnibus-255989da/linux-amd64/go1.10.1"
[mempool]
name="timeline"
Expand Down

0 comments on commit bd02053

Please sign in to comment.