add verify-script and run through data

This commit is contained in:
Pedro Gomes 2019-06-17 17:45:49 +02:00
parent 590b93ad3a
commit 4d489c7a86
49 changed files with 1879 additions and 83 deletions

4
.gitignore vendored
View File

@ -1,4 +1,6 @@
_site _site
.sass-cache .sass-cache
.jekyll-metadata .jekyll-metadata
.DS_Store .DS_Store
.env
node_modules

View File

@ -2,7 +2,10 @@
"name": "Ethereum Mainnet", "name": "Ethereum Mainnet",
"chain": "ETH", "chain": "ETH",
"network": "mainnet", "network": "mainnet",
"rpc": ["https://mainnet.infura.io/v3/${INFURA_API_KEY}", "https://api.mycryptoapi.com/eth"], "rpc": [
"https://mainnet.infura.io/v3/${INFURA_API_KEY}",
"https://api.mycryptoapi.com/eth"
],
"faucets": [], "faucets": [],
"nativeCurrency": { "nativeCurrency": {
"name": "Ether", "name": "Ether",

View File

@ -2,7 +2,9 @@
"name": "xDAI Chain", "name": "xDAI Chain",
"chain": "XDAI", "chain": "XDAI",
"network": "mainnet", "network": "mainnet",
"rpc": ["https://dai.poa.network"], "rpc": [
"https://dai.poa.network"
],
"faucets": [], "faucets": [],
"nativeCurrency": { "nativeCurrency": {
"name": "xDAI", "name": "xDAI",

View File

@ -2,7 +2,9 @@
"name": "EtherInc", "name": "EtherInc",
"chain": "ETI", "chain": "ETI",
"network": "mainnet", "network": "mainnet",
"rpc": ["https://api.einc.io/jsonrpc/mainnet"], "rpc": [
"https://api.einc.io/jsonrpc/mainnet"
],
"faucets": [], "faucets": [],
"nativeCurrency": { "nativeCurrency": {
"name": "EtherInc Ether", "name": "EtherInc Ether",

View File

@ -2,8 +2,12 @@
"name": "ThunderCore Mainnet", "name": "ThunderCore Mainnet",
"chain": "TT", "chain": "TT",
"network": "mainnet", "network": "mainnet",
"rpc": ["https://mainnet-rpc.thundercore.com"], "rpc": [
"faucets": ["https://faucet.thundercore.com"], "https://mainnet-rpc.thundercore.com"
],
"faucets": [
"https://faucet.thundercore.com"
],
"nativeCurrency": { "nativeCurrency": {
"name": "ThunderCore Mainnet Ether", "name": "ThunderCore Mainnet Ether",
"symbol": "TT", "symbol": "TT",

View File

@ -2,7 +2,9 @@
"name": "Metadium Mainnet", "name": "Metadium Mainnet",
"chain": "META", "chain": "META",
"network": "mainnet", "network": "mainnet",
"rpc": ["https://api.metadium.com/prod"], "rpc": [
"https://api.metadium.com/prod"
],
"faucets": [], "faucets": [],
"nativeCurrency": { "nativeCurrency": {
"name": "Metadium Mainnet Ether", "name": "Metadium Mainnet Ether",

View File

@ -2,7 +2,10 @@
"name": "IPOS Network", "name": "IPOS Network",
"chain": "IPOS", "chain": "IPOS",
"network": "mainnet", "network": "mainnet",
"rpc": ["https://rpc.iposlab.com", "https://rpc2.iposlab.com"], "rpc": [
"https://rpc.iposlab.com",
"https://rpc2.iposlab.com"
],
"faucets": [], "faucets": [],
"nativeCurrency": { "nativeCurrency": {
"name": "IPOS Network Ether", "name": "IPOS Network Ether",

View File

@ -2,7 +2,9 @@
"name": "Metadium Testnet", "name": "Metadium Testnet",
"chain": "META", "chain": "META",
"network": "testnet", "network": "testnet",
"rpc": ["https://api.metadium.com/dev"], "rpc": [
"https://api.metadium.com/dev"
],
"faucets": [], "faucets": [],
"nativeCurrency": { "nativeCurrency": {
"name": "Metadium Testnet Ether", "name": "Metadium Testnet Ether",

View File

@ -2,7 +2,9 @@
"name": "Ether-1", "name": "Ether-1",
"chain": "ETHO", "chain": "ETHO",
"network": "mainnet", "network": "mainnet",
"rpc": ["https://rpc.ether1.org"], "rpc": [
"https://rpc.ether1.org"
],
"faucets": [], "faucets": [],
"nativeCurrency": { "nativeCurrency": {
"name": "Ether-1 Ether", "name": "Ether-1 Ether",

View File

@ -2,7 +2,9 @@
"name": "PepChain Churchill", "name": "PepChain Churchill",
"chain": "PEP", "chain": "PEP",
"network": "testnet", "network": "testnet",
"rpc": ["https://churchill-rpc.pepchain.io"], "rpc": [
"https://churchill-rpc.pepchain.io"
],
"faucets": [], "faucets": [],
"nativeCurrency": { "nativeCurrency": {
"name": "PepChain Churchill Ether", "name": "PepChain Churchill Ether",

View File

@ -1,16 +1,20 @@
{ {
"name": "Lightstreams Testnet", "name": "Lightstreams Testnet",
"chain": "PHT", "chain": "PHT",
"network": "sirius", "network": "sirius",
"rpc": ["https://node.sirius.lightstreams.io"], "rpc": [
"faucets": ["https://discuss.lightstreams.network/t/request-test-tokens"], "https://node.sirius.lightstreams.io"
"nativeCurrency": { ],
"name": "Lightstreams PHT", "faucets": [
"symbol": "PHT", "https://discuss.lightstreams.network/t/request-test-tokens"
"decimals": 18 ],
}, "nativeCurrency": {
"infoURL": "https://explorer.sirius.lightstreams.io", "name": "Lightstreams PHT",
"shortName": "tpht", "symbol": "PHT",
"chainId": 162, "decimals": 18
"networkId": 162 },
"infoURL": "https://explorer.sirius.lightstreams.io",
"shortName": "tpht",
"chainId": 162,
"networkId": 162
} }

View File

@ -2,7 +2,9 @@
"name": "Atheios", "name": "Atheios",
"chain": "ATH", "chain": "ATH",
"network": "mainnet", "network": "mainnet",
"rpc": ["https://wallet.atheios.com:8797"], "rpc": [
"https://wallet.atheios.com:8797"
],
"faucets": [], "faucets": [],
"nativeCurrency": { "nativeCurrency": {
"name": "Atheios Ether", "name": "Atheios Ether",

View File

@ -1,16 +1,18 @@
{ {
"name": "Lightstreams Mainnet", "name": "Lightstreams Mainnet",
"chain": "PHT", "chain": "PHT",
"network": "mainnet", "network": "mainnet",
"rpc": ["https://node.mainnet.lightstreams.io"], "rpc": [
"faucets": [], "https://node.mainnet.lightstreams.io"
"nativeCurrency": { ],
"name": "Lightstreams PHT", "faucets": [],
"symbol": "PHT", "nativeCurrency": {
"decimals": 18 "name": "Lightstreams PHT",
}, "symbol": "PHT",
"infoURL": "https://explorer.lightstreams.io", "decimals": 18
"shortName": "pht", },
"chainId": 163, "infoURL": "https://explorer.lightstreams.io",
"networkId": 163 "shortName": "pht",
"chainId": 163,
"networkId": 163
} }

View File

@ -2,8 +2,12 @@
"name": "ThunderCore Testnet", "name": "ThunderCore Testnet",
"chain": "TST", "chain": "TST",
"network": "testnet", "network": "testnet",
"rpc": ["https://testnet-rpc.thundercore.com"], "rpc": [
"faucets": ["https://faucet-testnet.thundercore.com"], "https://testnet-rpc.thundercore.com"
],
"faucets": [
"https://faucet-testnet.thundercore.com"
],
"nativeCurrency": { "nativeCurrency": {
"name": "ThunderCore Testnet Ether", "name": "ThunderCore Testnet Ether",
"symbol": "TST", "symbol": "TST",

View File

@ -2,7 +2,9 @@
"name": "IOLite", "name": "IOLite",
"chain": "ILT", "chain": "ILT",
"network": "mainnet", "network": "mainnet",
"rpc": ["https://net.iolite.io"], "rpc": [
"https://net.iolite.io"
],
"faucets": [], "faucets": [],
"nativeCurrency": { "nativeCurrency": {
"name": "IOLite Ether", "name": "IOLite Ether",

View File

@ -2,7 +2,9 @@
"name": "Teslafunds", "name": "Teslafunds",
"chain": "TSF", "chain": "TSF",
"network": "mainnet", "network": "mainnet",
"rpc": ["https://tsfapi.europool.me"], "rpc": [
"https://tsfapi.europool.me"
],
"faucets": [], "faucets": [],
"nativeCurrency": { "nativeCurrency": {
"name": "Teslafunds Ether", "name": "Teslafunds Ether",

View File

@ -2,7 +2,9 @@
"name": "EtherGem", "name": "EtherGem",
"chain": "EGEM", "chain": "EGEM",
"network": "mainnet", "network": "mainnet",
"rpc": ["https://jsonrpc.egem.io/custom"], "rpc": [
"https://jsonrpc.egem.io/custom"
],
"faucets": [], "faucets": [],
"nativeCurrency": { "nativeCurrency": {
"name": "EtherGem Ether", "name": "EtherGem Ether",

View File

@ -2,7 +2,9 @@
"name": "Expanse Network", "name": "Expanse Network",
"chain": "EXP", "chain": "EXP",
"network": "mainnet", "network": "mainnet",
"rpc": ["https://node.expanse.tech"], "rpc": [
"https://node.expanse.tech"
],
"faucets": [], "faucets": [],
"nativeCurrency": { "nativeCurrency": {
"name": "Expanse Network Ether", "name": "Expanse Network Ether",

View File

@ -2,7 +2,9 @@
"name": "Akaroma", "name": "Akaroma",
"chain": "AKA", "chain": "AKA",
"network": "mainnet", "network": "mainnet",
"rpc": ["https://remote.akroma.io"], "rpc": [
"https://remote.akroma.io"
],
"faucets": [], "faucets": [],
"nativeCurrency": { "nativeCurrency": {
"name": "Akaroma Ether", "name": "Akaroma Ether",

View File

@ -2,7 +2,9 @@
"name": "Webchain", "name": "Webchain",
"chain": "WEB", "chain": "WEB",
"network": "mainnet", "network": "mainnet",
"rpc": ["https://node1.webchain.network"], "rpc": [
"https://node1.webchain.network"
],
"faucets": [], "faucets": [],
"nativeCurrency": { "nativeCurrency": {
"name": "Webchain Ether", "name": "Webchain Ether",

View File

@ -2,7 +2,9 @@
"name": "ARTIS sigma1", "name": "ARTIS sigma1",
"chain": "ARTIS", "chain": "ARTIS",
"network": "sigma1", "network": "sigma1",
"rpc": ["https://rpc.sigma1.artis.network"], "rpc": [
"https://rpc.sigma1.artis.network"
],
"faucets": [], "faucets": [],
"nativeCurrency": { "nativeCurrency": {
"name": "ARTIS sigma1 Ether", "name": "ARTIS sigma1 Ether",

View File

@ -2,7 +2,9 @@
"name": "ARTIS tau1", "name": "ARTIS tau1",
"chain": "ARTIS", "chain": "ARTIS",
"network": "tau1", "network": "tau1",
"rpc": ["https://rpc.tau1.artis.network"], "rpc": [
"https://rpc.tau1.artis.network"
],
"faucets": [], "faucets": [],
"nativeCurrency": { "nativeCurrency": {
"name": "ARTIS tau1 Ether", "name": "ARTIS tau1 Ether",

View File

@ -2,7 +2,9 @@
"name": "High Performance Blockchain", "name": "High Performance Blockchain",
"chain": "HPB", "chain": "HPB",
"network": "mainnet", "network": "mainnet",
"rpc": ["https://node.hpb.blue"], "rpc": [
"https://node.hpb.blue"
],
"faucets": [], "faucets": [],
"nativeCurrency": { "nativeCurrency": {
"name": "High Performance Blockchain Ether", "name": "High Performance Blockchain Ether",

View File

@ -2,7 +2,9 @@
"name": "Auxilium Network Mainnet", "name": "Auxilium Network Mainnet",
"chain": "AUX", "chain": "AUX",
"network": "mainnet", "network": "mainnet",
"rpc": ["https://rpc.auxilium.global"], "rpc": [
"https://rpc.auxilium.global"
],
"faucets": [], "faucets": [],
"nativeCurrency": { "nativeCurrency": {
"name": "Auxilium coin", "name": "Auxilium coin",
@ -13,4 +15,4 @@
"shortName": "aux", "shortName": "aux",
"chainId": 28945486, "chainId": 28945486,
"networkId": 28945486 "networkId": 28945486
} }

View File

@ -2,8 +2,12 @@
"name": "Ethereum Testnet Ropsten", "name": "Ethereum Testnet Ropsten",
"chain": "ETH", "chain": "ETH",
"network": "ropsten", "network": "ropsten",
"rpc": ["https://ropsten.infura.io/v3/${INFURA_API_KEY}"], "rpc": [
"faucets": ["https://faucet.ropsten.be?${ADDRESS}"], "https://ropsten.infura.io/v3/${INFURA_API_KEY}"
],
"faucets": [
"https://faucet.ropsten.be?${ADDRESS}"
],
"nativeCurrency": { "nativeCurrency": {
"name": "Ropsten Ether", "name": "Ropsten Ether",
"symbol": "ROP", "symbol": "ROP",

View File

@ -2,7 +2,10 @@
"name": "RSK Mainnet", "name": "RSK Mainnet",
"chain": "RSK", "chain": "RSK",
"network": "mainnet", "network": "mainnet",
"rpc": ["https://public-node.rsk.co", "https://mycrypto.rsk.co"], "rpc": [
"https://public-node.rsk.co",
"https://mycrypto.rsk.co"
],
"faucets": [], "faucets": [],
"nativeCurrency": { "nativeCurrency": {
"name": "RSK Mainnet Ether", "name": "RSK Mainnet Ether",

View File

@ -2,8 +2,13 @@
"name": "RSK Testnet", "name": "RSK Testnet",
"chain": "RSK", "chain": "RSK",
"network": "testnet", "network": "testnet",
"rpc": ["https://public-node.testnet.rsk.co", "https://mycrypto.testnet.rsk.co"], "rpc": [
"faucets": ["https://faucet.testnet.rsk.co"], "https://public-node.testnet.rsk.co",
"https://mycrypto.testnet.rsk.co"
],
"faucets": [
"https://faucet.testnet.rsk.co"
],
"nativeCurrency": { "nativeCurrency": {
"name": "RSK Testnet Ether", "name": "RSK Testnet Ether",
"symbol": "TRSK", "symbol": "TRSK",

View File

@ -2,7 +2,9 @@
"name": "Ethersocial Network", "name": "Ethersocial Network",
"chain": "ESN", "chain": "ESN",
"network": "mainnet", "network": "mainnet",
"rpc": ["https://api.esn.gonspool.com"], "rpc": [
"https://api.esn.gonspool.com"
],
"faucets": [], "faucets": [],
"nativeCurrency": { "nativeCurrency": {
"name": "Ethersocial Network Ether", "name": "Ethersocial Network Ether",

View File

@ -2,7 +2,9 @@
"name": "Pirl", "name": "Pirl",
"chain": "PIRL", "chain": "PIRL",
"network": "mainnet", "network": "mainnet",
"rpc": ["https://wallrpc.pirl.io"], "rpc": [
"https://wallrpc.pirl.io"
],
"faucets": [], "faucets": [],
"nativeCurrency": { "nativeCurrency": {
"name": "Pirl Ether", "name": "Pirl Ether",

View File

@ -2,8 +2,12 @@
"name": "Lisinski", "name": "Lisinski",
"chain": "CRO", "chain": "CRO",
"network": "mainnet", "network": "mainnet",
"rpc": ["https://rpc-bitfalls1.lisinski.online"], "rpc": [
"faucets": ["https://pipa.lisinski.online"], "https://rpc-bitfalls1.lisinski.online"
],
"faucets": [
"https://pipa.lisinski.online"
],
"nativeCurrency": { "nativeCurrency": {
"name": "Lisinski Ether", "name": "Lisinski Ether",
"symbol": "LISINSKI", "symbol": "LISINSKI",

View File

@ -2,8 +2,12 @@
"name": "Ethereum Testnet Rinkeby", "name": "Ethereum Testnet Rinkeby",
"chain": "ETH", "chain": "ETH",
"network": "rinkeby", "network": "rinkeby",
"rpc": ["https://rinkeby.infura.io/v3/${INFURA_API_KEY}"], "rpc": [
"faucets": ["https://faucet.rinkeby.io"], "https://rinkeby.infura.io/v3/${INFURA_API_KEY}"
],
"faucets": [
"https://faucet.rinkeby.io"
],
"nativeCurrency": { "nativeCurrency": {
"name": "Rinkeby Ether", "name": "Rinkeby Ether",
"symbol": "RIN", "symbol": "RIN",

View File

@ -2,8 +2,13 @@
"name": "Ethereum Testnet Kovan", "name": "Ethereum Testnet Kovan",
"chain": "ETH", "chain": "ETH",
"network": "kovan", "network": "kovan",
"rpc": ["https://kovan.infura.io/v3/${INFURA_API_KEY}"], "rpc": [
"faucets": ["https://faucet.kovan.network", "https://gitter.im/kovan-testnet/faucet"], "https://kovan.infura.io/v3/${INFURA_API_KEY}"
],
"faucets": [
"https://faucet.kovan.network",
"https://gitter.im/kovan-testnet/faucet"
],
"nativeCurrency": { "nativeCurrency": {
"name": "Kovan Ether", "name": "Kovan Ether",
"symbol": "KOV", "symbol": "KOV",

View File

@ -2,8 +2,15 @@
"name": "Ethereum Testnet Görli", "name": "Ethereum Testnet Görli",
"chain": "ETH", "chain": "ETH",
"network": "goerli", "network": "goerli",
"rpc": ["https://rpc.goerli.mudit.blog/", "https://rpc.slock.it/goerli ", "https://goerli.prylabs.net/"], "rpc": [
"faucets": ["https://goerli-faucet.slock.it/?address=${ADDRESS}", "https://faucet.goerli.mudit.blog"], "https://rpc.goerli.mudit.blog/",
"https://rpc.slock.it/goerli ",
"https://goerli.prylabs.net/"
],
"faucets": [
"https://goerli-faucet.slock.it/?address=${ADDRESS}",
"https://faucet.goerli.mudit.blog"
],
"nativeCurrency": { "nativeCurrency": {
"name": "Görli Ether", "name": "Görli Ether",
"symbol": "GOR", "symbol": "GOR",

View File

@ -2,7 +2,9 @@
"name": "GoChain", "name": "GoChain",
"chain": "GO", "chain": "GO",
"network": "mainnet", "network": "mainnet",
"rpc": ["https://rpc.gochain.io"], "rpc": [
"https://rpc.gochain.io"
],
"faucets": [], "faucets": [],
"nativeCurrency": { "nativeCurrency": {
"name": "GoChain Ether", "name": "GoChain Ether",

View File

@ -2,7 +2,9 @@
"name": "Ethereum Classic Mainnet", "name": "Ethereum Classic Mainnet",
"chain": "ETC", "chain": "ETC",
"network": "mainnet", "network": "mainnet",
"rpc": ["https://ethereumclassic.network"], "rpc": [
"https://ethereumclassic.network"
],
"faucets": [], "faucets": [],
"nativeCurrency": { "nativeCurrency": {
"name": "Ethereum Classic Ether", "name": "Ethereum Classic Ether",

View File

@ -2,8 +2,13 @@
"name": "Aquachain", "name": "Aquachain",
"chain": "AQUA", "chain": "AQUA",
"network": "mainnet", "network": "mainnet",
"rpc": ["https://c.onical.org", "https://tx.aquacha.in/api"], "rpc": [
"faucets": ["https://aquacha.in/faucet"], "https://c.onical.org",
"https://tx.aquacha.in/api"
],
"faucets": [
"https://aquacha.in/faucet"
],
"nativeCurrency": { "nativeCurrency": {
"name": "Aquachain Ether", "name": "Aquachain Ether",
"symbol": "AQUA", "symbol": "AQUA",

View File

@ -2,7 +2,9 @@
"name": "Ellaism", "name": "Ellaism",
"chain": "ELLA", "chain": "ELLA",
"network": "mainnet", "network": "mainnet",
"rpc": ["https://jsonrpc.ellaism.org"], "rpc": [
"https://jsonrpc.ellaism.org"
],
"faucets": [], "faucets": [],
"nativeCurrency": { "nativeCurrency": {
"name": "Ellaism Ether", "name": "Ellaism Ether",

View File

@ -2,7 +2,9 @@
"name": "Mix", "name": "Mix",
"chain": "MIX", "chain": "MIX",
"network": "mainnet", "network": "mainnet",
"rpc": ["https://rpc2.mix-blockchain.org:8647"], "rpc": [
"https://rpc2.mix-blockchain.org:8647"
],
"faucets": [], "faucets": [],
"nativeCurrency": { "nativeCurrency": {
"name": "Mix Ether", "name": "Mix Ether",

View File

@ -2,8 +2,12 @@
"name": "POA Network Sokol", "name": "POA Network Sokol",
"chain": "POA", "chain": "POA",
"network": "sokol", "network": "sokol",
"rpc": ["https://sokol.poa.network"], "rpc": [
"faucets": ["https://faucet-sokol.herokuapp.com"], "https://sokol.poa.network"
],
"faucets": [
"https://faucet-sokol.herokuapp.com"
],
"nativeCurrency": { "nativeCurrency": {
"name": "POA Sokol Ether", "name": "POA Sokol Ether",
"symbol": "POA", "symbol": "POA",

View File

@ -2,7 +2,9 @@
"name": "Musicoin", "name": "Musicoin",
"chain": "MUSIC", "chain": "MUSIC",
"network": "mainnet", "network": "mainnet",
"rpc": ["https://mewapi.musicoin.tw"], "rpc": [
"https://mewapi.musicoin.tw"
],
"faucets": [], "faucets": [],
"nativeCurrency": { "nativeCurrency": {
"name": "Musicoin", "name": "Musicoin",

View File

@ -2,7 +2,9 @@
"name": "Ubiq Network Mainnet", "name": "Ubiq Network Mainnet",
"chain": "UBQ", "chain": "UBQ",
"network": "mainnet", "network": "mainnet",
"rpc": ["https://pyrus2.ubiqscan.io"], "rpc": [
"https://pyrus2.ubiqscan.io"
],
"faucets": [], "faucets": [],
"nativeCurrency": { "nativeCurrency": {
"name": "Ubiq Ether", "name": "Ubiq Ether",

View File

@ -2,7 +2,9 @@
"name": "Callisto Mainnet", "name": "Callisto Mainnet",
"chain": "CLO", "chain": "CLO",
"network": "mainnet", "network": "mainnet",
"rpc": ["https://clo-geth.0xinfra.com"], "rpc": [
"https://clo-geth.0xinfra.com"
],
"faucets": [], "faucets": [],
"nativeCurrency": { "nativeCurrency": {
"name": "Callisto Mainnet Ether", "name": "Callisto Mainnet Ether",

View File

@ -2,7 +2,9 @@
"name": "TomoChain", "name": "TomoChain",
"chain": "TOMO", "chain": "TOMO",
"network": "mainnet", "network": "mainnet",
"rpc": ["https://core.tomocoin.io"], "rpc": [
"https://core.tomocoin.io"
],
"faucets": [], "faucets": [],
"nativeCurrency": { "nativeCurrency": {
"name": "TomoChain Ether", "name": "TomoChain Ether",

View File

@ -2,8 +2,13 @@
"name": "Nepal Blockchain Network", "name": "Nepal Blockchain Network",
"chain": "YETI", "chain": "YETI",
"network": "mainnet", "network": "mainnet",
"rpc": ["https://api.nepalblockchain.dev", "https://api.nepalblockchain.network"], "rpc": [
"faucets": ["https://faucet.nepalblockchain.network"], "https://api.nepalblockchain.dev",
"https://api.nepalblockchain.network"
],
"faucets": [
"https://faucet.nepalblockchain.network"
],
"nativeCurrency": { "nativeCurrency": {
"name": "Nepal Blockchain Network Ether", "name": "Nepal Blockchain Network Ether",
"symbol": "YETI", "symbol": "YETI",

View File

@ -2,7 +2,9 @@
"name": "POA Network Core", "name": "POA Network Core",
"chain": "POA", "chain": "POA",
"network": "core", "network": "core",
"rpc": ["https://core.poa.network"], "rpc": [
"https://core.poa.network"
],
"faucets": [], "faucets": [],
"nativeCurrency": { "nativeCurrency": {
"name": "POA Network Core Ether", "name": "POA Network Core Ether",

3
script/.eslintrc Normal file
View File

@ -0,0 +1,3 @@
{
"extends": "standard"
}

152
script/index.js Normal file
View File

@ -0,0 +1,152 @@
const fs = require('fs')
const path = require('path')
const axios = require('axios')
const BigNumber = require('bignumber.js')
require('dotenv').config()
const ROOT_DIRECTORY = path.join(__dirname, '../')
const CHAINS_DIRECTORY = path.join(ROOT_DIRECTORY, './_data/chains')
const NET_VERSION_REQ = {
id: 1,
jsonrpc: '2.0',
method: 'net_version',
params: []
}
const CHAIN_ID_REQ = {
id: 1,
jsonrpc: '2.0',
method: 'eth_chainId',
params: []
}
function formatRpcUrl (rpcUrl) {
return rpcUrl.replace(
'${INFURA_API_KEY}', // eslint-disable-line
process.env.INFURA_PROJECT_ID
)
}
async function writeJson (filePath, json) {
console.log('Overwriting', filePath)
return new Promise((resolve, reject) => {
const data = JSON.stringify(json, null, 2)
fs.writeFile(filePath, data, (err, res) => {
if (err) {
reject(err)
}
resolve(res)
})
})
}
async function rpcRequest (rpcUrl, body) {
const response = await axios.post(rpcUrl, body, {
timeout: 20000, // 20 secs
headers: {
Accept: 'application/json',
'Content-Type': 'application/json'
}
})
if (!response && !response.data) {
throw new Error('No Response Body')
}
if (response.data.error && response.data.error.message) {
throw new Error(response.data.error.message)
}
return response.data.result
}
function toNumber (value) {
const BN = new BigNumber(value)
let result = null
if (!BN.isNaN()) {
result = BN.toNumber()
}
return result
}
async function getNetworkId (rpcUrl) {
try {
rpcUrl = formatRpcUrl(rpcUrl)
const result = await rpcRequest(rpcUrl, NET_VERSION_REQ)
const networkId = toNumber(result)
return networkId
} catch (error) {
return null
}
}
async function getChainId (rpcUrl) {
try {
rpcUrl = formatRpcUrl(rpcUrl)
const result = await rpcRequest(rpcUrl, CHAIN_ID_REQ)
const chainId = toNumber(result)
return chainId
} catch (error) {
return null
}
}
fs.readdir(CHAINS_DIRECTORY, function (err, files) {
if (err) {
console.error('Could not list the directory.', err)
process.exit(1)
}
files.forEach(function (file, index) {
const filePath = path.join(CHAINS_DIRECTORY, file)
fs.stat(filePath, async function (error, stat) {
if (error) {
console.error('Error stating file.', error)
return
}
const ext = path.extname(file)
if (stat.isFile() && ext === '.json') {
const json = require(filePath)
console.log('Verifying file', file, 'through file name')
const fileName = file.replace(ext, '')
if (toNumber(fileName) !== toNumber(json.chainId)) {
console.log(`File ${file} chainId doesn't match file name`)
json.chainId = toNumber(fileName)
}
if (json.rpc && json.rpc.length) {
console.log('Verifying file', file, 'through rpc url')
try {
const chainIdArr = await Promise.all(
json.rpc.map(rpcUrl => getChainId(rpcUrl))
).filter(x => !!x)
const chainId =
chainIdArr && chainIdArr.length ? chainIdArr[0] : null
if (chainId && chainId !== toNumber(json.chainId)) {
console.log(`File ${file} chainId doesn't match rpc response`)
json.chainId = chainId
}
} catch (error) {
// do nothing
}
try {
const networkIdArr = await Promise.all(
json.rpc.map(rpcUrl => getNetworkId(rpcUrl))
).filter(x => !!x)
const networkId =
networkIdArr && networkIdArr.length ? networkIdArr[0] : null
if (networkId && networkId !== toNumber(json.networkId)) {
console.log(`File ${file} networkId doesn't match rpc response`)
json.networkId = networkId
}
} catch (error) {
// do nothing
}
}
await writeJson(filePath, json)
}
})
})
})

1492
script/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

25
script/package.json Normal file
View File

@ -0,0 +1,25 @@
{
"name": "script",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"axios": "^0.19.0",
"bignumber.js": "^9.0.0",
"dotenv": "^8.0.0"
},
"devDependencies": {
"eslint": "^5.16.0",
"eslint-config-standard": "^12.0.0",
"eslint-plugin-import": "^2.17.3",
"eslint-plugin-node": "^9.1.0",
"eslint-plugin-promise": "^4.1.1",
"eslint-plugin-standard": "^4.0.0"
}
}