diff --git a/package.json b/package.json index 6a66ce8..700c103 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "license": "ISC", "type": "module", "dependencies": { - "@helixbridge/helixconf": "^1.1.7", + "@helixbridge/helixconf": "^1.1.10", "@safe-global/api-kit": "^2.4.3", "@safe-global/protocol-kit": "^4.0.3", "ethers": "^6.13.2" diff --git a/src/generator/generate_configure.js b/src/generator/generate_configure.js index e793732..b29aeb2 100644 --- a/src/generator/generate_configure.js +++ b/src/generator/generate_configure.js @@ -42,7 +42,7 @@ async function generateWithGroup(options, group) { }; await _fillEncryptedPrivateKey(fillOptions); - await _fillRpcnodes(fillOptions); + // await _fillRpcnodes(fillOptions); const outputJson = JSON.stringify(configure, null, 2); await fs.writeFile(storeFile, outputJson); @@ -152,30 +152,30 @@ async function _fillEncryptedPrivateKey(options) { } } -async function _fillRpcnodes(options) { - const {configure, definition} = options; - const customRpcNodes = configure.rpcnodes ?? []; - const bridges = configure.bridges; - for (const bridge of bridges) { - const [sourceChainName, targetChainName] = bridge.direction.split('->'); - const [sourceChain, targetChain] = [ - HelixChain.get(sourceChainName), - HelixChain.get(targetChainName), - ]; - __updateRpcnodesRpc(customRpcNodes, {name: sourceChainName, rpc: sourceChain.rpc}); - __updateRpcnodesRpc(customRpcNodes, {name: targetChainName, rpc: targetChain.rpc}); - } - configure.rpcnodes = customRpcNodes; -} - -function __updateRpcnodesRpc(rpcnodes, detected = {name, rpc}) { - for (const rpcnode of rpcnodes) { - if (rpcnode.name !== detected.name) { - continue; - } - if (rpcnode.rpc) return; - rpcnode.rpc = detected.rpc; - return; - } - rpcnodes.push(detected); -} +// async function _fillRpcnodes(options) { +// const {configure, definition} = options; +// const customRpcNodes = configure.rpcnodes ?? []; +// const bridges = configure.bridges; +// for (const bridge of bridges) { +// const [sourceChainName, targetChainName] = bridge.direction.split('->'); +// const [sourceChain, targetChain] = [ +// HelixChain.get(sourceChainName), +// HelixChain.get(targetChainName), +// ]; +// __updateRpcnodesRpc(customRpcNodes, {name: sourceChainName, rpc: sourceChain.rpc}); +// __updateRpcnodesRpc(customRpcNodes, {name: targetChainName, rpc: targetChain.rpc}); +// } +// configure.rpcnodes = customRpcNodes; +// } +// +// function __updateRpcnodesRpc(rpcnodes, detected = {name, rpc}) { +// for (const rpcnode of rpcnodes) { +// if (rpcnode.name !== detected.name) { +// continue; +// } +// if (rpcnode.rpc) return; +// rpcnode.rpc = detected.rpc; +// return; +// } +// rpcnodes.push(detected); +// } diff --git a/yarn.lock b/yarn.lock index 55af7d7..59b5831 100644 --- a/yarn.lock +++ b/yarn.lock @@ -110,10 +110,10 @@ "@ethersproject/rlp" "^5.7.0" "@ethersproject/signing-key" "^5.7.0" -"@helixbridge/helixconf@^1.1.7": - version "1.1.7" - resolved "https://registry.yarnpkg.com/@helixbridge/helixconf/-/helixconf-1.1.7.tgz#a2d33b0a8aa03c704aa2c0e49c558bc57572e28d" - integrity sha512-1FIxGAzK4uvfz9sxmMOIvF9+e/CurUoxFgqHxSi5zIORfcp8iIZGCPIZCwgXAxxtAAz5GcrDU8STsRqcCGmzOw== +"@helixbridge/helixconf@^1.1.10": + version "1.1.10" + resolved "https://registry.yarnpkg.com/@helixbridge/helixconf/-/helixconf-1.1.10.tgz#9c1a2781a19cbb47272a799dcd9865c4b31f5145" + integrity sha512-wDRCsWKo0dmiMPCufD9qI+z/7fwZAEDYDNVmn6ttnBokNK0bVH5xSBKOVuhc5colHiiYuUlllWXYt1Yabi6cnQ== "@noble/curves@1.2.0": version "1.2.0"