mirror of
https://github.com/RoboSats/taptrade-core.git
synced 2025-07-24 03:33:20 +00:00
25 lines
877 B
Bash
25 lines
877 B
Bash
#!/bin/sh
|
|
|
|
/entrypoint.sh bitcoind -regtest -daemon
|
|
sleep 10;
|
|
|
|
# List existing wallets
|
|
WALLETS=$(bitcoin-cli -regtest -datadir="/home/bitcoin/.bitcoin" listwalletdir)
|
|
|
|
# Check if "coordinator_wallet" exists in the list of wallets
|
|
if echo "$WALLETS" | grep -q "coordinator_wallet"; then
|
|
echo "Wallet exists. Loading wallet..."
|
|
bitcoin-cli -regtest -datadir="/home/bitcoin/.bitcoin" loadwallet "coordinator_wallet"
|
|
else
|
|
echo "Wallet does not exist. Creating wallet..."
|
|
bitcoin-cli -regtest -datadir="/home/bitcoin/.bitcoin" createwallet "coordinator_wallet"
|
|
fi
|
|
|
|
# Generate initial blocks
|
|
bitcoin-cli -regtest -datadir="/home/bitcoin/.bitcoin" -rpcwallet="coordinator_wallet" -generate 101
|
|
|
|
# Generate a block every 120 seconds
|
|
while true; do
|
|
bitcoin-cli -regtest -datadir="/home/bitcoin/.bitcoin" -rpcwallet="coordinator_wallet" -generate 1
|
|
sleep 120
|
|
done |