mirror of
https://github.com/eosswedenorg/thalos
synced 2026-06-19 04:50:02 +02:00
abi.go: Get rid of global state by defining an AbiManager struct.
This commit is contained in:
parent
0ded3ee6fe
commit
45d1a468e8
3 changed files with 24 additions and 12 deletions
8
main.go
8
main.go
|
|
@ -35,6 +35,8 @@ var (
|
|||
eosClientCtx = context.Background()
|
||||
)
|
||||
|
||||
var abi_mgr *AbiManager
|
||||
|
||||
var redisNs redis.Namespace
|
||||
|
||||
// Reader states
|
||||
|
|
@ -216,9 +218,6 @@ func main() {
|
|||
return
|
||||
}
|
||||
|
||||
// Init Abi cache
|
||||
InitAbiCache(conf.Redis.CacheID)
|
||||
|
||||
// Connect client and get chain info.
|
||||
log.Printf("Get chain info from api at: %s", conf.Api)
|
||||
eosClient = eos.New(conf.Api)
|
||||
|
|
@ -228,6 +227,9 @@ func main() {
|
|||
return
|
||||
}
|
||||
|
||||
// Init Abi cache
|
||||
abi_mgr = abi.NewAbiManager(eosClient, conf.Redis.CacheID)
|
||||
|
||||
redisNs = redis.Namespace{
|
||||
Prefix: conf.Redis.Prefix,
|
||||
ChainID: chainInfo.ChainID.String(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue