Skip to content

Commit

Permalink
debug: blockheight
Browse files Browse the repository at this point in the history
  • Loading branch information
DhananjayPurohit committed Jun 14, 2024
1 parent 88f035f commit 83b3d2b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions clients/apps/nodejs/test_basic_workflow2.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ async function generateBlock(numBlocks) {
const generateBlockCommand = `docker exec $(docker ps -qf "name=mercurylayer_bitcoin_1") bitcoin-cli -regtest -rpcuser=user -rpcpassword=pass generatetoaddress ${numBlocks} "bcrt1qgh48u8aj4jvjkalc28lqujyx2wveck4jsm59x9"`;
exec(generateBlockCommand);
console.log(`Generated ${numBlocks} blocks`);

const clientConfig = client_config.load();
const electrumClient = await getElectrumClient(clientConfig);
const block_header = await electrumClient.request('blockchain.headers.subscribe');
const blockheight = block_header.height;
console.log("Current block height: ", blockheight);
}

async function depositCoin(clientConfig, wallet_name, amount, deposit_info) {
Expand Down

0 comments on commit 83b3d2b

Please sign in to comment.