From bf98d85d8afe2c7c73d6745c1d2a0876ec80d409 Mon Sep 17 00:00:00 2001 From: Torkel Rogstad Date: Sat, 10 May 2025 12:13:27 +0200 Subject: [PATCH] bitnames: update CLI args --- config.js | 2 +- utils/bitnames-cli.js | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/config.js b/config.js index 84c120b..6145a72 100644 --- a/config.js +++ b/config.js @@ -20,7 +20,7 @@ const defaultConfig = { cliPath: '~/Downloads/bitnames-cli', // TODO: the URL format is not yet supported by the BitNames CLI, // update this at a later point - rpcAddr: '127.0.0.1:6002' // Default BitNames RPC address + rpcUrl: 'http://127.0.0.1:6002' // Default BitNames RPC address } }; diff --git a/utils/bitnames-cli.js b/utils/bitnames-cli.js index e4c3aa4..63b70ae 100644 --- a/utils/bitnames-cli.js +++ b/utils/bitnames-cli.js @@ -1,8 +1,13 @@ const { exec } = require('child_process'); async function execBitnamesCli(config, command) { + const { rpcUrl } = config.bitnames; + if (!rpcUrl) { + throw new Error('Bitnames CLI RPC URL is not set'); + } + return new Promise((resolve, reject) => { - exec(`${config.bitnames.cliPath} --rpc-addr=${config.bitnames.rpcUrl} ${command}`, (error, stdout, stderr) => { + exec(`${config.bitnames.cliPath} --rpc-url=${rpcUrl} ${command}`, (error, stdout, stderr) => { if (error) { console.error(`BitNames CLI error:`, error); reject(error);