Skip to content

Commit

Permalink
Create networkConfig.js
Browse files Browse the repository at this point in the history
  • Loading branch information
KOSASIH authored Oct 31, 2024
1 parent 4bd17ce commit 67077d0
Showing 1 changed file with 68 additions and 0 deletions.
68 changes: 68 additions & 0 deletions blockchain_integration/pi_network/config/networkConfig.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
// config/networkConfig.js

const networks = {
mainnet: {
chainId: 1,
name: "Ethereum Mainnet",
rpcUrl: "https://mainnet.infura.io/v3/YOUR_INFURA_PROJECT_ID",
explorerUrl: "https://etherscan.io",
nativeCurrency: {
name: "Ether",
symbol: "ETH",
decimals: 18,
},
},
ropsten: {
chainId: 3,
name: "Ropsten Testnet",
rpcUrl: "https://ropsten.infura.io/v3/YOUR_INFURA_PROJECT_ID",
explorerUrl: "https://ropsten.etherscan.io",
nativeCurrency: {
name: "Test Ether",
symbol: "ETH",
decimals: 18,
},
},
rinkeby: {
chainId: 4,
name: "Rinkeby Testnet",
rpcUrl: "https://rinkeby.infura.io/v3/YOUR_INFURA_PROJECT_ID",
explorerUrl: "https://rinkeby.etherscan.io",
nativeCurrency: {
name: "Test Ether",
symbol: "ETH",
decimals: 18,
},
},
kovan: {
chainId: 42,
name: "Kovan Testnet",
rpcUrl: "https://kovan.infura.io/v3/YOUR_INFURA_PROJECT_ID",
explorerUrl: "https://kovan.etherscan.io",
nativeCurrency: {
name: "Test Ether",
symbol: "ETH",
decimals: 18,
},
},
localhost: {
chainId: 1337,
name: "Localhost",
rpcUrl: "http://127.0.0.1:8545",
explorerUrl: "",
nativeCurrency: {
name: "Ether",
symbol: "ETH",
decimals: 18,
},
},
};

const getNetworkConfig = (network) => {
return networks[network] || networks.localhost;
};

module.exports = {
networks,
getNetworkConfig,
};

0 comments on commit 67077d0

Please sign in to comment.