diff --git a/.gitignore b/.gitignore index c6880e3..a8296b5 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,8 @@ node_modules/ .env start-local-server test-local-server +start-decatur-main +start-decatur-test coverage start-my-infra dist/routes/** diff --git a/src/routes/v3/bitcore.js b/src/routes/v3/bitcore.js index 8867af8..49eaa6c 100644 --- a/src/routes/v3/bitcore.js +++ b/src/routes/v3/bitcore.js @@ -48,6 +48,8 @@ async function balanceFromBitcore(thisAddress) { const path = `${process.env.BITCORE_URL}api/BCH/${network}/address/${addr}/balance` + console.log(`path: ${path}`) + // Query the Bitcore Node API. const axiosResponse = await axios.get(path) const retData = axiosResponse.data diff --git a/src/routes/v3/blockbook.js b/src/routes/v3/blockbook.js index 00d1542..1858f96 100644 --- a/src/routes/v3/blockbook.js +++ b/src/routes/v3/blockbook.js @@ -175,6 +175,7 @@ async function balanceBulk(req, res, next) { // Loops through each address and creates an array of Promises, querying // Insight API in parallel. addresses = addresses.map(async (address, index) => + //console.log(`address: ${address}`) balanceFromBlockbook(address) ) @@ -340,9 +341,10 @@ async function utxosBulk(req, res, next) { // Loops through each address and creates an array of Promises, querying // Insight API in parallel. - addresses = addresses.map(async (address, index) => - utxosFromBlockbook(address) - ) + addresses = addresses.map(async (address, index) => { + console.log(`address: ${address}`) + return utxosFromBlockbook(address) + }) // Wait for all parallel Insight requests to return. const result = await axios.all(addresses) diff --git a/src/routes/v3/insight/address.js b/src/routes/v3/insight/address.js index a939120..1fd655b 100644 --- a/src/routes/v3/insight/address.js +++ b/src/routes/v3/insight/address.js @@ -45,12 +45,16 @@ function root(req, res, next) { // Returns a Promise. async function detailsFromInsight(thisAddress, currentPage = 0) { try { + /* let addr + if ( process.env.BITCOINCOM_BASEURL === "https://bch-insight.bitpay.com/api/" ) addr = BITBOX.Address.toCashAddress(thisAddress) else addr = BITBOX.Address.toLegacyAddress(thisAddress) + */ + const addr = BITBOX.Address.toLegacyAddress(thisAddress) let path = `${process.env.BITCOINCOM_BASEURL}addr/${addr}` @@ -60,6 +64,8 @@ async function detailsFromInsight(thisAddress, currentPage = 0) { const to = from + PAGE_SIZE path = `${path}?from=${from}&to=${to}` + //console.log(`path: ${path}`) + // Query the Insight server. const axiosResponse = await axios.get(path) const retData = axiosResponse.data diff --git a/src/routes/v3/insight/block.js b/src/routes/v3/insight/block.js index ce8a964..9763cc9 100644 --- a/src/routes/v3/insight/block.js +++ b/src/routes/v3/insight/block.js @@ -70,6 +70,7 @@ async function detailsByHashSingle(req, res, next) { async function detailsByHashBulk(req, res, next) { try { const hashes = req.body.hashes + //console.log(`hashes: ${JSON.stringify(hashes, null, 2)}`) // Reject if hashes is not an array. if (!Array.isArray(hashes)) {