Skip to content

Commit

Permalink
Bump indexer and register services before idxer start
Browse files Browse the repository at this point in the history
  • Loading branch information
joon9823 committed Feb 15, 2024
1 parent 33958ed commit a11f1eb
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
9 changes: 8 additions & 1 deletion cmd/minitiad/indexer.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ import (

"github.com/initia-labs/indexer"
indexercfg "github.com/initia-labs/indexer/config"
"github.com/initia-labs/indexer/service/collector"
"github.com/initia-labs/indexer/service/cron/pair"
"github.com/initia-labs/indexer/service/dashboard"
minitiaapp "github.com/initia-labs/minimove/app"
)

Expand All @@ -37,12 +40,16 @@ func preSetupIndexer(svrCtx *server.Context, clientCtx client.Context, ctx conte
return nil
}

idxer.GetHandler().RegisterService(collector.CollectorSvc)
idxer.GetHandler().RegisterService(dashboard.DashboardSvc)
idxer.GetHandler().RegisterCronjob(pair.Tag, pair.Expr, pair.JobInit, pair.JobFunc)

err = idxer.Validate()
if err != nil {
return err
}

err = idxer.Start()
err = idxer.Start(nil)
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ require (
golang.org/x/sync v0.6.0
)

require github.com/initia-labs/indexer v0.1.0-beta.20.0.20240129034833-18782f9d72db
require github.com/initia-labs/indexer v0.1.0-beta.20.0.20240214030756-b501447bda71

require (
cloud.google.com/go v0.110.10 // indirect
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -730,6 +730,8 @@ github.com/initia-labs/iavl v0.0.0-20240208034922-5d81c449d4c0 h1:GQ7/UD5mB6q104
github.com/initia-labs/iavl v0.0.0-20240208034922-5d81c449d4c0/go.mod h1:CmTGqMnRnucjxbjduneZXT+0vPgNElYvdefjX2q9tYc=
github.com/initia-labs/indexer v0.1.0-beta.20.0.20240129034833-18782f9d72db h1:eI96kQNj7Cksexuz1u3KiTAYvFB5m3LxkTqSOTpHAp4=
github.com/initia-labs/indexer v0.1.0-beta.20.0.20240129034833-18782f9d72db/go.mod h1:/LNEux188Q3t7hLeRhd8jflMrV7Xu1qYvTV2PdTXw4c=
github.com/initia-labs/indexer v0.1.0-beta.20.0.20240214030756-b501447bda71 h1:lPWpCg3GtwzjlYxbFP5+HXKXGYWk8T+pwSYIH9whF8s=
github.com/initia-labs/indexer v0.1.0-beta.20.0.20240214030756-b501447bda71/go.mod h1:/LNEux188Q3t7hLeRhd8jflMrV7Xu1qYvTV2PdTXw4c=
github.com/initia-labs/initia v0.2.0-beta.7 h1:OSX2R6mSK9CDNHkobPhhgSJA8jC5us/ZMb92RimJddU=
github.com/initia-labs/initia v0.2.0-beta.7/go.mod h1:4WHiGf1+s6CSPqRH1STGxVHaoL5DBeWFhdixdohYOjA=
github.com/initia-labs/initiavm v0.2.0-beta.2 h1:aSUZok4fQAWVJF9RA5mkF2mrdZq1gtqDllCHgBPjV58=
Expand Down

0 comments on commit a11f1eb

Please sign in to comment.