Skip to content

Commit

Permalink
Pass bitcoin-cli params via config file
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikolay Manolov committed Oct 28, 2018
1 parent eb9037b commit cf2a36d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ async function startDocker() {

async function nodeAvailable() {
try {
await exec('docker exec pandacash bitcoin-cli -regtest -rpcuser=regtest -rpcpassword=regtest getblockchaininfo');
await exec('docker exec pandacash bitcoin-cli -conf=/opt/bitcoin/bitcoin.conf getblockchaininfo');
} catch (e) {
await sleep(500);
await nodeAvailable();
Expand All @@ -56,15 +56,15 @@ async function seedAccounts() {
console.log('Seeding accounts');
keyPairs.forEach(async (keyPair) => {
try {
await exec(`docker exec pandacash bitcoin-cli -regtest -rpcuser=regtest -rpcpassword=regtest importaddress ${keyPair.address}`)
await exec(`docker exec pandacash bitcoin-cli -regtest -rpcuser=regtest -rpcpassword=regtest generatetoaddress 10 ${keyPair.address}`);
await exec(`docker exec pandacash bitcoin-cli -conf=/opt/bitcoin/bitcoin.conf importaddress ${keyPair.address}`)
await exec(`docker exec pandacash bitcoin-cli -conf=/opt/bitcoin/bitcoin.conf generatetoaddress 10 ${keyPair.address}`);

} catch (e) {
console.log(e);
}
});
console.log('Advancing blockchain to enable spending');
await exec('docker exec pandacash bitcoin-cli -regtest -rpcuser=regtest -rpcpassword=regtest generate 500');
await exec('docker exec pandacash bitcoin-cli -conf=/opt/bitcoin/bitcoin.conf generate 500');
}

async function enableLogging() {
Expand Down

0 comments on commit cf2a36d

Please sign in to comment.