feat(simapp/v2): Add store server to testnet init cmd (#21076)

This commit is contained in:
Hieu Vu 2024-07-26 03:50:57 +07:00 committed by GitHub
parent a0207294c5
commit b6eaf70b6a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View File

@ -10,7 +10,7 @@ SIMD="$ROOT/build/simdv2"
COSMOS_BUILD_OPTIONS=v2 make build
$SIMD testnet init-files --chain-id=testing --output-dir="$HOME/.testnet" --validator-count=3 --keyring-backend=test --minimum-gas-prices=0.000001stake --commit-timeout=900ms --single-host
$SIMD testnet init-files --chain-id=testing --output-dir="$HOME/.testnet" --validator-count=3 --keyring-backend=test --min-gas-prices=0.000001stake --commit-timeout=900ms --single-host
$SIMD start --log_level=info --home "$HOME/.testnet/node0/simdv2" &
$SIMD start --log_level=info --home "$HOME/.testnet/node1/simdv2" &

View File

@ -22,6 +22,7 @@ import (
serverv2 "cosmossdk.io/server/v2"
"cosmossdk.io/server/v2/api/grpc"
"cosmossdk.io/server/v2/cometbft"
"cosmossdk.io/server/v2/store"
authtypes "cosmossdk.io/x/auth/types"
banktypes "cosmossdk.io/x/bank/types"
stakingtypes "cosmossdk.io/x/staking/types"
@ -343,7 +344,8 @@ func initTestnetFiles[T transaction.Tx](
cometbft.OverwriteDefaultConfigTomlConfig(nodeConfig),
)
grpcServer := grpc.New[T](grpc.OverwriteDefaultConfig(grpcConfig))
server := serverv2.NewServer(coretesting.NewNopLogger(), cometServer, grpcServer)
storeServer := store.New[T]()
server := serverv2.NewServer(coretesting.NewNopLogger(), cometServer, grpcServer, storeServer)
err = server.WriteConfig(filepath.Join(nodeDir, "config"))
if err != nil {
return err