From e7e169c27a257585c80fcc1a329419c7855fc8de Mon Sep 17 00:00:00 2001 From: Tuan Pham Anh Date: Sun, 25 Aug 2024 09:49:41 +0700 Subject: [PATCH] rpc: set agoric to use goleveldb --- data/agoric.ini | 2 +- data/custom_build_scripts/agoric.sh | 61 ++++++++++++++++------------- 2 files changed, 34 insertions(+), 29 deletions(-) diff --git a/data/agoric.ini b/data/agoric.ini index e663ad1d..4f08a246 100644 --- a/data/agoric.ini +++ b/data/agoric.ini @@ -6,5 +6,5 @@ minimum_gas_prices = "0.03ubld,0.0034uist" start_flags = "--p2p.seeds=ade4d8bc8cbe014af6ebdf3cb7b1e9ad36f412c0@seeds.polkachu.com:14456,400f3d9e30b69e78a7fb891f60d76fa3c73f0ecc@agoric.rpc.kjnodes.com:12759,ebc272824924ea1a27ea3183dd0b9ba713494f83@agoric-mainnet-seed.autostake.com:27106" snapshot_prune = "cosmos-pruner" network = "net2" -db_backend = "pebbledb" +db_backend = "goleveldb" build_script = "https://raw.githubusercontent.com/notional-labs/cosmosia/main/data/custom_build_scripts/agoric.sh" diff --git a/data/custom_build_scripts/agoric.sh b/data/custom_build_scripts/agoric.sh index 72964f30..301539d1 100644 --- a/data/custom_build_scripts/agoric.sh +++ b/data/custom_build_scripts/agoric.sh @@ -28,20 +28,22 @@ if [[ -z $upgrading ]]; then # build cd $HOME/agoric-sdk - yarn install - yarn build - - cd $HOME/agoric-sdk/packages/cosmic-swingset && make - - cd $HOME/agoric-sdk/golang/cosmos - go build -buildmode=exe -tags pebbledb -ldflags "-w -s -X github.com/cosmos/cosmos-sdk/types.DBBackend=pebbledb" -o build/agd ./cmd/agd - # go build -buildmode=exe -tags pebbledb -ldflags "-w -s -X github.com/cosmos/cosmos-sdk/types.DBBackend=pebbledb" -o build/ag-cosmos-helper ./cmd/helper - go build -buildmode=c-shared -tags pebbledb -ldflags "-w -s -X github.com/cosmos/cosmos-sdk/types.DBBackend=pebbledb" -o build/libagcosmosdaemon.so ./cmd/libdaemon/main.go - -# mkdir -p "/root/go/bin" -# ln -sf "/root/agoric-sdk/bin/agd" "/root/go/bin/ag-chain-cosmos" -# ln -sf "/root/agoric-sdk/packages/cosmic-swingset/bin/ag-nchainz" "/root/go/bin/" -# ln -sf "/root/agoric-sdk/bin/agd" "/root/go/bin/agd" + git clean -xdf && git submodule foreach --recursive git clean -xdf + ./bin/agd build +# yarn install +# yarn build +# +# cd $HOME/agoric-sdk/packages/cosmic-swingset && make +# +# cd $HOME/agoric-sdk/golang/cosmos +# go build -buildmode=exe -tags pebbledb -ldflags "-w -s -X github.com/cosmos/cosmos-sdk/types.DBBackend=pebbledb" -o build/agd ./cmd/agd +# # go build -buildmode=exe -tags pebbledb -ldflags "-w -s -X github.com/cosmos/cosmos-sdk/types.DBBackend=pebbledb" -o build/ag-cosmos-helper ./cmd/helper +# go build -buildmode=c-shared -tags pebbledb -ldflags "-w -s -X github.com/cosmos/cosmos-sdk/types.DBBackend=pebbledb" -o build/libagcosmosdaemon.so ./cmd/libdaemon/main.go + + mkdir -p "/root/go/bin" + ln -sf "/root/agoric-sdk/bin/agd" "/root/go/bin/ag-chain-cosmos" + ln -sf "/root/agoric-sdk/packages/cosmic-swingset/bin/ag-nchainz" "/root/go/bin/" + ln -sf "/root/agoric-sdk/bin/agd" "/root/go/bin/agd" else repo_name=$(basename $git_repo |cut -d. -f1) cd $repo_name @@ -50,20 +52,23 @@ else git checkout "$p_version" - cd $HOME/agoric-sdk/golang/cosmos - go mod edit -replace github.com/tendermint/tm-db=github.com/notional-labs/tm-db@pebble - go mod tidy - go mod edit -replace github.com/cometbft/cometbft-db=github.com/notional-labs/cometbft-db@pebble - go mod tidy +# cd $HOME/agoric-sdk/golang/cosmos +# go mod edit -replace github.com/tendermint/tm-db=github.com/notional-labs/tm-db@pebble +# go mod tidy +# go mod edit -replace github.com/cometbft/cometbft-db=github.com/notional-labs/cometbft-db@pebble +# go mod tidy cd $HOME/agoric-sdk - yarn install - yarn build - - cd $HOME/agoric-sdk/packages/cosmic-swingset && make - - cd $HOME/agoric-sdk/golang/cosmos - go build -buildmode=exe -tags pebbledb -ldflags "-w -s -X github.com/cosmos/cosmos-sdk/types.DBBackend=pebbledb $opt_forcesync" -o build/agd ./cmd/agd - # go build -buildmode=exe -tags pebbledb -ldflags "-w -s -X github.com/cosmos/cosmos-sdk/types.DBBackend=pebbledb $opt_forcesync" -o build/ag-cosmos-helper ./cmd/helper - go build -buildmode=c-shared -tags pebbledb -ldflags "-w -s -X github.com/cosmos/cosmos-sdk/types.DBBackend=pebbledb $opt_forcesync" -o build/libagcosmosdaemon.so ./cmd/libdaemon/main.go + git clean -xdf && git submodule foreach --recursive git clean -xdf + ./bin/agd build + +# yarn install +# yarn build +# +# cd $HOME/agoric-sdk/packages/cosmic-swingset && make +# +# cd $HOME/agoric-sdk/golang/cosmos +# go build -buildmode=exe -tags pebbledb -ldflags "-w -s -X github.com/cosmos/cosmos-sdk/types.DBBackend=pebbledb $opt_forcesync" -o build/agd ./cmd/agd +# # go build -buildmode=exe -tags pebbledb -ldflags "-w -s -X github.com/cosmos/cosmos-sdk/types.DBBackend=pebbledb $opt_forcesync" -o build/ag-cosmos-helper ./cmd/helper +# go build -buildmode=c-shared -tags pebbledb -ldflags "-w -s -X github.com/cosmos/cosmos-sdk/types.DBBackend=pebbledb $opt_forcesync" -o build/libagcosmosdaemon.so ./cmd/libdaemon/main.go fi