How to Specify/Change Network chain_id
chain_id is used as part of the transaction signing and in most cases is the same as the originating network, but what if you would like to change it?
One reason can be to prevent the Fork environment from producing a signature valid on the actual network, in order to prevent a transaction replay attack:
1
...
2
โ€‹
3
const body = {
4
"network_id": "1", // network you wish to fork
5
"block_number": "14386016",
6
"chain_config": {
7
"chain_id": "3" // chain_id used in the forked enviroment
8
}
9
}
10
โ€‹
11
const resp = await axios.post(TENDERLY_FORK_API, body, opts);
Copied!
Copy link