feat: configurable faucet address for test-validator #2936
+51
−20
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.
Problem
When using the solana-test-validator, it should be possible to run this entirely within the localhost space.
Currently there are a few services which listen on
0.0.0.0
by default, and have no option to configure to another address.Summary of Changes
This PR fixes the faucet config in the test-validator, so that it runs on localhost + port 9900 (
FAUCET_PORT
constant from the faucet crate).If additional configuration is required, the flag
--rpc-faucet-address
can be used, which is the same as the flag used in the main validator crate.Example usage if it was required to make the faucet available to other hosts on port 9500:
solana-test-validator --rpc-faucet-address=0.0.0.0:9500
The clap arg validator ensures that any value passed will parse into a SocketAddr, otherwise an error is displayed to the user. If the flag isn't used, then the default value mentioned above is used.