-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #220 from phillamy/btc-core-create-wallets
Btc core create wallets
- Loading branch information
Showing
7 changed files
with
66 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/sh | ||
|
||
BITCOIN_CLI='bitcoin-cli' | ||
|
||
<% if( net === 'regtest' ) { %> | ||
BITCOIN_CLI="$BITCOIN_CLI -regtest" | ||
<% } %> | ||
|
||
while [ ! -f "/container_monitor/bitcoin_ready" ]; do echo "CYPHERNODE: bitcoind not ready" ; sleep 10 ; done | ||
|
||
echo "CYPHERNODE: bitcoind is ready" | ||
|
||
# Check for the basic wallets. If not present, create. | ||
BASIC_WALLETS='"watching01.dat" "xpubwatching01.dat" "spending01.dat"' | ||
|
||
CURRENT_WALLETS=`$BITCOIN_CLI listwallets` | ||
|
||
for wallet in $BASIC_WALLETS | ||
do | ||
echo "CYPHERNODE: Checking wallet [$wallet]" | ||
echo "$CURRENT_WALLETS" | grep -F $wallet > /dev/null 2>&1 | ||
|
||
if [ "$?" -ne "0" ]; then | ||
walletNameNoQuote=`echo $wallet | tr -d '"'` | ||
$BITCOIN_CLI createwallet ${walletNameNoQuote} && echo "CYPHERNODE: new wallet created : [$walletNameNoQuote]" | ||
else | ||
echo "CYPHERNODE: Wallet [$wallet] found" | ||
fi | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/sh | ||
|
||
rm -f /container_monitor/bitcoin_ready | ||
|
||
<% if ( features.indexOf('tor') !== -1 && torifyables && torifyables.indexOf('tor_bitcoin') !== -1 ) { %> | ||
while [ ! -f "/container_monitor/tor_ready" ]; | ||
do | ||
echo "CYPHERNODE: Waiting for Tor to be ready before starting bitcoind" | ||
sleep 10 | ||
done | ||
echo "CYPHERNODE: Tor is ready - Starting bitcoind" | ||
<% } %> | ||
|
||
# Create default wallets if they are not loaded | ||
/.bitcoin/createWallets.sh & | ||
|
||
exec bitcoind |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters