Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: simd runs in-process testnet by default #9246

Merged
merged 38 commits into from
Jun 29, 2021
Merged
Show file tree
Hide file tree
Changes from 32 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
e1fd374
update testnet subcommand to run in-process testnets by default
clevinson Apr 30, 2021
15803e3
Update simapp/simd/cmd/testnet.go
clevinson Apr 30, 2021
21a0961
update flag names, update `make localnet-start` task with new simd te…
clevinson Apr 30, 2021
80704f2
Merge remote-tracking branch 'origin/clevinson/ci-devnets' into clevi…
clevinson Apr 30, 2021
082d317
Merge remote-tracking branch 'origin/master' into clevinson/ci-devnets
clevinson Apr 30, 2021
837e58d
fix tests
clevinson Apr 30, 2021
12c7283
make lint-fix
clevinson Apr 30, 2021
60d3acf
Merge remote-tracking branch 'origin/master' into clevinson/ci-devnets
clevinson May 4, 2021
858fb0a
refactor Network's TestnetEnv to use network.Logger interface
clevinson May 4, 2021
052e19b
split testnet start & init-files into subcommands
clevinson May 6, 2021
72ff9d5
update makefile
clevinson May 11, 2021
ca21ad5
add port flags to testnets-start subcommand
clevinson May 13, 2021
9f15d2c
add option for printing mnemonic when running testnet
clevinson May 13, 2021
a7954de
add godocs for new testnet command
clevinson May 13, 2021
0918491
Merge branch 'master' into clevinson/ci-devnets
clevinson May 14, 2021
3766c4e
fix format
ryanchristo May 19, 2021
3bf532f
fix test vars
ryanchristo May 19, 2021
e4cae70
use chain subdirectories
ryanchristo May 19, 2021
9763928
use localnet directory
ryanchristo May 19, 2021
ccec784
fix lint
ryanchristo May 19, 2021
42e68ea
fix description
ryanchristo May 20, 2021
5b0d334
revert changes
ryanchristo May 20, 2021
2c286ef
Merge branch 'master' into clevinson/ci-devnets
ryanchristo May 20, 2021
606363b
fix description
ryanchristo May 21, 2021
42ab2fc
fix error
ryanchristo May 21, 2021
b9b53a9
Merge branch 'master' into clevinson/ci-devnets
ryanchristo May 21, 2021
d71fdb7
remove brackets
ryanchristo May 21, 2021
4587e1c
add changelog entries
ryanchristo May 26, 2021
65c6410
use private functions
ryanchristo May 26, 2021
2725ac7
consolidate input params
ryanchristo May 26, 2021
aee829f
Merge branch 'master' into clevinson/ci-devnets
ryanchristo May 26, 2021
0b9aaf1
fix struct name
ryanchristo May 26, 2021
f2210bd
Merge branch 'master' into clevinson/ci-devnets
ryanchristo Jun 28, 2021
e479ff1
amend changelog
ryanchristo Jun 28, 2021
b86cdcf
fix new testsuite
ryanchristo Jun 28, 2021
4717b85
fix test command
ryanchristo Jun 29, 2021
61ac80b
Merge branch 'master' into clevinson/ci-devnets
amaury1093 Jun 29, 2021
6892453
Merge branch 'master' into clevinson/ci-devnets
amaury1093 Jun 29, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ artifacts
# Data - ideally these don't exist
baseapp/data/*
client/lcd/keys/*
mytestnet
.testnets

# Testing
coverage.txt
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ if input key is empty, or input data contains empty key.
* via legacy `msg.Type()` (e.g. `message.action='send'`) is being deprecated, new `Msg`s won't emit these events.
* Please use concrete `Msg` TypeURLs instead (e.g. `message.action='/cosmos.bank.v1beta1.MsgSend'`).
* [\#9291](https://github.com/cosmos/cosmos-sdk/pull/9291) Migration scripts prior to v0.38 have been removed from the CLI `migrate` command. The oldest supported migration is v0.39->v0.42.
* [\#9246](https://github.com/cosmos/cosmos-sdk/pull/9246) Removed the CLI flag `--setup-config-only` from the `testnet` command and added the subcommand `init-files`.

### API Breaking Changes

Expand Down Expand Up @@ -112,6 +113,7 @@ if input key is empty, or input data contains empty key.
* The `RegisterCustomTypeURL` function and the `cosmos.base.v1beta1.ServiceMsg` interface have been removed from the interface registry.
* (codec) [\#9251](https://github.com/cosmos/cosmos-sdk/pull/9251) Rename `clientCtx.JSONMarshaler` to `clientCtx.JSONCodec` as per #9226.
* (x/bank) [\#9271](https://github.com/cosmos/cosmos-sdk/pull/9271) SendEnabledCoin(s) renamed to IsSendEnabledCoin(s) to better reflect its functionality.
* [\#9246](https://github.com/cosmos/cosmos-sdk/pull/9246) The `New` method for the network package now returns an error.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @aaronc should this be an API breaking change?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

technically yes



### State Machine Breaking
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -468,16 +468,16 @@ proto-update-deps:
### Localnet ###
###############################################################################

# Run a 4-node testnet locally
# Run a 4-node testnet locally via docker compose
localnet-start: build-linux localnet-stop
$(if $(shell $(DOCKER) inspect -f '{{ .Id }}' cosmossdk/simd-env 2>/dev/null),$(info found image cosmossdk/simd-env),$(MAKE) -C contrib/images simd-env)
if ! [ -f build/node0/simd/config/genesis.json ]; then $(DOCKER) run --rm \
if ! test -f build/node0/simd/config/genesis.json; then $(DOCKER) run --rm \
--user $(shell id -u):$(shell id -g) \
-v $(BUILDDIR):/simd:Z \
-v /etc/group:/etc/group:ro \
-v /etc/passwd:/etc/passwd:ro \
-v /etc/shadow:/etc/shadow:ro \
cosmossdk/simd-env testnet --v 4 -o . --starting-ip-address 192.168.10.2 --keyring-backend=test ; fi
cosmossdk/simd-env testnet init-files --v 4 -o . --starting-ip-address 192.168.10.2 --keyring-backend=test ; fi
docker-compose up -d
ryanchristo marked this conversation as resolved.
Show resolved Hide resolved

localnet-stop:
Expand Down
3 changes: 2 additions & 1 deletion client/context_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ func TestCLIQueryConn(t *testing.T) {
cfg := network.DefaultConfig()
cfg.NumValidators = 1

n := network.New(t, cfg)
n, err := network.New(t, t.TempDir(), cfg)
require.NoError(t, err)
defer n.Cleanup()

testClient := testdata.NewQueryClient(n.Validators[0].ClientCtx)
Expand Down
7 changes: 4 additions & 3 deletions client/grpc/tmservice/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,12 @@ func (s *IntegrationTestSuite) SetupSuite() {
cfg.NumValidators = 1

s.cfg = cfg
s.network = network.New(s.T(), cfg)

s.Require().NotNil(s.network)
var err error
s.network, err = network.New(s.T(), s.T().TempDir(), s.cfg)
s.Require().NoError(err)

_, err := s.network.WaitForHeight(1)
_, err = s.network.WaitForHeight(1)
s.Require().NoError(err)

s.queryClient = tmservice.NewServiceClient(s.network.Validators[0].ClientCtx)
Expand Down
7 changes: 4 additions & 3 deletions client/grpc_query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@ type IntegrationTestSuite struct {
func (s *IntegrationTestSuite) SetupSuite() {
s.T().Log("setting up integration test suite")

s.network = network.New(s.T(), network.DefaultConfig())
s.Require().NotNil(s.network)
var err error
s.network, err = network.New(s.T(), s.T().TempDir(), network.DefaultConfig())
s.Require().NoError(err)

_, err := s.network.WaitForHeight(2)
_, err = s.network.WaitForHeight(2)
s.Require().NoError(err)
}

Expand Down
5 changes: 3 additions & 2 deletions client/rpc/rpc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ type IntegrationTestSuite struct {
func (s *IntegrationTestSuite) SetupSuite() {
s.T().Log("setting up integration test suite")

s.network = network.New(s.T(), network.DefaultConfig())
s.Require().NotNil(s.network)
var err error
s.network, err = network.New(s.T(), s.T().TempDir(), network.DefaultConfig())
s.Require().NoError(err)

s.Require().NoError(s.network.WaitForNextBlock())
}
Expand Down
8 changes: 5 additions & 3 deletions server/grpc/grpc_web_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,12 @@ func (s *GRPCWebTestSuite) SetupSuite() {
cfg := network.DefaultConfig()
cfg.NumValidators = 1
s.cfg = cfg
s.network = network.New(s.T(), s.cfg)
s.Require().NotNil(s.network)

_, err := s.network.WaitForHeight(2)
var err error
s.network, err = network.New(s.T(), s.T().TempDir(), s.cfg)
s.Require().NoError(err)

_, err = s.network.WaitForHeight(2)
s.Require().NoError(err)

s.protoCdc = codec.NewProtoCodec(s.cfg.InterfaceRegistry)
Expand Down
8 changes: 5 additions & 3 deletions server/grpc/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,12 @@ func (s *IntegrationTestSuite) SetupSuite() {
s.app = simapp.Setup(false)
s.cfg = network.DefaultConfig()
s.cfg.NumValidators = 1
s.network = network.New(s.T(), s.cfg)
s.Require().NotNil(s.network)

_, err := s.network.WaitForHeight(2)
var err error
s.network, err = network.New(s.T(), s.T().TempDir(), s.cfg)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we add a changelog entry? This is an API breaking change. Not sure we should still merge this right now since we have a 0.43 beta freeze

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated changelog and makes sense to wait

s.Require().NoError(err)

_, err = s.network.WaitForHeight(2)
s.Require().NoError(err)

val0 := s.network.Validators[0]
Expand Down
2 changes: 1 addition & 1 deletion simapp/simd/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func initRootCmd(rootCmd *cobra.Command, encodingConfig params.EncodingConfig) {
genutilcli.ValidateGenesisCmd(simapp.ModuleBasics),
AddGenesisAccountCmd(simapp.DefaultNodeHome),
tmcli.NewCompletionCmd(rootCmd, true),
testnetCmd(simapp.ModuleBasics, banktypes.GenesisBalancesIterator{}),
NewTestnetCmd(simapp.ModuleBasics, banktypes.GenesisBalancesIterator{}),
debug.Cmd(),
config.Cmd(),
)
Expand Down
Loading