Skip to content

Commit

Permalink
add custom chain ID to config.ts (#348)
Browse files Browse the repository at this point in the history
  • Loading branch information
ceyonur authored Nov 8, 2022
1 parent 2519829 commit 253a35c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions contract-examples/hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ if (existsSync("./dynamic_rpc.json")) {
testRpc = importedRpc.rpc
}

let localRPC = ""
var localConf
if (existsSync("./local_rpc.json")) {
const importedRpc = require("./local_rpc.json")
localRPC = importedRpc.rpc
localConf = importedRpc
}

export default {
Expand All @@ -39,8 +39,8 @@ export default {
local: {
//"http://{ip}:{port}/ext/bc/{chainID}/rpc
// modify this in the local_rpc.json
url: localRPC,
chainId: 43214,
url: localConf.rpc,
chainId: localConf.chainId,
accounts: [
"0x56289e99c94b6912bfc12adc093c9b51124f0dc54ac7a766b2bc5ccf558d8027",
"0x7b4198529994b0dc604278c99d153cfd069d594753d471171a1d102a10438e07",
Expand Down
3 changes: 2 additions & 1 deletion contract-examples/local_rpc.example.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"rpc": "http://127.0.0.1:9650/ext/bc/dRTfPJh4jEaRZoGkPc7xreeYbDGBrGWRV48WAYVyUgApsmzGo/rpc"
"rpc": "http://127.0.0.1:9650/ext/bc/dRTfPJh4jEaRZoGkPc7xreeYbDGBrGWRV48WAYVyUgApsmzGo/rpc",
"chainId": 43214
}

0 comments on commit 253a35c

Please sign in to comment.