Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
};

Expand Down
7 changes: 6 additions & 1 deletion utils/bitnames-cli.js
Original file line number Diff line number Diff line change
@@ -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);
Expand Down