Skip to content

Commit 0315d3d

Browse files
authored
ci: default rpc spec is 0_7 (#1017)
1 parent 94ec7ce commit 0315d3d

File tree

2 files changed

+40
-56
lines changed

2 files changed

+40
-56
lines changed

src/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export const UDC = {
5959
ENTRYPOINT: 'deployContract',
6060
};
6161

62-
export const RPC_DEFAULT_VERSION = 'v0_6';
62+
export const RPC_DEFAULT_VERSION = 'v0_7';
6363

6464
export const RPC_NODES = {
6565
SN_GOERLI: [

www/docs/guides/connect_network.md

Lines changed: 39 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@ Then you need to select a node. A node is a safe way to connect with the Starkne
1616
> Main development devnets are Starknet-devnet-rs, Madara, ...
1717
1818
Each node is communicating with Starknet.js using a rpc specification. Most of the nodes are able to use 2 rpc spec versions.
19-
For example, this node is compatible with v0.5.1 & v0.6.0, using the following entry points :
19+
For example, this node is compatible with v0.6.0 & v0.7.0, using the following entry points :
2020

21-
- "https://free-rpc.nethermind.io/goerli-juno/v0_5"
2221
- "https://free-rpc.nethermind.io/goerli-juno/v0_6"
22+
- "https://free-rpc.nethermind.io/goerli-juno/v0_7"
2323

2424
From rpc spec v0.5.0, you can request the rpc spec version that uses a node address :
2525

2626
```typescript
2727
const resp = await myProvider.getSpecVersion();
2828
console.log('rpc version =', resp);
29-
// result : rpc version = 0.6.0
29+
// result : rpc version = 0.7.0
3030
```
3131

3232
On Starknet.js side, you have to select the proper version, to be in accordance with the node you want to use :
@@ -35,9 +35,9 @@ On Starknet.js side, you have to select the proper version, to be in accordance
3535
| :---------------------------: | ---------------------------- |
3636
| v0.4.0 | Starknet.js v5.21.1 |
3737
| v0.5.0 | Starknet.js v5.23.0 |
38-
| v0.5.1 | Starknet.js v5.29.0 & v6.3.0 |
39-
| v0.6.0 | Starknet.js v6.3.0 |
40-
| v0.7.0 | Starknet.js v6.3.0 |
38+
| v0.5.1 | Starknet.js v5.29.0 & v6.1.0 |
39+
| v0.6.0 | Starknet.js v6.4.3 |
40+
| v0.7.0 | Starknet.js v6.4.3 |
4141

4242
[!NOTE] Each Starknet.js version 6.x.x is compatible with 3 rpc spec versions, and recognize automatically the spec version if not provided.
4343

@@ -51,7 +51,7 @@ import { RpcProvider } from 'starknet';
5151

5252
### Default Rpc node
5353

54-
If you don't want to use a specific node, or to handle an API key, you can use by default:
54+
If you don't want to use a specific node, or to handle an API key, you can use by default (using Rpc spec 0.7.0):
5555

5656
```typescript
5757
const myProvider = new RpcProvider({ nodeUrl: constants.NetworkName.SN_GOERLI });
@@ -62,7 +62,7 @@ const myProvider = new RpcProvider(); // Goerli
6262

6363
> when using this syntax, a random public node will be selected.
6464
65-
Using a specific nodeUrl is the better approach, as such a node will have fewer limitations and will be less crowded.
65+
Using a specific nodeUrl is the better approach, as such a node will have fewer limitations, the last version of software and will be less crowded.
6666

6767
Some examples of RpcProvider instantiation to connect to RPC node providers:
6868

@@ -73,39 +73,27 @@ Some examples of RpcProvider instantiation to connect to RPC node providers:
7373
const providerInfuraMainnet = new RpcProvider({
7474
nodeUrl: 'https://starknet-mainnet.infura.io/v3/' + infuraKey,
7575
});
76-
// Blast node rpc 0.5.1 & 0.6.0 for Mainnet:
76+
// Blast node rpc 0.7.0 for Mainnet (0.4, 0.5 & 0_6 also available):
7777
const providerBlastMainnet = new RpcProvider({
78-
nodeUrl: 'https://starknet-mainnet.blastapi.io/' + blastKey + '/rpc/v0.5',
78+
nodeUrl: 'https://starknet-mainnet.blastapi.io/' + blastKey + '/rpc/v0_7',
7979
});
80-
const providerBlastMainnet = new RpcProvider({
81-
nodeUrl: 'https://starknet-mainnet.blastapi.io/' + blastKey + '/rpc/v0_6',
82-
});
83-
// Lava node rpc 0.4.0 for Mainnet:
80+
// Lava node rpc 0.6.0 for Mainnet:
8481
const providerMainnetLava = new RpcProvider({
8582
nodeUrl: 'https://g.w.lavanet.xyz:443/gateway/strk/rpc-http/' + lavaMainnetKey,
8683
});
87-
// Alchemy node rpc 0.5.1 for Mainnet:
84+
// Alchemy node rpc 0.6.0 for Mainnet:
8885
const providerAlchemyMainnet = new RpcProvider({
89-
nodeUrl: 'https://starknet-mainnet.g.alchemy.com/starknet/version/rpc/v0.5/' + alchemyKey,
90-
});
91-
// Public Nethermind node rpc 0.5.1 & 0.6.0 for Mainnet:
92-
const providerMainnetNethermindPublic = new RpcProvider({
93-
nodeUrl: 'https://free-rpc.nethermind.io/mainnet-juno/v0_5',
86+
nodeUrl: 'https://starknet-mainnet.g.alchemy.com/starknet/version/rpc/v0_6/' + alchemyKey,
9487
});
88+
// Public Nethermind node rpc 0.7.0 for Mainnet (0_6 also available):
9589
const providerMainnetNethermindPublic = new RpcProvider({
96-
nodeUrl: 'https://free-rpc.nethermind.io/mainnet-juno/v0_6',
97-
});
98-
// Public Blast node rpc 0.4.0, 0.5.1 & 0.6.0 for Mainnet:
99-
const providerBlastMainnet = new RpcProvider({
100-
nodeUrl: 'https://starknet-mainnet.public.blastapi.io/rpc/v0.4',
101-
});
102-
const providerBlastMainnet = new RpcProvider({
103-
nodeUrl: 'https://starknet-mainnet.public.blastapi.io/rpc/v0.5',
90+
nodeUrl: 'https://free-rpc.nethermind.io/mainnet-juno/v0_7',
10491
});
92+
// Public Blast node rpc 0.7.0 for Mainnet (0.4, 0.5 & 0_6 also available) :
10593
const providerBlastMainnet = new RpcProvider({
106-
nodeUrl: 'https://starknet-mainnet.public.blastapi.io/rpc/v0_6',
94+
nodeUrl: 'https://starknet-mainnet.public.blastapi.io/rpc/v0_7',
10795
});
108-
// Public Lava node rpc 0.4.0 for Mainnet:
96+
// Public Lava node rpc 0.6.0 for Mainnet:
10997
const providerLavaMainnet = new RpcProvider({
11098
nodeUrl: 'https://json-rpc.starknet-mainnet.public.lavanet.xyz',
11199
});
@@ -120,42 +108,38 @@ const providerLavaMainnet = new RpcProvider({
120108
const providerInfuraTestnet = new RpcProvider({
121109
nodeUrl: 'https://starknet-goerli.infura.io/v3/' + infuraKey,
122110
});
123-
// Blast node rpc 0.5.1 & 0.6.0 for Goerli Testnet:
124-
const providerBlastTestnet = new RpcProvider({
125-
nodeUrl: 'https://starknet-testnet.blastapi.io/' + blastKey + '/rpc/v0.5',
126-
});
111+
// Blast node rpc 0.7.0 for Goerli Testnet (0.4, 0.5 & 0_6 also available) :
127112
const providerBlastTestnet = new RpcProvider({
128-
nodeUrl: 'https://starknet-testnet.blastapi.io/' + blastKey + '/rpc/v0_6',
113+
nodeUrl: 'https://starknet-testnet.blastapi.io/' + blastKey + '/rpc/v0_7',
129114
});
130-
// Alchemy node rpc 0.5.1 for Goerli Testnet:
115+
// Alchemy node rpc 0.6.0 for Goerli Testnet:
131116
const providerAlchemyTestnet = new RpcProvider({
132-
nodeUrl: 'https://starknet-goerli.g.alchemy.com/starknet/version/rpc/v0.5/' + alchemyKey,
117+
nodeUrl: 'https://starknet-goerli.g.alchemy.com/starknet/version/rpc/v0_6/' + alchemyKey,
133118
});
134-
// Public Nethermind node rpc 0.5.1 & 0.6.0 for Goerli Testnet:
119+
// Public Nethermind node rpc 0.7.0 for Goerli Testnet (0_6 also available) :
135120
const providerTestnetNethermindPublic = new RpcProvider({
136-
nodeUrl: 'https://free-rpc.nethermind.io/goerli-juno/v0_5',
121+
nodeUrl: 'https://free-rpc.nethermind.io/goerli-juno/v0_7',
137122
});
138-
const providerTestnetNethermindPublic = new RpcProvider({
139-
nodeUrl: 'https://free-rpc.nethermind.io/goerli-juno/v0_6',
123+
// Public Blast node rpc 0.7.0 for Goerli Testnet (0.4, 0.5 & 0_6 also available) :
124+
const providerTestnetBlastPublic = new RpcProvider({
125+
nodeUrl: 'https://starknet-testnet.public.blastapi.io/rpc/v0_7',
140126
});
141127
```
142128

143129
### Sepolia Testnet
144130

145131
```typescript
146-
// Blast node rpc 0.5.1 & 0.60 for Sepolia Testnet:
147-
const providerBlastTestnet = new RpcProvider({
148-
nodeUrl: 'https://starknet-testnet.blastapi.io/' + blastKey + '/rpc/v0.5',
149-
});
150-
const providerBlastTestnet = new RpcProvider({
151-
nodeUrl: 'https://starknet-testnet.blastapi.io/' + blastKey + '/rpc/v0_6',
132+
// Infura node rpc 0.5.1 for Sepolia Testnet :
133+
const providerInfuraSepoliaTestnet = new RpcProvider({
134+
nodeUrl: 'https://starknet-sepolia.infura.io/v3/' + infuraKey,
152135
});
153-
// Alchemy node rpc for Sepolia Testnet:
154-
const providerSepoliaNethermindPublic = new RpcProvider({
155-
nodeUrl: 'https://free-rpc.nethermind.io/sepolia-juno/v0_5',
136+
// Public Nethermind node rpc 0.7.0 for Sepolia Testnet (0_6 also available) :
137+
const providerSepoliaTestnetNethermindPublic = new RpcProvider({
138+
nodeUrl: 'https://free-rpc.nethermind.io/sepolia-juno/v0_7',
156139
});
157-
const providerSepoliaNethermindPublic = new RpcProvider({
158-
nodeUrl: 'https://free-rpc.nethermind.io/sepolia-juno/v0_6',
140+
// Public Blast node rpc 0.7.0 for Sepolia Testnet (0_6 also available) :
141+
const providerSepoliaTestnetBlastPublic = new RpcProvider({
142+
nodeUrl: 'https://starknet-sepolia.public.blastapi.io/rpc/v0_7',
159143
});
160144
```
161145

@@ -166,22 +150,22 @@ const providerSepoliaNethermindPublic = new RpcProvider({
166150
For a local [Pathfinder](https://github.com/eqlabs/pathfinder) node:
167151

168152
```typescript
169-
const provider = new RpcProvider({ nodeUrl: '127.0.0.1:9545/rpc/v0_6' });
153+
const provider = new RpcProvider({ nodeUrl: '127.0.0.1:9545/rpc/v0_7' });
170154
```
171155

172156
Your node can be located in your local network (example: Pathfinder node running on a computer in your network, launched with this additional option: `--http-rpc 0.0.0.0:9545`).
173157
You can connect with:
174158

175159
```typescript
176-
const provider = new RpcProvider({ nodeUrl: '192.168.1.99:9545/rpc/v0_6' });
160+
const provider = new RpcProvider({ nodeUrl: '192.168.1.99:9545/rpc/v0_7' });
177161
```
178162

179163
### Juno
180164

181165
For a local [Juno](https://github.com/NethermindEth/juno) node initialize the provider with:
182166

183167
```typescript
184-
const provider = new RpcProvider({ nodeUrl: 'http://127.0.0.1:6060/v0_6' });
168+
const provider = new RpcProvider({ nodeUrl: 'http://127.0.0.1:6060/v0_7' });
185169
```
186170

187171
> If Juno is running on a separate computer in your local network, don't forget to add the option `--http-host 0.0.0.0` when launching Juno.

0 commit comments

Comments
 (0)