From f435f9f193554d50f38cc2f0f98673a4f5f5ae57 Mon Sep 17 00:00:00 2001 From: bludnic Date: Thu, 25 Jan 2024 19:30:08 +0000 Subject: [PATCH 1/5] chore: upgrade `adamant-wallets` to v2.3.0 --- scripts/wallets.mjs | 1 - src/config/development.json | 273 +++++++++++------ src/config/production.json | 273 +++++++++++------ src/config/test.json | 273 +++++++++++------ src/config/tor.json | 198 +++++++++---- src/config/utils/nodes.ts | 2 +- src/config/utils/services.ts | 2 +- src/lib/constants/cryptos/data.json | 441 ++++++++++++++++------------ src/lib/eth-index.js | 2 +- src/lib/nodes/adm/index.ts | 4 +- src/lib/nodes/btc/index.ts | 2 +- src/lib/nodes/dash/index.ts | 2 +- src/lib/nodes/doge/index.ts | 2 +- src/lib/nodes/eth/index.ts | 2 +- src/lib/nodes/lsk-indexer/index.ts | 2 +- src/lib/nodes/lsk/index.ts | 2 +- src/types/wallets/index.ts | 83 +++++- 17 files changed, 1017 insertions(+), 547 deletions(-) diff --git a/scripts/wallets.mjs b/scripts/wallets.mjs index 5fb277054..507ebc859 100644 --- a/scripts/wallets.mjs +++ b/scripts/wallets.mjs @@ -166,7 +166,6 @@ async function updateConfig(configs, configName) { configFile[configKey].explorer = config.explorer configFile[configKey].explorerTx = config.explorerTx configFile[configKey].explorerAddress = config.explorerAddress - configFile[configKey].minNodeVersion = config.minNodeVersion configFile[configKey].nodes = config.nodes configFile[configKey].services = config.services } diff --git a/src/config/development.json b/src/config/development.json index 3bc1d7f87..20d6a7cd1 100644 --- a/src/config/development.json +++ b/src/config/development.json @@ -1,136 +1,219 @@ { "adm": { "explorerTx": "https://explorer.adamant.im/tx/${ID}", - "minNodeVersion": "0.8.0", - "nodes": [ - { - "url": "https://clown.adamant.im" - }, - { - "url": "https://lake.adamant.im" - }, - { - "url": "https://endless.adamant.im", - "alt_ip": "http://149.102.157.15:36666" - }, - { - "url": "https://bid.adamant.im" - }, - { - "url": "https://unusual.adamant.im" - }, - { - "url": "https://debate.adamant.im", - "alt_ip": "http://95.216.161.113:36666" - }, - { - "url": "http://78.47.205.206:36666" - }, - { - "url": "http://5.161.53.74:36666" - }, - { - "url": "http://184.94.215.92:45555" - }, - { - "url": "https://node1.adamant.business", - "alt_ip": "http://194.233.75.29:45555" + "nodes": { + "list": [ + { + "url": "https://clown.adamant.im" + }, + { + "url": "https://lake.adamant.im" + }, + { + "url": "https://endless.adamant.im", + "alt_ip": "http://149.102.157.15:36666" + }, + { + "url": "https://bid.adamant.im" + }, + { + "url": "https://unusual.adamant.im" + }, + { + "url": "https://debate.adamant.im", + "alt_ip": "http://95.216.161.113:36666" + }, + { + "url": "http://78.47.205.206:36666" + }, + { + "url": "http://5.161.53.74:36666" + }, + { + "url": "http://184.94.215.92:45555" + }, + { + "url": "https://node1.adamant.business", + "alt_ip": "http://194.233.75.29:45555" + }, + { + "url": "https://node2.blockchain2fa.io" + }, + { + "url": "https://sunshine.adamant.im" + } + ], + "healthCheck": { + "normalUpdateInterval": 300000, + "crucialUpdateInterval": 30000, + "onScreenUpdateInterval": 10000, + "threshold": 10 }, - { - "url": "https://node2.blockchain2fa.io" + "minVersion": "0.8.0" + }, + "services": { + "list": { + "infoService": [ + { + "url": "https://info.adamant.im", + "alt_ip": "http://88.198.156.44:44099" + } + ] }, - { - "url": "https://sunshine.adamant.im" + "healthCheck": { + "normalUpdateInterval": 300000, + "crucialUpdateInterval": 300000, + "onScreenUpdateInterval": 300000 } - ], - "services": { - "infoService": [ - { - "url": "https://info.adamant.im", - "alt_ip": "http://88.198.156.44:44099" - } - ] }, "explorer": "https://explorer.adamant.im", "explorerAddress": "https://explorer.adamant.im/address/${ID}" }, "btc": { "explorerTx": "https://explorer.btc.com/btc/transaction/${ID}", - "nodes": [ - { - "url": "https://btcnode1.adamant.im", - "alt_ip": "http://176.9.38.204:44099" - }, - { - "url": "https://btcnode2.adamant.im", - "alt_ip": "http://176.9.32.126:44099" + "nodes": { + "list": [ + { + "url": "https://btcnode1.adamant.im", + "alt_ip": "http://176.9.38.204:44099" + }, + { + "url": "https://btcnode2.adamant.im", + "alt_ip": "http://176.9.32.126:44099" + } + ], + "healthCheck": { + "normalUpdateInterval": 360000, + "crucialUpdateInterval": 30000, + "onScreenUpdateInterval": 10000, + "threshold": 2 } - ], + }, "explorer": "https://explorer.btc.com", "explorerAddress": "https://explorer.btc.com/btc/address/${ID}" }, "dash": { "explorerTx": "https://dashblockexplorer.com/tx/${ID}", - "nodes": [ - { - "url": "https://dashnode1.adamant.im", - "alt_ip": "http://45.85.147.224:44099" - }, - { - "url": "https://dashnode2.adamant.im", - "alt_ip": "http://207.180.210.95:44099" + "nodes": { + "list": [ + { + "url": "https://dashnode1.adamant.im", + "alt_ip": "http://45.85.147.224:44099" + }, + { + "url": "https://dashnode2.adamant.im", + "alt_ip": "http://207.180.210.95:44099" + } + ], + "healthCheck": { + "normalUpdateInterval": 210000, + "crucialUpdateInterval": 30000, + "onScreenUpdateInterval": 10000, + "threshold": 3 } - ], + }, "explorer": "https://dashblockexplorer.com", "explorerAddress": "https://dashblockexplorer.com/address/${ID}" }, "doge": { "explorerTx": "https://dogechain.info/tx/${ID}", - "nodes": [ - { - "url": "https://dogenode1.adamant.im", - "alt_ip": "http://5.9.99.62:44099" - }, - { - "url": "https://dogenode2.adamant.im", - "alt_ip": "http://176.9.32.126:44098" + "nodes": { + "list": [ + { + "url": "https://dogenode1.adamant.im", + "alt_ip": "http://5.9.99.62:44099" + }, + { + "url": "https://dogenode2.adamant.im", + "alt_ip": "http://176.9.32.126:44098" + } + ], + "healthCheck": { + "normalUpdateInterval": 390000, + "crucialUpdateInterval": 30000, + "onScreenUpdateInterval": 10000, + "threshold": 3 } - ], + }, "explorer": "https://dogechain.info", "explorerAddress": "https://dogechain.info/address/${ID}" }, "eth": { "explorerTx": "https://etherscan.io/tx/${ID}", - "nodes": [ - { - "url": "https://ethnode1.adamant.im", - "alt_ip": "http://95.216.41.106:44099", - "hasIndex": true - }, - { - "url": "https://ethnode2.adamant.im", - "alt_ip": "http://95.216.114.252:44099", - "hasIndex": true + "nodes": { + "list": [ + { + "url": "https://ethnode1.adamant.im", + "alt_ip": "http://95.216.41.106:44099", + "hasIndex": true + }, + { + "url": "https://ethnode2.adamant.im", + "alt_ip": "http://95.216.114.252:44099", + "hasIndex": true + }, + { + "url": "https://ethnode3.adamant.im", + "alt_ip": "http://46.4.37.157:44099", + "hasIndex": true + } + ], + "healthCheck": { + "normalUpdateInterval": 300000, + "crucialUpdateInterval": 30000, + "onScreenUpdateInterval": 10000, + "threshold": 5 } - ], + }, "explorer": "https://etherscan.io", "explorerAddress": "https://etherscan.io/address/${ID}" }, "lsk": { "explorerTx": "https://liskscan.com/transaction/${ID}", - "nodes": [ - { - "url": "https://lisknode5.adamant.im", - "alt_ip": "http://38.242.243.29:44099" - } - ], - "services": { - "lskService": [ + "nodes": { + "list": [ { - "url": "https://liskservice5.adamant.im", - "alt_ip": "http://38.242.243.29:44098" + "url": "https://lisknode3.adamant.im", + "alt_ip": "http://157.90.229.236:44099" + }, + { + "url": "https://lisknode4.adamant.im", + "alt_ip": "http://78.47.205.206:44099" + }, + { + "url": "https://lisknode5.adamant.im", + "alt_ip": "http://38.242.243.29:44099" } - ] + ], + "healthCheck": { + "normalUpdateInterval": 270000, + "crucialUpdateInterval": 30000, + "onScreenUpdateInterval": 10000, + "threshold": 5 + } + }, + "services": { + "list": { + "lskService": [ + { + "url": "https://liskservice3.adamant.im", + "alt_ip": "http://157.90.229.236:44098" + }, + { + "url": "https://liskservice4.adamant.im", + "alt_ip": "http://78.47.205.206:44098" + }, + { + "url": "https://liskservice5.adamant.im", + "alt_ip": "http://38.242.243.29:44098" + } + ] + }, + "healthCheck": { + "normalUpdateInterval": 330000, + "crucialUpdateInterval": 30000, + "onScreenUpdateInterval": 10000 + } }, "explorer": "https://liskscan.com", "explorerAddress": "https://liskscan.com/account/${ID}" diff --git a/src/config/production.json b/src/config/production.json index a4255fe34..4bfc5631a 100644 --- a/src/config/production.json +++ b/src/config/production.json @@ -1,136 +1,219 @@ { "adm": { - "minNodeVersion": "0.8.0", - "nodes": [ - { - "url": "https://clown.adamant.im" - }, - { - "url": "https://lake.adamant.im" - }, - { - "url": "https://endless.adamant.im", - "alt_ip": "http://149.102.157.15:36666" - }, - { - "url": "https://bid.adamant.im" - }, - { - "url": "https://unusual.adamant.im" - }, - { - "url": "https://debate.adamant.im", - "alt_ip": "http://95.216.161.113:36666" - }, - { - "url": "http://78.47.205.206:36666" - }, - { - "url": "http://5.161.53.74:36666" - }, - { - "url": "http://184.94.215.92:45555" - }, - { - "url": "https://node1.adamant.business", - "alt_ip": "http://194.233.75.29:45555" + "nodes": { + "list": [ + { + "url": "https://clown.adamant.im" + }, + { + "url": "https://lake.adamant.im" + }, + { + "url": "https://endless.adamant.im", + "alt_ip": "http://149.102.157.15:36666" + }, + { + "url": "https://bid.adamant.im" + }, + { + "url": "https://unusual.adamant.im" + }, + { + "url": "https://debate.adamant.im", + "alt_ip": "http://95.216.161.113:36666" + }, + { + "url": "http://78.47.205.206:36666" + }, + { + "url": "http://5.161.53.74:36666" + }, + { + "url": "http://184.94.215.92:45555" + }, + { + "url": "https://node1.adamant.business", + "alt_ip": "http://194.233.75.29:45555" + }, + { + "url": "https://node2.blockchain2fa.io" + }, + { + "url": "https://sunshine.adamant.im" + } + ], + "healthCheck": { + "normalUpdateInterval": 300000, + "crucialUpdateInterval": 30000, + "onScreenUpdateInterval": 10000, + "threshold": 10 }, - { - "url": "https://node2.blockchain2fa.io" + "minVersion": "0.8.0" + }, + "services": { + "list": { + "infoService": [ + { + "url": "https://info.adamant.im", + "alt_ip": "http://88.198.156.44:44099" + } + ] }, - { - "url": "https://sunshine.adamant.im" + "healthCheck": { + "normalUpdateInterval": 300000, + "crucialUpdateInterval": 300000, + "onScreenUpdateInterval": 300000 } - ], - "services": { - "infoService": [ - { - "url": "https://info.adamant.im", - "alt_ip": "http://88.198.156.44:44099" - } - ] }, "explorerTx": "https://explorer.adamant.im/tx/${ID}", "explorer": "https://explorer.adamant.im", "explorerAddress": "https://explorer.adamant.im/address/${ID}" }, "btc": { - "nodes": [ - { - "url": "https://btcnode1.adamant.im", - "alt_ip": "http://176.9.38.204:44099" - }, - { - "url": "https://btcnode2.adamant.im", - "alt_ip": "http://176.9.32.126:44099" + "nodes": { + "list": [ + { + "url": "https://btcnode1.adamant.im", + "alt_ip": "http://176.9.38.204:44099" + }, + { + "url": "https://btcnode2.adamant.im", + "alt_ip": "http://176.9.32.126:44099" + } + ], + "healthCheck": { + "normalUpdateInterval": 360000, + "crucialUpdateInterval": 30000, + "onScreenUpdateInterval": 10000, + "threshold": 2 } - ], + }, "explorerTx": "https://explorer.btc.com/btc/transaction/${ID}", "explorer": "https://explorer.btc.com", "explorerAddress": "https://explorer.btc.com/btc/address/${ID}" }, "dash": { - "nodes": [ - { - "url": "https://dashnode1.adamant.im", - "alt_ip": "http://45.85.147.224:44099" - }, - { - "url": "https://dashnode2.adamant.im", - "alt_ip": "http://207.180.210.95:44099" + "nodes": { + "list": [ + { + "url": "https://dashnode1.adamant.im", + "alt_ip": "http://45.85.147.224:44099" + }, + { + "url": "https://dashnode2.adamant.im", + "alt_ip": "http://207.180.210.95:44099" + } + ], + "healthCheck": { + "normalUpdateInterval": 210000, + "crucialUpdateInterval": 30000, + "onScreenUpdateInterval": 10000, + "threshold": 3 } - ], + }, "explorerTx": "https://dashblockexplorer.com/tx/${ID}", "explorer": "https://dashblockexplorer.com", "explorerAddress": "https://dashblockexplorer.com/address/${ID}" }, "doge": { - "nodes": [ - { - "url": "https://dogenode1.adamant.im", - "alt_ip": "http://5.9.99.62:44099" - }, - { - "url": "https://dogenode2.adamant.im", - "alt_ip": "http://176.9.32.126:44098" + "nodes": { + "list": [ + { + "url": "https://dogenode1.adamant.im", + "alt_ip": "http://5.9.99.62:44099" + }, + { + "url": "https://dogenode2.adamant.im", + "alt_ip": "http://176.9.32.126:44098" + } + ], + "healthCheck": { + "normalUpdateInterval": 390000, + "crucialUpdateInterval": 30000, + "onScreenUpdateInterval": 10000, + "threshold": 3 } - ], + }, "explorerTx": "https://dogechain.info/tx/${ID}", "explorer": "https://dogechain.info", "explorerAddress": "https://dogechain.info/address/${ID}" }, "eth": { - "nodes": [ - { - "url": "https://ethnode1.adamant.im", - "alt_ip": "http://95.216.41.106:44099", - "hasIndex": true - }, - { - "url": "https://ethnode2.adamant.im", - "alt_ip": "http://95.216.114.252:44099", - "hasIndex": true + "nodes": { + "list": [ + { + "url": "https://ethnode1.adamant.im", + "alt_ip": "http://95.216.41.106:44099", + "hasIndex": true + }, + { + "url": "https://ethnode2.adamant.im", + "alt_ip": "http://95.216.114.252:44099", + "hasIndex": true + }, + { + "url": "https://ethnode3.adamant.im", + "alt_ip": "http://46.4.37.157:44099", + "hasIndex": true + } + ], + "healthCheck": { + "normalUpdateInterval": 300000, + "crucialUpdateInterval": 30000, + "onScreenUpdateInterval": 10000, + "threshold": 5 } - ], + }, "explorerTx": "https://etherscan.io/tx/${ID}", "explorer": "https://etherscan.io", "explorerAddress": "https://etherscan.io/address/${ID}" }, "lsk": { - "nodes": [ - { - "url": "https://lisknode5.adamant.im", - "alt_ip": "http://38.242.243.29:44099" + "nodes": { + "list": [ + { + "url": "https://lisknode3.adamant.im", + "alt_ip": "http://157.90.229.236:44099" + }, + { + "url": "https://lisknode4.adamant.im", + "alt_ip": "http://78.47.205.206:44099" + }, + { + "url": "https://lisknode5.adamant.im", + "alt_ip": "http://38.242.243.29:44099" + } + ], + "healthCheck": { + "normalUpdateInterval": 270000, + "crucialUpdateInterval": 30000, + "onScreenUpdateInterval": 10000, + "threshold": 5 } - ], + }, "explorerTx": "https://liskscan.com/transaction/${ID}", "services": { - "lskService": [ - { - "url": "https://liskservice5.adamant.im", - "alt_ip": "http://38.242.243.29:44098" - } - ] + "list": { + "lskService": [ + { + "url": "https://liskservice3.adamant.im", + "alt_ip": "http://157.90.229.236:44098" + }, + { + "url": "https://liskservice4.adamant.im", + "alt_ip": "http://78.47.205.206:44098" + }, + { + "url": "https://liskservice5.adamant.im", + "alt_ip": "http://38.242.243.29:44098" + } + ] + }, + "healthCheck": { + "normalUpdateInterval": 330000, + "crucialUpdateInterval": 30000, + "onScreenUpdateInterval": 10000 + } }, "explorer": "https://liskscan.com", "explorerAddress": "https://liskscan.com/account/${ID}" diff --git a/src/config/test.json b/src/config/test.json index 976551ef5..d880b162f 100644 --- a/src/config/test.json +++ b/src/config/test.json @@ -1,130 +1,219 @@ { "adm": { - "minNodeVersion": "0.7.0", - "nodes": [ - { - "url": "https://clown.adamant.im" - }, - { - "url": "https://lake.adamant.im" - }, - { - "url": "https://endless.adamant.im", - "alt_ip": "http://149.102.157.15:36666" - }, - { - "url": "https://bid.adamant.im" - }, - { - "url": "https://unusual.adamant.im" - }, - { - "url": "https://debate.adamant.im", - "alt_ip": "http://95.216.161.113:36666" - }, - { - "url": "http://78.47.205.206:36666" - }, - { - "url": "http://5.161.53.74:36666" - }, - { - "url": "http://184.94.215.92:45555" + "explorerTx": "https://explorer.adamant.im/tx/${ID}", + "nodes": { + "list": [ + { + "url": "https://clown.adamant.im" + }, + { + "url": "https://lake.adamant.im" + }, + { + "url": "https://endless.adamant.im", + "alt_ip": "http://149.102.157.15:36666" + }, + { + "url": "https://bid.adamant.im" + }, + { + "url": "https://unusual.adamant.im" + }, + { + "url": "https://debate.adamant.im", + "alt_ip": "http://95.216.161.113:36666" + }, + { + "url": "http://78.47.205.206:36666" + }, + { + "url": "http://5.161.53.74:36666" + }, + { + "url": "http://184.94.215.92:45555" + }, + { + "url": "https://node1.adamant.business", + "alt_ip": "http://194.233.75.29:45555" + }, + { + "url": "https://node2.blockchain2fa.io" + }, + { + "url": "https://sunshine.adamant.im" + } + ], + "healthCheck": { + "normalUpdateInterval": 300000, + "crucialUpdateInterval": 30000, + "onScreenUpdateInterval": 10000, + "threshold": 10 }, - { - "url": "https://node1.adamant.business" + "minVersion": "0.8.0" + }, + "services": { + "list": { + "infoService": [ + { + "url": "https://info.adamant.im", + "alt_ip": "http://88.198.156.44:44099" + } + ] }, - { - "url": "https://node2.blockchain2fa.io" + "healthCheck": { + "normalUpdateInterval": 300000, + "crucialUpdateInterval": 300000, + "onScreenUpdateInterval": 300000 } - ], - "services": { - "infoService": [ - { - "url": "https://info.adamant.im", - "alt_ip": "http://88.198.156.44:80" - } - ] }, - "explorerTx": "https://explorer.adamant.im/tx/${ID}", "explorer": "https://explorer.adamant.im", "explorerAddress": "https://explorer.adamant.im/address/${ID}" }, "btc": { - "nodes": [ - { - "url": "https://btcnode1.adamant.im", - "alt_ip": "http://176.9.38.204:44099" - }, - { - "url": "https://btcnode2.adamant.im", - "alt_ip": "http://176.9.32.126:44099" - } - ], "explorerTx": "https://explorer.btc.com/btc/transaction/${ID}", + "nodes": { + "list": [ + { + "url": "https://btcnode1.adamant.im", + "alt_ip": "http://176.9.38.204:44099" + }, + { + "url": "https://btcnode2.adamant.im", + "alt_ip": "http://176.9.32.126:44099" + } + ], + "healthCheck": { + "normalUpdateInterval": 360000, + "crucialUpdateInterval": 30000, + "onScreenUpdateInterval": 10000, + "threshold": 2 + } + }, "explorer": "https://explorer.btc.com", "explorerAddress": "https://explorer.btc.com/btc/address/${ID}" }, "dash": { - "nodes": [ - { - "url": "https://dashnode1.adamant.im" - } - ], "explorerTx": "https://dashblockexplorer.com/tx/${ID}", + "nodes": { + "list": [ + { + "url": "https://dashnode1.adamant.im", + "alt_ip": "http://45.85.147.224:44099" + }, + { + "url": "https://dashnode2.adamant.im", + "alt_ip": "http://207.180.210.95:44099" + } + ], + "healthCheck": { + "normalUpdateInterval": 210000, + "crucialUpdateInterval": 30000, + "onScreenUpdateInterval": 10000, + "threshold": 3 + } + }, "explorer": "https://dashblockexplorer.com", "explorerAddress": "https://dashblockexplorer.com/address/${ID}" }, "doge": { - "nodes": [ - { - "url": "https://dogenode1.adamant.im" - }, - { - "url": "https://dogenode2.adamant.im", - "alt_ip": "http://176.9.32.126:44098" - } - ], "explorerTx": "https://dogechain.info/tx/${ID}", + "nodes": { + "list": [ + { + "url": "https://dogenode1.adamant.im", + "alt_ip": "http://5.9.99.62:44099" + }, + { + "url": "https://dogenode2.adamant.im", + "alt_ip": "http://176.9.32.126:44098" + } + ], + "healthCheck": { + "normalUpdateInterval": 390000, + "crucialUpdateInterval": 30000, + "onScreenUpdateInterval": 10000, + "threshold": 3 + } + }, "explorer": "https://dogechain.info", "explorerAddress": "https://dogechain.info/address/${ID}" }, "eth": { - "nodes": [ - { - "url": "https://ethnode1.adamant.im", - "alt_ip": "http://95.216.41.106:44099", - "hasIndex": true - }, - { - "url": "https://ethnode2.adamant.im", - "alt_ip": "http://95.216.114.252:44099", - "hasIndex": true - } - ], "explorerTx": "https://etherscan.io/tx/${ID}", + "nodes": { + "list": [ + { + "url": "https://ethnode1.adamant.im", + "alt_ip": "http://95.216.41.106:44099", + "hasIndex": true + }, + { + "url": "https://ethnode2.adamant.im", + "alt_ip": "http://95.216.114.252:44099", + "hasIndex": true + }, + { + "url": "https://ethnode3.adamant.im", + "alt_ip": "http://46.4.37.157:44099", + "hasIndex": true + } + ], + "healthCheck": { + "normalUpdateInterval": 300000, + "crucialUpdateInterval": 30000, + "onScreenUpdateInterval": 10000, + "threshold": 5 + } + }, "explorer": "https://etherscan.io", "explorerAddress": "https://etherscan.io/address/${ID}" }, "lsk": { - "nodes": [ - { - "url": "https://lisknode3.adamant.im" - }, - { - "url": "https://lisknode4.adamant.im" - } - ], "explorerTx": "https://liskscan.com/transaction/${ID}", - "services": { - "lskService": [ + "nodes": { + "list": [ + { + "url": "https://lisknode3.adamant.im", + "alt_ip": "http://157.90.229.236:44099" + }, { - "url": "https://liskservice3.adamant.im" + "url": "https://lisknode4.adamant.im", + "alt_ip": "http://78.47.205.206:44099" }, { - "url": "https://liskservice4.adamant.im" + "url": "https://lisknode5.adamant.im", + "alt_ip": "http://38.242.243.29:44099" } - ] + ], + "healthCheck": { + "normalUpdateInterval": 270000, + "crucialUpdateInterval": 30000, + "onScreenUpdateInterval": 10000, + "threshold": 5 + } + }, + "services": { + "list": { + "lskService": [ + { + "url": "https://liskservice3.adamant.im", + "alt_ip": "http://157.90.229.236:44098" + }, + { + "url": "https://liskservice4.adamant.im", + "alt_ip": "http://78.47.205.206:44098" + }, + { + "url": "https://liskservice5.adamant.im", + "alt_ip": "http://38.242.243.29:44098" + } + ] + }, + "healthCheck": { + "normalUpdateInterval": 330000, + "crucialUpdateInterval": 30000, + "onScreenUpdateInterval": 10000 + } }, "explorer": "https://liskscan.com", "explorerAddress": "https://liskscan.com/account/${ID}" diff --git a/src/config/tor.json b/src/config/tor.json index fe67a6427..4d456b4ac 100644 --- a/src/config/tor.json +++ b/src/config/tor.json @@ -1,101 +1,179 @@ { "adm": { - "minNodeVersion": "0.8.0", - "nodes": [ - { - "url": "http://37g5to2z6bdoeegun4hms2hvkfbdxh4rcon4e3p267wtfkh4ji2ns6id.onion" - }, - { - "url": "http://fqjcvsibnbwhlwxndzqzziapiwoidgn24avfiauu4wo2fc3yyiy2qcid.onion" - }, - { - "url": "http://omhrhpc45njpgzp4fggtndazaodwuwvb5in6hsn3k7tvaqennmfaa2qd.onion" + "nodes": { + "list": [ + { + "url": "http://37g5to2z6bdoeegun4hms2hvkfbdxh4rcon4e3p267wtfkh4ji2ns6id.onion" + }, + { + "url": "http://fqjcvsibnbwhlwxndzqzziapiwoidgn24avfiauu4wo2fc3yyiy2qcid.onion" + }, + { + "url": "http://omhrhpc45njpgzp4fggtndazaodwuwvb5in6hsn3k7tvaqennmfaa2qd.onion" + }, + { + "url": "http://uxu6vnnrrnl7tmo7i657yvs4jbgdz734xvufryoi326az5dzufuwboad.onion" + }, + { + "url": "http://rukehjd2yalzgny7mdjqtzown2mazsaeh4zr7zjdg4l5afkgc3z2kgqd.onion" + } + ], + "healthCheck": { + "normalUpdateInterval": 300000, + "crucialUpdateInterval": 30000, + "onScreenUpdateInterval": 10000, + "threshold": 10 }, - { - "url": "http://uxu6vnnrrnl7tmo7i657yvs4jbgdz734xvufryoi326az5dzufuwboad.onion" + "minVersion": "0.8.0" + }, + "services": { + "list": { + "infoService": [ + { + "url": "http://czjsawp2crjmnkliw2h2kpk7wwd3a36zvvnvqgvzmi4t4vc2yzm7j2qd.onion" + } + ] }, - { - "url": "http://rukehjd2yalzgny7mdjqtzown2mazsaeh4zr7zjdg4l5afkgc3z2kgqd.onion" + "healthCheck": { + "normalUpdateInterval": 300000, + "crucialUpdateInterval": 300000, + "onScreenUpdateInterval": 300000 } - ], - "services": { - "infoService": [ - { - "url": "http://czjsawp2crjmnkliw2h2kpk7wwd3a36zvvnvqgvzmi4t4vc2yzm7j2qd.onion" - } - ] }, "explorerTx": "http://srovpmanmrbmbqe63vp5nycsa3j3g6be3bz46ksmo35u5pw7jjtjamid.onion/tx/${ID}", "explorer": "http://srovpmanmrbmbqe63vp5nycsa3j3g6be3bz46ksmo35u5pw7jjtjamid.onion", "explorerAddress": "http://srovpmanmrbmbqe63vp5nycsa3j3g6be3bz46ksmo35u5pw7jjtjamid.onion/address/${ID}" }, "btc": { - "nodes": [ - { - "url": "http://cc6ibzkfeseuwnmtjc6hlsd44bzg2sr3shbv7n35nj2rk2vm6dmtlnqd.onion" - }, - { - "url": "http://mgplh7en3d6ywsec5h6q3tc6mirsleb5cmlyn6nmp25qrb6gy35nypad.onion" + "nodes": { + "list": [ + { + "url": "http://cc6ibzkfeseuwnmtjc6hlsd44bzg2sr3shbv7n35nj2rk2vm6dmtlnqd.onion" + }, + { + "url": "http://mgplh7en3d6ywsec5h6q3tc6mirsleb5cmlyn6nmp25qrb6gy35nypad.onion" + } + ], + "healthCheck": { + "normalUpdateInterval": 360000, + "crucialUpdateInterval": 30000, + "onScreenUpdateInterval": 10000, + "threshold": 2 } - ], + }, "explorerTx": "https://explorer.btc.com/btc/transaction/${ID}", "explorer": "https://explorer.btc.com", "explorerAddress": "https://explorer.btc.com/btc/address/${ID}" }, "dash": { - "nodes": [ - { - "url": "http://ldod53womnlwjmd4noq5yuq26xx3mmbrr4uogkfymuakhofjcuqeygad.onion" - }, - { - "url": "http://eq2blda45h4kakbuq3g4stcgatiwqaefgmxzfsfuiahpdbt2pvbbepad.onion" + "nodes": { + "list": [ + { + "url": "http://ldod53womnlwjmd4noq5yuq26xx3mmbrr4uogkfymuakhofjcuqeygad.onion" + }, + { + "url": "http://eq2blda45h4kakbuq3g4stcgatiwqaefgmxzfsfuiahpdbt2pvbbepad.onion" + } + ], + "healthCheck": { + "normalUpdateInterval": 210000, + "crucialUpdateInterval": 30000, + "onScreenUpdateInterval": 10000, + "threshold": 3 } - ], + }, "explorerTx": "https://dashblockexplorer.com/tx/${ID}", "explorer": "https://dashblockexplorer.com", "explorerAddress": "https://dashblockexplorer.com/address/${ID}" }, "doge": { - "nodes": [ - { - "url": "http://mtg4mq43p67cbj6qwcqgppjv7uzm7ximjlzapsbnbh5ls6zqkjsq26ad.onion" - }, - { - "url": "http://bfu3iiofsagyhi22zijfilbkzlzbalpylhhfcluqmezx2avdwcxut7yd.onion" + "nodes": { + "list": [ + { + "url": "http://mtg4mq43p67cbj6qwcqgppjv7uzm7ximjlzapsbnbh5ls6zqkjsq26ad.onion" + }, + { + "url": "http://bfu3iiofsagyhi22zijfilbkzlzbalpylhhfcluqmezx2avdwcxut7yd.onion" + } + ], + "healthCheck": { + "normalUpdateInterval": 390000, + "crucialUpdateInterval": 30000, + "onScreenUpdateInterval": 10000, + "threshold": 3 } - ], + }, "explorerTx": "https://dogechain.info/tx/${ID}", "explorer": "https://dogechain.info", "explorerAddress": "https://dogechain.info/address/${ID}" }, "eth": { - "nodes": [ - { - "url": "http://vj3qid4h2d4cj2gexivjuuybah3mjzenpdyr5bj6z4hctp52jn6qsgid.onion", - "hasIndex": true - }, - { - "url": "http://jpbrp6xapsyfnvyosrpu5wmoi62fqotazkicjeiob32yz77rt7axobqd.onion", - "hasIndex": true + "nodes": { + "list": [ + { + "url": "http://vj3qid4h2d4cj2gexivjuuybah3mjzenpdyr5bj6z4hctp52jn6qsgid.onion", + "hasIndex": true + }, + { + "url": "http://jpbrp6xapsyfnvyosrpu5wmoi62fqotazkicjeiob32yz77rt7axobqd.onion", + "hasIndex": true + }, + { + "url": "http://rekynxikhumzsme7phumocz3mquy7y3onkw33skmvk2akjkin2iopqqd.onion", + "hasIndex": true + } + ], + "healthCheck": { + "normalUpdateInterval": 300000, + "crucialUpdateInterval": 30000, + "onScreenUpdateInterval": 10000, + "threshold": 5 } - ], + }, "explorerTx": "https://etherscan.io/tx/${ID}", "explorer": "https://etherscan.io", "explorerAddress": "https://etherscan.io/address/${ID}" }, "lsk": { - "nodes": [ - { - "url": "http://4bsg7dijnpkiu6wylaad5fiom4iep73oz3o2rojkwnuteaawd2w3o2ad.onion" + "nodes": { + "list": [ + { + "url": "http://nl2c4vcsdrd6je3ebt4236yst55mbso72ojmksrmlyoikapgnu647tid.onion" + }, + { + "url": "http://qpjxvkathebm7oso3dk5hb4cggbeecqvcpcthuxlpovtn66plr6f4wyd.onion" + }, + { + "url": "http://4bsg7dijnpkiu6wylaad5fiom4iep73oz3o2rojkwnuteaawd2w3o2ad.onion" + } + ], + "healthCheck": { + "normalUpdateInterval": 270000, + "crucialUpdateInterval": 30000, + "onScreenUpdateInterval": 10000, + "threshold": 5 } - ], + }, "explorerTx": "https://liskscan.com/transaction/${ID}", "services": { - "lskService": [ - { - "url": "http://cf6vf6xylvhza3t3ewffa7cmr2bqgaus5jwghiktjleids5ovdhoazad.onion" - } - ] + "list": { + "lskService": [ + { + "url": "http://xqrymra5go2nb3cslb3c3iv4weeuicybcxpjee4ay2indk2hgo7rw4qd.onion" + }, + { + "url": "http://s2q6phc22icy73zjccjq66555gwtvyuyrodmadwhjdhmvyehb3qrcsid.onion" + }, + { + "url": "http://cf6vf6xylvhza3t3ewffa7cmr2bqgaus5jwghiktjleids5ovdhoazad.onion" + } + ] + }, + "healthCheck": { + "normalUpdateInterval": 330000, + "crucialUpdateInterval": 30000, + "onScreenUpdateInterval": 10000 + } }, "explorer": "https://liskscan.com", "explorerAddress": "https://liskscan.com/account/${ID}" diff --git a/src/config/utils/nodes.ts b/src/config/utils/nodes.ts index e4e7ca02f..70a7318d8 100644 --- a/src/config/utils/nodes.ts +++ b/src/config/utils/nodes.ts @@ -3,7 +3,7 @@ import { BlockchainSymbol } from './types' import config from '../index' export function getNodes(blockchain: BlockchainSymbol): NodeInfo[] { - const nodes = config[blockchain]['nodes'] + const nodes = config[blockchain]['nodes']['list'] return nodes } diff --git a/src/config/utils/services.ts b/src/config/utils/services.ts index 70fad9287..6b4d1fe58 100644 --- a/src/config/utils/services.ts +++ b/src/config/utils/services.ts @@ -15,7 +15,7 @@ export function getService const blockchainConfig = config[blockchain] if ('services' in blockchainConfig) { - const services = blockchainConfig['services'] + const services = blockchainConfig['services']['list'] const service = services[serviceName] if (service) { diff --git a/src/lib/constants/cryptos/data.json b/src/lib/constants/cryptos/data.json index 188670b02..e291aeb8a 100644 --- a/src/lib/constants/cryptos/data.json +++ b/src/lib/constants/cryptos/data.json @@ -6,47 +6,56 @@ "qrPrefix": "adm", "regexAddress": "^U([0-9]{6,21})$", "decimals": 8, - "nodes": [ - { - "url": "https://clown.adamant.im" + "nodes": { + "list": [ + { + "url": "https://clown.adamant.im" + }, + { + "url": "https://lake.adamant.im" + }, + { + "url": "https://endless.adamant.im", + "alt_ip": "http://149.102.157.15:36666" + }, + { + "url": "https://bid.adamant.im" + }, + { + "url": "https://unusual.adamant.im" + }, + { + "url": "https://debate.adamant.im", + "alt_ip": "http://95.216.161.113:36666" + }, + { + "url": "http://78.47.205.206:36666" + }, + { + "url": "http://5.161.53.74:36666" + }, + { + "url": "http://184.94.215.92:45555" + }, + { + "url": "https://node1.adamant.business", + "alt_ip": "http://194.233.75.29:45555" + }, + { + "url": "https://node2.blockchain2fa.io" + }, + { + "url": "https://sunshine.adamant.im" + } + ], + "healthCheck": { + "normalUpdateInterval": 300000, + "crucialUpdateInterval": 30000, + "onScreenUpdateInterval": 10000, + "threshold": 10 }, - { - "url": "https://lake.adamant.im" - }, - { - "url": "https://endless.adamant.im", - "alt_ip": "http://149.102.157.15:36666" - }, - { - "url": "https://bid.adamant.im" - }, - { - "url": "https://unusual.adamant.im" - }, - { - "url": "https://debate.adamant.im", - "alt_ip": "http://95.216.161.113:36666" - }, - { - "url": "http://78.47.205.206:36666" - }, - { - "url": "http://5.161.53.74:36666" - }, - { - "url": "http://184.94.215.92:45555" - }, - { - "url": "https://node1.adamant.business", - "alt_ip": "http://194.233.75.29:45555" - }, - { - "url": "https://node2.blockchain2fa.io" - }, - { - "url": "https://sunshine.adamant.im" - } - ], + "minVersion": "0.8.0" + }, "createCoin": true, "cryptoTransferDecimals": 8, "fixedFee": 0.5, @@ -67,16 +76,24 @@ "regexAddress": "^bc1[a-zA-Z0-9]{39,59}$|^[13][1-9A-HJ-NP-Za-km-z]{25,34}$", "decimals": 8, "minTransferAmount": 0.00000546, - "nodes": [ - { - "url": "https://btcnode1.adamant.im", - "alt_ip": "http://176.9.38.204:44099" - }, - { - "url": "https://btcnode2.adamant.im", - "alt_ip": "http://176.9.32.126:44099" + "nodes": { + "list": [ + { + "url": "https://btcnode1.adamant.im", + "alt_ip": "http://176.9.38.204:44099" + }, + { + "url": "https://btcnode2.adamant.im", + "alt_ip": "http://176.9.32.126:44099" + } + ], + "healthCheck": { + "normalUpdateInterval": 360000, + "crucialUpdateInterval": 30000, + "onScreenUpdateInterval": 10000, + "threshold": 2 } - ], + }, "createCoin": true, "cryptoTransferDecimals": 8, "defaultFee": 0.00003153, @@ -118,68 +135,36 @@ "type": "ERC20", "fees": "ethereum" }, - "DAI": { - "symbol": "DAI", - "name": "Dai", - "decimals": 18, - "contractId": "0x6b175474e89094c44da98b954eedeac495271d0f", + "BZZ": { + "symbol": "BZZ", + "name": "Swarm", + "decimals": 16, + "contractId": "0x19062190B1925b5b6689D7073fDfC8c2976EF8Cb", "createCoin": false, "cryptoTransferDecimals": 6, "defaultVisibility": true, "defaultGasLimit": 58000, - "defaultOrdinalLevel": 50, + "defaultOrdinalLevel": 95, "status": "active", "mainCoin": "ETH", "type": "ERC20", "fees": "ethereum" }, - "BZZ": { - "symbol": "BZZ", - "name": "Swarm", - "decimals": 16, - "contractId": "0x19062190B1925b5b6689D7073fDfC8c2976EF8Cb", + "DAI": { + "symbol": "DAI", + "name": "Dai", + "decimals": 18, + "contractId": "0x6b175474e89094c44da98b954eedeac495271d0f", "createCoin": false, "cryptoTransferDecimals": 6, "defaultVisibility": true, "defaultGasLimit": 58000, - "defaultOrdinalLevel": 95, + "defaultOrdinalLevel": 50, "status": "active", "mainCoin": "ETH", "type": "ERC20", "fees": "ethereum" }, - "DOGE": { - "symbol": "DOGE", - "name": "Dogecoin", - "qrPrefix": "doge", - "regexAddress": "^[A|D|9][A-Z0-9]([0-9a-zA-Z]{9,})$", - "decimals": 8, - "minTransferAmount": 1, - "nodes": [ - { - "url": "https://dogenode1.adamant.im", - "alt_ip": "http://5.9.99.62:44099" - }, - { - "url": "https://dogenode2.adamant.im", - "alt_ip": "http://176.9.32.126:44098" - } - ], - "createCoin": true, - "cryptoTransferDecimals": 8, - "fixedFee": 1, - "defaultVisibility": true, - "txFetchInfo": { - "newPendingInterval": 5000, - "oldPendingInterval": 3000, - "registeredInterval": 20000, - "newPendingAttempts": 20, - "oldPendingAttempts": 4 - }, - "txConsistencyMaxTime": 900000, - "defaultOrdinalLevel": 70, - "explorerTx": "https://dogechain.info/tx/${ID}" - }, "DASH": { "symbol": "DASH", "name": "Dash", @@ -188,16 +173,24 @@ "regexAddress": "^[7X][1-9A-HJ-NP-Za-km-z]{33,}$", "decimals": 8, "minTransferAmount": 0.00002, - "nodes": [ - { - "url": "https://dashnode1.adamant.im", - "alt_ip": "http://45.85.147.224:44099" - }, - { - "url": "https://dashnode2.adamant.im", - "alt_ip": "http://207.180.210.95:44099" + "nodes": { + "list": [ + { + "url": "https://dashnode1.adamant.im", + "alt_ip": "http://45.85.147.224:44099" + }, + { + "url": "https://dashnode2.adamant.im", + "alt_ip": "http://207.180.210.95:44099" + } + ], + "healthCheck": { + "normalUpdateInterval": 210000, + "crucialUpdateInterval": 30000, + "onScreenUpdateInterval": 10000, + "threshold": 3 } - ], + }, "createCoin": true, "cryptoTransferDecimals": 8, "fixedFee": 0.0001, @@ -213,20 +206,45 @@ "defaultOrdinalLevel": 80, "explorerTx": "https://dashblockexplorer.com/tx/${ID}" }, - "FLUX": { - "symbol": "FLUX", - "name": "Flux", + "DOGE": { + "symbol": "DOGE", + "name": "Dogecoin", + "qrPrefix": "doge", + "regexAddress": "^[A|D|9][A-Z0-9]([0-9a-zA-Z]{9,})$", "decimals": 8, - "contractId": "0x720CD16b011b987Da3518fbf38c3071d4F0D1495", - "createCoin": false, - "cryptoTransferDecimals": 6, + "minTransferAmount": 1, + "nodes": { + "list": [ + { + "url": "https://dogenode1.adamant.im", + "alt_ip": "http://5.9.99.62:44099" + }, + { + "url": "https://dogenode2.adamant.im", + "alt_ip": "http://176.9.32.126:44098" + } + ], + "healthCheck": { + "normalUpdateInterval": 390000, + "crucialUpdateInterval": 30000, + "onScreenUpdateInterval": 10000, + "threshold": 3 + } + }, + "createCoin": true, + "cryptoTransferDecimals": 8, + "fixedFee": 1, "defaultVisibility": true, - "defaultGasLimit": 58000, - "defaultOrdinalLevel": 90, - "status": "active", - "mainCoin": "ETH", - "type": "ERC20", - "fees": "ethereum" + "txFetchInfo": { + "newPendingInterval": 5000, + "oldPendingInterval": 3000, + "registeredInterval": 20000, + "newPendingAttempts": 20, + "oldPendingAttempts": 4 + }, + "txConsistencyMaxTime": 900000, + "defaultOrdinalLevel": 70, + "explorerTx": "https://dogechain.info/tx/${ID}" }, "ENS": { "symbol": "ENS", @@ -247,18 +265,31 @@ "qrPrefix": "ethereum", "regexAddress": "^0x[0-9a-fA-F]{40}$", "decimals": 18, - "nodes": [ - { - "url": "https://ethnode1.adamant.im", - "alt_ip": "http://95.216.41.106:44099", - "hasIndex": true - }, - { - "url": "https://ethnode2.adamant.im", - "alt_ip": "http://95.216.114.252:44099", - "hasIndex": true + "nodes": { + "list": [ + { + "url": "https://ethnode1.adamant.im", + "alt_ip": "http://95.216.41.106:44099", + "hasIndex": true + }, + { + "url": "https://ethnode2.adamant.im", + "alt_ip": "http://95.216.114.252:44099", + "hasIndex": true + }, + { + "url": "https://ethnode3.adamant.im", + "alt_ip": "http://46.4.37.157:44099", + "hasIndex": true + } + ], + "healthCheck": { + "normalUpdateInterval": 300000, + "crucialUpdateInterval": 30000, + "onScreenUpdateInterval": 10000, + "threshold": 5 } - ], + }, "createCoin": true, "cryptoTransferDecimals": 6, "defaultVisibility": true, @@ -275,6 +306,21 @@ "defaultOrdinalLevel": 20, "explorerTx": "https://etherscan.io/tx/${ID}" }, + "GT": { + "symbol": "GT", + "name": "Gate", + "decimals": 8, + "contractId": "0xe66747a101bff2dba3697199dcce5b743b454759", + "createCoin": false, + "cryptoTransferDecimals": 6, + "defaultVisibility": true, + "defaultGasLimit": 58000, + "defaultOrdinalLevel": 100, + "status": "active", + "mainCoin": "ETH", + "type": "ERC20", + "fees": "ethereum" + }, "HOT": { "symbol": "HOT", "name": "Holo", @@ -288,33 +334,20 @@ "type": "ERC20", "fees": "ethereum" }, - "LSK": { - "symbol": "LSK", - "name": "Lisk", - "qrPrefix": "lisk", - "minBalance": 0.05, - "regexAddress": "^lsk[a-z2-9]{38}$", + "FLUX": { + "symbol": "FLUX", + "name": "Flux", "decimals": 8, - "nodes": [ - { - "url": "https://lisknode5.adamant.im", - "alt_ip": "http://38.242.243.29:44099" - } - ], - "createCoin": true, - "cryptoTransferDecimals": 8, - "defaultFee": 0.00164, + "contractId": "0x720CD16b011b987Da3518fbf38c3071d4F0D1495", + "createCoin": false, + "cryptoTransferDecimals": 6, "defaultVisibility": true, - "txFetchInfo": { - "newPendingInterval": 3000, - "oldPendingInterval": 3000, - "registeredInterval": 5000, - "newPendingAttempts": 15, - "oldPendingAttempts": 4 - }, - "txConsistencyMaxTime": 60000, - "defaultOrdinalLevel": 60, - "explorerTx": "https://liskscan.com/transaction/${ID}" + "defaultGasLimit": 58000, + "defaultOrdinalLevel": 90, + "status": "active", + "mainCoin": "ETH", + "type": "ERC20", + "fees": "ethereum" }, "INJ": { "symbol": "INJ", @@ -344,6 +377,50 @@ "type": "ERC20", "fees": "ethereum" }, + "LSK": { + "symbol": "LSK", + "name": "Lisk", + "qrPrefix": "lisk", + "minBalance": 0.05, + "regexAddress": "^lsk[a-z2-9]{38}$", + "decimals": 8, + "nodes": { + "list": [ + { + "url": "https://lisknode3.adamant.im", + "alt_ip": "http://157.90.229.236:44099" + }, + { + "url": "https://lisknode4.adamant.im", + "alt_ip": "http://78.47.205.206:44099" + }, + { + "url": "https://lisknode5.adamant.im", + "alt_ip": "http://38.242.243.29:44099" + } + ], + "healthCheck": { + "normalUpdateInterval": 270000, + "crucialUpdateInterval": 30000, + "onScreenUpdateInterval": 10000, + "threshold": 5 + } + }, + "createCoin": true, + "cryptoTransferDecimals": 8, + "defaultFee": 0.00164, + "defaultVisibility": true, + "txFetchInfo": { + "newPendingInterval": 3000, + "oldPendingInterval": 3000, + "registeredInterval": 5000, + "newPendingAttempts": 15, + "oldPendingAttempts": 4 + }, + "txConsistencyMaxTime": 60000, + "defaultOrdinalLevel": 60, + "explorerTx": "https://liskscan.com/transaction/${ID}" + }, "MATIC": { "symbol": "MATIC", "name": "Polygon", @@ -411,31 +488,29 @@ "type": "ERC20", "fees": "ethereum" }, - "STORJ": { - "symbol": "STORJ", - "name": "Storj", - "decimals": 8, - "contractId": "0xb64ef51c888972c908cfacf59b47c1afbc0ab8ac", + "SKL": { + "symbol": "SKL", + "name": "SKALE", + "decimals": 18, + "contractId": "0x00c83aecc790e8a4453e5dd3b0b4b3680501a7a7", "createCoin": false, "cryptoTransferDecimals": 6, "defaultVisibility": true, "defaultGasLimit": 58000, - "defaultOrdinalLevel": 100, + "defaultOrdinalLevel": 85, "status": "active", "mainCoin": "ETH", "type": "ERC20", "fees": "ethereum" }, - "SKL": { - "symbol": "SKL", - "name": "SKALE", + "SNX": { + "symbol": "SNX", + "name": "Synthetix Network", "decimals": 18, - "contractId": "0x00c83aecc790e8a4453e5dd3b0b4b3680501a7a7", + "contractId": "0xc011a73ee8576fb46f5e1c5751ca3b9fe0af2a6f", "createCoin": false, "cryptoTransferDecimals": 6, - "defaultVisibility": true, "defaultGasLimit": 58000, - "defaultOrdinalLevel": 85, "status": "active", "mainCoin": "ETH", "type": "ERC20", @@ -454,14 +529,16 @@ "type": "ERC20", "fees": "ethereum" }, - "SNX": { - "symbol": "SNX", - "name": "Synthetix Network", - "decimals": 18, - "contractId": "0xc011a73ee8576fb46f5e1c5751ca3b9fe0af2a6f", + "STORJ": { + "symbol": "STORJ", + "name": "Storj", + "decimals": 8, + "contractId": "0xb64ef51c888972c908cfacf59b47c1afbc0ab8ac", "createCoin": false, "cryptoTransferDecimals": 6, + "defaultVisibility": true, "defaultGasLimit": 58000, + "defaultOrdinalLevel": 100, "status": "active", "mainCoin": "ETH", "type": "ERC20", @@ -549,44 +626,44 @@ "type": "ERC20", "fees": "ethereum" }, - "WOO": { - "symbol": "WOO", - "name": "WOO Network", + "VERSE": { + "symbol": "VERSE", + "name": "Verse", "decimals": 18, - "contractId": "0x4691937a7508860f876c9c0a2a617e7d9e945d4b", + "contractId": "0x249cA82617eC3DfB2589c4c17ab7EC9765350a18", "createCoin": false, "cryptoTransferDecimals": 6, + "defaultVisibility": true, "defaultGasLimit": 58000, + "defaultOrdinalLevel": 95, "status": "active", "mainCoin": "ETH", "type": "ERC20", "fees": "ethereum" }, - "XCN": { - "symbol": "XCN", - "name": "Onyxcoin", + "WOO": { + "symbol": "WOO", + "name": "WOO Network", "decimals": 18, - "contractId": "0xa2cd3d43c775978a96bdbf12d733d5a1ed94fb18", + "contractId": "0x4691937a7508860f876c9c0a2a617e7d9e945d4b", "createCoin": false, "cryptoTransferDecimals": 6, - "defaultVisibility": true, "defaultGasLimit": 58000, - "defaultOrdinalLevel": 100, "status": "active", "mainCoin": "ETH", "type": "ERC20", "fees": "ethereum" }, - "VERSE": { - "symbol": "VERSE", - "name": "Verse", + "XCN": { + "symbol": "XCN", + "name": "Onyxcoin", "decimals": 18, - "contractId": "0x249cA82617eC3DfB2589c4c17ab7EC9765350a18", + "contractId": "0xa2cd3d43c775978a96bdbf12d733d5a1ed94fb18", "createCoin": false, "cryptoTransferDecimals": 6, "defaultVisibility": true, "defaultGasLimit": 58000, - "defaultOrdinalLevel": 95, + "defaultOrdinalLevel": 100, "status": "active", "mainCoin": "ETH", "type": "ERC20", diff --git a/src/lib/eth-index.js b/src/lib/eth-index.js index b5ddd87c5..ba4d474d2 100644 --- a/src/lib/eth-index.js +++ b/src/lib/eth-index.js @@ -105,7 +105,7 @@ function getTotalFromRange(range = '') { } function getUrl() { - const nodes = config.eth.nodes.filter((x) => x.hasIndex).map((x) => x.url) + const nodes = config.eth.nodes.list.filter((x) => x.hasIndex).map((x) => x.url) const index = Math.floor(Math.random() * nodes.length) return nodes[index] + '/ethtxs' } diff --git a/src/lib/nodes/adm/index.ts b/src/lib/nodes/adm/index.ts index 9b8d5573a..134177228 100644 --- a/src/lib/nodes/adm/index.ts +++ b/src/lib/nodes/adm/index.ts @@ -2,7 +2,7 @@ import config from '@/config' import { NodeInfo } from '@/types/wallets' import { AdmClient } from './AdmClient' -const endpoints = (config.adm.nodes as NodeInfo[]).map((endpoint) => endpoint.url) -export const adm = new AdmClient(endpoints, config.adm.minNodeVersion) +const endpoints = (config.adm.nodes.list as NodeInfo[]).map((endpoint) => endpoint.url) +export const adm = new AdmClient(endpoints, config.adm.nodes.minVersion) export default adm diff --git a/src/lib/nodes/btc/index.ts b/src/lib/nodes/btc/index.ts index 6c52544f3..9354436e6 100644 --- a/src/lib/nodes/btc/index.ts +++ b/src/lib/nodes/btc/index.ts @@ -2,7 +2,7 @@ import config from '@/config' import { NodeInfo } from '@/types/wallets' import { BtcClient } from './BtcClient' -const endpoints = (config.btc.nodes as NodeInfo[]).map((endpoint) => endpoint.url) +const endpoints = (config.btc.nodes.list as NodeInfo[]).map((endpoint) => endpoint.url) export const btc = new BtcClient(endpoints) export default btc diff --git a/src/lib/nodes/dash/index.ts b/src/lib/nodes/dash/index.ts index 640953e48..297b27701 100644 --- a/src/lib/nodes/dash/index.ts +++ b/src/lib/nodes/dash/index.ts @@ -2,7 +2,7 @@ import config from '@/config' import { NodeInfo } from '@/types/wallets' import { DashClient } from './DashClient' -const endpoints = (config.dash.nodes as NodeInfo[]).map((endpoint) => endpoint.url) +const endpoints = (config.dash.nodes.list as NodeInfo[]).map((endpoint) => endpoint.url) export const dash = new DashClient(endpoints) export default dash diff --git a/src/lib/nodes/doge/index.ts b/src/lib/nodes/doge/index.ts index 5143c9155..c43df54ae 100644 --- a/src/lib/nodes/doge/index.ts +++ b/src/lib/nodes/doge/index.ts @@ -2,7 +2,7 @@ import config from '@/config' import { NodeInfo } from '@/types/wallets' import { DogeClient } from './DogeClient' -const endpoints = (config.doge.nodes as NodeInfo[]).map((endpoint) => endpoint.url) +const endpoints = (config.doge.nodes.list as NodeInfo[]).map((endpoint) => endpoint.url) export const doge = new DogeClient(endpoints) export default doge diff --git a/src/lib/nodes/eth/index.ts b/src/lib/nodes/eth/index.ts index cfcdc500e..1f743b029 100644 --- a/src/lib/nodes/eth/index.ts +++ b/src/lib/nodes/eth/index.ts @@ -2,7 +2,7 @@ import config from '@/config' import { NodeInfo } from '@/types/wallets' import { EthClient } from './EthClient' -const endpoints = (config.eth.nodes as NodeInfo[]).map((endpoint) => endpoint.url) +const endpoints = (config.eth.nodes.list as NodeInfo[]).map((endpoint) => endpoint.url) export const eth = new EthClient(endpoints) export default eth diff --git a/src/lib/nodes/lsk-indexer/index.ts b/src/lib/nodes/lsk-indexer/index.ts index 8226a992b..9d00ee1af 100644 --- a/src/lib/nodes/lsk-indexer/index.ts +++ b/src/lib/nodes/lsk-indexer/index.ts @@ -2,7 +2,7 @@ import config from '@/config' import { Service } from '@/types/wallets' import { LskIndexerClient } from './LskIndexerClient' -const endpoints = (config.lsk.services.lskService as Service[]).map((endpoint) => endpoint.url) +const endpoints = (config.lsk.services.list.lskService as Service[]).map((endpoint) => endpoint.url) export const lskIndexer = new LskIndexerClient(endpoints) export default lskIndexer diff --git a/src/lib/nodes/lsk/index.ts b/src/lib/nodes/lsk/index.ts index f80da62f6..6228b23bd 100644 --- a/src/lib/nodes/lsk/index.ts +++ b/src/lib/nodes/lsk/index.ts @@ -2,7 +2,7 @@ import config from '@/config' import { NodeInfo } from '@/types/wallets' import { LskClient } from './LskClient' -const endpoints = (config.lsk.nodes as NodeInfo[]).map((endpoint) => endpoint.url) +const endpoints = (config.lsk.nodes.list as NodeInfo[]).map((endpoint) => endpoint.url) export const lsk = new LskClient(endpoints) export default lsk diff --git a/src/types/wallets/index.ts b/src/types/wallets/index.ts index 4eafed186..4b8b08ce8 100644 --- a/src/types/wallets/index.ts +++ b/src/types/wallets/index.ts @@ -92,14 +92,42 @@ export interface TokenGeneral { } /** Time in ms when difference between in-chat transfer and Tx timestamp considered as acceptable */ txConsistencyMaxTime?: number - /** - * Minimal node API version - * @example "0.8.0" - */ - minNodeVersion?: string - /** Node links for API */ - nodes?: NodeInfo[] - services?: Record + nodes?: { + /** Node links for API */ + list: NodeInfo[] + healthCheck: { + /** Regular node status update interval in ms */ + normalUpdateInterval: number + /** Node status update interval when there are no active nodes, in ms */ + crucialUpdateInterval: number + /** On the node screen, the status update interval in ms */ + onScreenUpdateInterval: number + /** Permissible height difference between nodes */ + threshold: number + } + /** + * Minimal node API version + * @example "0.8.0" + */ + minVersion?: string + } + services?: { + /** Service node links for API */ + list: Record + healthCheck: { + /** Regular service status update interval in ms */ + normalUpdateInterval: number + /** Service status update interval when there are no active services, in ms */ + crucialUpdateInterval: number + /** On the node screen, the status update interval in ms */ + onScreenUpdateInterval: number + } + /** + * Minimal service node API version + * @example "1.0.0" + */ + minVersion?: string + } /** Additional project links */ links?: ProjectLink[] tor?: { @@ -111,9 +139,42 @@ export interface TokenGeneral { explorerTx?: string /** URL to get address info (Tor) */ explorerAddress?: string - /** Node links for API (Tor) */ - nodes?: NodeInfo[] - services?: Record + nodes?: { + /** Node links for API */ + list: NodeInfo[] + healthCheck: { + /** Regular node status update interval in ms */ + normalUpdateInterval: number + /** Node status update interval when there are no active nodes, in ms */ + crucialUpdateInterval: number + /** On the node screen, the status update interval in ms */ + onScreenUpdateInterval: number + /** Permissible height difference between nodes */ + threshold: number + } + /** + * Minimal node API version + * @example "0.8.0" + */ + minVersion?: string + } + services?: { + /** Service node links for API */ + list: Record + healthCheck?: { + /** Regular service status update interval in ms */ + normalUpdateInterval: number + /** Service status update interval when there are no active services, in ms */ + crucialUpdateInterval: number + /** On the node screen, the status update interval in ms */ + onScreenUpdateInterval: number + } + /** + * Minimal service node API version + * @example "1.0.0" + */ + minVersion?: string + } /** Additional project links (Tor) */ links?: ProjectLink[] } From 318ef0bec356a902dd779208f7ad1716a4869a26 Mon Sep 17 00:00:00 2001 From: bludnic Date: Tue, 30 Jan 2024 15:27:30 +0000 Subject: [PATCH 2/5] chore(adaman-wallets): replace HEIGHT_EPSILON --- src/lib/nodes/abstract.client.ts | 2 +- src/lib/nodes/utils/filterSyncedNodes.ts | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/lib/nodes/abstract.client.ts b/src/lib/nodes/abstract.client.ts index 1a91733fb..2db0c7908 100644 --- a/src/lib/nodes/abstract.client.ts +++ b/src/lib/nodes/abstract.client.ts @@ -126,7 +126,7 @@ export abstract class Client { protected updateSyncStatuses() { const nodes = this.nodes.filter((x) => x.online && x.active) - const nodesInSync = filterSyncedNodes(nodes) + const nodesInSync = filterSyncedNodes(nodes, this.type) // Finally, all the nodes from the winner list are considered to be in sync, all the // others are not diff --git a/src/lib/nodes/utils/filterSyncedNodes.ts b/src/lib/nodes/utils/filterSyncedNodes.ts index ba176195f..98c4e8969 100644 --- a/src/lib/nodes/utils/filterSyncedNodes.ts +++ b/src/lib/nodes/utils/filterSyncedNodes.ts @@ -1,10 +1,15 @@ +import config from '@/config' +import { NodeType } from '@/lib/nodes/types' + /** * Allowed height delta for the nodes. * * If two nodes' heights differ by no more than this value, * they are considered to be in sync with each other. */ -const HEIGHT_EPSILON = 10 +function getHeightEpsilon(nodeType: NodeType): number { + return config[nodeType].nodes.healthCheck.threshold +} interface Node { height: number @@ -20,7 +25,7 @@ type GroupNodes = { * height (considering HEIGHT_EPSILON). These nodes are considered to be in sync with the network, * all the others are not. */ -export function filterSyncedNodes(nodes: N[]): GroupNodes { +export function filterSyncedNodes(nodes: N[], type: NodeType): GroupNodes { if (nodes.length === 0) { return { height: 0, @@ -28,13 +33,15 @@ export function filterSyncedNodes(nodes: N[]): GroupNodes { } } + const heightEpsilon = getHeightEpsilon(type) + // For each node we take its height and list of nodes that have the same height ± epsilon const groups = nodes.map((node) => { return { /** In case of "win" this height will be considered to be real height of the network */ height: node.height, /** List of nodes with the same (or close) height, including current one */ - nodes: nodes.filter((x) => Math.abs(node.height - x.height) <= HEIGHT_EPSILON) + nodes: nodes.filter((x) => Math.abs(node.height - x.height) <= heightEpsilon) } }) From 1630147576d21e5c2ff9c46950147d16ad232455 Mon Sep 17 00:00:00 2001 From: bludnic Date: Tue, 30 Jan 2024 18:21:06 +0000 Subject: [PATCH 3/5] chore(adamant-wallets): add healtcheck interfaces --- src/types/wallets/index.ts | 60 +++++++++++++++----------------------- 1 file changed, 24 insertions(+), 36 deletions(-) diff --git a/src/types/wallets/index.ts b/src/types/wallets/index.ts index 4b8b08ce8..2105a5709 100644 --- a/src/types/wallets/index.ts +++ b/src/types/wallets/index.ts @@ -15,6 +15,26 @@ export interface NodeInfo { hasIndex?: boolean } +export interface NodeHealthcheck { + /** Regular node status update interval in ms */ + normalUpdateInterval: number + /** Node status update interval when there are no active nodes, in ms */ + crucialUpdateInterval: number + /** On the node screen, the status update interval in ms */ + onScreenUpdateInterval: number + /** Permissible height difference between nodes */ + threshold: number +} + +export interface ServiceHealthcheck { + /** Regular node status update interval in ms */ + normalUpdateInterval: number + /** Node status update interval when there are no active nodes, in ms */ + crucialUpdateInterval: number + /** On the node screen, the status update interval in ms */ + onScreenUpdateInterval: number +} + export interface ProjectLink { name: string url: string @@ -95,16 +115,7 @@ export interface TokenGeneral { nodes?: { /** Node links for API */ list: NodeInfo[] - healthCheck: { - /** Regular node status update interval in ms */ - normalUpdateInterval: number - /** Node status update interval when there are no active nodes, in ms */ - crucialUpdateInterval: number - /** On the node screen, the status update interval in ms */ - onScreenUpdateInterval: number - /** Permissible height difference between nodes */ - threshold: number - } + healthCheck: NodeHealthcheck /** * Minimal node API version * @example "0.8.0" @@ -114,14 +125,7 @@ export interface TokenGeneral { services?: { /** Service node links for API */ list: Record - healthCheck: { - /** Regular service status update interval in ms */ - normalUpdateInterval: number - /** Service status update interval when there are no active services, in ms */ - crucialUpdateInterval: number - /** On the node screen, the status update interval in ms */ - onScreenUpdateInterval: number - } + healthCheck: ServiceHealthcheck /** * Minimal service node API version * @example "1.0.0" @@ -142,16 +146,7 @@ export interface TokenGeneral { nodes?: { /** Node links for API */ list: NodeInfo[] - healthCheck: { - /** Regular node status update interval in ms */ - normalUpdateInterval: number - /** Node status update interval when there are no active nodes, in ms */ - crucialUpdateInterval: number - /** On the node screen, the status update interval in ms */ - onScreenUpdateInterval: number - /** Permissible height difference between nodes */ - threshold: number - } + healthCheck: NodeHealthcheck /** * Minimal node API version * @example "0.8.0" @@ -161,14 +156,7 @@ export interface TokenGeneral { services?: { /** Service node links for API */ list: Record - healthCheck?: { - /** Regular service status update interval in ms */ - normalUpdateInterval: number - /** Service status update interval when there are no active services, in ms */ - crucialUpdateInterval: number - /** On the node screen, the status update interval in ms */ - onScreenUpdateInterval: number - } + healthCheck?: ServiceHealthcheck /** * Minimal service node API version * @example "1.0.0" From 5f4eb70ad6daba9856905e8af2ca60903abc01cc Mon Sep 17 00:00:00 2001 From: bludnic Date: Tue, 30 Jan 2024 18:21:49 +0000 Subject: [PATCH 4/5] feat(nodes): use healtcheck constants from `adamant-wallets` --- src/lib/nodes/abstract.client.ts | 8 ++++- src/lib/nodes/abstract.node.ts | 36 ++++++++++++++++----- src/lib/nodes/adm/AdmNode.ts | 2 +- src/lib/nodes/btc/BtcNode.ts | 2 +- src/lib/nodes/dash/DashNode.ts | 2 +- src/lib/nodes/doge/DogeNode.ts | 2 +- src/lib/nodes/eth/EthNode.ts | 2 +- src/lib/nodes/index.ts | 29 ++++++----------- src/lib/nodes/lsk-indexer/LskIndexer.ts | 2 +- src/lib/nodes/lsk/LskNode.ts | 2 +- src/lib/nodes/nodes-manager.ts | 12 +++++++ src/lib/nodes/nodes.ts | 15 +++++++++ src/lib/nodes/services.ts | 5 +++ src/lib/nodes/types.ts | 3 ++ src/lib/nodes/utils/filterSyncedNodes.ts | 6 ++-- src/lib/nodes/utils/getHealthcheckConfig.ts | 35 ++++++++++++++++++++ src/views/Nodes.vue | 8 ++--- 17 files changed, 130 insertions(+), 41 deletions(-) create mode 100644 src/lib/nodes/nodes-manager.ts create mode 100644 src/lib/nodes/nodes.ts create mode 100644 src/lib/nodes/services.ts create mode 100644 src/lib/nodes/utils/getHealthcheckConfig.ts diff --git a/src/lib/nodes/abstract.client.ts b/src/lib/nodes/abstract.client.ts index 2db0c7908..63f55c6a5 100644 --- a/src/lib/nodes/abstract.client.ts +++ b/src/lib/nodes/abstract.client.ts @@ -1,4 +1,4 @@ -import type { NodeType } from '@/lib/nodes/types' +import type { HealthcheckInterval, NodeType } from '@/lib/nodes/types' import { filterSyncedNodes } from './utils/filterSyncedNodes' import { Node } from './abstract.node' import { nodesStorage } from './storage' @@ -49,6 +49,12 @@ export abstract class Client { } } + updateHealthCheckInterval(interval: HealthcheckInterval) { + for (const node of this.nodes) { + void node.updateHealthCheckInterval(interval) + } + } + getClient(): N['client'] { const node = this.useFastest ? this.getFastestNode() : this.getRandomNode() diff --git a/src/lib/nodes/abstract.node.ts b/src/lib/nodes/abstract.node.ts index 197e9daf0..48285629d 100644 --- a/src/lib/nodes/abstract.node.ts +++ b/src/lib/nodes/abstract.node.ts @@ -1,5 +1,6 @@ +import { getHealthCheckInterval } from './utils/getHealthcheckConfig' import { TNodeLabel } from './constants' -import { NodeStatus } from './types' +import { HealthcheckInterval, NodeKind, NodeStatus, NodeType } from './types' import { nodesStorage } from './storage' type HealthcheckResult = { @@ -15,11 +16,6 @@ type WsProtocol = 'ws:' | 'wss:' */ const appProtocol = location.protocol -/** - * Interval how often to update node statuses - */ -const REVISE_CONNECTION_TIMEOUT = 60000 - export abstract class Node { /** * Indicates whether node is active (i.e. user allows the application @@ -93,16 +89,29 @@ export abstract class Node { * Will be updated after `GET /api/node/status` */ socketSupport = false + + type: NodeType + kind: NodeKind label: TNodeLabel onStatusChangeCallback?: (nodeStatus: ReturnType) => void timer?: NodeJS.Timeout + healthCheckInterval: HealthcheckInterval = 'normal' abstract client: C - constructor(url: string, label: TNodeLabel, version = '', minNodeVersion = '') { + constructor( + url: string, + type: NodeType, + kind: NodeKind, + label: TNodeLabel, + version = '', + minNodeVersion = '' + ) { this.url = url + this.type = type this.label = label + this.kind = kind this.protocol = new URL(url).protocol as HttpProtocol this.port = new URL(url).port this.hostname = new URL(url).hostname @@ -130,7 +139,18 @@ export abstract class Node { this.fireStatusChange() } - this.timer = setTimeout(() => this.startHealthcheck(), REVISE_CONNECTION_TIMEOUT) + this.timer = setTimeout( + () => this.startHealthcheck(), + getHealthCheckInterval( + this.type, + this.kind, + this.online ? this.healthCheckInterval : 'crucial' + ) + ) + } + + updateHealthCheckInterval(interval: HealthcheckInterval) { + this.healthCheckInterval = interval } private fireStatusChange() { diff --git a/src/lib/nodes/adm/AdmNode.ts b/src/lib/nodes/adm/AdmNode.ts index 6bc751dac..70d1f8c0e 100644 --- a/src/lib/nodes/adm/AdmNode.ts +++ b/src/lib/nodes/adm/AdmNode.ts @@ -31,7 +31,7 @@ export class AdmNode extends Node { client: AxiosInstance constructor(url: string, minNodeVersion = '0.0.0') { - super(url, NODE_LABELS.AdmNode, minNodeVersion, minNodeVersion) + super(url, 'adm', 'node', NODE_LABELS.AdmNode, minNodeVersion, minNodeVersion) this.wsPort = '36668' // default wsPort this.wsProtocol = this.protocol === 'https:' ? 'wss:' : 'ws:' diff --git a/src/lib/nodes/btc/BtcNode.ts b/src/lib/nodes/btc/BtcNode.ts index dd1823e5c..c4d0b5063 100644 --- a/src/lib/nodes/btc/BtcNode.ts +++ b/src/lib/nodes/btc/BtcNode.ts @@ -11,7 +11,7 @@ export class BtcNode extends Node { client: AxiosInstance constructor(url: string) { - super(url, NODE_LABELS.BtcNode) + super(url, 'btc', 'node', NODE_LABELS.BtcNode) this.client = createBtcLikeClient(url) diff --git a/src/lib/nodes/dash/DashNode.ts b/src/lib/nodes/dash/DashNode.ts index 1e4c24599..9e3082c26 100644 --- a/src/lib/nodes/dash/DashNode.ts +++ b/src/lib/nodes/dash/DashNode.ts @@ -11,7 +11,7 @@ export class DashNode extends Node { client: AxiosInstance constructor(url: string) { - super(url, NODE_LABELS.DashNode) + super(url, 'dash', 'node', NODE_LABELS.DashNode) this.client = createBtcLikeClient(url) diff --git a/src/lib/nodes/doge/DogeNode.ts b/src/lib/nodes/doge/DogeNode.ts index 9ccf99134..d010cc6ab 100644 --- a/src/lib/nodes/doge/DogeNode.ts +++ b/src/lib/nodes/doge/DogeNode.ts @@ -11,7 +11,7 @@ export class DogeNode extends Node { client: AxiosInstance constructor(url: string) { - super(url, NODE_LABELS.DogeNode) + super(url, 'doge', 'node', NODE_LABELS.DogeNode) this.client = createBtcLikeClient(url) diff --git a/src/lib/nodes/eth/EthNode.ts b/src/lib/nodes/eth/EthNode.ts index 6b05b4a60..eb61e9fed 100644 --- a/src/lib/nodes/eth/EthNode.ts +++ b/src/lib/nodes/eth/EthNode.ts @@ -15,7 +15,7 @@ export class EthNode extends Node { client: Web3Eth constructor(url: string) { - super(url, NODE_LABELS.EthNode) + super(url, 'eth', 'node', NODE_LABELS.EthNode) this.provider = new HttpProvider(this.url) this.client = new Web3Eth(this.provider) diff --git a/src/lib/nodes/index.ts b/src/lib/nodes/index.ts index 680aa053b..8e28ff2f6 100644 --- a/src/lib/nodes/index.ts +++ b/src/lib/nodes/index.ts @@ -1,20 +1,11 @@ -import { adm } from './adm' -import { btc } from './btc' -import { dash } from './dash' -import { doge } from './doge' -import { eth } from './eth' -import { lsk } from './lsk' -import { lskIndexer } from './lsk-indexer' +export { adm } from './adm' +export { btc } from './btc' +export { dash } from './dash' +export { doge } from './doge' +export { eth } from './eth' +export { lsk } from './lsk' +export { lskIndexer } from './lsk-indexer' -export const nodes = { - adm, - btc, - dash, - doge, - eth, - lsk -} - -export const services = { - lskIndexer -} +export { nodes } from './nodes' +export { services } from './services' +export { nodesManager } from './nodes-manager' diff --git a/src/lib/nodes/lsk-indexer/LskIndexer.ts b/src/lib/nodes/lsk-indexer/LskIndexer.ts index 49664eedd..b4965314a 100644 --- a/src/lib/nodes/lsk-indexer/LskIndexer.ts +++ b/src/lib/nodes/lsk-indexer/LskIndexer.ts @@ -11,7 +11,7 @@ export class LskIndexer extends Node { client: AxiosInstance constructor(url: string) { - super(url, NODE_LABELS.LskIndexer) + super(url, 'lsk', 'service', NODE_LABELS.LskIndexer) this.client = axios.create({ baseURL: `${url}/api/v3` }) diff --git a/src/lib/nodes/lsk/LskNode.ts b/src/lib/nodes/lsk/LskNode.ts index 5d4c23c76..a2085227e 100644 --- a/src/lib/nodes/lsk/LskNode.ts +++ b/src/lib/nodes/lsk/LskNode.ts @@ -13,7 +13,7 @@ export class LskNode extends Node { client: AxiosInstance constructor(url: string) { - super(url, NODE_LABELS.LskNode) + super(url, 'lsk', 'node', NODE_LABELS.LskNode) this.client = axios.create({ baseURL: url }) diff --git a/src/lib/nodes/nodes-manager.ts b/src/lib/nodes/nodes-manager.ts new file mode 100644 index 000000000..8d6abcdfe --- /dev/null +++ b/src/lib/nodes/nodes-manager.ts @@ -0,0 +1,12 @@ +import type { HealthcheckInterval } from './types' +import { nodes } from './nodes' + +class NodesManager { + updateHealthcheckInterval(interval: HealthcheckInterval) { + for (const node of Object.values(nodes)) { + node.updateHealthCheckInterval(interval) + } + } +} + +export const nodesManager = new NodesManager() diff --git a/src/lib/nodes/nodes.ts b/src/lib/nodes/nodes.ts new file mode 100644 index 000000000..9be8d5dcf --- /dev/null +++ b/src/lib/nodes/nodes.ts @@ -0,0 +1,15 @@ +import { adm } from './adm' +import { btc } from './btc' +import { dash } from './dash' +import { doge } from './doge' +import { eth } from './eth' +import { lsk } from './lsk' + +export const nodes = { + adm, + btc, + dash, + doge, + eth, + lsk +} diff --git a/src/lib/nodes/services.ts b/src/lib/nodes/services.ts new file mode 100644 index 000000000..f60c8f4e4 --- /dev/null +++ b/src/lib/nodes/services.ts @@ -0,0 +1,5 @@ +import { lskIndexer } from './lsk-indexer' + +export const services = { + lskIndexer +} diff --git a/src/lib/nodes/types.ts b/src/lib/nodes/types.ts index bcb505979..d938906fb 100644 --- a/src/lib/nodes/types.ts +++ b/src/lib/nodes/types.ts @@ -6,3 +6,6 @@ export type NodeStatus = | 'unsupported_version' // node version is too low export type NodeType = 'adm' | 'eth' | 'btc' | 'doge' | 'dash' | 'lsk' +export type NodeKind = 'node' | 'service' + +export type HealthcheckInterval = 'normal' | 'crucial' | 'onScreen' diff --git a/src/lib/nodes/utils/filterSyncedNodes.ts b/src/lib/nodes/utils/filterSyncedNodes.ts index 98c4e8969..bc4448431 100644 --- a/src/lib/nodes/utils/filterSyncedNodes.ts +++ b/src/lib/nodes/utils/filterSyncedNodes.ts @@ -1,5 +1,5 @@ -import config from '@/config' import { NodeType } from '@/lib/nodes/types' +import { getNodeHealthcheckConfig } from './getHealthcheckConfig' /** * Allowed height delta for the nodes. @@ -8,7 +8,9 @@ import { NodeType } from '@/lib/nodes/types' * they are considered to be in sync with each other. */ function getHeightEpsilon(nodeType: NodeType): number { - return config[nodeType].nodes.healthCheck.threshold + const config = getNodeHealthcheckConfig(nodeType) + + return config.threshold } interface Node { diff --git a/src/lib/nodes/utils/getHealthcheckConfig.ts b/src/lib/nodes/utils/getHealthcheckConfig.ts new file mode 100644 index 000000000..ed188da3c --- /dev/null +++ b/src/lib/nodes/utils/getHealthcheckConfig.ts @@ -0,0 +1,35 @@ +import config from '@/config' +import { HealthcheckInterval, NodeKind, NodeType } from '@/lib/nodes/types' +import type { NodeHealthcheck, ServiceHealthcheck } from '@/types/wallets' + +export function getNodeHealthcheckConfig(nodeType: NodeType): NodeHealthcheck { + return config[nodeType].nodes.healthCheck +} + +export function getServiceHealthcheckConfig(nodeType: NodeType): ServiceHealthcheck { + return config[nodeType].services.healthCheck +} + +export function getHealthCheckInterval( + nodeType: NodeType, + nodeKind: NodeKind, + interval: HealthcheckInterval +) { + const config = + nodeKind === 'service' + ? getServiceHealthcheckConfig(nodeType) + : getNodeHealthcheckConfig(nodeType) + + switch (interval) { + case 'normal': + return config.normalUpdateInterval + case 'crucial': + return config.crucialUpdateInterval + case 'onScreen': + return config.onScreenUpdateInterval + default: + throw new Error( + `getNodeHealthCheckInterval: Interval ${interval} is not defined in the Node's config` + ) + } +} diff --git a/src/views/Nodes.vue b/src/views/Nodes.vue index 53ab2146e..e915e52be 100644 --- a/src/views/Nodes.vue +++ b/src/views/Nodes.vue @@ -47,6 +47,7 @@ From c5b69d2c1d42e6053d06b98d9e2f24b691979d58 Mon Sep 17 00:00:00 2001 From: bludnic Date: Wed, 31 Jan 2024 18:54:05 +0000 Subject: [PATCH 5/5] chore: regenerate `adamant-wallets` v2.3.1 --- src/lib/constants/cryptos/data.json | 400 ++++++++++++++-------------- 1 file changed, 200 insertions(+), 200 deletions(-) diff --git a/src/lib/constants/cryptos/data.json b/src/lib/constants/cryptos/data.json index e291aeb8a..ccf3f7908 100644 --- a/src/lib/constants/cryptos/data.json +++ b/src/lib/constants/cryptos/data.json @@ -1,4 +1,45 @@ { + "BTC": { + "symbol": "BTC", + "name": "Bitcoin", + "qrPrefix": "bitcoin", + "minBalance": 0.00001, + "regexAddress": "^bc1[a-zA-Z0-9]{39,59}$|^[13][1-9A-HJ-NP-Za-km-z]{25,34}$", + "decimals": 8, + "minTransferAmount": 0.00000546, + "nodes": { + "list": [ + { + "url": "https://btcnode1.adamant.im", + "alt_ip": "http://176.9.38.204:44099" + }, + { + "url": "https://btcnode2.adamant.im", + "alt_ip": "http://176.9.32.126:44099" + } + ], + "healthCheck": { + "normalUpdateInterval": 360000, + "crucialUpdateInterval": 30000, + "onScreenUpdateInterval": 10000, + "threshold": 2 + } + }, + "createCoin": true, + "cryptoTransferDecimals": 8, + "defaultFee": 0.00003153, + "defaultVisibility": true, + "txFetchInfo": { + "newPendingInterval": 10000, + "oldPendingInterval": 3000, + "registeredInterval": 40000, + "newPendingAttempts": 20, + "oldPendingAttempts": 4 + }, + "txConsistencyMaxTime": 10800000, + "defaultOrdinalLevel": 10, + "explorerTx": "https://explorer.btc.com/btc/transaction/${ID}" + }, "ADM": { "symbol": "ADM", "name": "ADAMANT Messenger", @@ -68,103 +109,6 @@ "defaultOrdinalLevel": 0, "explorerTx": "https://explorer.adamant.im/tx/${ID}" }, - "BTC": { - "symbol": "BTC", - "name": "Bitcoin", - "qrPrefix": "bitcoin", - "minBalance": 0.00001, - "regexAddress": "^bc1[a-zA-Z0-9]{39,59}$|^[13][1-9A-HJ-NP-Za-km-z]{25,34}$", - "decimals": 8, - "minTransferAmount": 0.00000546, - "nodes": { - "list": [ - { - "url": "https://btcnode1.adamant.im", - "alt_ip": "http://176.9.38.204:44099" - }, - { - "url": "https://btcnode2.adamant.im", - "alt_ip": "http://176.9.32.126:44099" - } - ], - "healthCheck": { - "normalUpdateInterval": 360000, - "crucialUpdateInterval": 30000, - "onScreenUpdateInterval": 10000, - "threshold": 2 - } - }, - "createCoin": true, - "cryptoTransferDecimals": 8, - "defaultFee": 0.00003153, - "defaultVisibility": true, - "txFetchInfo": { - "newPendingInterval": 10000, - "oldPendingInterval": 3000, - "registeredInterval": 40000, - "newPendingAttempts": 20, - "oldPendingAttempts": 4 - }, - "txConsistencyMaxTime": 10800000, - "defaultOrdinalLevel": 10, - "explorerTx": "https://explorer.btc.com/btc/transaction/${ID}" - }, - "BUSD": { - "symbol": "BUSD", - "name": "Binance USD", - "decimals": 18, - "contractId": "0x4fabb145d64652a948d72533023f6e7a623c7c53", - "createCoin": false, - "cryptoTransferDecimals": 6, - "defaultGasLimit": 58000, - "status": "active", - "mainCoin": "ETH", - "type": "ERC20", - "fees": "ethereum" - }, - "BNB": { - "symbol": "BNB", - "name": "Binance Coin", - "decimals": 18, - "contractId": "0xB8c77482e45F1F44dE1745F52C74426C631bDD52", - "createCoin": false, - "cryptoTransferDecimals": 6, - "defaultGasLimit": 58000, - "status": "active", - "mainCoin": "ETH", - "type": "ERC20", - "fees": "ethereum" - }, - "BZZ": { - "symbol": "BZZ", - "name": "Swarm", - "decimals": 16, - "contractId": "0x19062190B1925b5b6689D7073fDfC8c2976EF8Cb", - "createCoin": false, - "cryptoTransferDecimals": 6, - "defaultVisibility": true, - "defaultGasLimit": 58000, - "defaultOrdinalLevel": 95, - "status": "active", - "mainCoin": "ETH", - "type": "ERC20", - "fees": "ethereum" - }, - "DAI": { - "symbol": "DAI", - "name": "Dai", - "decimals": 18, - "contractId": "0x6b175474e89094c44da98b954eedeac495271d0f", - "createCoin": false, - "cryptoTransferDecimals": 6, - "defaultVisibility": true, - "defaultGasLimit": 58000, - "defaultOrdinalLevel": 50, - "status": "active", - "mainCoin": "ETH", - "type": "ERC20", - "fees": "ethereum" - }, "DASH": { "symbol": "DASH", "name": "Dash", @@ -206,6 +150,21 @@ "defaultOrdinalLevel": 80, "explorerTx": "https://dashblockexplorer.com/tx/${ID}" }, + "BZZ": { + "symbol": "BZZ", + "name": "Swarm", + "decimals": 16, + "contractId": "0x19062190B1925b5b6689D7073fDfC8c2976EF8Cb", + "createCoin": false, + "cryptoTransferDecimals": 6, + "defaultVisibility": true, + "defaultGasLimit": 58000, + "defaultOrdinalLevel": 95, + "status": "active", + "mainCoin": "ETH", + "type": "ERC20", + "fees": "ethereum" + }, "DOGE": { "symbol": "DOGE", "name": "Dogecoin", @@ -246,19 +205,6 @@ "defaultOrdinalLevel": 70, "explorerTx": "https://dogechain.info/tx/${ID}" }, - "ENS": { - "symbol": "ENS", - "name": "Ethereum Name Service", - "decimals": 18, - "contractId": "0xC18360217D8F7Ab5e7c516566761Ea12Ce7F9D72", - "createCoin": false, - "cryptoTransferDecimals": 6, - "defaultGasLimit": 58000, - "status": "active", - "mainCoin": "ETH", - "type": "ERC20", - "fees": "ethereum" - }, "ETH": { "symbol": "ETH", "name": "Ethereum", @@ -306,34 +252,6 @@ "defaultOrdinalLevel": 20, "explorerTx": "https://etherscan.io/tx/${ID}" }, - "GT": { - "symbol": "GT", - "name": "Gate", - "decimals": 8, - "contractId": "0xe66747a101bff2dba3697199dcce5b743b454759", - "createCoin": false, - "cryptoTransferDecimals": 6, - "defaultVisibility": true, - "defaultGasLimit": 58000, - "defaultOrdinalLevel": 100, - "status": "active", - "mainCoin": "ETH", - "type": "ERC20", - "fees": "ethereum" - }, - "HOT": { - "symbol": "HOT", - "name": "Holo", - "decimals": 18, - "contractId": "0x6c6ee5e31d828de241282b9606c8e98ea48526e2", - "createCoin": false, - "cryptoTransferDecimals": 6, - "defaultGasLimit": 58000, - "status": "active", - "mainCoin": "ETH", - "type": "ERC20", - "fees": "ethereum" - }, "FLUX": { "symbol": "FLUX", "name": "Flux", @@ -349,29 +267,29 @@ "type": "ERC20", "fees": "ethereum" }, - "INJ": { - "symbol": "INJ", - "name": "Injective", - "regexAddress": "^(inj)[a-zA-HJ-NP-Z0-9]{25,39}$", + "BNB": { + "symbol": "BNB", + "name": "Binance Coin", "decimals": 18, - "contractId": "0xe28b3b32b6c345a34ff64674606124dd5aceca30", + "contractId": "0xB8c77482e45F1F44dE1745F52C74426C631bDD52", "createCoin": false, "cryptoTransferDecimals": 6, "defaultGasLimit": 58000, - "explorerTx": "https://explorer.injective.network/transaction/${ID}", "status": "active", "mainCoin": "ETH", "type": "ERC20", "fees": "ethereum" }, - "LINK": { - "symbol": "LINK", - "name": "Chainlink", + "GT": { + "symbol": "GT", + "name": "Gate", "decimals": 18, - "contractId": "0x514910771af9ca656af840dff83e8264ecf986ca", + "contractId": "0xe66747a101bff2dba3697199dcce5b743b454759", "createCoin": false, "cryptoTransferDecimals": 6, + "defaultVisibility": true, "defaultGasLimit": 58000, + "defaultOrdinalLevel": 100, "status": "active", "mainCoin": "ETH", "type": "ERC20", @@ -421,26 +339,26 @@ "defaultOrdinalLevel": 60, "explorerTx": "https://liskscan.com/transaction/${ID}" }, - "MATIC": { - "symbol": "MATIC", - "name": "Polygon", - "regexAddress": "^0x[0-9a-fA-F]{40}$", + "DAI": { + "symbol": "DAI", + "name": "Dai", "decimals": 18, - "contractId": "0x7d1afa7b718fb893db30a3abc0cfc608aacfebb0", + "contractId": "0x6b175474e89094c44da98b954eedeac495271d0f", "createCoin": false, "cryptoTransferDecimals": 6, + "defaultVisibility": true, "defaultGasLimit": 58000, - "explorerTx": "https://polygonscan.com/tx/${ID}", + "defaultOrdinalLevel": 50, "status": "active", "mainCoin": "ETH", "type": "ERC20", "fees": "ethereum" }, - "MANA": { - "symbol": "MANA", - "name": "Decentraland", + "BUSD": { + "symbol": "BUSD", + "name": "Binance USD", "decimals": 18, - "contractId": "0x0f5d2fb29fb7d3cfee444a200298f468908cc942", + "contractId": "0x4fabb145d64652a948d72533023f6e7a623c7c53", "createCoin": false, "cryptoTransferDecimals": 6, "defaultGasLimit": 58000, @@ -449,11 +367,52 @@ "type": "ERC20", "fees": "ethereum" }, - "PAXG": { - "symbol": "PAXG", - "name": "PAX Gold", + "ENS": { + "symbol": "ENS", + "name": "Ethereum Name Service", "decimals": 18, - "contractId": "0x45804880de22913dafe09f4980848ece6ecbaf78", + "contractId": "0xC18360217D8F7Ab5e7c516566761Ea12Ce7F9D72", + "createCoin": false, + "cryptoTransferDecimals": 6, + "defaultGasLimit": 58000, + "status": "active", + "mainCoin": "ETH", + "type": "ERC20", + "fees": "ethereum" + }, + "INJ": { + "symbol": "INJ", + "name": "Injective", + "regexAddress": "^(inj)[a-zA-HJ-NP-Z0-9]{25,39}$", + "decimals": 18, + "contractId": "0xe28b3b32b6c345a34ff64674606124dd5aceca30", + "createCoin": false, + "cryptoTransferDecimals": 6, + "defaultGasLimit": 58000, + "explorerTx": "https://explorer.injective.network/transaction/${ID}", + "status": "active", + "mainCoin": "ETH", + "type": "ERC20", + "fees": "ethereum" + }, + "HOT": { + "symbol": "HOT", + "name": "Holo", + "decimals": 18, + "contractId": "0x6c6ee5e31d828de241282b9606c8e98ea48526e2", + "createCoin": false, + "cryptoTransferDecimals": 6, + "defaultGasLimit": 58000, + "status": "active", + "mainCoin": "ETH", + "type": "ERC20", + "fees": "ethereum" + }, + "MANA": { + "symbol": "MANA", + "name": "Decentraland", + "decimals": 18, + "contractId": "0x0f5d2fb29fb7d3cfee444a200298f468908cc942", "createCoin": false, "cryptoTransferDecimals": 6, "defaultGasLimit": 58000, @@ -475,39 +434,67 @@ "type": "ERC20", "fees": "ethereum" }, - "REN": { - "symbol": "REN", - "name": "Ren", + "MATIC": { + "symbol": "MATIC", + "name": "Polygon", + "regexAddress": "^0x[0-9a-fA-F]{40}$", "decimals": 18, - "contractId": "0x408e41876cccdc0f92210600ef50372656052a38", + "contractId": "0x7d1afa7b718fb893db30a3abc0cfc608aacfebb0", "createCoin": false, "cryptoTransferDecimals": 6, "defaultGasLimit": 58000, + "explorerTx": "https://polygonscan.com/tx/${ID}", "status": "active", "mainCoin": "ETH", "type": "ERC20", "fees": "ethereum" }, - "SKL": { - "symbol": "SKL", - "name": "SKALE", + "LINK": { + "symbol": "LINK", + "name": "Chainlink", "decimals": 18, - "contractId": "0x00c83aecc790e8a4453e5dd3b0b4b3680501a7a7", + "contractId": "0x514910771af9ca656af840dff83e8264ecf986ca", + "createCoin": false, + "cryptoTransferDecimals": 6, + "defaultGasLimit": 58000, + "status": "active", + "mainCoin": "ETH", + "type": "ERC20", + "fees": "ethereum" + }, + "STORJ": { + "symbol": "STORJ", + "name": "Storj", + "decimals": 8, + "contractId": "0xb64ef51c888972c908cfacf59b47c1afbc0ab8ac", "createCoin": false, "cryptoTransferDecimals": 6, "defaultVisibility": true, "defaultGasLimit": 58000, - "defaultOrdinalLevel": 85, + "defaultOrdinalLevel": 100, "status": "active", "mainCoin": "ETH", "type": "ERC20", "fees": "ethereum" }, - "SNX": { - "symbol": "SNX", - "name": "Synthetix Network", + "PAXG": { + "symbol": "PAXG", + "name": "PAX Gold", "decimals": 18, - "contractId": "0xc011a73ee8576fb46f5e1c5751ca3b9fe0af2a6f", + "contractId": "0x45804880de22913dafe09f4980848ece6ecbaf78", + "createCoin": false, + "cryptoTransferDecimals": 6, + "defaultGasLimit": 58000, + "status": "active", + "mainCoin": "ETH", + "type": "ERC20", + "fees": "ethereum" + }, + "REN": { + "symbol": "REN", + "name": "Ren", + "decimals": 18, + "contractId": "0x408e41876cccdc0f92210600ef50372656052a38", "createCoin": false, "cryptoTransferDecimals": 6, "defaultGasLimit": 58000, @@ -529,16 +516,16 @@ "type": "ERC20", "fees": "ethereum" }, - "STORJ": { - "symbol": "STORJ", - "name": "Storj", - "decimals": 8, - "contractId": "0xb64ef51c888972c908cfacf59b47c1afbc0ab8ac", + "SKL": { + "symbol": "SKL", + "name": "SKALE", + "decimals": 18, + "contractId": "0x00c83aecc790e8a4453e5dd3b0b4b3680501a7a7", "createCoin": false, "cryptoTransferDecimals": 6, "defaultVisibility": true, "defaultGasLimit": 58000, - "defaultOrdinalLevel": 100, + "defaultOrdinalLevel": 85, "status": "active", "mainCoin": "ETH", "type": "ERC20", @@ -557,14 +544,16 @@ "type": "ERC20", "fees": "ethereum" }, - "USDP": { - "symbol": "USDP", - "name": "PAX Dollar", + "VERSE": { + "symbol": "VERSE", + "name": "Verse", "decimals": 18, - "contractId": "0x8e870d67f660d95d5be530380d0ec0bd388289e1", + "contractId": "0x249cA82617eC3DfB2589c4c17ab7EC9765350a18", "createCoin": false, "cryptoTransferDecimals": 6, + "defaultVisibility": true, "defaultGasLimit": 58000, + "defaultOrdinalLevel": 95, "status": "active", "mainCoin": "ETH", "type": "ERC20", @@ -598,6 +587,19 @@ "type": "ERC20", "fees": "ethereum" }, + "USDP": { + "symbol": "USDP", + "name": "PAX Dollar", + "decimals": 18, + "contractId": "0x8e870d67f660d95d5be530380d0ec0bd388289e1", + "createCoin": false, + "cryptoTransferDecimals": 6, + "defaultGasLimit": 58000, + "status": "active", + "mainCoin": "ETH", + "type": "ERC20", + "fees": "ethereum" + }, "USDS": { "symbol": "USDS", "name": "Stably USD", @@ -626,21 +628,6 @@ "type": "ERC20", "fees": "ethereum" }, - "VERSE": { - "symbol": "VERSE", - "name": "Verse", - "decimals": 18, - "contractId": "0x249cA82617eC3DfB2589c4c17ab7EC9765350a18", - "createCoin": false, - "cryptoTransferDecimals": 6, - "defaultVisibility": true, - "defaultGasLimit": 58000, - "defaultOrdinalLevel": 95, - "status": "active", - "mainCoin": "ETH", - "type": "ERC20", - "fees": "ethereum" - }, "WOO": { "symbol": "WOO", "name": "WOO Network", @@ -668,5 +655,18 @@ "mainCoin": "ETH", "type": "ERC20", "fees": "ethereum" + }, + "SNX": { + "symbol": "SNX", + "name": "Synthetix Network", + "decimals": 18, + "contractId": "0xc011a73ee8576fb46f5e1c5751ca3b9fe0af2a6f", + "createCoin": false, + "cryptoTransferDecimals": 6, + "defaultGasLimit": 58000, + "status": "active", + "mainCoin": "ETH", + "type": "ERC20", + "fees": "ethereum" } } \ No newline at end of file