diff --git a/CHANGELOG.md b/CHANGELOG.md index 1894148..e1864ca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ - [#129](https://github.com/crypto-com/pystarport/pull/129) create and get validator are incompatible. - [#137](https://github.com/crypto-com/pystarport/pull/137) support ica and icaauth cmd. - [#139](https://github.com/crypto-com/pystarport/pull/139) support ibc channel upgrade related methods. +- [#141](https://github.com/crypto-com/pystarport/pull/141) make cmd flag support multiple chains. *Feb 7, 2023* diff --git a/pystarport/cluster.py b/pystarport/cluster.py index b3539fb..a401272 100644 --- a/pystarport/cluster.py +++ b/pystarport/cluster.py @@ -1239,7 +1239,14 @@ def init_cluster( cfg["chain_id"] = chain_id chains = list(config.values()) - for chain in chains: + + # for multiple chains, there can be multiple cmds splited by `,` + if cmd is not None: + cmds = cmd.split(",") + else: + cmds = [None] * len(chains) + + for chain, cmd in zip(chains, cmds): (data_dir / chain["chain_id"]).mkdir() init_devnet( data_dir / chain["chain_id"], chain, base_port, image, cmd, gen_compose_file