mirror of
https://github.com/eosswedenorg/thalos
synced 2026-07-04 12:03:41 +02:00
cmd/thalos/main.go: use conf.Ship.Chain if set as namespace. otherwise default to chain id from api.
This commit is contained in:
parent
e0f7e3b4e9
commit
ac57e82992
1 changed files with 8 additions and 1 deletions
|
|
@ -106,6 +106,13 @@ func init() {
|
||||||
log.SetFormatter(&formatter)
|
log.SetFormatter(&formatter)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func getChain(def string) string {
|
||||||
|
if len(conf.Ship.Chain) > 0 {
|
||||||
|
return conf.Ship.Chain
|
||||||
|
}
|
||||||
|
return def
|
||||||
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
var err error
|
var err error
|
||||||
var chainInfo *eos.InfoResp
|
var chainInfo *eos.InfoResp
|
||||||
|
|
@ -224,7 +231,7 @@ func main() {
|
||||||
shClient,
|
shClient,
|
||||||
api_redis.NewPublisher(rdb, api_redis.Namespace{
|
api_redis.NewPublisher(rdb, api_redis.Namespace{
|
||||||
Prefix: conf.Redis.Prefix,
|
Prefix: conf.Redis.Prefix,
|
||||||
ChainID: chainInfo.ChainID.String(),
|
ChainID: getChain(chainInfo.ChainID.String()),
|
||||||
}),
|
}),
|
||||||
abi.NewAbiManager(rdb, eosClient, conf.Redis.CacheID),
|
abi.NewAbiManager(rdb, eosClient, conf.Redis.CacheID),
|
||||||
codec,
|
codec,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue