-
Notifications
You must be signed in to change notification settings - Fork 77
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: add (local|testnet|mainnet) default networks #1408
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. One thing to check and it might have been filled as an issue in the past, but do the default networks show up when using network ls
? Should they?
Amazing and finally. For mainnet, could we also set the network passphrase please 🙏 |
They do not.
Good question! @janewang? @willemneal did you see the "Known Limitations" section? Are these tests being run? Which CI job runs them? |
Yes, don't me think. |
7079f39
to
bff30ea
Compare
--network testnet
default setting--network [testnet|mainnet]
default settings
@willemneal is there a straightforward way to do this? We currently require a Network {
rpc_url: "https://example.com/bring-your-own-rpc".to_owned(),
network_passphrase: "Public Global Stellar Network ; September 2015".to_owned(),
}, |
For |
--network [testnet|mainnet]
default settings--network [local|testnet|mainnet]
default settings
bff30ea
to
fb9868e
Compare
--network [local|testnet|mainnet]
default settings
Great idea, @janewang! I've updated the PR description to show the full output of
|
fb9868e
to
3c8ae9f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I have been saying for sometime the config needs some refactoring but this looks good to me!
Similar to how we support `--network futurenet` before you even set it. No need to make people go look it up on https://developers.stellar.org/docs/reference/networks This adds a dependency on [phf](https://crates.io/crates/phf) to construct a compile-time Map of named networks to named network settings. It also lists default networks with the `network ls [-l]` commands, and slightly updates (fixes, really) the behavior of `network ls`. Previously, if you had a local and global network named the same thing, `network ls` would show that name twice. Now it will only show them once. When you `network ls -l`, it will show all name collisions. $ cargo run -q -- network ls future futurenet local testnet mainnet $ cargo run -q -- network ls -l Local "/Users/chadoh/code/s/cli/.soroban/network/future.toml" Name: future Network { rpc_url: "https://rpc-futurenet.stellar.org:443", network_passphrase: "Test SDF Future Network ; October 2022", } Local "/Users/chadoh/code/s/cli/.soroban/network/futurenet.toml" Name: futurenet Network { rpc_url: "https://rpc-futurenet.stellar.org:443", network_passphrase: "Test SDF Future Network ; October 2022", } Global "/Users/chadoh/.config/soroban/network/future.toml" Name: future Network { rpc_url: "https://rpc-futurenet.stellar.org:443", network_passphrase: "Test SDF Future Network ; October 2022", } Global "/Users/chadoh/.config/soroban/network/local.toml" Name: local Network { rpc_url: "http://localhost:8000/rpc", network_passphrase: "Standalone Network ; February 2017", } Global "/Users/chadoh/.config/soroban/network/testnet.toml" Name: testnet Network { rpc_url: "https://soroban-testnet.stellar.org", network_passphrase: "Test SDF Network ; September 2015", } Default Name: local Network { rpc_url: "http://localhost:8000/rpc", network_passphrase: "Standalone Network ; February 2017", } Default Name: futurenet Network { rpc_url: "https://soroban-testnet.stellar.org", network_passphrase: "Test SDF Network ; September 2015", } Default Name: mainnet Network { rpc_url: "https://example.com/bring-your-own", network_passphrase: "Public Global Stellar Network ; September 2015", } Default Name: testnet Network { rpc_url: "https://rpc-futurenet.stellar.org:443", network_passphrase: "Test SDF Future Network ; October 2022", }
3c8ae9f
to
58d5cc3
Compare
Similar to how we support `--network futurenet` before you even set it. No need to make people go look it up on https://developers.stellar.org/docs/reference/networks This adds a dependency on [phf](https://crates.io/crates/phf) to construct a compile-time Map of named networks to named network settings. It also lists default networks with the `network ls [-l]` commands, and slightly updates (fixes, really) the behavior of `network ls`. Previously, if you had a local and global network named the same thing, `network ls` would show that name twice. Now it will only show them once. When you `network ls -l`, it will show all name collisions. $ cargo run -q -- network ls future futurenet local testnet mainnet $ cargo run -q -- network ls -l Local "/Users/chadoh/code/s/cli/.soroban/network/future.toml" Name: future Network { rpc_url: "https://rpc-futurenet.stellar.org:443", network_passphrase: "Test SDF Future Network ; October 2022", } Local "/Users/chadoh/code/s/cli/.soroban/network/futurenet.toml" Name: futurenet Network { rpc_url: "https://rpc-futurenet.stellar.org:443", network_passphrase: "Test SDF Future Network ; October 2022", } Global "/Users/chadoh/.config/soroban/network/future.toml" Name: future Network { rpc_url: "https://rpc-futurenet.stellar.org:443", network_passphrase: "Test SDF Future Network ; October 2022", } Global "/Users/chadoh/.config/soroban/network/local.toml" Name: local Network { rpc_url: "http://localhost:8000/rpc", network_passphrase: "Standalone Network ; February 2017", } Global "/Users/chadoh/.config/soroban/network/testnet.toml" Name: testnet Network { rpc_url: "https://soroban-testnet.stellar.org", network_passphrase: "Test SDF Network ; September 2015", } Default Name: local Network { rpc_url: "http://localhost:8000/rpc", network_passphrase: "Standalone Network ; February 2017", } Default Name: futurenet Network { rpc_url: "https://soroban-testnet.stellar.org", network_passphrase: "Test SDF Network ; September 2015", } Default Name: mainnet Network { rpc_url: "https://example.com/bring-your-own", network_passphrase: "Public Global Stellar Network ; September 2015", } Default Name: testnet Network { rpc_url: "https://rpc-futurenet.stellar.org:443", network_passphrase: "Test SDF Future Network ; October 2022", }
Similar to how we support
--network futurenet
before you even set it.No need to make people go look it up on https://developers.stellar.org/docs/reference/networks
This adds a dependency on phf to construct a compile-time Map of named networks to named network settings.
It also lists default networks with the
network ls [-l]
commands, and slightly updates (fixes, really) the behavior ofnetwork ls
. Previously, if you had a local and global network named the same thing,network ls
would show that name twice. Now it will only show them once. When younetwork ls -l
, it will show all name collisions.