mirror of
https://github.com/eosswedenorg/thalos
synced 2026-06-16 04:24:56 +02:00
cmd/main/main.go: Load message codec from config and pass to SpawnProccessor
This commit is contained in:
parent
f8f1d0399f
commit
bbf63e447d
1 changed files with 10 additions and 0 deletions
|
|
@ -8,6 +8,8 @@ import (
|
|||
"syscall"
|
||||
"time"
|
||||
|
||||
"github.com/eosswedenorg/thalos/api/message"
|
||||
_ "github.com/eosswedenorg/thalos/api/message/json"
|
||||
api_redis "github.com/eosswedenorg/thalos/api/redis"
|
||||
"github.com/eosswedenorg/thalos/app"
|
||||
"github.com/eosswedenorg/thalos/app/abi"
|
||||
|
|
@ -187,6 +189,13 @@ func main() {
|
|||
s.IrreversibleOnly = conf.Ship.IrreversibleOnly
|
||||
})
|
||||
|
||||
// Get codec
|
||||
codec, err := message.GetCodec(conf.MessageCodec)
|
||||
if err != nil {
|
||||
log.WithError(err).Fatal("Failed to load codec")
|
||||
return
|
||||
}
|
||||
|
||||
processor := app.SpawnProccessor(
|
||||
shClient,
|
||||
api_redis.NewPublisher(rdb, api_redis.Namespace{
|
||||
|
|
@ -194,6 +203,7 @@ func main() {
|
|||
ChainID: chainInfo.ChainID.String(),
|
||||
}),
|
||||
abi.NewAbiManager(rdb, eosClient, conf.Redis.CacheID),
|
||||
codec,
|
||||
)
|
||||
|
||||
// Run the application
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue