Skip to content

Commit

Permalink
rpc: set agoric to use goleveldb
Browse files Browse the repository at this point in the history
  • Loading branch information
baabeetaa committed Aug 25, 2024
1 parent 14f8873 commit e7e169c
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 29 deletions.
2 changes: 1 addition & 1 deletion data/agoric.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ minimum_gas_prices = "0.03ubld,0.0034uist"
start_flags = "--p2p.seeds=ade4d8bc8cbe014af6ebdf3cb7b1e9ad36f412c0@seeds.polkachu.com:14456,[email protected]: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"
61 changes: 33 additions & 28 deletions data/custom_build_scripts/agoric.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

0 comments on commit e7e169c

Please sign in to comment.