虽然 Cloudflare 的 Ethereum Gateway 在推出时支持 Rinkeby 测试网,但 Rinkeby 未完成合并 ↗,因此,将不再是主网的可靠过渡环境。
Cloudflare 将于 2023 年 1 月 30 日弃用对 Rinkeby 的支持。
为了避免您的 Web3 开发或调试出现任何问题,您应该切换到 Sepolia 测试网,您的 Ethereum Gateway 完全支持该网络。
要进行迁移,您应更新在读取或写入以太坊网络时使用的端点。
例如,您以前可能一直使用以前的端点与 Ethereum Gateway 进行交互。
curl https://web3-trial.cloudflare-eth.com/v1/rinkeby \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc": "2.0",
"method": "eth_getBlockByNumber",
"params": ["0x2244", true],
"id": 1
}'await fetch(
new Request('https://web3-trial.cloudflare-eth.com/v1/rinkeby', {
method: 'POST',
body: JSON.stringify({
jsonrpc: '2.0',
method: 'eth_getBlockByNumber',
params: ['0x2244', true],
id: 1,
}),
headers: {
'Content-Type': 'application/json',
},
})
).then(resp => {
return resp.json();
});要从 Rinkeby 迁移,请更改端点的结尾以使用其他测试网。
curl https://web3-trial.cloudflare-eth.com/v1/sepolia \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc": "2.0",
"method": "eth_getBlockByNumber",
"params": ["0x2244", true],
"id": 1
}'await fetch(
new Request('https://web3-trial.cloudflare-eth.com/v1/sepolia', {
method: 'POST',
body: JSON.stringify({
jsonrpc: '2.0',
method: 'eth_getBlockByNumber',
params: ['0x2244', true],
id: 1,
}),
headers: {
'Content-Type': 'application/json',
},
})
).then(resp => {
return resp.json();
});