diff --git a/bin/v0.34.x/Dockerfile b/Dockerfile similarity index 89% rename from bin/v0.34.x/Dockerfile rename to Dockerfile index 75bd578..d53e394 100644 --- a/bin/v0.34.x/Dockerfile +++ b/Dockerfile @@ -15,12 +15,12 @@ WORKDIR /code COPY . /code/ # See https://github.com/CosmWasm/wasmvm/releases -ADD https://github.com/CosmWasm/wasmvm/releases/download/v0.16.3/libwasmvm_muslc.a /lib/libwasmvm_muslc.a +ADD https://github.com/terra-money/wasmvm/releases/download/v0.16.4/libwasmvm_muslc.a /lib/libwasmvm_muslc.a # use mimalloc for musl RUN git clone --depth 1 https://github.com/microsoft/mimalloc; cd mimalloc; mkdir build; cd build; cmake ..; make -j$(nproc); make install -ENV MIMALLOC_LARGE_OS_PAGES=1 +ENV MIMALLOC_RESERVE_HUGE_OS_PAGES=4 # force it to use static lib (from above) not standard libgo_cosmwasm.so file RUN LEDGER_ENABLED=false go build -work -tags muslc,linux -mod=readonly -ldflags="-extldflags '-L/code/mimalloc/build -lmimalloc'" -o build/mantlemint ./sync.go diff --git a/bin/v0.34.x/Makefile b/Makefile similarity index 55% rename from bin/v0.34.x/Makefile rename to Makefile index ce5d4b9..df79f5d 100644 --- a/bin/v0.34.x/Makefile +++ b/Makefile @@ -6,16 +6,16 @@ build: go.sum ifeq ($(OS),Windows_NT) exit 1 else - go build -mod=readonly $(BUILD_FLAGS) -o build/mantlemint ./sync + go build -mod=readonly $(BUILD_FLAGS) -o build/mantlemint ./sync.go endif -build-linux: +build-static: mkdir -p $(BUILDDIR) - docker buildx build --platform=linux/amd64 --tag terramoney/mantlemint ./ - docker create --platform=linux/amd64 --name temp terramoney/mantlemint:latest + docker buildx build --tag terramoney/mantlemint ./ + docker create --name temp terramoney/mantlemint:latest docker cp temp:/usr/local/bin/mantlemint $(BUILDDIR)/ docker rm temp install: go.sum - go install -mod=readonly $(BUILD_FLAGS) ./ \ No newline at end of file + go install -mod=readonly $(BUILD_FLAGS) ./ diff --git a/README.md b/README.md index f732559..693b465 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ Mantlemint is a fast core optimized for serving massive user queries. -Native query performance on RPC is very slow and is not suitable for massive query handling, due to the inefficiencies introduced by IAVL tree. Mantlemint is running on `fauxMerkleTree` mode, basically removing the IAVL inefficiencies while using the same core to compute the same module outputs. +Native query performance on RPC is slow and is not suitable for massive query handling, due to the inefficiencies introduced by IAVL tree. Mantlemint is running on `fauxMerkleTree` mode, basically removing the IAVL inefficiencies while using the same core to compute the same module outputs. If you are looking to serve any kind of public node accepting varying degrees of end-user queries, it is recommended that you run a mantlemint instance alongside of your RPC. While mantlemint is indeed faster at resolving queries, due to the absence of IAVL tree and native tendermint, it cannot join p2p network by itself. Rather, you would have to relay finalized blocks to mantlemint, using RPC's websocket. @@ -51,6 +51,22 @@ Mantlemint internally runs the same Terra Core, therefore you need to provide th It is __required__ to run mantlemint in a separate `$HOME` directory than RPC; while mantlemint maintains its own database, some of the data may be overwritten by either mantlemint or RPC and may cause trouble. + +### Building + +#### 1. As a statically-linked application +```sh +$ make build-static # results in build/mantlemint +``` + + +#### 2. As a dynamically-linked application +```sh +$ make build # results in build/mantlemint +$ make install # results in $GOPATH/bin/mantlemint +``` + + ### Running Mantlemint depends on 2 configs: @@ -67,7 +83,7 @@ GENESIS_PATH=config/genesis.json \ # - create and maintain $HOME/mantlemint.db directory # - create and maintain $HOME/data/* for wasm blobs; (unsafe to share with RPC!) # - create and maintain $HOME/$(INDEXER_DB).db for mantle indexers -HOME=mantlemint \ +MANTLEMINT_HOME=mantlemint \ # Chain ID CHAIN_ID=columbus-5 \ @@ -82,18 +98,49 @@ WS_ENDPOINTS=ws://rpc1:26657/websocket,ws://rpc2:26657/websocket \ INDEXER_DB=indexer \ # Flag to enable/disable mantlemint sync, mainly for debugging -DISABLE_SYNC=true \ +DISABLE_SYNC=false \ # Run sync binary sync ``` +## Health check + +`mantlemint` implements a separate `/health` endpoint. It is particularly useful if you want to suppress traffics being routed to `mantlemint` nodes still syncing or unavailable due to whatever reason. + +The endpoint will response: +- `200 OK` if mantlemint sync status is up-to date (i.e. syncing using websocket from RPC) +- `400 NOK` if mantlemint is still syncing past blocks, and is not ready to serve the latest state yet. + +Please note that mantlemint still is able to serve queries while `/health` returns `NOK`. ## Default Indexes - `/index/tx/by_height/{height}`: List all transactions and their responses in a block. Equivalent to `tendermint/block?height=xxx`, with tx responses base64-decoded for better usability. - `/index/tx/by_hash/{txHash}`: Get transaction and its response by hash. Equivalent to `lcd/txs/{hash}`, but without hitting RPC. -# LICENSE +## Notable Differences from [core](https://github.com/terra-money/core) + +- Uses a forked [tendermint/tm-db](https://github.com/terra-money/tm-db/commit/c71e8b6e9f20d7f5be32527db4a92ae19ac0d2b2): Disables unncessary mutexes in `prefixdb` methods +- Replaces ABCIClient with [NewConcurrentQueryClient](https://github.com/terra-money/mantlemint/blob/main/bin/v0.34.x/mantlemint/client.go#L110): Removal of mutexes allow better concurrency, even during block injection +- Uses single batch-protected db: All state changes are flushed at once, making it safe to read from db during block injection +- Automatic failover: In case of block injection failure, mantlemint reverts back to the previous known state and retry + + +## Community + +- [Offical Website](https://terra.money) +- [Discord](https://discord.gg/e29HWwC2Mz) +- [Telegram](https://t.me/terra_announcements) +- [Twitter](https://twitter.com/terra_money) +- [YouTube](https://goo.gl/3G4T1z) + +## Contributing + +If you are interested in contributing to Terra Core source, please review our [code of conduct](./CODE_OF_CONDUCT.md). + +# License + +This software is licensed under the Apache 2.0 license. Read more about it here. -Apache 2.0 +© 2021 Terraform Labs, PTE LTD diff --git a/bin/v0.34.x/block_feed/aggregate.go b/block_feed/aggregate.go similarity index 100% rename from bin/v0.34.x/block_feed/aggregate.go rename to block_feed/aggregate.go diff --git a/bin/v0.34.x/block_feed/helpers.go b/block_feed/helpers.go similarity index 100% rename from bin/v0.34.x/block_feed/helpers.go rename to block_feed/helpers.go diff --git a/bin/v0.34.x/block_feed/rpc.go b/block_feed/rpc.go similarity index 100% rename from bin/v0.34.x/block_feed/rpc.go rename to block_feed/rpc.go diff --git a/bin/v0.34.x/block_feed/types.go b/block_feed/types.go similarity index 100% rename from bin/v0.34.x/block_feed/types.go rename to block_feed/types.go diff --git a/bin/v0.34.x/block_feed/websocket.go b/block_feed/websocket.go similarity index 100% rename from bin/v0.34.x/block_feed/websocket.go rename to block_feed/websocket.go diff --git a/bin/v0.34.x/config/config.go b/config/config.go similarity index 67% rename from bin/v0.34.x/config/config.go rename to config/config.go index e777441..35c9a1f 100644 --- a/bin/v0.34.x/config/config.go +++ b/config/config.go @@ -2,30 +2,34 @@ package config import ( "fmt" + "github.com/cosmos/cosmos-sdk/x/crisis" + "github.com/spf13/pflag" + "github.com/spf13/viper" terra "github.com/terra-money/core/app" "os" + "path/filepath" "strings" ) type Config struct { - GenesisPath string - Home string - ChainID string - RPCEndpoints []string - WSEndpoints []string - MantlemintDB string - IndexerDB string - DisableSync bool + GenesisPath string + Home string + ChainID string + RPCEndpoints []string + WSEndpoints []string + MantlemintDB string + IndexerDB string + DisableSync bool } // NewConfig converts envvars into consumable config chunks func NewConfig() Config { - return Config{ + cfg := Config{ // GenesisPath sets the location of genesis GenesisPath: getValidEnv("GENESIS_PATH"), // Home sets where the default terra home is. - Home: getValidEnv("HOME"), + Home: getValidEnv("MANTLEMINT_HOME"), // ChainID sets expected chain id for this mantlemint instance ChainID: getValidEnv("CHAIN_ID"), @@ -61,6 +65,23 @@ func NewConfig() Config { return disableSync == "true" }(), } + + viper.SetConfigType("toml") + viper.SetConfigName("app") + viper.AutomaticEnv() + viper.AddConfigPath(filepath.Join(cfg.Home, "config")) + + pflag.Bool(crisis.FlagSkipGenesisInvariants, false, "Skip x/crisis invariants check on startup") + pflag.Parse() + if bindErr := viper.BindPFlags(pflag.CommandLine); bindErr != nil { + panic(bindErr) + } + + if err := viper.MergeInConfig(); err != nil { + panic(fmt.Errorf("failed to merge configuration: %w", err)) + } + + return cfg } func (cfg Config) Print() { diff --git a/bin/v0.34.x/db/heleveldb/config.go b/db/heleveldb/config.go similarity index 100% rename from bin/v0.34.x/db/heleveldb/config.go rename to db/heleveldb/config.go diff --git a/bin/v0.34.x/db/heleveldb/leveldb_batch.go b/db/heleveldb/leveldb_batch.go similarity index 93% rename from bin/v0.34.x/db/heleveldb/leveldb_batch.go rename to db/heleveldb/leveldb_batch.go index 7268d02..2506c0d 100644 --- a/bin/v0.34.x/db/heleveldb/leveldb_batch.go +++ b/db/heleveldb/leveldb_batch.go @@ -4,8 +4,8 @@ import ( "fmt" tmdb "github.com/tendermint/tm-db" - "github.com/terra-money/mantlemint-provider-v0.34.x/db/hld" - "github.com/terra-money/mantlemint-provider-v0.34.x/db/rollbackable" + "github.com/terra-money/mantlemint/db/hld" + "github.com/terra-money/mantlemint/db/rollbackable" ) var _ hld.HeightLimitEnabledBatch = (*LevelBatch)(nil) diff --git a/bin/v0.34.x/db/heleveldb/leveldb_driver.go b/db/heleveldb/leveldb_driver.go similarity index 96% rename from bin/v0.34.x/db/heleveldb/leveldb_driver.go rename to db/heleveldb/leveldb_driver.go index c1cbc54..ac3420a 100644 --- a/bin/v0.34.x/db/heleveldb/leveldb_driver.go +++ b/db/heleveldb/leveldb_driver.go @@ -5,8 +5,8 @@ import ( "math" tmdb "github.com/tendermint/tm-db" - "github.com/terra-money/mantlemint-provider-v0.34.x/db/hld" - "github.com/terra-money/mantlemint-provider-v0.34.x/lib" + "github.com/terra-money/mantlemint/db/hld" + "github.com/terra-money/mantlemint/lib" ) type Driver struct { diff --git a/bin/v0.34.x/db/heleveldb/leveldb_iterator.go b/db/heleveldb/leveldb_iterator.go similarity index 96% rename from bin/v0.34.x/db/heleveldb/leveldb_iterator.go rename to db/heleveldb/leveldb_iterator.go index 2a02495..2b770f7 100644 --- a/bin/v0.34.x/db/heleveldb/leveldb_iterator.go +++ b/db/heleveldb/leveldb_iterator.go @@ -4,7 +4,7 @@ import ( "bytes" tmdb "github.com/tendermint/tm-db" - "github.com/terra-money/mantlemint-provider-v0.34.x/db/hld" + "github.com/terra-money/mantlemint/db/hld" ) var _ hld.HeightLimitEnabledIterator = (*Iterator)(nil) diff --git a/bin/v0.34.x/db/heleveldb/types.go b/db/heleveldb/types.go similarity index 94% rename from bin/v0.34.x/db/heleveldb/types.go rename to db/heleveldb/types.go index e99f447..50cc185 100644 --- a/bin/v0.34.x/db/heleveldb/types.go +++ b/db/heleveldb/types.go @@ -4,7 +4,7 @@ import ( "encoding/binary" "math" - "github.com/terra-money/mantlemint-provider-v0.34.x/lib" + "github.com/terra-money/mantlemint/lib" ) const ( diff --git a/bin/v0.34.x/db/hld/cluster_utils.go b/db/hld/cluster_utils.go similarity index 100% rename from bin/v0.34.x/db/hld/cluster_utils.go rename to db/hld/cluster_utils.go diff --git a/bin/v0.34.x/db/hld/height_limited_db.go b/db/hld/height_limited_db.go similarity index 99% rename from bin/v0.34.x/db/hld/height_limited_db.go rename to db/hld/height_limited_db.go index a42cb1a..6436b4f 100644 --- a/bin/v0.34.x/db/hld/height_limited_db.go +++ b/db/hld/height_limited_db.go @@ -5,7 +5,7 @@ import ( "fmt" "sync" - "github.com/terra-money/mantlemint-provider-v0.34.x/lib" + "github.com/terra-money/mantlemint/lib" tmdb "github.com/tendermint/tm-db" ) diff --git a/bin/v0.34.x/db/hld/height_limited_iterator.go b/db/hld/height_limited_iterator.go similarity index 100% rename from bin/v0.34.x/db/hld/height_limited_iterator.go rename to db/hld/height_limited_iterator.go diff --git a/bin/v0.34.x/db/hld/types.go b/db/hld/types.go similarity index 100% rename from bin/v0.34.x/db/hld/types.go rename to db/hld/types.go diff --git a/bin/v0.34.x/db/rollbackable/rollbackable_batch.go b/db/rollbackable/rollbackable_batch.go similarity index 100% rename from bin/v0.34.x/db/rollbackable/rollbackable_batch.go rename to db/rollbackable/rollbackable_batch.go diff --git a/bin/v0.34.x/db/safe_batch/safe_batch.go b/db/safe_batch/safe_batch.go similarity index 96% rename from bin/v0.34.x/db/safe_batch/safe_batch.go rename to db/safe_batch/safe_batch.go index 1e1e2f7..8979be9 100644 --- a/bin/v0.34.x/db/safe_batch/safe_batch.go +++ b/db/safe_batch/safe_batch.go @@ -4,7 +4,7 @@ import ( "fmt" tmdb "github.com/tendermint/tm-db" - "github.com/terra-money/mantlemint-provider-v0.34.x/db/rollbackable" + "github.com/terra-money/mantlemint/db/rollbackable" ) var _ tmdb.DB = (*SafeBatchDB)(nil) diff --git a/bin/v0.34.x/db/safe_batch/safe_batch_nullify.go b/db/safe_batch/safe_batch_nullify.go similarity index 100% rename from bin/v0.34.x/db/safe_batch/safe_batch_nullify.go rename to db/safe_batch/safe_batch_nullify.go diff --git a/bin/v0.34.x/db/snappy/snappy_batch.go b/db/snappy/snappy_batch.go similarity index 100% rename from bin/v0.34.x/db/snappy/snappy_batch.go rename to db/snappy/snappy_batch.go diff --git a/bin/v0.34.x/db/snappy/snappy_db.go b/db/snappy/snappy_db.go similarity index 100% rename from bin/v0.34.x/db/snappy/snappy_db.go rename to db/snappy/snappy_db.go diff --git a/bin/v0.34.x/db/snappy/snappy_db_test.go b/db/snappy/snappy_db_test.go similarity index 100% rename from bin/v0.34.x/db/snappy/snappy_db_test.go rename to db/snappy/snappy_db_test.go diff --git a/bin/v0.34.x/db/types.go b/db/types.go similarity index 100% rename from bin/v0.34.x/db/types.go rename to db/types.go diff --git a/bin/v0.34.x/go.mod b/go.mod similarity index 91% rename from bin/v0.34.x/go.mod rename to go.mod index 27b21cd..28ba35a 100644 --- a/bin/v0.34.x/go.mod +++ b/go.mod @@ -1,9 +1,8 @@ -module github.com/terra-money/mantlemint-provider-v0.34.x +module github.com/terra-money/mantlemint go 1.17 require ( - github.com/CosmWasm/wasmvm v0.16.3 // indirect github.com/cosmos/cosmos-sdk v0.44.5 github.com/cosmos/iavl v0.17.3 github.com/gogo/protobuf v1.3.3 @@ -12,17 +11,19 @@ require ( github.com/gorilla/websocket v1.4.2 github.com/hashicorp/golang-lru v0.5.4 github.com/pkg/errors v0.9.1 + github.com/spf13/pflag v1.0.5 github.com/spf13/viper v1.8.1 github.com/stretchr/testify v1.7.0 github.com/tendermint/tendermint v0.34.14 github.com/tendermint/tm-db v0.6.6 - github.com/terra-money/core v0.5.16 + github.com/terra-money/core v0.5.18-0.20220304040324-70c1ef6f11b0 ) require ( filippo.io/edwards25519 v1.0.0-beta.2 // indirect github.com/99designs/keyring v1.1.6 // indirect github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d // indirect + github.com/CosmWasm/wasmvm v0.16.3 // indirect github.com/DataDog/zstd v1.4.5 // indirect github.com/armon/go-metrics v0.3.9 // indirect github.com/beorn7/perks v1.0.1 // indirect @@ -33,6 +34,7 @@ require ( github.com/confio/ics23/go v0.6.6 // indirect github.com/cosmos/btcutil v1.0.4 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect + github.com/cosmos/gorocksdb v1.2.0 // indirect github.com/cosmos/ibc-go v1.1.5 // indirect github.com/cosmos/ledger-cosmos-go v0.11.1 // indirect github.com/cosmos/ledger-go v0.9.2 // indirect @@ -85,10 +87,8 @@ require ( github.com/spf13/cast v1.3.1 // indirect github.com/spf13/cobra v1.2.1 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect - github.com/spf13/pflag v1.0.5 // indirect github.com/subosito/gotenv v1.2.0 // indirect - github.com/syndtr/goleveldb v1.0.1-0.20200815110645-5c35d600f0ca // indirect - github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c // indirect + github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect github.com/tendermint/btcd v0.1.1 // indirect github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15 // indirect github.com/tendermint/go-amino v0.16.0 // indirect @@ -100,7 +100,7 @@ require ( golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 // indirect golang.org/x/text v0.3.6 // indirect google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71 // indirect - google.golang.org/grpc v1.42.0 // indirect + google.golang.org/grpc v1.44.0 // indirect google.golang.org/protobuf v1.27.1 // indirect gopkg.in/ini.v1 v1.63.2 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect @@ -114,3 +114,7 @@ replace google.golang.org/grpc => google.golang.org/grpc v1.33.2 replace github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 replace github.com/99designs/keyring => github.com/cosmos/keyring v1.1.7-0.20210622111912-ef00f8ac3d76 + +replace github.com/CosmWasm/wasmvm => github.com/terra-money/wasmvm v0.16.4 + +replace github.com/tendermint/tm-db => github.com/terra-money/tm-db v0.6.5-0.20220307182415-c71e8b6e9f20 diff --git a/bin/v0.34.x/go.sum b/go.sum similarity index 98% rename from bin/v0.34.x/go.sum rename to go.sum index a6287f6..1e321f6 100644 --- a/bin/v0.34.x/go.sum +++ b/go.sum @@ -57,8 +57,6 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03 github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d h1:nalkkPQcITbvhmL4+C4cKA87NW0tfm3Kl9VXRoPywFg= github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d/go.mod h1:URdX5+vg25ts3aCh8H5IFZybJYKWhJHYMTnf+ULtoC4= -github.com/CosmWasm/wasmvm v0.16.3 h1:hUf33EHRmyyvKMhwVl7nMaAOY0vYJVB4bhU+HPfHfBM= -github.com/CosmWasm/wasmvm v0.16.3/go.mod h1:Id107qllDJyJjVQQsKMOy2YYF98sqPJ2t+jX1QES40A= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/DataDog/zstd v1.4.1/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo= github.com/DataDog/zstd v1.4.5 h1:EndNeuB0l9syBZhut0wns3gV1hL8zX8LIu6ZiVHWLIQ= @@ -177,6 +175,8 @@ github.com/cosmos/cosmos-sdk v0.44.5/go.mod h1:maUA6m2TBxOJZkbwl0eRtEBgTX37kcaiO github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= +github.com/cosmos/gorocksdb v1.2.0 h1:d0l3jJG8M4hBouIZq0mDUHZ+zjOx044J3nGRskwTb4Y= +github.com/cosmos/gorocksdb v1.2.0/go.mod h1:aaKvKItm514hKfNJpUJXnnOWeBnk2GL4+Qw9NHizILw= github.com/cosmos/iavl v0.17.3 h1:s2N819a2olOmiauVa0WAhoIJq9EhSXE9HDBAoR9k+8Y= github.com/cosmos/iavl v0.17.3/go.mod h1:prJoErZFABYZGDHka1R6Oay4z9PrNeFFiMKHDAMOi4w= github.com/cosmos/ibc-go v1.1.5 h1:H+q6G0szM5lePgLDQbTAaKQU5UR28ZjOIA3JJjNhuPQ= @@ -230,12 +230,12 @@ github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaB github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/ethereum/go-ethereum v1.9.25/go.mod h1:vMkFiYLHI4tgPw4k2j4MHKoovchFE8plZ0M9VMk4/oM= -github.com/facebookgo/ensure v0.0.0-20160127193407-b4ab57deab51 h1:0JZ+dUmQeA8IIVUMzysrX4/AKuQwWhV2dYQuPZdvdSQ= -github.com/facebookgo/ensure v0.0.0-20160127193407-b4ab57deab51/go.mod h1:Yg+htXGokKKdzcwhuNDwVvN+uBxDGXJ7G/VN1d8fa64= +github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c h1:8ISkoahWXwZR41ois5lSJBSVw4D0OV19Ht/JSTzvSv0= +github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c/go.mod h1:Yg+htXGokKKdzcwhuNDwVvN+uBxDGXJ7G/VN1d8fa64= github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 h1:JWuenKqqX8nojtoVVWjGfOF9635RETekkoH6Cc9SX0A= github.com/facebookgo/stack v0.0.0-20160209184415-751773369052/go.mod h1:UbMTZqLaRiH3MsBH8va0n7s1pQYcu3uTb8G4tygF4Zg= -github.com/facebookgo/subset v0.0.0-20150612182917-8dac2c3c4870 h1:E2s37DuLxFhQDg5gKsWoLBOB0n+ZW8s599zru8FJ2/Y= -github.com/facebookgo/subset v0.0.0-20150612182917-8dac2c3c4870/go.mod h1:5tD+neXqOorC30/tWg0LCSkrqj/AR6gu8yY8/fpw1q0= +github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4 h1:7HZCaLC5+BZpmbhCOZJ293Lz68O7PYrF2EzeiFMwCLk= +github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4/go.mod h1:5tD+neXqOorC30/tWg0LCSkrqj/AR6gu8yY8/fpw1q0= github.com/fatih/color v1.3.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= @@ -759,10 +759,9 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= -github.com/syndtr/goleveldb v1.0.1-0.20190923125748-758128399b1d/go.mod h1:9OrXJhf154huy1nPWmuSrkgjPUtUNhA+Zmy+6AESzuA= -github.com/syndtr/goleveldb v1.0.1-0.20200815110645-5c35d600f0ca h1:Ld/zXl5t4+D69SiV4JoN7kkfvJdOWlPpfxrzxpLMoUk= github.com/syndtr/goleveldb v1.0.1-0.20200815110645-5c35d600f0ca/go.mod h1:u2MKkTVTVJWe5D1rCvame8WqhBd88EuIwODJZ1VHCPM= -github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c h1:g+WoO5jjkqGAzHWCjJB1zZfXPIAaDpzXIEJ0eS6B5Ok= +github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY= +github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c/go.mod h1:ahpPrc7HpcfEWDQRZEmnXMzHY03mLDYMCxeDzy46i+8= github.com/tendermint/btcd v0.1.1 h1:0VcxPfflS2zZ3RiOAHkBiFUcPvbtRj5O7zHmcJWHV7s= github.com/tendermint/btcd v0.1.1/go.mod h1:DC6/m53jtQzr/NFmMNEu0rxf18/ktVoVtMrnDD5pN+U= @@ -772,14 +771,14 @@ github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2l github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= github.com/tendermint/tendermint v0.34.14 h1:GCXmlS8Bqd2Ix3TQCpwYLUNHe+Y+QyJsm5YE+S/FkPo= github.com/tendermint/tendermint v0.34.14/go.mod h1:FrwVm3TvsVicI9Z7FlucHV6Znfd5KBc/Lpp69cCwtk0= -github.com/tendermint/tm-db v0.5.1/go.mod h1:g92zWjHpCYlEvQXvy9M168Su8V1IBEeawpXVVBaK4f4= -github.com/tendermint/tm-db v0.6.4/go.mod h1:dptYhIpJ2M5kUuenLr+Yyf3zQOv1SgBZcl8/BmWlMBw= -github.com/tendermint/tm-db v0.6.6 h1:EzhaOfR0bdKyATqcd5PNeyeq8r+V4bRPHBfyFdD9kGM= -github.com/tendermint/tm-db v0.6.6/go.mod h1:wP8d49A85B7/erz/r4YbKssKw6ylsO/hKtFk7E1aWZI= -github.com/terra-money/core v0.5.16 h1:iLP+guLzd9gOjYMYURzBmwu6bdlsfJflYUFoQCZsbuc= -github.com/terra-money/core v0.5.16/go.mod h1:MEpq9DsEr2lBs8P7GiIJLfBqCZZKHfdl5qEs0nOcQkg= +github.com/terra-money/core v0.5.18-0.20220304040324-70c1ef6f11b0 h1:40hUUCkXo31cSh9QsVzTj2BrDUoawKVIytzcPqcJNvQ= +github.com/terra-money/core v0.5.18-0.20220304040324-70c1ef6f11b0/go.mod h1:aUZfcVV4GP92baeM/XLFN3FOWzkMUrLjMs3B1+MDovY= github.com/terra-money/ledger-terra-go v0.11.2 h1:BVXZl+OhJOri6vFNjjVaTabRLApw9MuG7mxWL4V718c= github.com/terra-money/ledger-terra-go v0.11.2/go.mod h1:ClJ2XMj1ptcnONzKH+GhVPi7Y8pXIT+UzJ0TNt0tfZE= +github.com/terra-money/tm-db v0.6.5-0.20220307182415-c71e8b6e9f20 h1:SRTmFwbfR2+uirbUxwXqSbKMCFOCD8rUxtpCqNomCC4= +github.com/terra-money/tm-db v0.6.5-0.20220307182415-c71e8b6e9f20/go.mod h1:K6twQf1PGDxC6K6V+G2l0nrYsQAxsypb4PpbJnyzwJw= +github.com/terra-money/wasmvm v0.16.4 h1:7zPlIV9zFy4NH+kfV2Yu9o5pMuD6rK36Fmdw4/CLur0= +github.com/terra-money/wasmvm v0.16.4/go.mod h1:Id107qllDJyJjVQQsKMOy2YYF98sqPJ2t+jX1QES40A= github.com/tidwall/gjson v1.6.7/go.mod h1:zeFuBCIqD4sN/gmqBzZ4j7Jd6UcA2Fc56x7QFsv+8fI= github.com/tidwall/match v1.0.3/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= github.com/tidwall/pretty v1.0.2/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= @@ -811,7 +810,6 @@ github.com/zondax/hid v0.9.0 h1:eiT3P6vNxAEVxXMw66eZUAAnU2zD33JBkfG/EnfAKl8= github.com/zondax/hid v0.9.0/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= go.etcd.io/bbolt v1.3.6 h1:/ecaJf0sk1l4l6V4awd65v2C3ILy7MSj+s/x1ADCIMU= go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= diff --git a/bin/v0.34.x/indexer/block/block.go b/indexer/block/block.go similarity index 82% rename from bin/v0.34.x/indexer/block/block.go rename to indexer/block/block.go index f9a499f..6d6ec0f 100644 --- a/bin/v0.34.x/indexer/block/block.go +++ b/indexer/block/block.go @@ -5,8 +5,8 @@ import ( tmjson "github.com/tendermint/tendermint/libs/json" tm "github.com/tendermint/tendermint/types" tmdb "github.com/tendermint/tm-db" - "github.com/terra-money/mantlemint-provider-v0.34.x/indexer" - "github.com/terra-money/mantlemint-provider-v0.34.x/mantlemint" + "github.com/terra-money/mantlemint/indexer" + "github.com/terra-money/mantlemint/mantlemint" ) var IndexBlock = indexer.CreateIndexer(func(indexerDB tmdb.Batch, block *tm.Block, blockID *tm.BlockID, _ *mantlemint.EventCollector) error { diff --git a/bin/v0.34.x/indexer/block/block_test.go b/indexer/block/block_test.go similarity index 100% rename from bin/v0.34.x/indexer/block/block_test.go rename to indexer/block/block_test.go diff --git a/bin/v0.34.x/indexer/block/client.go b/indexer/block/client.go similarity index 95% rename from bin/v0.34.x/indexer/block/client.go rename to indexer/block/client.go index c8f1aa7..a4b4563 100644 --- a/bin/v0.34.x/indexer/block/client.go +++ b/indexer/block/client.go @@ -9,7 +9,7 @@ import ( "github.com/gorilla/mux" tmdb "github.com/tendermint/tm-db" - "github.com/terra-money/mantlemint-provider-v0.34.x/indexer" + "github.com/terra-money/mantlemint/indexer" ) var ( diff --git a/bin/v0.34.x/indexer/block/types.go b/indexer/block/types.go similarity index 75% rename from bin/v0.34.x/indexer/block/types.go rename to indexer/block/types.go index c7df9ab..4fb02fb 100644 --- a/bin/v0.34.x/indexer/block/types.go +++ b/indexer/block/types.go @@ -2,7 +2,7 @@ package block import ( tm "github.com/tendermint/tendermint/types" - "github.com/terra-money/mantlemint-provider-v0.34.x/lib" + "github.com/terra-money/mantlemint/lib" ) var prefix = []byte("block/height:") @@ -12,5 +12,5 @@ var getKey = func(height uint64) []byte { type BlockRecord struct { BlockID *tm.BlockID `json:"block_id""` - Block *tm.Block `json:"block"` + Block *tm.Block `json:"block"` } diff --git a/bin/v0.34.x/indexer/fixtures/block_4724005_raw.json b/indexer/fixtures/block_4724005_raw.json similarity index 100% rename from bin/v0.34.x/indexer/fixtures/block_4724005_raw.json rename to indexer/fixtures/block_4724005_raw.json diff --git a/bin/v0.34.x/indexer/fixtures/block_4814775.json b/indexer/fixtures/block_4814775.json similarity index 100% rename from bin/v0.34.x/indexer/fixtures/block_4814775.json rename to indexer/fixtures/block_4814775.json diff --git a/bin/v0.34.x/indexer/fixtures/response_4814775.json b/indexer/fixtures/response_4814775.json similarity index 100% rename from bin/v0.34.x/indexer/fixtures/response_4814775.json rename to indexer/fixtures/response_4814775.json diff --git a/bin/v0.34.x/indexer/height/client.go b/indexer/height/client.go similarity index 100% rename from bin/v0.34.x/indexer/height/client.go rename to indexer/height/client.go diff --git a/bin/v0.34.x/indexer/height/height.go b/indexer/height/height.go similarity index 82% rename from bin/v0.34.x/indexer/height/height.go rename to indexer/height/height.go index 9b51cf6..d6a8d98 100644 --- a/bin/v0.34.x/indexer/height/height.go +++ b/indexer/height/height.go @@ -5,8 +5,8 @@ import ( tmjson "github.com/tendermint/tendermint/libs/json" tm "github.com/tendermint/tendermint/types" tmdb "github.com/tendermint/tm-db" - "github.com/terra-money/mantlemint-provider-v0.34.x/indexer" - "github.com/terra-money/mantlemint-provider-v0.34.x/mantlemint" + "github.com/terra-money/mantlemint/indexer" + "github.com/terra-money/mantlemint/mantlemint" ) var IndexHeight = indexer.CreateIndexer(func(indexerDB tmdb.Batch, block *tm.Block, _ *tm.BlockID, _ *mantlemint.EventCollector) error { diff --git a/bin/v0.34.x/indexer/height/types.go b/indexer/height/types.go similarity index 100% rename from bin/v0.34.x/indexer/height/types.go rename to indexer/height/types.go diff --git a/bin/v0.34.x/indexer/indexer.go b/indexer/indexer.go similarity index 92% rename from bin/v0.34.x/indexer/indexer.go rename to indexer/indexer.go index ae4fe37..7cfbc25 100644 --- a/bin/v0.34.x/indexer/indexer.go +++ b/indexer/indexer.go @@ -5,8 +5,8 @@ import ( "github.com/gorilla/mux" tm "github.com/tendermint/tendermint/types" tmdb "github.com/tendermint/tm-db" - "github.com/terra-money/mantlemint-provider-v0.34.x/db/snappy" - "github.com/terra-money/mantlemint-provider-v0.34.x/mantlemint" + "github.com/terra-money/mantlemint/db/snappy" + "github.com/terra-money/mantlemint/mantlemint" "time" ) diff --git a/bin/v0.34.x/indexer/tx/client.go b/indexer/tx/client.go similarity index 97% rename from bin/v0.34.x/indexer/tx/client.go rename to indexer/tx/client.go index 80d8028..bcb4cd5 100644 --- a/bin/v0.34.x/indexer/tx/client.go +++ b/indexer/tx/client.go @@ -8,7 +8,7 @@ import ( "github.com/gorilla/mux" tmdb "github.com/tendermint/tm-db" - "github.com/terra-money/mantlemint-provider-v0.34.x/indexer" + "github.com/terra-money/mantlemint/indexer" ) var ( diff --git a/bin/v0.34.x/indexer/tx/tx.go b/indexer/tx/tx.go similarity index 95% rename from bin/v0.34.x/indexer/tx/tx.go rename to indexer/tx/tx.go index 9344cd7..5030aae 100644 --- a/bin/v0.34.x/indexer/tx/tx.go +++ b/indexer/tx/tx.go @@ -7,8 +7,8 @@ import ( tm "github.com/tendermint/tendermint/types" tmdb "github.com/tendermint/tm-db" terra "github.com/terra-money/core/app" - "github.com/terra-money/mantlemint-provider-v0.34.x/indexer" - "github.com/terra-money/mantlemint-provider-v0.34.x/mantlemint" + "github.com/terra-money/mantlemint/indexer" + "github.com/terra-money/mantlemint/mantlemint" ) var cdc = terra.MakeEncodingConfig() diff --git a/bin/v0.34.x/indexer/tx/tx_test.go b/indexer/tx/tx_test.go similarity index 95% rename from bin/v0.34.x/indexer/tx/tx_test.go rename to indexer/tx/tx_test.go index 0c9bb01..01bbf46 100644 --- a/bin/v0.34.x/indexer/tx/tx_test.go +++ b/indexer/tx/tx_test.go @@ -6,7 +6,7 @@ import ( tmjson "github.com/tendermint/tendermint/libs/json" tendermint "github.com/tendermint/tendermint/types" tmdb "github.com/tendermint/tm-db" - "github.com/terra-money/mantlemint-provider-v0.34.x/mantlemint" + "github.com/terra-money/mantlemint/mantlemint" "io/ioutil" "os" "testing" diff --git a/bin/v0.34.x/indexer/tx/types.go b/indexer/tx/types.go similarity index 97% rename from bin/v0.34.x/indexer/tx/types.go rename to indexer/tx/types.go index 4009e31..ab95543 100644 --- a/bin/v0.34.x/indexer/tx/types.go +++ b/indexer/tx/types.go @@ -3,7 +3,7 @@ package tx import ( "encoding/json" abci "github.com/tendermint/tendermint/abci/types" - "github.com/terra-money/mantlemint-provider-v0.34.x/lib" + "github.com/terra-money/mantlemint/lib" "time" ) diff --git a/bin/v0.34.x/indexer/types.go b/indexer/types.go similarity index 92% rename from bin/v0.34.x/indexer/types.go rename to indexer/types.go index 797ac29..bcaeb69 100644 --- a/bin/v0.34.x/indexer/types.go +++ b/indexer/types.go @@ -4,7 +4,7 @@ import ( "github.com/gorilla/mux" tm "github.com/tendermint/tendermint/types" tmdb "github.com/tendermint/tm-db" - "github.com/terra-money/mantlemint-provider-v0.34.x/mantlemint" + "github.com/terra-money/mantlemint/mantlemint" "log" "net/http" "runtime" diff --git a/bin/v0.34.x/lib/bytes.go b/lib/bytes.go similarity index 100% rename from bin/v0.34.x/lib/bytes.go rename to lib/bytes.go diff --git a/bin/v0.34.x/mantlemint/appcreator.go b/mantlemint/appcreator.go similarity index 100% rename from bin/v0.34.x/mantlemint/appcreator.go rename to mantlemint/appcreator.go diff --git a/bin/v0.34.x/mantlemint/client.go b/mantlemint/client.go similarity index 100% rename from bin/v0.34.x/mantlemint/client.go rename to mantlemint/client.go diff --git a/bin/v0.34.x/mantlemint/event.go b/mantlemint/event.go similarity index 100% rename from bin/v0.34.x/mantlemint/event.go rename to mantlemint/event.go diff --git a/bin/v0.34.x/mantlemint/executor.go b/mantlemint/executor.go similarity index 100% rename from bin/v0.34.x/mantlemint/executor.go rename to mantlemint/executor.go diff --git a/bin/v0.34.x/mantlemint/reactor.go b/mantlemint/reactor.go similarity index 100% rename from bin/v0.34.x/mantlemint/reactor.go rename to mantlemint/reactor.go diff --git a/bin/v0.34.x/mantlemint/types.go b/mantlemint/types.go similarity index 100% rename from bin/v0.34.x/mantlemint/types.go rename to mantlemint/types.go diff --git a/bin/v0.34.x/rpc/cache.go b/rpc/cache.go similarity index 100% rename from bin/v0.34.x/rpc/cache.go rename to rpc/cache.go diff --git a/bin/v0.34.x/rpc/cache_test.go b/rpc/cache_test.go similarity index 100% rename from bin/v0.34.x/rpc/cache_test.go rename to rpc/cache_test.go diff --git a/bin/v0.34.x/rpc/client.go b/rpc/client.go similarity index 100% rename from bin/v0.34.x/rpc/client.go rename to rpc/client.go diff --git a/bin/v0.34.x/rpc/register.go b/rpc/register.go similarity index 100% rename from bin/v0.34.x/rpc/register.go rename to rpc/register.go diff --git a/bin/v0.34.x/store/rootmulti/dbadapter.go b/store/rootmulti/dbadapter.go similarity index 100% rename from bin/v0.34.x/store/rootmulti/dbadapter.go rename to store/rootmulti/dbadapter.go diff --git a/bin/v0.34.x/store/rootmulti/proof.go b/store/rootmulti/proof.go similarity index 100% rename from bin/v0.34.x/store/rootmulti/proof.go rename to store/rootmulti/proof.go diff --git a/bin/v0.34.x/store/rootmulti/store.go b/store/rootmulti/store.go similarity index 99% rename from bin/v0.34.x/store/rootmulti/store.go rename to store/rootmulti/store.go index 55b15b3..d3925cd 100644 --- a/bin/v0.34.x/store/rootmulti/store.go +++ b/store/rootmulti/store.go @@ -16,7 +16,7 @@ import ( "github.com/pkg/errors" abci "github.com/tendermint/tendermint/abci/types" dbm "github.com/tendermint/tm-db" - "github.com/terra-money/mantlemint-provider-v0.34.x/db/hld" + "github.com/terra-money/mantlemint/db/hld" "github.com/cosmos/cosmos-sdk/snapshots" snapshottypes "github.com/cosmos/cosmos-sdk/snapshots/types" diff --git a/bin/v0.34.x/sync.go b/sync.go similarity index 85% rename from bin/v0.34.x/sync.go rename to sync.go index 140bcc4..83f2ac9 100644 --- a/bin/v0.34.x/sync.go +++ b/sync.go @@ -4,12 +4,6 @@ import ( "crypto/sha1" "encoding/hex" "fmt" - "io/ioutil" - "log" - "os" - "path/filepath" - "runtime/debug" - "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" @@ -21,17 +15,21 @@ import ( terra "github.com/terra-money/core/app" core "github.com/terra-money/core/types" wasmconfig "github.com/terra-money/core/x/wasm/config" - blockFeeder "github.com/terra-money/mantlemint-provider-v0.34.x/block_feed" - "github.com/terra-money/mantlemint-provider-v0.34.x/config" - "github.com/terra-money/mantlemint-provider-v0.34.x/db/heleveldb" - "github.com/terra-money/mantlemint-provider-v0.34.x/db/hld" - "github.com/terra-money/mantlemint-provider-v0.34.x/db/safe_batch" - "github.com/terra-money/mantlemint-provider-v0.34.x/indexer" - "github.com/terra-money/mantlemint-provider-v0.34.x/indexer/block" - "github.com/terra-money/mantlemint-provider-v0.34.x/indexer/tx" - "github.com/terra-money/mantlemint-provider-v0.34.x/mantlemint" - "github.com/terra-money/mantlemint-provider-v0.34.x/rpc" - "github.com/terra-money/mantlemint-provider-v0.34.x/store/rootmulti" + blockFeeder "github.com/terra-money/mantlemint/block_feed" + "github.com/terra-money/mantlemint/config" + "github.com/terra-money/mantlemint/db/heleveldb" + "github.com/terra-money/mantlemint/db/hld" + "github.com/terra-money/mantlemint/db/safe_batch" + "github.com/terra-money/mantlemint/indexer" + "github.com/terra-money/mantlemint/indexer/block" + "github.com/terra-money/mantlemint/indexer/tx" + "github.com/terra-money/mantlemint/mantlemint" + "github.com/terra-money/mantlemint/rpc" + "github.com/terra-money/mantlemint/store/rootmulti" + "io/ioutil" + "log" + "os" + "runtime/debug" tmdb "github.com/tendermint/tm-db" ) @@ -41,14 +39,6 @@ func main() { mantlemintConfig := config.NewConfig() mantlemintConfig.Print() - viper.SetConfigType("toml") - viper.SetConfigName("app") - viper.AddConfigPath(filepath.Join(mantlemintConfig.Home, "config")) - - if err := viper.MergeInConfig(); err != nil { - panic(fmt.Errorf("failed to merge configuration: %w", err)) - } - sdkConfig := sdk.GetConfig() sdkConfig.SetCoinType(core.CoinType) sdkConfig.SetFullFundraiserPath(core.FullFundraiserPath) @@ -92,11 +82,7 @@ func main() { 0, codec, simapp.EmptyAppOptions{}, - &wasmconfig.Config{ - ContractQueryGasLimit: 3000000, - ContractDebugMode: false, - ContractMemoryCacheSize: 1024, - }, + wasmconfig.GetConfig(viper.GetViper()), fauxMerkleModeOpt, func(ba *baseapp.BaseApp) { ba.SetCMS(cms) @@ -237,6 +223,12 @@ func main() { rollbackBatch = nil } + // run indexer BEFORE batch flush + if indexerErr := indexerInstance.Run(feed.Block, feed.BlockID, mm.GetCurrentEventCollector()); indexerErr != nil { + debug.PrintStack() + panic(indexerErr) + } + // flush db batch // returns rollback batch that reverts current block injection if rollback, flushErr := batchedOrigin.Flush(); flushErr != nil { @@ -248,12 +240,6 @@ func main() { hldb.ClearWriteHeight() - // run indexer - if indexerErr := indexerInstance.Run(feed.Block, feed.BlockID, mm.GetCurrentEventCollector()); indexerErr != nil { - debug.PrintStack() - panic(indexerErr) - } - cacheInvalidateChan <- feed.Block.Height } }