Skip to content

Commit e5aa136

Browse files
committed
chore: make localhost chain id a configurable variable
Signed-off-by: Tomás Migone <[email protected]>
1 parent 333f98e commit e5aa136

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

packages/hardhat-graph-protocol/src/sdk/hardhat.base.config.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@ interface SecureAccountsOptions {
99
enabled?: boolean
1010
}
1111

12-
// RPCs
12+
// Hardhat variables
1313
const ARBITRUM_ONE_RPC = vars.get('ARBITRUM_ONE_RPC', 'https://arb1.arbitrum.io/rpc')
1414
const ARBITRUM_SEPOLIA_RPC = vars.get('ARBITRUM_SEPOLIA_RPC', 'https://sepolia-rollup.arbitrum.io/rpc')
1515
const LOCALHOST_RPC = vars.get('LOCALHOST_RPC', 'http://localhost:8545')
16+
const LOCALHOST_CHAIN_ID = vars.get('LOCALHOST_CHAIN_ID', '31337')
1617

1718
export const solidityUserConfig: SolidityUserConfig = {
1819
version: '0.8.27',
@@ -54,7 +55,7 @@ export const networksUserConfig: BaseNetworksUserConfig = {
5455
},
5556
},
5657
localhost: {
57-
chainId: 31337,
58+
chainId: parseInt(LOCALHOST_CHAIN_ID),
5859
url: LOCALHOST_RPC,
5960
secureAccounts: {
6061
enabled: true,

packages/horizon/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ The following environment variables might be required:
1212
| `ARBITRUM_ONE_RPC` | Arbitrum One RPC URL - defaults to `https://arb1.arbitrum.io/rpc` |
1313
| `ARBITRUM_SEPOLIA_RPC` | Arbitrum Sepolia RPC URL - defaults to `https://sepolia-rollup.arbitrum.io/rpc` |
1414
| `LOCALHOST_RPC` | Localhost RPC URL - defaults to `http://localhost:8545` |
15+
| `LOCALHOST_CHAIN_ID` | Localhost chain ID - defaults to `31337` |
1516

1617
You can set them using Hardhat:
1718

packages/subgraph-service/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ The following environment variables might be required:
1212
| `ARBITRUM_ONE_RPC` | Arbitrum One RPC URL - defaults to `https://arb1.arbitrum.io/rpc` |
1313
| `ARBITRUM_SEPOLIA_RPC` | Arbitrum Sepolia RPC URL - defaults to `https://sepolia-rollup.arbitrum.io/rpc` |
1414
| `LOCALHOST_RPC` | Localhost RPC URL - defaults to `http://localhost:8545` |
15-
15+
| `LOCALHOST_CHAIN_ID` | Localhost chain ID - defaults to `31337` |
1616
You can set them using Hardhat:
1717

1818
```bash

0 commit comments

Comments
 (0)