Skip to content

Commit afdf47c

Browse files
Configurable --network providers docs (#3875)
<!-- Reference any GitHub issues resolved by this PR --> Towards #3765 Stack: - #3874 - #3875 ⬅ ## Introduced changes <!-- A brief description of the changes --> - Documentation to configurable `--network` providers ## Checklist <!-- Make sure all of these are complete --> - [x] Linked relevant issue - [x] Updated relevant documentation - [x] Added relevant tests - [x] Performed self-review of the code - [x] Added changes to `CHANGELOG.md` --------- Co-authored-by: Franciszek Job <[email protected]>
1 parent d6bb60a commit afdf47c

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1717

1818
- A bug that prevented the `#[test_case]` attribute from being used on its own with cheatcodes
1919

20+
### Cast
21+
22+
#### Added
23+
24+
- Possibility to configure urls of predefined networks used by `--network` flag via `sncast` profile in `snfoundry.toml`
25+
2026
## [0.51.2] - 2025-10-31
2127

2228
### Cast

docs/src/appendix/snfoundry-toml.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,19 @@ The `block-explorer` field specifies the block explorer service used to display
9090
block-explorer = "StarkScan"
9191
```
9292

93+
#### `[sncast.<profile-name>.networks]`
94+
95+
The URLs of the predefined networks can be configured.
96+
When you use `--network <network_name>`, `sncast` first checks whether you have a custom URL configured for that network.
97+
In the absence of a user-defined value, the default configuration is applied - public RPC provider is used for `mainnet` and `sepolia`, and the `devnet` endpoint is determined automatically.
98+
99+
```toml
100+
[sncast.myprofile.networks]
101+
mainnet = "https://mainnet.your-node.com"
102+
sepolia = "https://sepolia.your-node.com"
103+
devnet = "http://127.0.0.1:5050"
104+
```
105+
93106
#### Complete Example of `snfoundry.toml` File
94107

95108
```toml
@@ -102,6 +115,11 @@ wait-params = { timeout = 500, retry-interval = 10 }
102115
block-explorer = "StarkScan"
103116
show-explorer-links = true
104117

118+
[sncast.myprofile1.networks]
119+
mainnet = "https://mainnet.your-node.com"
120+
sepolia = "https://sepolia.your-node.com"
121+
devnet = "http://127.0.0.1:5050"
122+
105123
[sncast.dev]
106124
url = "http://127.0.0.1:5056/rpc"
107125
account = "devuser"

docs/src/starknet/sncast-overview.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ For **devnet**, `sncast` will try to detect running `starknet-devnet` instance a
7171
If using `sncast` extensively, we recommend getting access to a dedicated RPC node and providing its URL to sncast with
7272
`--url` flag.
7373

74+
> 📝 **Note**
75+
> You can configure URLs for predefined networks (used by the `--network` flag) in `snfoundry.toml` profiles. Read more in [snfoundry.toml Reference](../appendix/snfoundry-toml.md#sncastprofile-namenetworks).
76+
7477
### Arguments
7578

7679
Some `sncast` commands (namely `call`, `deploy` and `invoke`) allow passing arguments to perform an action with on the blockchain.

0 commit comments

Comments
 (0)