refactor(dev): rename the lamassu-* dev-infra containers, databases and credentials to bitspire-*
Container names (relay, bitcoind, lnd, lnd-alice, lightning-pub, miner,
postgres), the regtest bitcoind rpcuser/rpcpassword, the postgres role and
database (bitspire_dev), the dev admin token, BITSPIRE_HOST_IP, the devenv
project name, and the banners/log prefixes in the scripts. Credentials
are dev-only regtest values and are consistent across all 31 sites
(rpcuser=, rpcpassword=, rpcpass=, --user) — the containers would not
talk to each other otherwise.
Anyone with the old stack running needs `docker compose down` once before
`up`: the container names changed, so compose will otherwise see a conflict.
Secret-scanner allowlist markers added on the credential lines, and on two
pre-existing dev.sh comments ("private key") the hook flags as PRIVATE KEY
— prose, no key material; this diff introduced neither.
This commit is contained in:
parent
bf2b9427aa
commit
561fd35aed
11 changed files with 143 additions and 143 deletions
100
devenv.nix
100
devenv.nix
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
{
|
{
|
||||||
# Project metadata
|
# Project metadata
|
||||||
name = "lamassu-next";
|
name = "bitspire-next";
|
||||||
|
|
||||||
# ============================================
|
# ============================================
|
||||||
# Languages
|
# Languages
|
||||||
|
|
@ -65,7 +65,7 @@
|
||||||
|
|
||||||
services.postgres = {
|
services.postgres = {
|
||||||
enable = true;
|
enable = true;
|
||||||
initialDatabases = [{ name = "lamassu_dev"; }];
|
initialDatabases = [{ name = "bitspire_dev"; }];
|
||||||
listen_addresses = "127.0.0.1";
|
listen_addresses = "127.0.0.1";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -97,7 +97,7 @@
|
||||||
|
|
||||||
env = {
|
env = {
|
||||||
RUST_BACKTRACE = "1";
|
RUST_BACKTRACE = "1";
|
||||||
DATABASE_URL = "postgresql://localhost/lamassu_dev";
|
DATABASE_URL = "postgresql://localhost/bitspire_dev";
|
||||||
|
|
||||||
# Nostr development relay
|
# Nostr development relay
|
||||||
NOSTR_RELAY_URL = "ws://localhost:7777";
|
NOSTR_RELAY_URL = "ws://localhost:7777";
|
||||||
|
|
@ -130,7 +130,7 @@
|
||||||
|
|
||||||
# Wait for strfry
|
# Wait for strfry
|
||||||
echo -n "strfry relay: "
|
echo -n "strfry relay: "
|
||||||
until docker exec lamassu-relay nc -z localhost 7777 2>/dev/null; do
|
until docker exec bitspire-relay nc -z localhost 7777 2>/dev/null; do
|
||||||
echo -n "."
|
echo -n "."
|
||||||
sleep 2
|
sleep 2
|
||||||
done
|
done
|
||||||
|
|
@ -138,7 +138,7 @@
|
||||||
|
|
||||||
# Wait for bitcoind
|
# Wait for bitcoind
|
||||||
echo -n "bitcoind: "
|
echo -n "bitcoind: "
|
||||||
until docker exec lamassu-bitcoind bitcoin-cli -regtest -rpcuser=lamassu -rpcpassword=lamassu getblockchaininfo >/dev/null 2>&1; do
|
until docker exec bitspire-bitcoind bitcoin-cli -regtest -rpcuser=bitspire -rpcpassword=bitspire getblockchaininfo >/dev/null 2>&1; do # pragma: allowlist secret
|
||||||
echo -n "."
|
echo -n "."
|
||||||
sleep 2
|
sleep 2
|
||||||
done
|
done
|
||||||
|
|
@ -146,7 +146,7 @@
|
||||||
|
|
||||||
# Wait for LND
|
# Wait for LND
|
||||||
echo -n "LND: "
|
echo -n "LND: "
|
||||||
until docker exec lamassu-lnd lncli --network=regtest getinfo >/dev/null 2>&1; do
|
until docker exec bitspire-lnd lncli --network=regtest getinfo >/dev/null 2>&1; do
|
||||||
echo -n "."
|
echo -n "."
|
||||||
sleep 3
|
sleep 3
|
||||||
done
|
done
|
||||||
|
|
@ -154,7 +154,7 @@
|
||||||
|
|
||||||
# Wait for Alice's LND
|
# Wait for Alice's LND
|
||||||
echo -n "LND (Alice): "
|
echo -n "LND (Alice): "
|
||||||
until docker exec lamassu-lnd-alice lncli --network=regtest getinfo >/dev/null 2>&1; do
|
until docker exec bitspire-lnd-alice lncli --network=regtest getinfo >/dev/null 2>&1; do
|
||||||
echo -n "."
|
echo -n "."
|
||||||
sleep 3
|
sleep 3
|
||||||
done
|
done
|
||||||
|
|
@ -196,7 +196,7 @@
|
||||||
mine-blocks.exec = ''
|
mine-blocks.exec = ''
|
||||||
BLOCKS=''${1:-1}
|
BLOCKS=''${1:-1}
|
||||||
echo "Mining $BLOCKS regtest block(s)..."
|
echo "Mining $BLOCKS regtest block(s)..."
|
||||||
docker exec lamassu-bitcoind bitcoin-cli -regtest -rpcuser=lamassu -rpcpassword=lamassu -generate "$BLOCKS"
|
docker exec bitspire-bitcoind bitcoin-cli -regtest -rpcuser=bitspire -rpcpassword=bitspire -generate "$BLOCKS" # pragma: allowlist secret
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# Start auto-miner (mines 1 block every 30 seconds)
|
# Start auto-miner (mines 1 block every 30 seconds)
|
||||||
|
|
@ -211,19 +211,19 @@
|
||||||
# Stop auto-miner
|
# Stop auto-miner
|
||||||
auto-mine-stop.exec = ''
|
auto-mine-stop.exec = ''
|
||||||
echo "Stopping auto-miner..."
|
echo "Stopping auto-miner..."
|
||||||
docker stop lamassu-miner 2>/dev/null || true
|
docker stop bitspire-miner 2>/dev/null || true
|
||||||
docker rm lamassu-miner 2>/dev/null || true
|
docker rm bitspire-miner 2>/dev/null || true
|
||||||
echo "Auto-miner stopped."
|
echo "Auto-miner stopped."
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# Connect to LND CLI
|
# Connect to LND CLI
|
||||||
lncli.exec = ''
|
lncli.exec = ''
|
||||||
docker exec -it lamassu-lnd lncli --network=regtest "$@"
|
docker exec -it bitspire-lnd lncli --network=regtest "$@"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# Connect to Bitcoin CLI
|
# Connect to Bitcoin CLI
|
||||||
btccli.exec = ''
|
btccli.exec = ''
|
||||||
docker exec -it lamassu-bitcoind bitcoin-cli -regtest -rpcuser=lamassu -rpcpassword=lamassu "$@"
|
docker exec -it bitspire-bitcoind bitcoin-cli -regtest -rpcuser=bitspire -rpcpassword=bitspire "$@" # pragma: allowlist secret
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# Test relay connection
|
# Test relay connection
|
||||||
|
|
@ -234,7 +234,7 @@
|
||||||
|
|
||||||
# Connect to Alice's LND CLI (second node for testing payments)
|
# Connect to Alice's LND CLI (second node for testing payments)
|
||||||
lncli-alice.exec = ''
|
lncli-alice.exec = ''
|
||||||
docker exec -it lamassu-lnd-alice lncli --network=regtest "$@"
|
docker exec -it bitspire-lnd-alice lncli --network=regtest "$@"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# Setup Lightning channel between Alice and the main LND node
|
# Setup Lightning channel between Alice and the main LND node
|
||||||
|
|
@ -243,46 +243,46 @@
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
# Get LND's pubkey and address
|
# Get LND's pubkey and address
|
||||||
LND_INFO=$(docker exec lamassu-lnd lncli --network=regtest getinfo 2>/dev/null)
|
LND_INFO=$(docker exec bitspire-lnd lncli --network=regtest getinfo 2>/dev/null)
|
||||||
LND_PUBKEY=$(echo "$LND_INFO" | jq -r '.identity_pubkey')
|
LND_PUBKEY=$(echo "$LND_INFO" | jq -r '.identity_pubkey')
|
||||||
echo "LND pubkey: $LND_PUBKEY"
|
echo "LND pubkey: $LND_PUBKEY"
|
||||||
|
|
||||||
# Connect Alice to LND
|
# Connect Alice to LND
|
||||||
echo "Connecting Alice to LND..."
|
echo "Connecting Alice to LND..."
|
||||||
docker exec lamassu-lnd-alice lncli --network=regtest connect "$LND_PUBKEY@lnd:9735" 2>/dev/null || true
|
docker exec bitspire-lnd-alice lncli --network=regtest connect "$LND_PUBKEY@lnd:9735" 2>/dev/null || true
|
||||||
|
|
||||||
# Check if Alice has enough funds
|
# Check if Alice has enough funds
|
||||||
ALICE_BALANCE=$(docker exec lamassu-lnd-alice lncli --network=regtest walletbalance 2>/dev/null | jq -r '.confirmed_balance')
|
ALICE_BALANCE=$(docker exec bitspire-lnd-alice lncli --network=regtest walletbalance 2>/dev/null | jq -r '.confirmed_balance')
|
||||||
echo "Alice's on-chain balance: $ALICE_BALANCE sats"
|
echo "Alice's on-chain balance: $ALICE_BALANCE sats"
|
||||||
|
|
||||||
if [ "$ALICE_BALANCE" -lt 1000000 ]; then
|
if [ "$ALICE_BALANCE" -lt 1000000 ]; then
|
||||||
echo ""
|
echo ""
|
||||||
echo "Alice needs funds. Getting new address..."
|
echo "Alice needs funds. Getting new address..."
|
||||||
ALICE_ADDR=$(docker exec lamassu-lnd-alice lncli --network=regtest newaddress p2wkh | jq -r '.address')
|
ALICE_ADDR=$(docker exec bitspire-lnd-alice lncli --network=regtest newaddress p2wkh | jq -r '.address')
|
||||||
echo "Alice's address: $ALICE_ADDR"
|
echo "Alice's address: $ALICE_ADDR"
|
||||||
echo ""
|
echo ""
|
||||||
echo "Sending 5 BTC to Alice..."
|
echo "Sending 5 BTC to Alice..."
|
||||||
docker exec lamassu-bitcoind bitcoin-cli -regtest -rpcuser=lamassu -rpcpassword=lamassu sendtoaddress "$ALICE_ADDR" 5
|
docker exec bitspire-bitcoind bitcoin-cli -regtest -rpcuser=bitspire -rpcpassword=bitspire sendtoaddress "$ALICE_ADDR" 5 # pragma: allowlist secret
|
||||||
echo "Mining 6 blocks for confirmation..."
|
echo "Mining 6 blocks for confirmation..."
|
||||||
docker exec lamassu-bitcoind bitcoin-cli -regtest -rpcuser=lamassu -rpcpassword=lamassu -generate 6 >/dev/null
|
docker exec bitspire-bitcoind bitcoin-cli -regtest -rpcuser=bitspire -rpcpassword=bitspire -generate 6 >/dev/null # pragma: allowlist secret
|
||||||
sleep 2
|
sleep 2
|
||||||
ALICE_BALANCE=$(docker exec lamassu-lnd-alice lncli --network=regtest walletbalance 2>/dev/null | jq -r '.confirmed_balance')
|
ALICE_BALANCE=$(docker exec bitspire-lnd-alice lncli --network=regtest walletbalance 2>/dev/null | jq -r '.confirmed_balance')
|
||||||
echo "Alice's new balance: $ALICE_BALANCE sats"
|
echo "Alice's new balance: $ALICE_BALANCE sats"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Open channel from Alice to LND (1M sats)
|
# Open channel from Alice to LND (1M sats)
|
||||||
echo ""
|
echo ""
|
||||||
echo "Opening 1M sat channel from Alice to LND..."
|
echo "Opening 1M sat channel from Alice to LND..."
|
||||||
docker exec lamassu-lnd-alice lncli --network=regtest openchannel --node_key="$LND_PUBKEY" --local_amt=1000000
|
docker exec bitspire-lnd-alice lncli --network=regtest openchannel --node_key="$LND_PUBKEY" --local_amt=1000000
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "Mining 6 blocks to confirm channel..."
|
echo "Mining 6 blocks to confirm channel..."
|
||||||
docker exec lamassu-bitcoind bitcoin-cli -regtest -rpcuser=lamassu -rpcpassword=lamassu -generate 6 >/dev/null
|
docker exec bitspire-bitcoind bitcoin-cli -regtest -rpcuser=bitspire -rpcpassword=bitspire -generate 6 >/dev/null # pragma: allowlist secret
|
||||||
|
|
||||||
sleep 3
|
sleep 3
|
||||||
echo ""
|
echo ""
|
||||||
echo "Channel status:"
|
echo "Channel status:"
|
||||||
docker exec lamassu-lnd-alice lncli --network=regtest listchannels | jq '.channels[] | {remote_pubkey, capacity, local_balance, remote_balance, active}'
|
docker exec bitspire-lnd-alice lncli --network=regtest listchannels | jq '.channels[] | {remote_pubkey, capacity, local_balance, remote_balance, active}'
|
||||||
echo ""
|
echo ""
|
||||||
echo "Channel setup complete! Alice can now pay invoices to Lightning.Pub."
|
echo "Channel setup complete! Alice can now pay invoices to Lightning.Pub."
|
||||||
'';
|
'';
|
||||||
|
|
@ -294,14 +294,14 @@
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
echo "Paying invoice from Alice's node..."
|
echo "Paying invoice from Alice's node..."
|
||||||
docker exec lamassu-lnd-alice lncli --network=regtest payinvoice --force "$1"
|
docker exec bitspire-lnd-alice lncli --network=regtest payinvoice --force "$1"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# Create invoice on Alice's node (for testing ATM payouts)
|
# Create invoice on Alice's node (for testing ATM payouts)
|
||||||
alice-invoice.exec = ''
|
alice-invoice.exec = ''
|
||||||
AMOUNT=''${1:-1000}
|
AMOUNT=''${1:-1000}
|
||||||
MEMO=''${2:-"Test invoice"}
|
MEMO=''${2:-"Test invoice"}
|
||||||
docker exec lamassu-lnd-alice lncli --network=regtest addinvoice --amt="$AMOUNT" --memo="$MEMO" | jq -r '.payment_request'
|
docker exec bitspire-lnd-alice lncli --network=regtest addinvoice --amt="$AMOUNT" --memo="$MEMO" | jq -r '.payment_request'
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# Fund ATM account in Lightning.Pub
|
# Fund ATM account in Lightning.Pub
|
||||||
|
|
@ -324,7 +324,7 @@
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "Invoice created. Paying from Alice..."
|
echo "Invoice created. Paying from Alice..."
|
||||||
docker exec lamassu-lnd-alice lncli --network=regtest payinvoice --force "$INVOICE"
|
docker exec bitspire-lnd-alice lncli --network=regtest payinvoice --force "$INVOICE"
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "ATM account funded with $AMOUNT sats!"
|
echo "ATM account funded with $AMOUNT sats!"
|
||||||
|
|
@ -334,14 +334,14 @@
|
||||||
test-setup.exec = ''
|
test-setup.exec = ''
|
||||||
echo ""
|
echo ""
|
||||||
echo "═══════════════════════════════════════════════════════════"
|
echo "═══════════════════════════════════════════════════════════"
|
||||||
echo " Lamassu Next - Test Setup Validation"
|
echo " bitSpire - Test Setup Validation"
|
||||||
echo "═══════════════════════════════════════════════════════════"
|
echo "═══════════════════════════════════════════════════════════"
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
# Mine a block to wake up LND sync (regtest quirk: LND reports
|
# Mine a block to wake up LND sync (regtest quirk: LND reports
|
||||||
# "not synced" when no blocks mined recently)
|
# "not synced" when no blocks mined recently)
|
||||||
echo "Mining block to sync nodes..."
|
echo "Mining block to sync nodes..."
|
||||||
docker exec lamassu-bitcoind bitcoin-cli -regtest -rpcuser=lamassu -rpcpassword=lamassu -generate 1 >/dev/null 2>&1
|
docker exec bitspire-bitcoind bitcoin-cli -regtest -rpcuser=bitspire -rpcpassword=bitspire -generate 1 >/dev/null 2>&1 # pragma: allowlist secret
|
||||||
sleep 1
|
sleep 1
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
|
|
@ -362,19 +362,19 @@
|
||||||
echo "───────────────────────────────────────────────────────────"
|
echo "───────────────────────────────────────────────────────────"
|
||||||
|
|
||||||
# Check containers
|
# Check containers
|
||||||
docker ps --format '{{.Names}}' | grep -q lamassu-relay
|
docker ps --format '{{.Names}}' | grep -q bitspire-relay
|
||||||
check $? "strfry relay running"
|
check $? "strfry relay running"
|
||||||
|
|
||||||
docker ps --format '{{.Names}}' | grep -q lamassu-bitcoind
|
docker ps --format '{{.Names}}' | grep -q bitspire-bitcoind
|
||||||
check $? "bitcoind running"
|
check $? "bitcoind running"
|
||||||
|
|
||||||
docker ps --format '{{.Names}}' | grep -q lamassu-lnd
|
docker ps --format '{{.Names}}' | grep -q bitspire-lnd
|
||||||
check $? "LND running"
|
check $? "LND running"
|
||||||
|
|
||||||
docker ps --format '{{.Names}}' | grep -q lamassu-lnd-alice
|
docker ps --format '{{.Names}}' | grep -q bitspire-lnd-alice
|
||||||
check $? "LND Alice running"
|
check $? "LND Alice running"
|
||||||
|
|
||||||
docker ps --format '{{.Names}}' | grep -q lamassu-lightning-pub
|
docker ps --format '{{.Names}}' | grep -q bitspire-lightning-pub
|
||||||
check $? "Lightning.Pub running"
|
check $? "Lightning.Pub running"
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
|
|
@ -386,32 +386,32 @@
|
||||||
check $? "Nostr relay port open"
|
check $? "Nostr relay port open"
|
||||||
|
|
||||||
# Check bitcoind RPC
|
# Check bitcoind RPC
|
||||||
docker exec lamassu-bitcoind bitcoin-cli -regtest -rpcuser=lamassu -rpcpassword=lamassu getblockchaininfo >/dev/null 2>&1
|
docker exec bitspire-bitcoind bitcoin-cli -regtest -rpcuser=bitspire -rpcpassword=bitspire getblockchaininfo >/dev/null 2>&1 # pragma: allowlist secret
|
||||||
check $? "Bitcoin RPC responding"
|
check $? "Bitcoin RPC responding"
|
||||||
|
|
||||||
# Check LND
|
# Check LND
|
||||||
docker exec lamassu-lnd lncli --network=regtest getinfo >/dev/null 2>&1
|
docker exec bitspire-lnd lncli --network=regtest getinfo >/dev/null 2>&1
|
||||||
check $? "LND RPC responding"
|
check $? "LND RPC responding"
|
||||||
|
|
||||||
# Check Alice
|
# Check Alice
|
||||||
docker exec lamassu-lnd-alice lncli --network=regtest getinfo >/dev/null 2>&1
|
docker exec bitspire-lnd-alice lncli --network=regtest getinfo >/dev/null 2>&1
|
||||||
check $? "LND Alice RPC responding"
|
check $? "LND Alice RPC responding"
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "3. Blockchain State"
|
echo "3. Blockchain State"
|
||||||
echo "───────────────────────────────────────────────────────────"
|
echo "───────────────────────────────────────────────────────────"
|
||||||
|
|
||||||
BLOCKS=$(docker exec lamassu-bitcoind bitcoin-cli -regtest -rpcuser=lamassu -rpcpassword=lamassu getblockcount 2>/dev/null)
|
BLOCKS=$(docker exec bitspire-bitcoind bitcoin-cli -regtest -rpcuser=bitspire -rpcpassword=bitspire getblockcount 2>/dev/null) # pragma: allowlist secret
|
||||||
[ "$BLOCKS" -ge 100 ]
|
[ "$BLOCKS" -ge 100 ]
|
||||||
check $? "Block height >= 100 (current: $BLOCKS)"
|
check $? "Block height >= 100 (current: $BLOCKS)"
|
||||||
|
|
||||||
# Check LND synced
|
# Check LND synced
|
||||||
LND_SYNCED=$(docker exec lamassu-lnd lncli --network=regtest getinfo 2>/dev/null | jq -r '.synced_to_chain')
|
LND_SYNCED=$(docker exec bitspire-lnd lncli --network=regtest getinfo 2>/dev/null | jq -r '.synced_to_chain')
|
||||||
[ "$LND_SYNCED" = "true" ]
|
[ "$LND_SYNCED" = "true" ]
|
||||||
check $? "LND synced to chain"
|
check $? "LND synced to chain"
|
||||||
|
|
||||||
# Check Alice synced
|
# Check Alice synced
|
||||||
ALICE_SYNCED=$(docker exec lamassu-lnd-alice lncli --network=regtest getinfo 2>/dev/null | jq -r '.synced_to_chain')
|
ALICE_SYNCED=$(docker exec bitspire-lnd-alice lncli --network=regtest getinfo 2>/dev/null | jq -r '.synced_to_chain')
|
||||||
[ "$ALICE_SYNCED" = "true" ]
|
[ "$ALICE_SYNCED" = "true" ]
|
||||||
check $? "LND Alice synced to chain"
|
check $? "LND Alice synced to chain"
|
||||||
|
|
||||||
|
|
@ -420,17 +420,17 @@
|
||||||
echo "───────────────────────────────────────────────────────────"
|
echo "───────────────────────────────────────────────────────────"
|
||||||
|
|
||||||
# Check Alice has active channels
|
# Check Alice has active channels
|
||||||
ALICE_CHANNELS=$(docker exec lamassu-lnd-alice lncli --network=regtest listchannels 2>/dev/null | jq '.channels | length')
|
ALICE_CHANNELS=$(docker exec bitspire-lnd-alice lncli --network=regtest listchannels 2>/dev/null | jq '.channels | length')
|
||||||
[ "$ALICE_CHANNELS" -ge 1 ]
|
[ "$ALICE_CHANNELS" -ge 1 ]
|
||||||
check $? "Alice has active channels (count: $ALICE_CHANNELS)"
|
check $? "Alice has active channels (count: $ALICE_CHANNELS)"
|
||||||
|
|
||||||
# Check channel is active
|
# Check channel is active
|
||||||
ACTIVE_CHANNEL=$(docker exec lamassu-lnd-alice lncli --network=regtest listchannels 2>/dev/null | jq '.channels[0].active')
|
ACTIVE_CHANNEL=$(docker exec bitspire-lnd-alice lncli --network=regtest listchannels 2>/dev/null | jq '.channels[0].active')
|
||||||
[ "$ACTIVE_CHANNEL" = "true" ]
|
[ "$ACTIVE_CHANNEL" = "true" ]
|
||||||
check $? "Channel is active"
|
check $? "Channel is active"
|
||||||
|
|
||||||
# Check Alice has outbound capacity
|
# Check Alice has outbound capacity
|
||||||
ALICE_LOCAL=$(docker exec lamassu-lnd-alice lncli --network=regtest listchannels 2>/dev/null | jq -r '.channels[0].local_balance // 0')
|
ALICE_LOCAL=$(docker exec bitspire-lnd-alice lncli --network=regtest listchannels 2>/dev/null | jq -r '.channels[0].local_balance // 0')
|
||||||
[ "$ALICE_LOCAL" -ge 10000 ]
|
[ "$ALICE_LOCAL" -ge 10000 ]
|
||||||
check $? "Alice has outbound capacity ($ALICE_LOCAL sats)"
|
check $? "Alice has outbound capacity ($ALICE_LOCAL sats)"
|
||||||
|
|
||||||
|
|
@ -439,12 +439,12 @@
|
||||||
echo "───────────────────────────────────────────────────────────"
|
echo "───────────────────────────────────────────────────────────"
|
||||||
|
|
||||||
# Create test invoice on LND and pay from Alice
|
# Create test invoice on LND and pay from Alice
|
||||||
TEST_INVOICE=$(docker exec lamassu-lnd lncli --network=regtest addinvoice --amt=100 --memo="test-setup validation" 2>/dev/null | jq -r '.payment_request')
|
TEST_INVOICE=$(docker exec bitspire-lnd lncli --network=regtest addinvoice --amt=100 --memo="test-setup validation" 2>/dev/null | jq -r '.payment_request')
|
||||||
if [ -n "$TEST_INVOICE" ]; then
|
if [ -n "$TEST_INVOICE" ]; then
|
||||||
check 0 "Created 100 sat test invoice"
|
check 0 "Created 100 sat test invoice"
|
||||||
|
|
||||||
# Pay it
|
# Pay it
|
||||||
PAY_RESULT=$(docker exec lamassu-lnd-alice lncli --network=regtest payinvoice --force "$TEST_INVOICE" 2>&1)
|
PAY_RESULT=$(docker exec bitspire-lnd-alice lncli --network=regtest payinvoice --force "$TEST_INVOICE" 2>&1)
|
||||||
if echo "$PAY_RESULT" | grep -q "SUCCEEDED"; then
|
if echo "$PAY_RESULT" | grep -q "SUCCEEDED"; then
|
||||||
check 0 "Payment Alice → LND succeeded"
|
check 0 "Payment Alice → LND succeeded"
|
||||||
else
|
else
|
||||||
|
|
@ -478,7 +478,7 @@
|
||||||
|
|
||||||
# Create invoice on Alice (simulating customer's wallet)
|
# Create invoice on Alice (simulating customer's wallet)
|
||||||
echo "1. Creating invoice on Alice's wallet..."
|
echo "1. Creating invoice on Alice's wallet..."
|
||||||
INVOICE=$(docker exec lamassu-lnd-alice lncli --network=regtest addinvoice --amt="$AMOUNT" --memo="E2E test" | jq -r '.payment_request')
|
INVOICE=$(docker exec bitspire-lnd-alice lncli --network=regtest addinvoice --amt="$AMOUNT" --memo="E2E test" | jq -r '.payment_request')
|
||||||
echo " Invoice: ''${INVOICE:0:40}..."
|
echo " Invoice: ''${INVOICE:0:40}..."
|
||||||
|
|
||||||
# Use test-pay.mjs to pay via Lightning.Pub
|
# Use test-pay.mjs to pay via Lightning.Pub
|
||||||
|
|
@ -490,7 +490,7 @@
|
||||||
echo ""
|
echo ""
|
||||||
echo "3. Verifying payment on Alice..."
|
echo "3. Verifying payment on Alice..."
|
||||||
sleep 2
|
sleep 2
|
||||||
PAID=$(docker exec lamassu-lnd-alice lncli --network=regtest listinvoices 2>/dev/null | jq '.invoices[-1].settled')
|
PAID=$(docker exec bitspire-lnd-alice lncli --network=regtest listinvoices 2>/dev/null | jq '.invoices[-1].settled')
|
||||||
if [ "$PAID" = "true" ]; then
|
if [ "$PAID" = "true" ]; then
|
||||||
echo " ✓ Payment received!"
|
echo " ✓ Payment received!"
|
||||||
else
|
else
|
||||||
|
|
@ -507,15 +507,15 @@
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
echo "LND (Lightning.Pub's node):"
|
echo "LND (Lightning.Pub's node):"
|
||||||
docker exec lamassu-lnd lncli --network=regtest getinfo 2>/dev/null | jq '{pubkey: .identity_pubkey, alias: .alias, channels: .num_active_channels, peers: .num_peers}'
|
docker exec bitspire-lnd lncli --network=regtest getinfo 2>/dev/null | jq '{pubkey: .identity_pubkey, alias: .alias, channels: .num_active_channels, peers: .num_peers}'
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "LND Alice (Payment source):"
|
echo "LND Alice (Payment source):"
|
||||||
docker exec lamassu-lnd-alice lncli --network=regtest getinfo 2>/dev/null | jq '{pubkey: .identity_pubkey, alias: .alias, channels: .num_active_channels, peers: .num_peers}'
|
docker exec bitspire-lnd-alice lncli --network=regtest getinfo 2>/dev/null | jq '{pubkey: .identity_pubkey, alias: .alias, channels: .num_active_channels, peers: .num_peers}'
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "Channel Details:"
|
echo "Channel Details:"
|
||||||
docker exec lamassu-lnd-alice lncli --network=regtest listchannels 2>/dev/null | jq '.channels[] | {peer: .remote_pubkey[0:16], capacity, local: .local_balance, remote: .remote_balance, active}'
|
docker exec bitspire-lnd-alice lncli --network=regtest listchannels 2>/dev/null | jq '.channels[] | {peer: .remote_pubkey[0:16], capacity, local: .local_balance, remote: .remote_balance, active}'
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "Lightning.Pub Nostr pubkey:"
|
echo "Lightning.Pub Nostr pubkey:"
|
||||||
|
|
@ -533,7 +533,7 @@
|
||||||
|
|
||||||
enterShell = ''
|
enterShell = ''
|
||||||
echo ""
|
echo ""
|
||||||
echo " ⚡ Lamassu Next - Nostr-Native Lightning ATM"
|
echo " ⚡ bitSpire - Nostr-Native Lightning ATM"
|
||||||
echo " ─────────────────────────────────────────────"
|
echo " ─────────────────────────────────────────────"
|
||||||
echo " Node.js: $(node --version)"
|
echo " Node.js: $(node --version)"
|
||||||
echo " Rust: $(rustc --version | cut -d' ' -f2)"
|
echo " Rust: $(rustc --version | cut -d' ' -f2)"
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
# Lamassu Next Development Environment
|
# bitSpire Development Environment
|
||||||
#
|
#
|
||||||
# Single command to manage the complete development stack:
|
# Single command to manage the complete development stack:
|
||||||
# - Regtest Bitcoin/Lightning network (from ~/dev/local/docker/regtest)
|
# - Regtest Bitcoin/Lightning network (from ~/dev/local/docker/regtest)
|
||||||
|
|
@ -67,7 +67,7 @@ success() { echo -e "${GREEN}✓${NC} $1"; }
|
||||||
# Ensure state directory exists
|
# Ensure state directory exists
|
||||||
mkdir -p "$STATE_DIR"
|
mkdir -p "$STATE_DIR"
|
||||||
|
|
||||||
# Get ATM pubkey from its private key
|
# Get ATM pubkey from its private key # pragma: allowlist secret
|
||||||
get_atm_pubkey() {
|
get_atm_pubkey() {
|
||||||
local env_file="$PROJECT_DIR/apps/machine/.env"
|
local env_file="$PROJECT_DIR/apps/machine/.env"
|
||||||
if [[ ! -f "$env_file" ]]; then
|
if [[ ! -f "$env_file" ]]; then
|
||||||
|
|
@ -96,8 +96,8 @@ get_atm_pubkey() {
|
||||||
|
|
||||||
get_local_ip() {
|
get_local_ip() {
|
||||||
# Allow explicit override via env var
|
# Allow explicit override via env var
|
||||||
if [[ -n "${LAMASSU_HOST_IP:-}" ]]; then
|
if [[ -n "${BITSPIRE_HOST_IP:-}" ]]; then
|
||||||
echo "$LAMASSU_HOST_IP"
|
echo "$BITSPIRE_HOST_IP"
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
@ -146,7 +146,7 @@ lnd4_has_active_channels() {
|
||||||
}
|
}
|
||||||
|
|
||||||
is_lightning_pub_ready() {
|
is_lightning_pub_ready() {
|
||||||
docker logs lamassu-lightning-pub 2>&1 | grep -q "LightningPub listening"
|
docker logs bitspire-lightning-pub 2>&1 | grep -q "LightningPub listening"
|
||||||
}
|
}
|
||||||
|
|
||||||
get_lnd4_balance() {
|
get_lnd4_balance() {
|
||||||
|
|
@ -422,8 +422,8 @@ wait_for_lightning_pub() {
|
||||||
local attempts=0
|
local attempts=0
|
||||||
while ! is_lightning_pub_ready && [[ $attempts -lt 45 ]]; do
|
while ! is_lightning_pub_ready && [[ $attempts -lt 45 ]]; do
|
||||||
# Check for errors
|
# Check for errors
|
||||||
if docker logs lamassu-lightning-pub 2>&1 | grep -q "Error:"; then
|
if docker logs bitspire-lightning-pub 2>&1 | grep -q "Error:"; then
|
||||||
local err=$(docker logs lamassu-lightning-pub 2>&1 | grep "Error:" | tail -1)
|
local err=$(docker logs bitspire-lightning-pub 2>&1 | grep "Error:" | tail -1)
|
||||||
error "Lightning.Pub error: $err"
|
error "Lightning.Pub error: $err"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
@ -437,14 +437,14 @@ wait_for_lightning_pub() {
|
||||||
return 0
|
return 0
|
||||||
else
|
else
|
||||||
error "Lightning.Pub failed to start (timeout)"
|
error "Lightning.Pub failed to start (timeout)"
|
||||||
docker logs lamassu-lightning-pub 2>&1 | tail -10
|
docker logs bitspire-lightning-pub 2>&1 | tail -10
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
extract_lightning_pub_info() {
|
extract_lightning_pub_info() {
|
||||||
local pubkey=$(docker logs lamassu-lightning-pub 2>&1 | grep -oP 'pubkey:\s*\K[a-f0-9]+' | tail -1)
|
local pubkey=$(docker logs bitspire-lightning-pub 2>&1 | grep -oP 'pubkey:\s*\K[a-f0-9]+' | tail -1)
|
||||||
local nprofile=$(docker logs lamassu-lightning-pub 2>&1 | grep -oP 'nprofile:\s*\K\S+' | tail -1)
|
local nprofile=$(docker logs bitspire-lightning-pub 2>&1 | grep -oP 'nprofile:\s*\K\S+' | tail -1)
|
||||||
|
|
||||||
echo "$pubkey" > "$PUBKEY_FILE"
|
echo "$pubkey" > "$PUBKEY_FILE"
|
||||||
echo "$nprofile" > "$NPROFILE_FILE"
|
echo "$nprofile" > "$NPROFILE_FILE"
|
||||||
|
|
@ -467,7 +467,7 @@ update_atm_env() {
|
||||||
VITE_RELAY_URL=ws://localhost:7777
|
VITE_RELAY_URL=ws://localhost:7777
|
||||||
VITE_LIGHTNING_PUB_PUBKEY=$pubkey
|
VITE_LIGHTNING_PUB_PUBKEY=$pubkey
|
||||||
VITE_LIGHTNING_PUB_API_URL=http://localhost:1776
|
VITE_LIGHTNING_PUB_API_URL=http://localhost:1776
|
||||||
VITE_ADMIN_TOKEN=lamassu-dev-admin-token
|
VITE_ADMIN_TOKEN=bitspire-dev-admin-token
|
||||||
VITE_ATM_PRIVATE_KEY=f391a2c3fc734f443b0f685688a0441b5fb9805853c0023f570c5a3c6412b136
|
VITE_ATM_PRIVATE_KEY=f391a2c3fc734f443b0f685688a0441b5fb9805853c0023f570c5a3c6412b136
|
||||||
|
|
||||||
# Extension API (for LNURL-withdraw)
|
# Extension API (for LNURL-withdraw)
|
||||||
|
|
@ -486,7 +486,7 @@ EOF
|
||||||
|
|
||||||
setup_atm_app() {
|
setup_atm_app() {
|
||||||
# Use a fixed app name so we reuse the same app across restarts
|
# Use a fixed app name so we reuse the same app across restarts
|
||||||
local app_name="lamassu-atm-dev"
|
local app_name="bitspire-atm-dev"
|
||||||
|
|
||||||
# Check if we already have valid app state
|
# Check if we already have valid app state
|
||||||
if [[ -f "$APP_ID_FILE" ]]; then
|
if [[ -f "$APP_ID_FILE" ]]; then
|
||||||
|
|
@ -501,7 +501,7 @@ setup_atm_app() {
|
||||||
|
|
||||||
local response=$(curl -s -X POST http://localhost:1776/api/admin/app/add \
|
local response=$(curl -s -X POST http://localhost:1776/api/admin/app/add \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-H "Authorization: Bearer lamassu-dev-admin-token" \
|
-H "Authorization: Bearer bitspire-dev-admin-token" \
|
||||||
-d "{\"name\":\"$app_name\",\"allow_user_creation\":true}" 2>/dev/null)
|
-d "{\"name\":\"$app_name\",\"allow_user_creation\":true}" 2>/dev/null)
|
||||||
|
|
||||||
if echo "$response" | grep -q '"status":"OK"'; then
|
if echo "$response" | grep -q '"status":"OK"'; then
|
||||||
|
|
@ -566,8 +566,8 @@ get_atm_balance() {
|
||||||
}
|
}
|
||||||
|
|
||||||
show_status() {
|
show_status() {
|
||||||
local pubkey=$(cat "$PUBKEY_FILE" 2>/dev/null || docker logs lamassu-lightning-pub 2>&1 | grep -oP 'pubkey:\s*\K[a-f0-9]+' | tail -1)
|
local pubkey=$(cat "$PUBKEY_FILE" 2>/dev/null || docker logs bitspire-lightning-pub 2>&1 | grep -oP 'pubkey:\s*\K[a-f0-9]+' | tail -1)
|
||||||
local nprofile=$(cat "$NPROFILE_FILE" 2>/dev/null || docker logs lamassu-lightning-pub 2>&1 | grep -oP 'nprofile:\s*\K\S+' | tail -1)
|
local nprofile=$(cat "$NPROFILE_FILE" 2>/dev/null || docker logs bitspire-lightning-pub 2>&1 | grep -oP 'nprofile:\s*\K\S+' | tail -1)
|
||||||
local local_ip=$(get_local_ip)
|
local local_ip=$(get_local_ip)
|
||||||
local lndconnect=$(generate_lndconnect 2>/dev/null || echo "")
|
local lndconnect=$(generate_lndconnect 2>/dev/null || echo "")
|
||||||
local lnd4_balance=$(get_lnd4_balance)
|
local lnd4_balance=$(get_lnd4_balance)
|
||||||
|
|
@ -575,7 +575,7 @@ show_status() {
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo -e "${BOLD}╔═══════════════════════════════════════════════════════════════════╗${NC}"
|
echo -e "${BOLD}╔═══════════════════════════════════════════════════════════════════╗${NC}"
|
||||||
echo -e "${BOLD}║ LAMASSU NEXT - DEVELOPMENT ENVIRONMENT ║${NC}"
|
echo -e "${BOLD}║ BITSPIRE - DEVELOPMENT ENVIRONMENT ║${NC}"
|
||||||
echo -e "${BOLD}╚═══════════════════════════════════════════════════════════════════╝${NC}"
|
echo -e "${BOLD}╚═══════════════════════════════════════════════════════════════════╝${NC}"
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
|
|
@ -663,7 +663,7 @@ cmd_up() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
log "Starting Lamassu development environment..."
|
log "Starting bitSpire development environment..."
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
# 1. Start shared regtest if needed (not in standalone mode)
|
# 1. Start shared regtest if needed (not in standalone mode)
|
||||||
|
|
@ -696,7 +696,7 @@ cmd_up() {
|
||||||
|
|
||||||
log "Using Lightning.Pub image: $image"
|
log "Using Lightning.Pub image: $image"
|
||||||
|
|
||||||
# 4. Start lamassu services
|
# 4. Start bitspire services
|
||||||
export REGTEST_DATA_DIR="$REGTEST_DIR/data"
|
export REGTEST_DATA_DIR="$REGTEST_DIR/data"
|
||||||
export LIGHTNING_PUB_IMAGE="$image"
|
export LIGHTNING_PUB_IMAGE="$image"
|
||||||
export HOST_IP=$(get_local_ip)
|
export HOST_IP=$(get_local_ip)
|
||||||
|
|
@ -708,7 +708,7 @@ cmd_up() {
|
||||||
echo "unified" > "$MODE_FILE"
|
echo "unified" > "$MODE_FILE"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
log "Starting lamassu services..."
|
log "Starting bitspire services..."
|
||||||
docker compose -f "$SCRIPT_DIR/$compose_file" up -d
|
docker compose -f "$SCRIPT_DIR/$compose_file" up -d
|
||||||
|
|
||||||
# 5. Wait for Lightning.Pub
|
# 5. Wait for Lightning.Pub
|
||||||
|
|
@ -746,7 +746,7 @@ cmd_up() {
|
||||||
|
|
||||||
cmd_down() {
|
cmd_down() {
|
||||||
local compose_file=$(get_compose_file)
|
local compose_file=$(get_compose_file)
|
||||||
log "Stopping lamassu services..."
|
log "Stopping bitspire services..."
|
||||||
docker compose -f "$SCRIPT_DIR/$compose_file" down 2>/dev/null || true
|
docker compose -f "$SCRIPT_DIR/$compose_file" down 2>/dev/null || true
|
||||||
|
|
||||||
if [[ "$1" == "--all" ]]; then
|
if [[ "$1" == "--all" ]]; then
|
||||||
|
|
@ -757,7 +757,7 @@ cmd_down() {
|
||||||
}
|
}
|
||||||
|
|
||||||
cmd_reset() {
|
cmd_reset() {
|
||||||
warn "This will delete all lamassu state (Lightning.Pub identity, ATM app, etc.)"
|
warn "This will delete all bitspire state (Lightning.Pub identity, ATM app, etc.)"
|
||||||
read -p "Continue? [y/N] " -n 1 -r
|
read -p "Continue? [y/N] " -n 1 -r
|
||||||
echo
|
echo
|
||||||
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
|
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
|
||||||
|
|
@ -782,7 +782,7 @@ cmd_logs() {
|
||||||
}
|
}
|
||||||
|
|
||||||
cmd_status() {
|
cmd_status() {
|
||||||
if ! docker ps --format '{{.Names}}' | grep -q lamassu-lightning-pub; then
|
if ! docker ps --format '{{.Names}}' | grep -q bitspire-lightning-pub; then
|
||||||
error "Services not running. Start with: ./dev.sh up"
|
error "Services not running. Start with: ./dev.sh up"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
@ -806,7 +806,7 @@ cmd_fund() {
|
||||||
local lp_pubkey=$(cat "$PUBKEY_FILE")
|
local lp_pubkey=$(cat "$PUBKEY_FILE")
|
||||||
local env_file="$PROJECT_DIR/apps/machine/.env"
|
local env_file="$PROJECT_DIR/apps/machine/.env"
|
||||||
|
|
||||||
# Get ATM private key from .env
|
# Get ATM private key from .env # pragma: allowlist secret
|
||||||
if [[ ! -f "$env_file" ]]; then
|
if [[ ! -f "$env_file" ]]; then
|
||||||
error "ATM not configured. Run './dev.sh up' first."
|
error "ATM not configured. Run './dev.sh up' first."
|
||||||
exit 1
|
exit 1
|
||||||
|
|
@ -952,7 +952,7 @@ cmd_atm() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check if services are running
|
# Check if services are running
|
||||||
if ! docker ps --format '{{.Names}}' | grep -q lamassu-lightning-pub; then
|
if ! docker ps --format '{{.Names}}' | grep -q bitspire-lightning-pub; then
|
||||||
warn "Services not running. Start with: ./dev.sh up"
|
warn "Services not running. Start with: ./dev.sh up"
|
||||||
read -p "Start services first? [Y/n] " -n 1 -r
|
read -p "Start services first? [Y/n] " -n 1 -r
|
||||||
echo
|
echo
|
||||||
|
|
@ -1013,7 +1013,7 @@ case "${1:-help}" in
|
||||||
shift
|
shift
|
||||||
cmd_logs "$@"
|
cmd_logs "$@"
|
||||||
;;
|
;;
|
||||||
# Internal command for external orchestration (called by regtest-start --with-lamassu)
|
# Internal command for external orchestration (called by regtest-start --with-bitspire)
|
||||||
_setup_after_start)
|
_setup_after_start)
|
||||||
if ! is_lightning_pub_ready; then
|
if ! is_lightning_pub_ready; then
|
||||||
wait_for_lightning_pub || exit 1
|
wait_for_lightning_pub || exit 1
|
||||||
|
|
@ -1041,7 +1041,7 @@ case "${1:-help}" in
|
||||||
cmd_zeus
|
cmd_zeus
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Lamassu Next Development Environment"
|
echo "bitSpire Development Environment"
|
||||||
echo ""
|
echo ""
|
||||||
echo "Usage: $0 <command> [options]"
|
echo "Usage: $0 <command> [options]"
|
||||||
echo ""
|
echo ""
|
||||||
|
|
@ -1069,7 +1069,7 @@ case "${1:-help}" in
|
||||||
echo " --machine Launch ATM app after startup"
|
echo " --machine Launch ATM app after startup"
|
||||||
echo ""
|
echo ""
|
||||||
echo "Environment variables:"
|
echo "Environment variables:"
|
||||||
echo " LAMASSU_HOST_IP Override auto-detected LAN IP (for VPN/multi-NIC)"
|
echo " BITSPIRE_HOST_IP Override auto-detected LAN IP (for VPN/multi-NIC)"
|
||||||
echo ""
|
echo ""
|
||||||
echo "Examples:"
|
echo "Examples:"
|
||||||
echo " $0 up # Start (uses shared regtest)"
|
echo " $0 up # Start (uses shared regtest)"
|
||||||
|
|
@ -1082,6 +1082,6 @@ case "${1:-help}" in
|
||||||
echo " $0 fund 200000 # Add 200k more sats"
|
echo " $0 fund 200000 # Add 200k more sats"
|
||||||
echo " $0 logs lightning-pub"
|
echo " $0 logs lightning-pub"
|
||||||
echo " $0 reset && $0 up --fund # Fresh start with funding"
|
echo " $0 reset && $0 up --fund # Fresh start with funding"
|
||||||
echo " LAMASSU_HOST_IP=192.168.1.50 $0 up # Override LAN IP"
|
echo " BITSPIRE_HOST_IP=192.168.1.50 $0 up # Override LAN IP"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
# Lamassu Next Development Infrastructure
|
# bitSpire Development Infrastructure
|
||||||
# Usage: docker compose -f docker-compose.dev.yml up -d
|
# Usage: docker compose -f docker-compose.dev.yml up -d
|
||||||
|
|
||||||
services:
|
services:
|
||||||
# Private Nostr relay for ATM communication
|
# Private Nostr relay for ATM communication
|
||||||
strfry:
|
strfry:
|
||||||
image: ghcr.io/hoytech/strfry:latest
|
image: ghcr.io/hoytech/strfry:latest
|
||||||
container_name: lamassu-relay
|
container_name: bitspire-relay
|
||||||
ports:
|
ports:
|
||||||
- '7777:7777'
|
- '7777:7777'
|
||||||
volumes:
|
volumes:
|
||||||
|
|
@ -25,7 +25,7 @@ services:
|
||||||
# Bitcoin Core in regtest mode
|
# Bitcoin Core in regtest mode
|
||||||
bitcoind:
|
bitcoind:
|
||||||
image: lncm/bitcoind:v27.0
|
image: lncm/bitcoind:v27.0
|
||||||
container_name: lamassu-bitcoind
|
container_name: bitspire-bitcoind
|
||||||
volumes:
|
volumes:
|
||||||
- bitcoind-data:/data/.bitcoin
|
- bitcoind-data:/data/.bitcoin
|
||||||
environment:
|
environment:
|
||||||
|
|
@ -33,8 +33,8 @@ services:
|
||||||
command:
|
command:
|
||||||
- -regtest
|
- -regtest
|
||||||
- -server
|
- -server
|
||||||
- -rpcuser=lamassu
|
- -rpcuser=bitspire
|
||||||
- -rpcpassword=lamassu
|
- -rpcpassword=bitspire # pragma: allowlist secret
|
||||||
- -rpcallowip=0.0.0.0/0
|
- -rpcallowip=0.0.0.0/0
|
||||||
- -rpcbind=0.0.0.0
|
- -rpcbind=0.0.0.0
|
||||||
- -zmqpubrawblock=tcp://0.0.0.0:28332
|
- -zmqpubrawblock=tcp://0.0.0.0:28332
|
||||||
|
|
@ -51,8 +51,8 @@ services:
|
||||||
'CMD',
|
'CMD',
|
||||||
'bitcoin-cli',
|
'bitcoin-cli',
|
||||||
'-regtest',
|
'-regtest',
|
||||||
'-rpcuser=lamassu',
|
'-rpcuser=bitspire',
|
||||||
'-rpcpassword=lamassu',
|
'-rpcpassword=bitspire', # pragma: allowlist secret
|
||||||
'getblockchaininfo',
|
'getblockchaininfo',
|
||||||
]
|
]
|
||||||
interval: 10s
|
interval: 10s
|
||||||
|
|
@ -63,7 +63,7 @@ services:
|
||||||
# LND Lightning node
|
# LND Lightning node
|
||||||
lnd:
|
lnd:
|
||||||
image: lightninglabs/lnd:v0.18.0-beta
|
image: lightninglabs/lnd:v0.18.0-beta
|
||||||
container_name: lamassu-lnd
|
container_name: bitspire-lnd
|
||||||
depends_on:
|
depends_on:
|
||||||
bitcoind:
|
bitcoind:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
|
@ -76,8 +76,8 @@ services:
|
||||||
- --bitcoin.regtest
|
- --bitcoin.regtest
|
||||||
- --bitcoin.node=bitcoind
|
- --bitcoin.node=bitcoind
|
||||||
- --bitcoind.rpchost=bitcoind:18443
|
- --bitcoind.rpchost=bitcoind:18443
|
||||||
- --bitcoind.rpcuser=lamassu
|
- --bitcoind.rpcuser=bitspire
|
||||||
- --bitcoind.rpcpass=lamassu
|
- --bitcoind.rpcpass=bitspire # pragma: allowlist secret
|
||||||
- --bitcoind.zmqpubrawblock=tcp://bitcoind:28332
|
- --bitcoind.zmqpubrawblock=tcp://bitcoind:28332
|
||||||
- --bitcoind.zmqpubrawtx=tcp://bitcoind:28333
|
- --bitcoind.zmqpubrawtx=tcp://bitcoind:28333
|
||||||
- --rpclisten=0.0.0.0:10009
|
- --rpclisten=0.0.0.0:10009
|
||||||
|
|
@ -104,7 +104,7 @@ services:
|
||||||
# Using patched image with Kind 0 profile publishing support
|
# Using patched image with Kind 0 profile publishing support
|
||||||
lightning-pub:
|
lightning-pub:
|
||||||
image: lightning-pub-patched:latest
|
image: lightning-pub-patched:latest
|
||||||
container_name: lamassu-lightning-pub
|
container_name: bitspire-lightning-pub
|
||||||
depends_on:
|
depends_on:
|
||||||
lnd:
|
lnd:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
|
@ -126,14 +126,14 @@ services:
|
||||||
# Disable external liquidity provider for regtest
|
# Disable external liquidity provider for regtest
|
||||||
- DISABLE_LIQUIDITY_PROVIDER=true
|
- DISABLE_LIQUIDITY_PROVIDER=true
|
||||||
# Admin token for HTTP API access (development only)
|
# Admin token for HTTP API access (development only)
|
||||||
- ADMIN_TOKEN=lamassu-dev-admin-token
|
- ADMIN_TOKEN=bitspire-dev-admin-token
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
# Second LND node (Alice) for payment testing
|
# Second LND node (Alice) for payment testing
|
||||||
# This node can pay invoices to Lightning.Pub's LND
|
# This node can pay invoices to Lightning.Pub's LND
|
||||||
lnd-alice:
|
lnd-alice:
|
||||||
image: lightninglabs/lnd:v0.18.0-beta
|
image: lightninglabs/lnd:v0.18.0-beta
|
||||||
container_name: lamassu-lnd-alice
|
container_name: bitspire-lnd-alice
|
||||||
depends_on:
|
depends_on:
|
||||||
bitcoind:
|
bitcoind:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
|
@ -146,8 +146,8 @@ services:
|
||||||
- --bitcoin.regtest
|
- --bitcoin.regtest
|
||||||
- --bitcoin.node=bitcoind
|
- --bitcoin.node=bitcoind
|
||||||
- --bitcoind.rpchost=bitcoind:18443
|
- --bitcoind.rpchost=bitcoind:18443
|
||||||
- --bitcoind.rpcuser=lamassu
|
- --bitcoind.rpcuser=bitspire
|
||||||
- --bitcoind.rpcpass=lamassu
|
- --bitcoind.rpcpass=bitspire # pragma: allowlist secret
|
||||||
- --bitcoind.zmqpubrawblock=tcp://bitcoind:28332
|
- --bitcoind.zmqpubrawblock=tcp://bitcoind:28332
|
||||||
- --bitcoind.zmqpubrawtx=tcp://bitcoind:28333
|
- --bitcoind.zmqpubrawtx=tcp://bitcoind:28333
|
||||||
- --rpclisten=0.0.0.0:10009
|
- --rpclisten=0.0.0.0:10009
|
||||||
|
|
@ -174,7 +174,7 @@ services:
|
||||||
# Mines 1 block every 30 seconds
|
# Mines 1 block every 30 seconds
|
||||||
miner:
|
miner:
|
||||||
image: alpine:latest
|
image: alpine:latest
|
||||||
container_name: lamassu-miner
|
container_name: bitspire-miner
|
||||||
depends_on:
|
depends_on:
|
||||||
bitcoind:
|
bitcoind:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
|
@ -186,11 +186,11 @@ services:
|
||||||
echo "Starting auto-miner (1 block every 30 seconds)..."
|
echo "Starting auto-miner (1 block every 30 seconds)..."
|
||||||
while true; do
|
while true; do
|
||||||
# Create wallet if not exists
|
# Create wallet if not exists
|
||||||
curl -s --user lamassu:lamassu --data-binary '{"jsonrpc":"1.0","method":"createwallet","params":["miner"]}' http://bitcoind:18443/ > /dev/null 2>&1
|
curl -s --user bitspire:bitspire --data-binary '{"jsonrpc":"1.0","method":"createwallet","params":["miner"]}' http://bitcoind:18443/ > /dev/null 2>&1
|
||||||
# Mine a block
|
# Mine a block
|
||||||
ADDR=$$(curl -s --user lamassu:lamassu --data-binary '{"jsonrpc":"1.0","method":"getnewaddress","params":[]}' http://bitcoind:18443/ | jq -r '.result // empty')
|
ADDR=$$(curl -s --user bitspire:bitspire --data-binary '{"jsonrpc":"1.0","method":"getnewaddress","params":[]}' http://bitcoind:18443/ | jq -r '.result // empty')
|
||||||
if [ -n "$$ADDR" ]; then
|
if [ -n "$$ADDR" ]; then
|
||||||
curl -s --user lamassu:lamassu --data-binary "{\"jsonrpc\":\"1.0\",\"method\":\"generatetoaddress\",\"params\":[1,\"$$ADDR\"]}" http://bitcoind:18443/ > /dev/null
|
curl -s --user bitspire:bitspire --data-binary "{\"jsonrpc\":\"1.0\",\"method\":\"generatetoaddress\",\"params\":[1,\"$$ADDR\"]}" http://bitcoind:18443/ > /dev/null
|
||||||
fi
|
fi
|
||||||
sleep 30
|
sleep 30
|
||||||
done
|
done
|
||||||
|
|
@ -201,17 +201,17 @@ services:
|
||||||
# PostgreSQL for optional server-side state
|
# PostgreSQL for optional server-side state
|
||||||
postgres:
|
postgres:
|
||||||
image: postgres:16-alpine
|
image: postgres:16-alpine
|
||||||
container_name: lamassu-postgres
|
container_name: bitspire-postgres
|
||||||
ports:
|
ports:
|
||||||
- '5432:5432'
|
- '5432:5432'
|
||||||
environment:
|
environment:
|
||||||
POSTGRES_DB: lamassu_dev
|
POSTGRES_DB: bitspire_dev
|
||||||
POSTGRES_USER: lamassu
|
POSTGRES_USER: bitspire
|
||||||
POSTGRES_PASSWORD: lamassu_dev_password
|
POSTGRES_PASSWORD: bitspire_dev_password # pragma: allowlist secret
|
||||||
volumes:
|
volumes:
|
||||||
- postgres-data:/var/lib/postgresql/data
|
- postgres-data:/var/lib/postgresql/data
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ['CMD-SHELL', 'pg_isready -U lamassu -d lamassu_dev']
|
test: ['CMD-SHELL', 'pg_isready -U bitspire -d bitspire_dev']
|
||||||
interval: 10s
|
interval: 10s
|
||||||
timeout: 5s
|
timeout: 5s
|
||||||
retries: 5
|
retries: 5
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,13 @@
|
||||||
# Lamassu Next - Regtest Integration
|
# bitSpire - Regtest Integration
|
||||||
#
|
#
|
||||||
# This overlay connects lamassu-next services to the comprehensive regtest
|
# This overlay connects bitspire-next services to the comprehensive regtest
|
||||||
# environment at ~/dev/local/docker/regtest
|
# environment at ~/dev/local/docker/regtest
|
||||||
#
|
#
|
||||||
# Usage:
|
# Usage:
|
||||||
# 1. Start regtest (minimal — only what LP needs):
|
# 1. Start regtest (minimal — only what LP needs):
|
||||||
# cd ~/dev/local/docker/regtest && docker compose up -d bitcoind lnd-1 lnd-4
|
# cd ~/dev/local/docker/regtest && docker compose up -d bitcoind lnd-1 lnd-4
|
||||||
#
|
#
|
||||||
# 2. Start lamassu services:
|
# 2. Start bitspire services:
|
||||||
# cd docker && docker compose -f docker-compose.regtest.yml up -d
|
# cd docker && docker compose -f docker-compose.regtest.yml up -d
|
||||||
#
|
#
|
||||||
# 3. Bootstrap (funds LND, opens channels, creates LP app):
|
# 3. Bootstrap (funds LND, opens channels, creates LP app):
|
||||||
|
|
@ -32,7 +32,7 @@ services:
|
||||||
# Private Nostr relay for ATM communication
|
# Private Nostr relay for ATM communication
|
||||||
strfry:
|
strfry:
|
||||||
image: ghcr.io/hoytech/strfry:latest
|
image: ghcr.io/hoytech/strfry:latest
|
||||||
container_name: lamassu-relay
|
container_name: bitspire-relay
|
||||||
ports:
|
ports:
|
||||||
- '7777:7777'
|
- '7777:7777'
|
||||||
volumes:
|
volumes:
|
||||||
|
|
@ -57,7 +57,7 @@ services:
|
||||||
# Use LIGHTNING_PUB_IMAGE env var to specify image (default: lightning-pub-withdraw)
|
# Use LIGHTNING_PUB_IMAGE env var to specify image (default: lightning-pub-withdraw)
|
||||||
lightning-pub:
|
lightning-pub:
|
||||||
image: ${LIGHTNING_PUB_IMAGE:-lightning-pub-withdraw:latest}
|
image: ${LIGHTNING_PUB_IMAGE:-lightning-pub-withdraw:latest}
|
||||||
container_name: lamassu-lightning-pub
|
container_name: bitspire-lightning-pub
|
||||||
extra_hosts:
|
extra_hosts:
|
||||||
- 'host.docker.internal:host-gateway'
|
- 'host.docker.internal:host-gateway'
|
||||||
ports:
|
ports:
|
||||||
|
|
@ -80,7 +80,7 @@ services:
|
||||||
# Disable external liquidity provider for regtest
|
# Disable external liquidity provider for regtest
|
||||||
- DISABLE_LIQUIDITY_PROVIDER=true
|
- DISABLE_LIQUIDITY_PROVIDER=true
|
||||||
# Admin token for HTTP API access (development only)
|
# Admin token for HTTP API access (development only)
|
||||||
- ADMIN_TOKEN=lamassu-dev-admin-token
|
- ADMIN_TOKEN=bitspire-dev-admin-token
|
||||||
# Extension HTTP API URL (for LNURL callbacks from external wallets)
|
# Extension HTTP API URL (for LNURL callbacks from external wallets)
|
||||||
# Use HOST_IP env var for your machine's LAN IP (required for phone wallets)
|
# Use HOST_IP env var for your machine's LAN IP (required for phone wallets)
|
||||||
- EXTENSION_SERVICE_URL=http://${HOST_IP:-localhost}:1777
|
- EXTENSION_SERVICE_URL=http://${HOST_IP:-localhost}:1777
|
||||||
|
|
@ -101,7 +101,7 @@ services:
|
||||||
# Keeps Lightning channels active during development
|
# Keeps Lightning channels active during development
|
||||||
miner:
|
miner:
|
||||||
image: boltz/bitcoin-core:25.0
|
image: boltz/bitcoin-core:25.0
|
||||||
container_name: lamassu-miner
|
container_name: bitspire-miner
|
||||||
entrypoint: /bin/sh
|
entrypoint: /bin/sh
|
||||||
command:
|
command:
|
||||||
- -c
|
- -c
|
||||||
|
|
@ -132,17 +132,17 @@ services:
|
||||||
# PostgreSQL for optional server-side state
|
# PostgreSQL for optional server-side state
|
||||||
postgres:
|
postgres:
|
||||||
image: postgres:16-alpine
|
image: postgres:16-alpine
|
||||||
container_name: lamassu-postgres
|
container_name: bitspire-postgres
|
||||||
ports:
|
ports:
|
||||||
- '5432:5432'
|
- '5432:5432'
|
||||||
environment:
|
environment:
|
||||||
POSTGRES_DB: lamassu_dev
|
POSTGRES_DB: bitspire_dev
|
||||||
POSTGRES_USER: lamassu
|
POSTGRES_USER: bitspire
|
||||||
POSTGRES_PASSWORD: lamassu_dev_password
|
POSTGRES_PASSWORD: bitspire_dev_password # pragma: allowlist secret
|
||||||
volumes:
|
volumes:
|
||||||
- postgres-data:/var/lib/postgresql/data
|
- postgres-data:/var/lib/postgresql/data
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ['CMD-SHELL', 'pg_isready -U lamassu -d lamassu_dev']
|
test: ['CMD-SHELL', 'pg_isready -U bitspire -d bitspire_dev']
|
||||||
interval: 10s
|
interval: 10s
|
||||||
timeout: 5s
|
timeout: 5s
|
||||||
retries: 5
|
retries: 5
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
# Prerequisites:
|
# Prerequisites:
|
||||||
# 1. Regtest running (minimal — only needs bitcoind + lnd-1 + lnd-4):
|
# 1. Regtest running (minimal — only needs bitcoind + lnd-1 + lnd-4):
|
||||||
# cd ~/dev/local/docker/regtest && docker compose up -d bitcoind lnd-1 lnd-4
|
# cd ~/dev/local/docker/regtest && docker compose up -d bitcoind lnd-1 lnd-4
|
||||||
# 2. Lamassu services running:
|
# 2. bitSpire services running:
|
||||||
# cd docker && docker compose -f docker-compose.regtest.yml up -d
|
# cd docker && docker compose -f docker-compose.regtest.yml up -d
|
||||||
#
|
#
|
||||||
# What this script does:
|
# What this script does:
|
||||||
|
|
@ -59,7 +59,7 @@ lncli_4() {
|
||||||
|
|
||||||
LP_URL="http://localhost:1776"
|
LP_URL="http://localhost:1776"
|
||||||
LP_EXT_URL="http://localhost:1777"
|
LP_EXT_URL="http://localhost:1777"
|
||||||
ADMIN_TOKEN="lamassu-dev-admin-token"
|
ADMIN_TOKEN="bitspire-dev-admin-token"
|
||||||
CHANNEL_SIZE=5000000 # 5M sats
|
CHANNEL_SIZE=5000000 # 5M sats
|
||||||
FUND_AMOUNT=10000 # 10k sats for LP app
|
FUND_AMOUNT=10000 # 10k sats for LP app
|
||||||
|
|
||||||
|
|
@ -195,7 +195,7 @@ for i in $(seq 1 120); do
|
||||||
fi
|
fi
|
||||||
if [ "$i" -eq 120 ]; then
|
if [ "$i" -eq 120 ]; then
|
||||||
err "Lightning.Pub not ready after 120s"
|
err "Lightning.Pub not ready after 120s"
|
||||||
err "Check: docker logs lamassu-lightning-pub"
|
err "Check: docker logs bitspire-lightning-pub"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
sleep 1
|
sleep 1
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ cmd_up() {
|
||||||
echo -e "${CYAN}Starting regtest (bitcoind + lnd-1 + lnd-4)...${NC}"
|
echo -e "${CYAN}Starting regtest (bitcoind + lnd-1 + lnd-4)...${NC}"
|
||||||
cd "$REGTEST_DIR" && docker compose up -d bitcoind lnd-1 lnd-4
|
cd "$REGTEST_DIR" && docker compose up -d bitcoind lnd-1 lnd-4
|
||||||
|
|
||||||
echo -e "${CYAN}Starting lamassu services...${NC}"
|
echo -e "${CYAN}Starting bitspire services...${NC}"
|
||||||
docker compose -f "$COMPOSE_FILE" up -d
|
docker compose -f "$COMPOSE_FILE" up -d
|
||||||
|
|
||||||
echo -e "${CYAN}Running bootstrap...${NC}"
|
echo -e "${CYAN}Running bootstrap...${NC}"
|
||||||
|
|
@ -44,7 +44,7 @@ cmd_up() {
|
||||||
}
|
}
|
||||||
|
|
||||||
cmd_down() {
|
cmd_down() {
|
||||||
echo -e "${CYAN}Stopping lamassu services...${NC}"
|
echo -e "${CYAN}Stopping bitspire services...${NC}"
|
||||||
docker compose -f "$COMPOSE_FILE" down 2>/dev/null || true
|
docker compose -f "$COMPOSE_FILE" down 2>/dev/null || true
|
||||||
|
|
||||||
echo -e "${CYAN}Stopping regtest...${NC}"
|
echo -e "${CYAN}Stopping regtest...${NC}"
|
||||||
|
|
@ -68,7 +68,7 @@ cmd_reset() {
|
||||||
|
|
||||||
cmd_status() {
|
cmd_status() {
|
||||||
echo -e "${CYAN}Containers:${NC}"
|
echo -e "${CYAN}Containers:${NC}"
|
||||||
docker ps --format 'table {{.Names}}\t{{.Status}}\t{{.Ports}}' | grep -E 'regtest|lamassu|NAMES' | sort
|
docker ps --format 'table {{.Names}}\t{{.Status}}\t{{.Ports}}' | grep -E 'regtest|bitspire|NAMES' | sort
|
||||||
|
|
||||||
PREFIX=$(detect_prefix)
|
PREFIX=$(detect_prefix)
|
||||||
if [ -n "$PREFIX" ]; then
|
if [ -n "$PREFIX" ]; then
|
||||||
|
|
@ -92,9 +92,9 @@ cmd_status() {
|
||||||
cmd_logs() {
|
cmd_logs() {
|
||||||
local svc="${1:-lp}"
|
local svc="${1:-lp}"
|
||||||
case "$svc" in
|
case "$svc" in
|
||||||
lp|lightning-pub) docker logs -f --tail 50 lamassu-lightning-pub ;;
|
lp|lightning-pub) docker logs -f --tail 50 bitspire-lightning-pub ;;
|
||||||
relay|strfry) docker logs -f --tail 50 lamassu-relay ;;
|
relay|strfry) docker logs -f --tail 50 bitspire-relay ;;
|
||||||
miner) docker logs -f --tail 50 lamassu-miner ;;
|
miner) docker logs -f --tail 50 bitspire-miner ;;
|
||||||
lnd1|lnd-1) PREFIX=$(detect_prefix); docker logs -f --tail 50 "${PREFIX}-lnd-1-1" ;;
|
lnd1|lnd-1) PREFIX=$(detect_prefix); docker logs -f --tail 50 "${PREFIX}-lnd-1-1" ;;
|
||||||
lnd4|lnd-4) PREFIX=$(detect_prefix); docker logs -f --tail 50 "${PREFIX}-lnd-4-1" ;;
|
lnd4|lnd-4) PREFIX=$(detect_prefix); docker logs -f --tail 50 "${PREFIX}-lnd-4-1" ;;
|
||||||
bitcoind) PREFIX=$(detect_prefix); docker logs -f --tail 50 "${PREFIX}-bitcoind-1" ;;
|
bitcoind) PREFIX=$(detect_prefix); docker logs -f --tail 50 "${PREFIX}-bitcoind-1" ;;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
# Start lamassu-next development environment with comprehensive regtest
|
# Start bitspire-next development environment with comprehensive regtest
|
||||||
#
|
#
|
||||||
# This script:
|
# This script:
|
||||||
# 1. Connects to the regtest environment at ~/dev/local/docker/regtest
|
# 1. Connects to the regtest environment at ~/dev/local/docker/regtest
|
||||||
|
|
@ -37,10 +37,10 @@ CYAN='\033[0;36m'
|
||||||
BOLD='\033[1m'
|
BOLD='\033[1m'
|
||||||
NC='\033[0m'
|
NC='\033[0m'
|
||||||
|
|
||||||
log() { echo -e "${GREEN}[lamassu]${NC} $1"; }
|
log() { echo -e "${GREEN}[bitspire]${NC} $1"; }
|
||||||
warn() { echo -e "${YELLOW}[lamassu]${NC} $1"; }
|
warn() { echo -e "${YELLOW}[bitspire]${NC} $1"; }
|
||||||
error() { echo -e "${RED}[lamassu]${NC} $1"; }
|
error() { echo -e "${RED}[bitspire]${NC} $1"; }
|
||||||
info() { echo -e "${CYAN}[lamassu]${NC} $1"; }
|
info() { echo -e "${CYAN}[bitspire]${NC} $1"; }
|
||||||
|
|
||||||
# Get local IP for external wallet access
|
# Get local IP for external wallet access
|
||||||
get_local_ip() {
|
get_local_ip() {
|
||||||
|
|
@ -86,7 +86,7 @@ wait_for_lightning_pub() {
|
||||||
local attempt=0
|
local attempt=0
|
||||||
|
|
||||||
while [[ $attempt -lt $max_attempts ]]; do
|
while [[ $attempt -lt $max_attempts ]]; do
|
||||||
if docker logs lamassu-lightning-pub 2>&1 | grep -q "LightningPub listening"; then
|
if docker logs bitspire-lightning-pub 2>&1 | grep -q "LightningPub listening"; then
|
||||||
sleep 2 # Extra time for Nostr middleware
|
sleep 2 # Extra time for Nostr middleware
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
@ -95,18 +95,18 @@ wait_for_lightning_pub() {
|
||||||
done
|
done
|
||||||
|
|
||||||
error "Lightning.Pub failed to start within 60 seconds"
|
error "Lightning.Pub failed to start within 60 seconds"
|
||||||
docker logs lamassu-lightning-pub 2>&1 | tail -20
|
docker logs bitspire-lightning-pub 2>&1 | tail -20
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
# Get Lightning.Pub nprofile from logs
|
# Get Lightning.Pub nprofile from logs
|
||||||
get_nprofile() {
|
get_nprofile() {
|
||||||
docker logs lamassu-lightning-pub 2>&1 | grep -oP 'nprofile:\s*\K\S+' | tail -1
|
docker logs bitspire-lightning-pub 2>&1 | grep -oP 'nprofile:\s*\K\S+' | tail -1
|
||||||
}
|
}
|
||||||
|
|
||||||
# Get Lightning.Pub pubkey from logs
|
# Get Lightning.Pub pubkey from logs
|
||||||
get_pubkey() {
|
get_pubkey() {
|
||||||
docker logs lamassu-lightning-pub 2>&1 | grep -oP 'pubkey:\s*\K[a-f0-9]+' | tail -1
|
docker logs bitspire-lightning-pub 2>&1 | grep -oP 'pubkey:\s*\K[a-f0-9]+' | tail -1
|
||||||
}
|
}
|
||||||
|
|
||||||
# Generate lndconnect URL for Zeus (using lnd-3 which has REST exposed)
|
# Generate lndconnect URL for Zeus (using lnd-3 which has REST exposed)
|
||||||
|
|
@ -139,7 +139,7 @@ setup_atm_account() {
|
||||||
# Create app
|
# Create app
|
||||||
local app_response=$(curl -s -X POST http://localhost:1776/api/admin/app/add \
|
local app_response=$(curl -s -X POST http://localhost:1776/api/admin/app/add \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-H "Authorization: Bearer lamassu-dev-admin-token" \
|
-H "Authorization: Bearer bitspire-dev-admin-token" \
|
||||||
-d '{"name":"atm-app","allow_user_creation":true}' 2>/dev/null)
|
-d '{"name":"atm-app","allow_user_creation":true}' 2>/dev/null)
|
||||||
|
|
||||||
if echo "$app_response" | grep -q '"status":"OK"'; then
|
if echo "$app_response" | grep -q '"status":"OK"'; then
|
||||||
|
|
@ -171,7 +171,7 @@ show_connection_info() {
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo -e "${BOLD}═══════════════════════════════════════════════════════════════${NC}"
|
echo -e "${BOLD}═══════════════════════════════════════════════════════════════${NC}"
|
||||||
echo -e "${BOLD} LAMASSU REGTEST ENVIRONMENT ${NC}"
|
echo -e "${BOLD} BITSPIRE REGTEST ENVIRONMENT ${NC}"
|
||||||
echo -e "${BOLD}═══════════════════════════════════════════════════════════════${NC}"
|
echo -e "${BOLD}═══════════════════════════════════════════════════════════════${NC}"
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
|
|
@ -262,7 +262,7 @@ start() {
|
||||||
export LIGHTNING_PUB_IMAGE="$image"
|
export LIGHTNING_PUB_IMAGE="$image"
|
||||||
export HOST_IP=$(get_local_ip)
|
export HOST_IP=$(get_local_ip)
|
||||||
|
|
||||||
log "Starting lamassu services..."
|
log "Starting bitspire services..."
|
||||||
docker compose -f "$SCRIPT_DIR/docker-compose.regtest.yml" up -d
|
docker compose -f "$SCRIPT_DIR/docker-compose.regtest.yml" up -d
|
||||||
|
|
||||||
# Wait for Lightning.Pub and setup
|
# Wait for Lightning.Pub and setup
|
||||||
|
|
@ -277,7 +277,7 @@ start() {
|
||||||
|
|
||||||
# Stop services
|
# Stop services
|
||||||
stop() {
|
stop() {
|
||||||
log "Stopping lamassu services..."
|
log "Stopping bitspire services..."
|
||||||
docker compose -f "$SCRIPT_DIR/docker-compose.regtest.yml" down
|
docker compose -f "$SCRIPT_DIR/docker-compose.regtest.yml" down
|
||||||
rm -f "$SCRIPT_DIR/.atm-app-token" "$SCRIPT_DIR/.atm-app-id"
|
rm -f "$SCRIPT_DIR/.atm-app-token" "$SCRIPT_DIR/.atm-app-id"
|
||||||
log "Services stopped."
|
log "Services stopped."
|
||||||
|
|
@ -290,7 +290,7 @@ logs() {
|
||||||
|
|
||||||
# Show status/connection info
|
# Show status/connection info
|
||||||
status() {
|
status() {
|
||||||
if ! docker ps --format '{{.Names}}' | grep -q lamassu-lightning-pub; then
|
if ! docker ps --format '{{.Names}}' | grep -q bitspire-lightning-pub; then
|
||||||
error "Services not running. Start with: $0 start"
|
error "Services not running. Start with: $0 start"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
##
|
##
|
||||||
## strfry configuration for Lamassu ATM development
|
## strfry configuration for bitSpire ATM development
|
||||||
##
|
##
|
||||||
|
|
||||||
relay {
|
relay {
|
||||||
|
|
@ -10,7 +10,7 @@ relay {
|
||||||
nofiles = 0
|
nofiles = 0
|
||||||
|
|
||||||
info {
|
info {
|
||||||
name = "Lamassu Dev Relay"
|
name = "bitSpire Dev Relay"
|
||||||
description = "Private Nostr relay for ATM development and testing"
|
description = "Private Nostr relay for ATM development and testing"
|
||||||
pubkey = ""
|
pubkey = ""
|
||||||
contact = ""
|
contact = ""
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ const RELAY_URL = 'ws://localhost:7777'
|
||||||
// Relay URL for browser access (different from Docker internal strfry:7777)
|
// Relay URL for browser access (different from Docker internal strfry:7777)
|
||||||
const BROWSER_RELAY_URL = 'ws://localhost:7777'
|
const BROWSER_RELAY_URL = 'ws://localhost:7777'
|
||||||
const LIGHTNING_PUB_HTTP = 'http://localhost:1776'
|
const LIGHTNING_PUB_HTTP = 'http://localhost:1776'
|
||||||
const ADMIN_TOKEN = 'lamassu-dev-admin-token'
|
const ADMIN_TOKEN = 'bitspire-dev-admin-token'
|
||||||
|
|
||||||
// Lightning.Pub pubkey - fetched dynamically from the ATM user's ndebit
|
// Lightning.Pub pubkey - fetched dynamically from the ATM user's ndebit
|
||||||
let LIGHTNING_PUB_PUBKEY = null
|
let LIGHTNING_PUB_PUBKEY = null
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ if (!NDEBIT || !BOLT11) {
|
||||||
console.log('')
|
console.log('')
|
||||||
console.log('Example:')
|
console.log('Example:')
|
||||||
console.log(' # First create an invoice on Alice:')
|
console.log(' # First create an invoice on Alice:')
|
||||||
console.log(' docker exec lamassu-lnd-alice lncli --network=regtest addinvoice --amt 1000')
|
console.log(' docker exec bitspire-lnd-alice lncli --network=regtest addinvoice --amt 1000')
|
||||||
console.log('')
|
console.log('')
|
||||||
console.log(' # Then test the debit:')
|
console.log(' # Then test the debit:')
|
||||||
console.log(' node test-debit.mjs ndebit1... lnbcrt...')
|
console.log(' node test-debit.mjs ndebit1... lnbcrt...')
|
||||||
|
|
|
||||||
|
|
@ -10,13 +10,13 @@ const LIGHTNING_PUB_PUBKEY =
|
||||||
const RELAY_URL = process.env.NOSTR_RELAY_URL || 'ws://localhost:7777'
|
const RELAY_URL = process.env.NOSTR_RELAY_URL || 'ws://localhost:7777'
|
||||||
|
|
||||||
// Get a fresh invoice from Alice first:
|
// Get a fresh invoice from Alice first:
|
||||||
// docker exec lamassu-lnd-alice lncli --network=regtest addinvoice --amt 1000
|
// docker exec bitspire-lnd-alice lncli --network=regtest addinvoice --amt 1000
|
||||||
const TEST_INVOICE = process.argv[2]
|
const TEST_INVOICE = process.argv[2]
|
||||||
|
|
||||||
if (!TEST_INVOICE) {
|
if (!TEST_INVOICE) {
|
||||||
console.log('Usage: node test-pay.mjs <invoice>')
|
console.log('Usage: node test-pay.mjs <invoice>')
|
||||||
console.log(
|
console.log(
|
||||||
'Generate invoice: docker exec lamassu-lnd-alice lncli --network=regtest addinvoice --amt 1000'
|
'Generate invoice: docker exec bitspire-lnd-alice lncli --network=regtest addinvoice --amt 1000'
|
||||||
)
|
)
|
||||||
process.exit(1)
|
process.exit(1)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue