Skip to content

Commit

Permalink
Merge PR cosmos#4731: Save sim params and export app state to file
Browse files Browse the repository at this point in the history
  • Loading branch information
fedekunze authored and alexanderbez committed Jul 19, 2019
1 parent 130f356 commit bd63560
Show file tree
Hide file tree
Showing 3 changed files with 232 additions and 75 deletions.
70 changes: 49 additions & 21 deletions doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,40 +50,68 @@ To execute a completely pseudo-random simulation:
$ go test -mod=readonly github.com/cosmos/cosmos-sdk/simapp \
-run=TestFullAppSimulation \
-SimulationEnabled=true \
-SimulationNumBlocks=100 \
-SimulationBlockSize=200 \
-SimulationCommit=true \
-SimulationSeed=99 \
-SimulationPeriod=5 \
-Enabled=true \
-NumBlocks=100 \
-BlockSize=200 \
-Commit=true \
-Seed=99 \
-Period=5 \
-v -timeout 24h
To execute simulation from a genesis file:
$ go test -mod=readonly github.com/cosmos/cosmos-sdk/simapp \
-run=TestFullAppSimulation \
-SimulationEnabled=true \
-SimulationNumBlocks=100 \
-SimulationBlockSize=200 \
-SimulationCommit=true \
-SimulationSeed=99 \
-SimulationPeriod=5 \
-SimulationGenesis=/path/to/genesis.json \
-Enabled=true \
-NumBlocks=100 \
-BlockSize=200 \
-Commit=true \
-Seed=99 \
-Period=5 \
-Genesis=/path/to/genesis.json \
-v -timeout 24h
To execute simulation from a params file:
To execute simulation from a simulation params file:
$ go test -mod=readonly github.com/cosmos/cosmos-sdk/simapp \
-run=TestFullAppSimulation \
-SimulationEnabled=true \
-SimulationNumBlocks=100 \
-SimulationBlockSize=200 \
-SimulationCommit=true \
-SimulationSeed=99 \
-SimulationPeriod=5 \
-SimulationParams=/path/to/params.json \
-Enabled=true \
-NumBlocks=100 \
-BlockSize=200 \
-Commit=true \
-Seed=99 \
-Period=5 \
-Params=/path/to/params.json \
-v -timeout 24h
To export the simulation params to a file at a given block height:
$ go test -mod=readonly github.com/cosmos/cosmos-sdk/simapp \
-run=TestFullAppSimulation \
-Enabled=true \
-NumBlocks=100 \
-BlockSize=200 \
-Commit=true \
-Seed=99 \
-Period=5 \
-ExportParamsPath=/path/to/params.json \
-ExportParamsHeight=50 \
-v -timeout 24h
To export the simulation app state (i.e genesis) to a file:
$ go test -mod=readonly github.com/cosmos/cosmos-sdk/simapp \
-run=TestFullAppSimulation \
-Enabled=true \
-NumBlocks=100 \
-BlockSize=200 \
-Commit=true \
-Seed=99 \
-Period=5 \
-ExportStatePath=/path/to/genesis.json \
v -timeout 24h
Params
Params that are provided to simulation from a JSON file are used to used to set
Expand Down
Loading

0 comments on commit bd63560

Please sign in to comment.