[cherry-pick #18204] Cherry pick refactoring of sui-test-validator
crate into sui
to release v1.28 branch
#18436
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR integrates
sui-test-validator
binary intosui start
, but keeps the crate for now before being deprecated.sui start
is preservedsui-test-validator
behaviour can be achieved by passing two flags:sui start --force-regenesis --with-faucet
.sui-test-validator.sh
bash script that is executable to keep backward compatibility with the previous binarysui-test-validator
binary for now.One difference in flag/options usage is that
sui-test-validator
used to startgraphql
service when thegraphql-port
arg was passed. To keep it consistent across all three services, they each have their own flag to use to start the service with default host and port, and a port can be provided to it as well:--with-faucet
or--with-faucet=9123
--with-indexer
or--with-indexer=9124
--with-graphql
or--with-graphql=9125
Previously,
sui-test-validator
exposed a few flags and options (see orig codehere), which were migrated to
sui start
. There are two new flags insui start
,--with-graphql
and--with-faucet
, to make it easier to start these services with default values. Due to this, the bash script checks for multiple flags and their values and tries to ensure everything is passed correctly.sui-test-validator
implemented a simple faucet wrapper of thesui-faucet
crate. This was moved intofaucet.rs
module insui
crate.Given that there are three extra services that can be started, plus a configuration variable to start the network without a fullnode, here is an explanation of what each service requires:
graphql requires indexer
- without an indexer, the GraphQL will have no data to serve.--with-indexer
will be implied if--with-graphql
is passed.indexer requires fullnode
- without a fullnode, the indexer will start ingesting mainnet data with default settings. The program throws an error here.Existing tests.
Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required.
For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates.
sui-test-validator
intosui start
.sui start
can now be used to also start an indexer, a GraphQL service, or a faucet. Note that you need to buildsui
with--features indexer
, and have installedlibpq
to start the indexer and GraphQL services. By default, this feature is turned off to preserve backward compatibility ofsui start
. Alternatively, you can download the latest release and use thesui-pg
binary, which is built using theindexer
feature.sui start
is preservedsui-test-validator
behaviour can be achieved by passing two flags:sui start --force-regenesis --with-faucet
.sui-test-validator.sh
bash script tosui/scripts
folder that is executable to keep backward compatibility with the previous binary