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);