From 99ddda8c893450ed6b6f344f1fc70eec4a1f3a62 Mon Sep 17 00:00:00 2001 From: "fateme.r" Date: Mon, 11 Nov 2024 12:41:55 +0330 Subject: [PATCH 1/5] Use bitcoin rpc scanner instead of esplora scanner --- apps/rosen-service/config/default.yaml | 5 +- apps/rosen-service/package.json | 14 +- apps/rosen-service/src/configs.ts | 4 +- .../src/observation/chains/bitcoin.ts | 8 +- .../src/scanner/chains/bitcoin.ts | 8 +- package-lock.json | 283 +++++++++++++++--- 6 files changed, 259 insertions(+), 63 deletions(-) diff --git a/apps/rosen-service/config/default.yaml b/apps/rosen-service/config/default.yaml index 9092892c..9bf36a86 100644 --- a/apps/rosen-service/config/default.yaml +++ b/apps/rosen-service/config/default.yaml @@ -31,7 +31,10 @@ bitcoin: tokens: rwt: initialHeight: - esploraUrl: https://blockstream.info + rpc: + url: + username: + password: ethereum: addresses: lock: diff --git a/apps/rosen-service/package.json b/apps/rosen-service/package.json index 672880d8..40163dbb 100644 --- a/apps/rosen-service/package.json +++ b/apps/rosen-service/package.json @@ -17,14 +17,14 @@ "get-config": "npx @rosen-bridge/cli download-assets --chain-type mainnet --out config --include-prereleases" }, "dependencies": { - "@rosen-bridge/bitcoin-esplora-scanner": "^0.1.14", - "@rosen-bridge/bitcoin-observation-extractor": "^4.0.7", - "@rosen-bridge/evm-observation-extractor": "^3.0.5", - "@rosen-bridge/evm-rpc-scanner": "^1.0.4", + "@rosen-bridge/bitcoin-observation-extractor": "^4.0.8", + "@rosen-bridge/bitcoin-rpc-scanner": "^1.0.0", + "@rosen-bridge/evm-observation-extractor": "^3.1.0", + "@rosen-bridge/evm-rpc-scanner": "^2.0.0", "@rosen-bridge/extended-typeorm": "^0.0.3", - "@rosen-bridge/observation-extractor": "^5.0.7", - "@rosen-bridge/scanner": "^4.1.3", - "@rosen-bridge/watcher-data-extractor": "^8.0.2", + "@rosen-bridge/observation-extractor": "^5.0.8", + "@rosen-bridge/scanner": "^5.0.0", + "@rosen-bridge/watcher-data-extractor": "^9.0.0", "@rosen-bridge/winston-logger": "^0.2.1", "@rosen-ui/asset-calculator": "^2.0.0", "config": "^3.3.7" diff --git a/apps/rosen-service/src/configs.ts b/apps/rosen-service/src/configs.ts index 107b2b12..f8bc42ba 100644 --- a/apps/rosen-service/src/configs.ts +++ b/apps/rosen-service/src/configs.ts @@ -59,7 +59,9 @@ const getConfig = () => { tokens: { rwt: nodeConfig.get('bitcoin.tokens.rwt'), }, - esploraUrl: nodeConfig.get('bitcoin.esploraUrl'), + rpcUrl: nodeConfig.get('bitcoin.rpc.url'), + rpcUsername: getOptionalString('bitcoin.rpc.username'), + rpcPassword: getOptionalString('bitcoin.rpc.password'), }, ethereum: { addresses: { diff --git a/apps/rosen-service/src/observation/chains/bitcoin.ts b/apps/rosen-service/src/observation/chains/bitcoin.ts index db1a10ea..545ae39c 100644 --- a/apps/rosen-service/src/observation/chains/bitcoin.ts +++ b/apps/rosen-service/src/observation/chains/bitcoin.ts @@ -1,4 +1,4 @@ -import { BitcoinEsploraObservationExtractor } from '@rosen-bridge/bitcoin-observation-extractor'; +import { BitcoinRpcObservationExtractor } from '@rosen-bridge/bitcoin-observation-extractor'; import WinstonLogger from '@rosen-bridge/winston-logger'; import { getRosenTokens } from '../../utils'; @@ -8,7 +8,7 @@ import config from '../../configs'; import dataSource from '../../data-source'; import AppError from '../../errors/AppError'; -import { BitcoinEsploraScanner } from '@rosen-bridge/bitcoin-esplora-scanner'; +import { BitcoinRpcScanner } from '@rosen-bridge/bitcoin-rpc-scanner'; const logger = WinstonLogger.getInstance().getLogger(import.meta.url); @@ -16,9 +16,9 @@ const logger = WinstonLogger.getInstance().getLogger(import.meta.url); * register an observation extractor for the provided scanner * @param scanner */ -export const registerBitcoinExtractor = (scanner: BitcoinEsploraScanner) => { +export const registerBitcoinExtractor = (scanner: BitcoinRpcScanner) => { try { - const observationExtractor = new BitcoinEsploraObservationExtractor( + const observationExtractor = new BitcoinRpcObservationExtractor( config.bitcoin.addresses.lock, dataSource, getRosenTokens(), diff --git a/apps/rosen-service/src/scanner/chains/bitcoin.ts b/apps/rosen-service/src/scanner/chains/bitcoin.ts index 69d8471b..d8195de9 100644 --- a/apps/rosen-service/src/scanner/chains/bitcoin.ts +++ b/apps/rosen-service/src/scanner/chains/bitcoin.ts @@ -1,4 +1,4 @@ -import { BitcoinEsploraScanner } from '@rosen-bridge/bitcoin-esplora-scanner'; +import { BitcoinRpcScanner } from '@rosen-bridge/bitcoin-rpc-scanner'; import WinstonLogger from '@rosen-bridge/winston-logger'; import dataSource from '../../data-source'; @@ -28,12 +28,14 @@ const scannerLogger = WinstonLogger.getInstance().getLogger( */ export const startBitcoinScanner = async () => { try { - const scanner = new BitcoinEsploraScanner( + const scanner = new BitcoinRpcScanner( { - esploraUrl: config.bitcoin.esploraUrl, + rpcUrl: config.bitcoin.rpcUrl, dataSource, initialHeight: config.bitcoin.initialHeight, timeout: SCANNER_API_TIMEOUT, + username: config.bitcoin.rpcUsername, + password: config.bitcoin.rpcPassword, }, scannerLogger ); diff --git a/package-lock.json b/package-lock.json index e6968904..0209b7a0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -142,14 +142,14 @@ "version": "2.0.0", "license": "GPL-3.0", "dependencies": { - "@rosen-bridge/bitcoin-esplora-scanner": "^0.1.14", - "@rosen-bridge/bitcoin-observation-extractor": "^4.0.7", - "@rosen-bridge/evm-observation-extractor": "^3.0.5", - "@rosen-bridge/evm-rpc-scanner": "^1.0.4", + "@rosen-bridge/bitcoin-observation-extractor": "^4.0.8", + "@rosen-bridge/bitcoin-rpc-scanner": "^1.0.0", + "@rosen-bridge/evm-observation-extractor": "^3.1.0", + "@rosen-bridge/evm-rpc-scanner": "^2.0.0", "@rosen-bridge/extended-typeorm": "^0.0.3", - "@rosen-bridge/observation-extractor": "^5.0.7", - "@rosen-bridge/scanner": "^4.1.3", - "@rosen-bridge/watcher-data-extractor": "^8.0.2", + "@rosen-bridge/observation-extractor": "^5.0.8", + "@rosen-bridge/scanner": "^5.0.0", + "@rosen-bridge/watcher-data-extractor": "^9.0.0", "@rosen-bridge/winston-logger": "^0.2.1", "@rosen-ui/asset-calculator": "^2.0.0", "config": "^3.3.7" @@ -162,6 +162,58 @@ "typescript": "^5.0.0" } }, + "apps/rosen-service/node_modules/@rosen-bridge/abstract-logger": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@rosen-bridge/abstract-logger/-/abstract-logger-1.0.0.tgz", + "integrity": "sha512-hN/cb0HSlhqvaEjqzFPZGIYOa70gdPd+mYrS5C7uNrv1Vw6k2k4lY4US05rwBENjSQpwik1H4gdCBzUkbCcjGA==" + }, + "apps/rosen-service/node_modules/@rosen-bridge/scanner": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@rosen-bridge/scanner/-/scanner-5.0.0.tgz", + "integrity": "sha512-v4ayWIBA1yEpitCCN1Y9B/BgyqxMvHj+SnXQ9nAURSgV9fW7Q7y4ijRMiXwsxft/OEe06TVJTIv8mSx/mH4CKg==", + "dependencies": { + "@apollo/client": "^3.8.7", + "@blockfrost/blockfrost-js": "^5.4.0", + "@cardano-ogmios/client": "^6.6.1", + "@cardano-ogmios/schema": "^6.6.1", + "@rosen-bridge/abstract-extractor": "^0.3.1", + "@rosen-bridge/abstract-logger": "^1.0.0", + "@rosen-bridge/json-bigint": "^0.1.0", + "@rosen-clients/ergo-explorer": "^1.1.1", + "@rosen-clients/ergo-node": "^1.1.1", + "await-semaphore": "^0.1.3", + "axios": "^1.6.8", + "cockatiel": "^3.2.1", + "cross-fetch": "^4.0.0", + "lodash-es": "^4.17.21", + "reflect-metadata": "^0.1.13", + "sqlite3": "^5.0.9", + "typeorm": "^0.3.20" + } + }, + "apps/rosen-service/node_modules/@rosen-bridge/watcher-data-extractor": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/@rosen-bridge/watcher-data-extractor/-/watcher-data-extractor-9.0.0.tgz", + "integrity": "sha512-OrQCtVxd4XaLEYAQZVVQbtf6Vy+U+rwEbbUbb3+AH/m0ekw9/oDVBgrRDgQq9kCkAMqybhpUgpp9OkILtCSZFA==", + "dependencies": { + "@rosen-bridge/abstract-extractor": "^0.3.1", + "@rosen-bridge/abstract-logger": "^1.0.0", + "@rosen-bridge/extended-typeorm": "^0.0.3", + "@rosen-bridge/json-bigint": "^0.1.0", + "@rosen-bridge/scanner": "^5.0.0", + "@rosen-bridge/tokens": "^1.2.1", + "@rosen-clients/ergo-explorer": "^1.1.1", + "@types/lodash-es": "^4.17.6", + "blakejs": "^1.2.1", + "ergo-lib-wasm-nodejs": "^0.24.1", + "json-bigint": "^1.0.0", + "lodash-es": "^4.17.21", + "pg": "^8.10.0", + "reflect-metadata": "^0.1.13", + "sqlite3": "^5.0.9", + "typeorm": "^0.3.20" + } + }, "apps/rosen-service/node_modules/@types/node": { "version": "18.19.1", "dev": true, @@ -170,6 +222,14 @@ "undici-types": "~5.26.4" } }, + "apps/rosen-service/node_modules/cross-fetch": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-4.0.0.tgz", + "integrity": "sha512-e4a5N8lVvuLgAWgnCrLr2PP0YyDOTHa9H/Rj54dirp61qXnNq46m82bRhNqIA5VccJtWBvPTFRV3TtvHUKPB1g==", + "dependencies": { + "node-fetch": "^2.6.12" + } + }, "apps/rosen-service/node_modules/tsconfig-paths": { "version": "4.2.0", "dev": true, @@ -8536,9 +8596,9 @@ ] }, "node_modules/@rosen-bridge/abstract-extractor": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/@rosen-bridge/abstract-extractor/-/abstract-extractor-0.3.0.tgz", - "integrity": "sha512-Ty2CRgNKc0JzHbiDUfYxQy53fDNALJiQgsDYBapZGSTfqgl8wPm3yQytp7cpIDBwfgQGD3Y2wE+UEwRgjwQNbA==", + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@rosen-bridge/abstract-extractor/-/abstract-extractor-0.3.1.tgz", + "integrity": "sha512-C09GpKLmaLog6hAGX63KZ4qw50vu0dV3UHil+dJUI9l6Ei7e5wNcDYR+Y2iLyOKwSG4xleF/nl0r42u+XUn+6A==", "dependencies": { "@rosen-bridge/abstract-logger": "^1.0.0", "@rosen-bridge/json-bigint": "^0.1.0", @@ -8574,13 +8634,12 @@ } }, "node_modules/@rosen-bridge/bitcoin-esplora-scanner": { - "version": "0.1.14", - "resolved": "https://registry.npmjs.org/@rosen-bridge/bitcoin-esplora-scanner/-/bitcoin-esplora-scanner-0.1.14.tgz", - "integrity": "sha512-CV74VNVn7tPph0KPxQq0JiBtbI2RDTHUXbg2dUi98hiafFbRIF1bSw6sNWAEfI00RmNR20q7kgD7a7nO2HOiLw==", - "license": "GPL-3.0", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@rosen-bridge/bitcoin-esplora-scanner/-/bitcoin-esplora-scanner-1.0.0.tgz", + "integrity": "sha512-rlTGX9XLgEXnDVcMNY0OgtF4eAh1wU8lsnDnQrm4FgY7QR8y5h7F9/R6Vba+F2i2mG/XQpHCrZ8MrIJ6FMhXDg==", "dependencies": { "@rosen-bridge/abstract-logger": "^1.0.0", - "@rosen-bridge/scanner": "^4.1.3", + "@rosen-bridge/scanner": "^5.0.0", "axios": "^1.6.8" }, "engines": { @@ -8592,16 +8651,47 @@ "resolved": "https://registry.npmjs.org/@rosen-bridge/abstract-logger/-/abstract-logger-1.0.0.tgz", "integrity": "sha512-hN/cb0HSlhqvaEjqzFPZGIYOa70gdPd+mYrS5C7uNrv1Vw6k2k4lY4US05rwBENjSQpwik1H4gdCBzUkbCcjGA==" }, + "node_modules/@rosen-bridge/bitcoin-esplora-scanner/node_modules/@rosen-bridge/scanner": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@rosen-bridge/scanner/-/scanner-5.0.0.tgz", + "integrity": "sha512-v4ayWIBA1yEpitCCN1Y9B/BgyqxMvHj+SnXQ9nAURSgV9fW7Q7y4ijRMiXwsxft/OEe06TVJTIv8mSx/mH4CKg==", + "dependencies": { + "@apollo/client": "^3.8.7", + "@blockfrost/blockfrost-js": "^5.4.0", + "@cardano-ogmios/client": "^6.6.1", + "@cardano-ogmios/schema": "^6.6.1", + "@rosen-bridge/abstract-extractor": "^0.3.1", + "@rosen-bridge/abstract-logger": "^1.0.0", + "@rosen-bridge/json-bigint": "^0.1.0", + "@rosen-clients/ergo-explorer": "^1.1.1", + "@rosen-clients/ergo-node": "^1.1.1", + "await-semaphore": "^0.1.3", + "axios": "^1.6.8", + "cockatiel": "^3.2.1", + "cross-fetch": "^4.0.0", + "lodash-es": "^4.17.21", + "reflect-metadata": "^0.1.13", + "sqlite3": "^5.0.9", + "typeorm": "^0.3.20" + } + }, + "node_modules/@rosen-bridge/bitcoin-esplora-scanner/node_modules/cross-fetch": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-4.0.0.tgz", + "integrity": "sha512-e4a5N8lVvuLgAWgnCrLr2PP0YyDOTHa9H/Rj54dirp61qXnNq46m82bRhNqIA5VccJtWBvPTFRV3TtvHUKPB1g==", + "dependencies": { + "node-fetch": "^2.6.12" + } + }, "node_modules/@rosen-bridge/bitcoin-observation-extractor": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/@rosen-bridge/bitcoin-observation-extractor/-/bitcoin-observation-extractor-4.0.7.tgz", - "integrity": "sha512-mtQfx5utzCcjLR9spz07kZ+IoFscsTIJnlzEHlS8cVsZHTUejhbH4co4ceDdqsx7RYePty7XJ4TYLNObS6N8lg==", - "license": "GPL-3.0", + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/@rosen-bridge/bitcoin-observation-extractor/-/bitcoin-observation-extractor-4.0.8.tgz", + "integrity": "sha512-Kd+DowGCECZd1EUAg5Pg4sHtKLVMEQpEa4UzcsjOku+I11nXVVNm0lZbpPD7sdKzDO/W7Y5ZFWyhIO8NvEV2aw==", "dependencies": { "@rosen-bridge/abstract-logger": "^1.0.0", - "@rosen-bridge/bitcoin-esplora-scanner": "^0.1.14", - "@rosen-bridge/bitcoin-rpc-scanner": "^0.2.8", - "@rosen-bridge/observation-extractor": "^5.0.7", + "@rosen-bridge/bitcoin-esplora-scanner": "^1.0.0", + "@rosen-bridge/bitcoin-rpc-scanner": "^1.0.0", + "@rosen-bridge/observation-extractor": "^5.0.8", "@rosen-bridge/rosen-extractor": "^6.2.0", "@rosen-bridge/tokens": "^1.2.0", "typeorm": "^0.3.20" @@ -8616,13 +8706,12 @@ "integrity": "sha512-hN/cb0HSlhqvaEjqzFPZGIYOa70gdPd+mYrS5C7uNrv1Vw6k2k4lY4US05rwBENjSQpwik1H4gdCBzUkbCcjGA==" }, "node_modules/@rosen-bridge/bitcoin-rpc-scanner": { - "version": "0.2.8", - "resolved": "https://registry.npmjs.org/@rosen-bridge/bitcoin-rpc-scanner/-/bitcoin-rpc-scanner-0.2.8.tgz", - "integrity": "sha512-pOpa6ytcsqOGXkTdqwR6kmWycqAx4QWLaU4UWGpWSozJ2QrKXTXwfwb67uEuSiFL4g2zvqSJ2pSRQwaUdkBx1g==", - "license": "GPL-3.0", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@rosen-bridge/bitcoin-rpc-scanner/-/bitcoin-rpc-scanner-1.0.0.tgz", + "integrity": "sha512-gpk2fhZ7hIFHmRUTDjUHojLmChajkEajK69+H6mak6Yi0cDYweJMGttUjrNN7rv+BHQ95X2s2ANCNo2HCQ41IA==", "dependencies": { "@rosen-bridge/abstract-logger": "^1.0.0", - "@rosen-bridge/scanner": "^4.1.3", + "@rosen-bridge/scanner": "^5.0.0", "axios": "^1.6.8" }, "engines": { @@ -8632,8 +8721,39 @@ "node_modules/@rosen-bridge/bitcoin-rpc-scanner/node_modules/@rosen-bridge/abstract-logger": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/@rosen-bridge/abstract-logger/-/abstract-logger-1.0.0.tgz", - "integrity": "sha512-hN/cb0HSlhqvaEjqzFPZGIYOa70gdPd+mYrS5C7uNrv1Vw6k2k4lY4US05rwBENjSQpwik1H4gdCBzUkbCcjGA==", - "license": "GPL-3.0" + "integrity": "sha512-hN/cb0HSlhqvaEjqzFPZGIYOa70gdPd+mYrS5C7uNrv1Vw6k2k4lY4US05rwBENjSQpwik1H4gdCBzUkbCcjGA==" + }, + "node_modules/@rosen-bridge/bitcoin-rpc-scanner/node_modules/@rosen-bridge/scanner": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@rosen-bridge/scanner/-/scanner-5.0.0.tgz", + "integrity": "sha512-v4ayWIBA1yEpitCCN1Y9B/BgyqxMvHj+SnXQ9nAURSgV9fW7Q7y4ijRMiXwsxft/OEe06TVJTIv8mSx/mH4CKg==", + "dependencies": { + "@apollo/client": "^3.8.7", + "@blockfrost/blockfrost-js": "^5.4.0", + "@cardano-ogmios/client": "^6.6.1", + "@cardano-ogmios/schema": "^6.6.1", + "@rosen-bridge/abstract-extractor": "^0.3.1", + "@rosen-bridge/abstract-logger": "^1.0.0", + "@rosen-bridge/json-bigint": "^0.1.0", + "@rosen-clients/ergo-explorer": "^1.1.1", + "@rosen-clients/ergo-node": "^1.1.1", + "await-semaphore": "^0.1.3", + "axios": "^1.6.8", + "cockatiel": "^3.2.1", + "cross-fetch": "^4.0.0", + "lodash-es": "^4.17.21", + "reflect-metadata": "^0.1.13", + "sqlite3": "^5.0.9", + "typeorm": "^0.3.20" + } + }, + "node_modules/@rosen-bridge/bitcoin-rpc-scanner/node_modules/cross-fetch": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-4.0.0.tgz", + "integrity": "sha512-e4a5N8lVvuLgAWgnCrLr2PP0YyDOTHa9H/Rj54dirp61qXnNq46m82bRhNqIA5VccJtWBvPTFRV3TtvHUKPB1g==", + "dependencies": { + "node-fetch": "^2.6.12" + } }, "node_modules/@rosen-bridge/bitcoin-utxo-selection": { "version": "0.2.0", @@ -8700,14 +8820,13 @@ } }, "node_modules/@rosen-bridge/evm-observation-extractor": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/@rosen-bridge/evm-observation-extractor/-/evm-observation-extractor-3.0.5.tgz", - "integrity": "sha512-WJZdAKJHMtWXWXDDgo3Q3hZDZZxFWfSr8SuKDSvmIaOOxuCZ3VbKxHJlnOmz4LtxgncXK3YT0fdNqzQ1sOne9Q==", - "license": "GPL-3.0", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@rosen-bridge/evm-observation-extractor/-/evm-observation-extractor-3.1.0.tgz", + "integrity": "sha512-91wNCsBKRUB4CvXymw7XrlTt92lj3sjuh7NPSWoWKSl3fmslhHqkd4DUj6nSHMQCs29ThzBp/7EfergPkl7Rig==", "dependencies": { "@rosen-bridge/abstract-logger": "^1.0.0", - "@rosen-bridge/evm-rpc-scanner": "^1.0.4", - "@rosen-bridge/observation-extractor": "^5.0.7", + "@rosen-bridge/evm-rpc-scanner": "^2.0.0", + "@rosen-bridge/observation-extractor": "^5.0.8", "@rosen-bridge/rosen-extractor": "^6.2.0", "@rosen-bridge/tokens": "^1.2.0", "blakejs": "^1.2.1", @@ -8724,21 +8843,51 @@ "license": "GPL-3.0" }, "node_modules/@rosen-bridge/evm-rpc-scanner": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@rosen-bridge/evm-rpc-scanner/-/evm-rpc-scanner-1.0.4.tgz", - "integrity": "sha512-IrMrpK51SJkgUT7QY/nfjb/1U4t9yh1C/x+eZeFe2vRlLN+kX9NUtYHwGCY3Qfnfd+zpFrbRQQ0ooG7C70H5FA==", - "license": "GPL-3.0", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@rosen-bridge/evm-rpc-scanner/-/evm-rpc-scanner-2.0.0.tgz", + "integrity": "sha512-EPTXRYoI2odeXGwqIJuZ6BPsn+F6Dz/7J+Mo0uX8AfzgHTPkykqav13IYs5g58feESk+SSfFAsgXUpbYoGEgnA==", "dependencies": { "@rosen-bridge/abstract-logger": "^1.0.0", - "@rosen-bridge/scanner": "^4.1.3", + "@rosen-bridge/scanner": "^5.0.0", "ethers": "^6.11.0" } }, "node_modules/@rosen-bridge/evm-rpc-scanner/node_modules/@rosen-bridge/abstract-logger": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/@rosen-bridge/abstract-logger/-/abstract-logger-1.0.0.tgz", - "integrity": "sha512-hN/cb0HSlhqvaEjqzFPZGIYOa70gdPd+mYrS5C7uNrv1Vw6k2k4lY4US05rwBENjSQpwik1H4gdCBzUkbCcjGA==", - "license": "GPL-3.0" + "integrity": "sha512-hN/cb0HSlhqvaEjqzFPZGIYOa70gdPd+mYrS5C7uNrv1Vw6k2k4lY4US05rwBENjSQpwik1H4gdCBzUkbCcjGA==" + }, + "node_modules/@rosen-bridge/evm-rpc-scanner/node_modules/@rosen-bridge/scanner": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@rosen-bridge/scanner/-/scanner-5.0.0.tgz", + "integrity": "sha512-v4ayWIBA1yEpitCCN1Y9B/BgyqxMvHj+SnXQ9nAURSgV9fW7Q7y4ijRMiXwsxft/OEe06TVJTIv8mSx/mH4CKg==", + "dependencies": { + "@apollo/client": "^3.8.7", + "@blockfrost/blockfrost-js": "^5.4.0", + "@cardano-ogmios/client": "^6.6.1", + "@cardano-ogmios/schema": "^6.6.1", + "@rosen-bridge/abstract-extractor": "^0.3.1", + "@rosen-bridge/abstract-logger": "^1.0.0", + "@rosen-bridge/json-bigint": "^0.1.0", + "@rosen-clients/ergo-explorer": "^1.1.1", + "@rosen-clients/ergo-node": "^1.1.1", + "await-semaphore": "^0.1.3", + "axios": "^1.6.8", + "cockatiel": "^3.2.1", + "cross-fetch": "^4.0.0", + "lodash-es": "^4.17.21", + "reflect-metadata": "^0.1.13", + "sqlite3": "^5.0.9", + "typeorm": "^0.3.20" + } + }, + "node_modules/@rosen-bridge/evm-rpc-scanner/node_modules/cross-fetch": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-4.0.0.tgz", + "integrity": "sha512-e4a5N8lVvuLgAWgnCrLr2PP0YyDOTHa9H/Rj54dirp61qXnNq46m82bRhNqIA5VccJtWBvPTFRV3TtvHUKPB1g==", + "dependencies": { + "node-fetch": "^2.6.12" + } }, "node_modules/@rosen-bridge/extended-typeorm": { "version": "0.0.3", @@ -8791,15 +8940,15 @@ "integrity": "sha512-hN/cb0HSlhqvaEjqzFPZGIYOa70gdPd+mYrS5C7uNrv1Vw6k2k4lY4US05rwBENjSQpwik1H4gdCBzUkbCcjGA==" }, "node_modules/@rosen-bridge/observation-extractor": { - "version": "5.0.7", - "resolved": "https://registry.npmjs.org/@rosen-bridge/observation-extractor/-/observation-extractor-5.0.7.tgz", - "integrity": "sha512-CLMwnmfVrgY3YgbW6ZKHM4ySu9DEvbtTQYhq23NWLCTVUNEJmsCEe48Rx1gZjeqSKMP0Mc/gnVj58Vopj2dPYA==", + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/@rosen-bridge/observation-extractor/-/observation-extractor-5.0.8.tgz", + "integrity": "sha512-nCE8IMf8Mt/thJR9grhzCqFcc/9Z0W8k3Oi/Y28o29ZXnIikUoPh7a9O2diCxhgQN5jZsakU5ujXvwql0Z8XuA==", "dependencies": { "@cardano-ogmios/schema": "^6.6.1", - "@rosen-bridge/abstract-extractor": "^0.3.0", + "@rosen-bridge/abstract-extractor": "^0.3.1", "@rosen-bridge/abstract-logger": "^1.0.0", "@rosen-bridge/rosen-extractor": "^6.2.0", - "@rosen-bridge/scanner": "^4.1.3", + "@rosen-bridge/scanner": "^5.0.0", "@rosen-bridge/tokens": "^1.2.0", "blakejs": "^1.2.1", "ergo-lib-wasm-nodejs": "^0.24.1", @@ -8814,6 +8963,38 @@ "resolved": "https://registry.npmjs.org/@rosen-bridge/abstract-logger/-/abstract-logger-1.0.0.tgz", "integrity": "sha512-hN/cb0HSlhqvaEjqzFPZGIYOa70gdPd+mYrS5C7uNrv1Vw6k2k4lY4US05rwBENjSQpwik1H4gdCBzUkbCcjGA==" }, + "node_modules/@rosen-bridge/observation-extractor/node_modules/@rosen-bridge/scanner": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@rosen-bridge/scanner/-/scanner-5.0.0.tgz", + "integrity": "sha512-v4ayWIBA1yEpitCCN1Y9B/BgyqxMvHj+SnXQ9nAURSgV9fW7Q7y4ijRMiXwsxft/OEe06TVJTIv8mSx/mH4CKg==", + "dependencies": { + "@apollo/client": "^3.8.7", + "@blockfrost/blockfrost-js": "^5.4.0", + "@cardano-ogmios/client": "^6.6.1", + "@cardano-ogmios/schema": "^6.6.1", + "@rosen-bridge/abstract-extractor": "^0.3.1", + "@rosen-bridge/abstract-logger": "^1.0.0", + "@rosen-bridge/json-bigint": "^0.1.0", + "@rosen-clients/ergo-explorer": "^1.1.1", + "@rosen-clients/ergo-node": "^1.1.1", + "await-semaphore": "^0.1.3", + "axios": "^1.6.8", + "cockatiel": "^3.2.1", + "cross-fetch": "^4.0.0", + "lodash-es": "^4.17.21", + "reflect-metadata": "^0.1.13", + "sqlite3": "^5.0.9", + "typeorm": "^0.3.20" + } + }, + "node_modules/@rosen-bridge/observation-extractor/node_modules/cross-fetch": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-4.0.0.tgz", + "integrity": "sha512-e4a5N8lVvuLgAWgnCrLr2PP0YyDOTHa9H/Rj54dirp61qXnNq46m82bRhNqIA5VccJtWBvPTFRV3TtvHUKPB1g==", + "dependencies": { + "node-fetch": "^2.6.12" + } + }, "node_modules/@rosen-bridge/rosen-app": { "resolved": "apps/rosen", "link": true @@ -11931,6 +12112,14 @@ "node": ">=6" } }, + "node_modules/cockatiel": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/cockatiel/-/cockatiel-3.2.1.tgz", + "integrity": "sha512-gfrHV6ZPkquExvMh9IOkKsBzNDk6sDuZ6DdBGUBkvFnTCqCxzpuq48RySgP0AnaqQkw2zynOFj9yly6T1Q2G5Q==", + "engines": { + "node": ">=16" + } + }, "node_modules/code-block-writer": { "version": "12.0.0", "dev": true, From 1e43c54ac459c3f0356d75ddf77953380c6c8644 Mon Sep 17 00:00:00 2001 From: "fateme.r" Date: Mon, 11 Nov 2024 12:43:30 +0330 Subject: [PATCH 2/5] Add changeset --- .changeset/pretty-mice-sparkle.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/pretty-mice-sparkle.md diff --git a/.changeset/pretty-mice-sparkle.md b/.changeset/pretty-mice-sparkle.md new file mode 100644 index 00000000..c4f6de5c --- /dev/null +++ b/.changeset/pretty-mice-sparkle.md @@ -0,0 +1,5 @@ +--- +'@rosen-bridge/rosen-service': minor +--- + +Update bitcoin scanner to use rpc endpoint instead of esplora. From 949fb0888cbf7e747c8d961572cb45cf607a0c02 Mon Sep 17 00:00:00 2001 From: "fateme.r" Date: Mon, 11 Nov 2024 13:13:54 +0330 Subject: [PATCH 3/5] update event trigger extractor --- apps/rosen-service/package.json | 1 + .../src/event-trigger/event-trigger-service.ts | 9 +++++++++ package-lock.json | 1 + 3 files changed, 11 insertions(+) diff --git a/apps/rosen-service/package.json b/apps/rosen-service/package.json index 40163dbb..b75477a6 100644 --- a/apps/rosen-service/package.json +++ b/apps/rosen-service/package.json @@ -17,6 +17,7 @@ "get-config": "npx @rosen-bridge/cli download-assets --chain-type mainnet --out config --include-prereleases" }, "dependencies": { + "@rosen-bridge/abstract-extractor": "^0.3.1", "@rosen-bridge/bitcoin-observation-extractor": "^4.0.8", "@rosen-bridge/bitcoin-rpc-scanner": "^1.0.0", "@rosen-bridge/evm-observation-extractor": "^3.1.0", diff --git a/apps/rosen-service/src/event-trigger/event-trigger-service.ts b/apps/rosen-service/src/event-trigger/event-trigger-service.ts index c7167ee3..e18274a3 100644 --- a/apps/rosen-service/src/event-trigger/event-trigger-service.ts +++ b/apps/rosen-service/src/event-trigger/event-trigger-service.ts @@ -1,6 +1,7 @@ import { ErgoScanner } from '@rosen-bridge/scanner'; import { EventTriggerExtractor } from '@rosen-bridge/watcher-data-extractor'; import WinstonLogger from '@rosen-bridge/winston-logger'; +import { ErgoNetworkType } from '@rosen-bridge/abstract-extractor'; import configs from '../configs'; @@ -28,6 +29,8 @@ export const registerExtractors = (scanner: ErgoScanner) => { const ergoEventTriggerExtractor = new EventTriggerExtractor( 'ergo-extractor', dataSource, + ErgoNetworkType.Explorer, + configs.ergo.explorerUrl, configs.ergo.addresses.eventTrigger, configs.ergo.tokens.rwt, configs.ergo.addresses.permit, @@ -37,6 +40,8 @@ export const registerExtractors = (scanner: ErgoScanner) => { const cardanoEventTriggerExtractor = new EventTriggerExtractor( 'cardano-extractor', dataSource, + ErgoNetworkType.Explorer, + configs.ergo.explorerUrl, configs.cardano.addresses.eventTrigger, configs.cardano.tokens.rwt, configs.cardano.addresses.permit, @@ -46,6 +51,8 @@ export const registerExtractors = (scanner: ErgoScanner) => { const bitcoinEventTriggerExtractor = new EventTriggerExtractor( 'bitcoin-extractor', dataSource, + ErgoNetworkType.Explorer, + configs.ergo.explorerUrl, configs.bitcoin.addresses.eventTrigger, configs.bitcoin.tokens.rwt, configs.bitcoin.addresses.permit, @@ -55,6 +62,8 @@ export const registerExtractors = (scanner: ErgoScanner) => { const ethereumEventTriggerExtractor = new EventTriggerExtractor( 'ethereum-extractor', dataSource, + ErgoNetworkType.Explorer, + configs.ergo.explorerUrl, configs.ethereum.addresses.eventTrigger, configs.ethereum.tokens.rwt, configs.ethereum.addresses.permit, diff --git a/package-lock.json b/package-lock.json index 0209b7a0..b4b82066 100644 --- a/package-lock.json +++ b/package-lock.json @@ -142,6 +142,7 @@ "version": "2.0.0", "license": "GPL-3.0", "dependencies": { + "@rosen-bridge/abstract-extractor": "^0.3.1", "@rosen-bridge/bitcoin-observation-extractor": "^4.0.8", "@rosen-bridge/bitcoin-rpc-scanner": "^1.0.0", "@rosen-bridge/evm-observation-extractor": "^3.1.0", From 5b18a00bfd0d0789585282e5dfb3631688d55a6d Mon Sep 17 00:00:00 2001 From: "fateme.r" Date: Tue, 12 Nov 2024 11:27:33 +0330 Subject: [PATCH 4/5] update rosen-app packages --- .changeset/late-ants-battle.md | 5 + apps/rosen-service/config/default.yaml | 2 + apps/rosen-service/src/configs.ts | 1 + apps/rosen/package.json | 6 +- package-lock.json | 217 ++----------------------- 5 files changed, 26 insertions(+), 205 deletions(-) create mode 100644 .changeset/late-ants-battle.md diff --git a/.changeset/late-ants-battle.md b/.changeset/late-ants-battle.md new file mode 100644 index 00000000..8a7450e1 --- /dev/null +++ b/.changeset/late-ants-battle.md @@ -0,0 +1,5 @@ +--- +'@rosen-bridge/rosen-app': patch +--- + +Update scanner packages diff --git a/apps/rosen-service/config/default.yaml b/apps/rosen-service/config/default.yaml index 9bf36a86..756fac16 100644 --- a/apps/rosen-service/config/default.yaml +++ b/apps/rosen-service/config/default.yaml @@ -31,6 +31,8 @@ bitcoin: tokens: rwt: initialHeight: + esplora: + url: https://mempool.space rpc: url: username: diff --git a/apps/rosen-service/src/configs.ts b/apps/rosen-service/src/configs.ts index f8bc42ba..a1e1644e 100644 --- a/apps/rosen-service/src/configs.ts +++ b/apps/rosen-service/src/configs.ts @@ -59,6 +59,7 @@ const getConfig = () => { tokens: { rwt: nodeConfig.get('bitcoin.tokens.rwt'), }, + esploraUrl: nodeConfig.get('bitcoin.esplora.url'), rpcUrl: nodeConfig.get('bitcoin.rpc.url'), rpcUsername: getOptionalString('bitcoin.rpc.username'), rpcPassword: getOptionalString('bitcoin.rpc.password'), diff --git a/apps/rosen/package.json b/apps/rosen/package.json index 5e4146dc..41e048c2 100644 --- a/apps/rosen/package.json +++ b/apps/rosen/package.json @@ -23,10 +23,10 @@ "@rosen-bridge/ergo-box-selection": "^0.1.0", "@rosen-bridge/extended-typeorm": "^0.0.3", "@rosen-bridge/minimum-fee": "^2.0.1", - "@rosen-bridge/observation-extractor": "^5.0.7", - "@rosen-bridge/scanner": "^4.1.3", + "@rosen-bridge/observation-extractor": "^5.0.8", + "@rosen-bridge/scanner": "^5.0.0", "@rosen-bridge/tokens": "^1.2.1", - "@rosen-bridge/watcher-data-extractor": "^8.0.2", + "@rosen-bridge/watcher-data-extractor": "^9.0.0", "@rosen-clients/cardano-koios": "^2.0.1", "@rosen-clients/ergo-explorer": "^1.0.2", "@rosen-network/bitcoin": "^1.0.0", diff --git a/package-lock.json b/package-lock.json index b4b82066..02b74b27 100644 --- a/package-lock.json +++ b/package-lock.json @@ -89,10 +89,10 @@ "@rosen-bridge/ergo-box-selection": "^0.1.0", "@rosen-bridge/extended-typeorm": "^0.0.3", "@rosen-bridge/minimum-fee": "^2.0.1", - "@rosen-bridge/observation-extractor": "^5.0.7", - "@rosen-bridge/scanner": "^4.1.3", + "@rosen-bridge/observation-extractor": "^5.0.8", + "@rosen-bridge/scanner": "^5.0.0", "@rosen-bridge/tokens": "^1.2.1", - "@rosen-bridge/watcher-data-extractor": "^8.0.2", + "@rosen-bridge/watcher-data-extractor": "^9.0.0", "@rosen-clients/cardano-koios": "^2.0.1", "@rosen-clients/ergo-explorer": "^1.0.2", "@rosen-network/bitcoin": "^1.0.0", @@ -163,58 +163,6 @@ "typescript": "^5.0.0" } }, - "apps/rosen-service/node_modules/@rosen-bridge/abstract-logger": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@rosen-bridge/abstract-logger/-/abstract-logger-1.0.0.tgz", - "integrity": "sha512-hN/cb0HSlhqvaEjqzFPZGIYOa70gdPd+mYrS5C7uNrv1Vw6k2k4lY4US05rwBENjSQpwik1H4gdCBzUkbCcjGA==" - }, - "apps/rosen-service/node_modules/@rosen-bridge/scanner": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/@rosen-bridge/scanner/-/scanner-5.0.0.tgz", - "integrity": "sha512-v4ayWIBA1yEpitCCN1Y9B/BgyqxMvHj+SnXQ9nAURSgV9fW7Q7y4ijRMiXwsxft/OEe06TVJTIv8mSx/mH4CKg==", - "dependencies": { - "@apollo/client": "^3.8.7", - "@blockfrost/blockfrost-js": "^5.4.0", - "@cardano-ogmios/client": "^6.6.1", - "@cardano-ogmios/schema": "^6.6.1", - "@rosen-bridge/abstract-extractor": "^0.3.1", - "@rosen-bridge/abstract-logger": "^1.0.0", - "@rosen-bridge/json-bigint": "^0.1.0", - "@rosen-clients/ergo-explorer": "^1.1.1", - "@rosen-clients/ergo-node": "^1.1.1", - "await-semaphore": "^0.1.3", - "axios": "^1.6.8", - "cockatiel": "^3.2.1", - "cross-fetch": "^4.0.0", - "lodash-es": "^4.17.21", - "reflect-metadata": "^0.1.13", - "sqlite3": "^5.0.9", - "typeorm": "^0.3.20" - } - }, - "apps/rosen-service/node_modules/@rosen-bridge/watcher-data-extractor": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/@rosen-bridge/watcher-data-extractor/-/watcher-data-extractor-9.0.0.tgz", - "integrity": "sha512-OrQCtVxd4XaLEYAQZVVQbtf6Vy+U+rwEbbUbb3+AH/m0ekw9/oDVBgrRDgQq9kCkAMqybhpUgpp9OkILtCSZFA==", - "dependencies": { - "@rosen-bridge/abstract-extractor": "^0.3.1", - "@rosen-bridge/abstract-logger": "^1.0.0", - "@rosen-bridge/extended-typeorm": "^0.0.3", - "@rosen-bridge/json-bigint": "^0.1.0", - "@rosen-bridge/scanner": "^5.0.0", - "@rosen-bridge/tokens": "^1.2.1", - "@rosen-clients/ergo-explorer": "^1.1.1", - "@types/lodash-es": "^4.17.6", - "blakejs": "^1.2.1", - "ergo-lib-wasm-nodejs": "^0.24.1", - "json-bigint": "^1.0.0", - "lodash-es": "^4.17.21", - "pg": "^8.10.0", - "reflect-metadata": "^0.1.13", - "sqlite3": "^5.0.9", - "typeorm": "^0.3.20" - } - }, "apps/rosen-service/node_modules/@types/node": { "version": "18.19.1", "dev": true, @@ -223,14 +171,6 @@ "undici-types": "~5.26.4" } }, - "apps/rosen-service/node_modules/cross-fetch": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-4.0.0.tgz", - "integrity": "sha512-e4a5N8lVvuLgAWgnCrLr2PP0YyDOTHa9H/Rj54dirp61qXnNq46m82bRhNqIA5VccJtWBvPTFRV3TtvHUKPB1g==", - "dependencies": { - "node-fetch": "^2.6.12" - } - }, "apps/rosen-service/node_modules/tsconfig-paths": { "version": "4.2.0", "dev": true, @@ -8652,38 +8592,6 @@ "resolved": "https://registry.npmjs.org/@rosen-bridge/abstract-logger/-/abstract-logger-1.0.0.tgz", "integrity": "sha512-hN/cb0HSlhqvaEjqzFPZGIYOa70gdPd+mYrS5C7uNrv1Vw6k2k4lY4US05rwBENjSQpwik1H4gdCBzUkbCcjGA==" }, - "node_modules/@rosen-bridge/bitcoin-esplora-scanner/node_modules/@rosen-bridge/scanner": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/@rosen-bridge/scanner/-/scanner-5.0.0.tgz", - "integrity": "sha512-v4ayWIBA1yEpitCCN1Y9B/BgyqxMvHj+SnXQ9nAURSgV9fW7Q7y4ijRMiXwsxft/OEe06TVJTIv8mSx/mH4CKg==", - "dependencies": { - "@apollo/client": "^3.8.7", - "@blockfrost/blockfrost-js": "^5.4.0", - "@cardano-ogmios/client": "^6.6.1", - "@cardano-ogmios/schema": "^6.6.1", - "@rosen-bridge/abstract-extractor": "^0.3.1", - "@rosen-bridge/abstract-logger": "^1.0.0", - "@rosen-bridge/json-bigint": "^0.1.0", - "@rosen-clients/ergo-explorer": "^1.1.1", - "@rosen-clients/ergo-node": "^1.1.1", - "await-semaphore": "^0.1.3", - "axios": "^1.6.8", - "cockatiel": "^3.2.1", - "cross-fetch": "^4.0.0", - "lodash-es": "^4.17.21", - "reflect-metadata": "^0.1.13", - "sqlite3": "^5.0.9", - "typeorm": "^0.3.20" - } - }, - "node_modules/@rosen-bridge/bitcoin-esplora-scanner/node_modules/cross-fetch": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-4.0.0.tgz", - "integrity": "sha512-e4a5N8lVvuLgAWgnCrLr2PP0YyDOTHa9H/Rj54dirp61qXnNq46m82bRhNqIA5VccJtWBvPTFRV3TtvHUKPB1g==", - "dependencies": { - "node-fetch": "^2.6.12" - } - }, "node_modules/@rosen-bridge/bitcoin-observation-extractor": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/@rosen-bridge/bitcoin-observation-extractor/-/bitcoin-observation-extractor-4.0.8.tgz", @@ -8724,38 +8632,6 @@ "resolved": "https://registry.npmjs.org/@rosen-bridge/abstract-logger/-/abstract-logger-1.0.0.tgz", "integrity": "sha512-hN/cb0HSlhqvaEjqzFPZGIYOa70gdPd+mYrS5C7uNrv1Vw6k2k4lY4US05rwBENjSQpwik1H4gdCBzUkbCcjGA==" }, - "node_modules/@rosen-bridge/bitcoin-rpc-scanner/node_modules/@rosen-bridge/scanner": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/@rosen-bridge/scanner/-/scanner-5.0.0.tgz", - "integrity": "sha512-v4ayWIBA1yEpitCCN1Y9B/BgyqxMvHj+SnXQ9nAURSgV9fW7Q7y4ijRMiXwsxft/OEe06TVJTIv8mSx/mH4CKg==", - "dependencies": { - "@apollo/client": "^3.8.7", - "@blockfrost/blockfrost-js": "^5.4.0", - "@cardano-ogmios/client": "^6.6.1", - "@cardano-ogmios/schema": "^6.6.1", - "@rosen-bridge/abstract-extractor": "^0.3.1", - "@rosen-bridge/abstract-logger": "^1.0.0", - "@rosen-bridge/json-bigint": "^0.1.0", - "@rosen-clients/ergo-explorer": "^1.1.1", - "@rosen-clients/ergo-node": "^1.1.1", - "await-semaphore": "^0.1.3", - "axios": "^1.6.8", - "cockatiel": "^3.2.1", - "cross-fetch": "^4.0.0", - "lodash-es": "^4.17.21", - "reflect-metadata": "^0.1.13", - "sqlite3": "^5.0.9", - "typeorm": "^0.3.20" - } - }, - "node_modules/@rosen-bridge/bitcoin-rpc-scanner/node_modules/cross-fetch": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-4.0.0.tgz", - "integrity": "sha512-e4a5N8lVvuLgAWgnCrLr2PP0YyDOTHa9H/Rj54dirp61qXnNq46m82bRhNqIA5VccJtWBvPTFRV3TtvHUKPB1g==", - "dependencies": { - "node-fetch": "^2.6.12" - } - }, "node_modules/@rosen-bridge/bitcoin-utxo-selection": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/@rosen-bridge/bitcoin-utxo-selection/-/bitcoin-utxo-selection-0.2.0.tgz", @@ -8858,38 +8734,6 @@ "resolved": "https://registry.npmjs.org/@rosen-bridge/abstract-logger/-/abstract-logger-1.0.0.tgz", "integrity": "sha512-hN/cb0HSlhqvaEjqzFPZGIYOa70gdPd+mYrS5C7uNrv1Vw6k2k4lY4US05rwBENjSQpwik1H4gdCBzUkbCcjGA==" }, - "node_modules/@rosen-bridge/evm-rpc-scanner/node_modules/@rosen-bridge/scanner": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/@rosen-bridge/scanner/-/scanner-5.0.0.tgz", - "integrity": "sha512-v4ayWIBA1yEpitCCN1Y9B/BgyqxMvHj+SnXQ9nAURSgV9fW7Q7y4ijRMiXwsxft/OEe06TVJTIv8mSx/mH4CKg==", - "dependencies": { - "@apollo/client": "^3.8.7", - "@blockfrost/blockfrost-js": "^5.4.0", - "@cardano-ogmios/client": "^6.6.1", - "@cardano-ogmios/schema": "^6.6.1", - "@rosen-bridge/abstract-extractor": "^0.3.1", - "@rosen-bridge/abstract-logger": "^1.0.0", - "@rosen-bridge/json-bigint": "^0.1.0", - "@rosen-clients/ergo-explorer": "^1.1.1", - "@rosen-clients/ergo-node": "^1.1.1", - "await-semaphore": "^0.1.3", - "axios": "^1.6.8", - "cockatiel": "^3.2.1", - "cross-fetch": "^4.0.0", - "lodash-es": "^4.17.21", - "reflect-metadata": "^0.1.13", - "sqlite3": "^5.0.9", - "typeorm": "^0.3.20" - } - }, - "node_modules/@rosen-bridge/evm-rpc-scanner/node_modules/cross-fetch": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-4.0.0.tgz", - "integrity": "sha512-e4a5N8lVvuLgAWgnCrLr2PP0YyDOTHa9H/Rj54dirp61qXnNq46m82bRhNqIA5VccJtWBvPTFRV3TtvHUKPB1g==", - "dependencies": { - "node-fetch": "^2.6.12" - } - }, "node_modules/@rosen-bridge/extended-typeorm": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/@rosen-bridge/extended-typeorm/-/extended-typeorm-0.0.3.tgz", @@ -8964,38 +8808,6 @@ "resolved": "https://registry.npmjs.org/@rosen-bridge/abstract-logger/-/abstract-logger-1.0.0.tgz", "integrity": "sha512-hN/cb0HSlhqvaEjqzFPZGIYOa70gdPd+mYrS5C7uNrv1Vw6k2k4lY4US05rwBENjSQpwik1H4gdCBzUkbCcjGA==" }, - "node_modules/@rosen-bridge/observation-extractor/node_modules/@rosen-bridge/scanner": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/@rosen-bridge/scanner/-/scanner-5.0.0.tgz", - "integrity": "sha512-v4ayWIBA1yEpitCCN1Y9B/BgyqxMvHj+SnXQ9nAURSgV9fW7Q7y4ijRMiXwsxft/OEe06TVJTIv8mSx/mH4CKg==", - "dependencies": { - "@apollo/client": "^3.8.7", - "@blockfrost/blockfrost-js": "^5.4.0", - "@cardano-ogmios/client": "^6.6.1", - "@cardano-ogmios/schema": "^6.6.1", - "@rosen-bridge/abstract-extractor": "^0.3.1", - "@rosen-bridge/abstract-logger": "^1.0.0", - "@rosen-bridge/json-bigint": "^0.1.0", - "@rosen-clients/ergo-explorer": "^1.1.1", - "@rosen-clients/ergo-node": "^1.1.1", - "await-semaphore": "^0.1.3", - "axios": "^1.6.8", - "cockatiel": "^3.2.1", - "cross-fetch": "^4.0.0", - "lodash-es": "^4.17.21", - "reflect-metadata": "^0.1.13", - "sqlite3": "^5.0.9", - "typeorm": "^0.3.20" - } - }, - "node_modules/@rosen-bridge/observation-extractor/node_modules/cross-fetch": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-4.0.0.tgz", - "integrity": "sha512-e4a5N8lVvuLgAWgnCrLr2PP0YyDOTHa9H/Rj54dirp61qXnNq46m82bRhNqIA5VccJtWBvPTFRV3TtvHUKPB1g==", - "dependencies": { - "node-fetch": "^2.6.12" - } - }, "node_modules/@rosen-bridge/rosen-app": { "resolved": "apps/rosen", "link": true @@ -9028,22 +8840,22 @@ "link": true }, "node_modules/@rosen-bridge/scanner": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/@rosen-bridge/scanner/-/scanner-4.1.3.tgz", - "integrity": "sha512-21o0zu54XtGpXuvApgXlAb/9AV3XBt/kb5nJT1c5pLG1MlrMbjcpPXW6kEsdI/M+XP+Hpr7//y9TRotipKh1Ug==", - "license": "GPL-3.0", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@rosen-bridge/scanner/-/scanner-5.0.0.tgz", + "integrity": "sha512-v4ayWIBA1yEpitCCN1Y9B/BgyqxMvHj+SnXQ9nAURSgV9fW7Q7y4ijRMiXwsxft/OEe06TVJTIv8mSx/mH4CKg==", "dependencies": { "@apollo/client": "^3.8.7", "@blockfrost/blockfrost-js": "^5.4.0", "@cardano-ogmios/client": "^6.6.1", "@cardano-ogmios/schema": "^6.6.1", - "@rosen-bridge/abstract-extractor": "^0.3.0", + "@rosen-bridge/abstract-extractor": "^0.3.1", "@rosen-bridge/abstract-logger": "^1.0.0", "@rosen-bridge/json-bigint": "^0.1.0", "@rosen-clients/ergo-explorer": "^1.1.1", "@rosen-clients/ergo-node": "^1.1.1", "await-semaphore": "^0.1.3", "axios": "^1.6.8", + "cockatiel": "^3.2.1", "cross-fetch": "^4.0.0", "lodash-es": "^4.17.21", "reflect-metadata": "^0.1.13", @@ -9058,7 +8870,8 @@ }, "node_modules/@rosen-bridge/scanner/node_modules/cross-fetch": { "version": "4.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-4.0.0.tgz", + "integrity": "sha512-e4a5N8lVvuLgAWgnCrLr2PP0YyDOTHa9H/Rj54dirp61qXnNq46m82bRhNqIA5VccJtWBvPTFRV3TtvHUKPB1g==", "dependencies": { "node-fetch": "^2.6.12" } @@ -9103,15 +8916,15 @@ "link": true }, "node_modules/@rosen-bridge/watcher-data-extractor": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/@rosen-bridge/watcher-data-extractor/-/watcher-data-extractor-8.0.2.tgz", - "integrity": "sha512-pnpSbuqgCVEecCZDZrL6TthMrXPWkgpXOC5pnWFYNyjOyYlymxCrCEhW15L8hahmRPyy2LfH0TMd0LGQNmeRzg==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/@rosen-bridge/watcher-data-extractor/-/watcher-data-extractor-9.0.0.tgz", + "integrity": "sha512-OrQCtVxd4XaLEYAQZVVQbtf6Vy+U+rwEbbUbb3+AH/m0ekw9/oDVBgrRDgQq9kCkAMqybhpUgpp9OkILtCSZFA==", "dependencies": { - "@rosen-bridge/abstract-extractor": "^0.3.0", + "@rosen-bridge/abstract-extractor": "^0.3.1", "@rosen-bridge/abstract-logger": "^1.0.0", "@rosen-bridge/extended-typeorm": "^0.0.3", "@rosen-bridge/json-bigint": "^0.1.0", - "@rosen-bridge/scanner": "^4.1.3", + "@rosen-bridge/scanner": "^5.0.0", "@rosen-bridge/tokens": "^1.2.1", "@rosen-clients/ergo-explorer": "^1.1.1", "@types/lodash-es": "^4.17.6", From 66d28b1b7d3635fa7c7a7134702a028e3401e676 Mon Sep 17 00:00:00 2001 From: "fateme.r" Date: Tue, 12 Nov 2024 11:31:26 +0330 Subject: [PATCH 5/5] Fix esplora url --- apps/rosen-service/config/default.yaml | 3 +-- apps/rosen-service/src/configs.ts | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/apps/rosen-service/config/default.yaml b/apps/rosen-service/config/default.yaml index 756fac16..f8377520 100644 --- a/apps/rosen-service/config/default.yaml +++ b/apps/rosen-service/config/default.yaml @@ -31,8 +31,7 @@ bitcoin: tokens: rwt: initialHeight: - esplora: - url: https://mempool.space + esploraUrl: https://blockstream.info rpc: url: username: diff --git a/apps/rosen-service/src/configs.ts b/apps/rosen-service/src/configs.ts index a1e1644e..1f0df0d8 100644 --- a/apps/rosen-service/src/configs.ts +++ b/apps/rosen-service/src/configs.ts @@ -59,7 +59,7 @@ const getConfig = () => { tokens: { rwt: nodeConfig.get('bitcoin.tokens.rwt'), }, - esploraUrl: nodeConfig.get('bitcoin.esplora.url'), + esploraUrl: nodeConfig.get('bitcoin.esploraUrl'), rpcUrl: nodeConfig.get('bitcoin.rpc.url'), rpcUsername: getOptionalString('bitcoin.rpc.username'), rpcPassword: getOptionalString('bitcoin.rpc.password'),