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
|
||||
name = "lamassu-next";
|
||||
name = "bitspire-next";
|
||||
|
||||
# ============================================
|
||||
# Languages
|
||||
|
|
@ -65,7 +65,7 @@
|
|||
|
||||
services.postgres = {
|
||||
enable = true;
|
||||
initialDatabases = [{ name = "lamassu_dev"; }];
|
||||
initialDatabases = [{ name = "bitspire_dev"; }];
|
||||
listen_addresses = "127.0.0.1";
|
||||
};
|
||||
|
||||
|
|
@ -97,7 +97,7 @@
|
|||
|
||||
env = {
|
||||
RUST_BACKTRACE = "1";
|
||||
DATABASE_URL = "postgresql://localhost/lamassu_dev";
|
||||
DATABASE_URL = "postgresql://localhost/bitspire_dev";
|
||||
|
||||
# Nostr development relay
|
||||
NOSTR_RELAY_URL = "ws://localhost:7777";
|
||||
|
|
@ -130,7 +130,7 @@
|
|||
|
||||
# Wait for strfry
|
||||
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 "."
|
||||
sleep 2
|
||||
done
|
||||
|
|
@ -138,7 +138,7 @@
|
|||
|
||||
# Wait for 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 "."
|
||||
sleep 2
|
||||
done
|
||||
|
|
@ -146,7 +146,7 @@
|
|||
|
||||
# Wait for 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 "."
|
||||
sleep 3
|
||||
done
|
||||
|
|
@ -154,7 +154,7 @@
|
|||
|
||||
# Wait for Alice's LND
|
||||
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 "."
|
||||
sleep 3
|
||||
done
|
||||
|
|
@ -196,7 +196,7 @@
|
|||
mine-blocks.exec = ''
|
||||
BLOCKS=''${1:-1}
|
||||
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)
|
||||
|
|
@ -211,19 +211,19 @@
|
|||
# Stop auto-miner
|
||||
auto-mine-stop.exec = ''
|
||||
echo "Stopping auto-miner..."
|
||||
docker stop lamassu-miner 2>/dev/null || true
|
||||
docker rm lamassu-miner 2>/dev/null || true
|
||||
docker stop bitspire-miner 2>/dev/null || true
|
||||
docker rm bitspire-miner 2>/dev/null || true
|
||||
echo "Auto-miner stopped."
|
||||
'';
|
||||
|
||||
# Connect to LND CLI
|
||||
lncli.exec = ''
|
||||
docker exec -it lamassu-lnd lncli --network=regtest "$@"
|
||||
docker exec -it bitspire-lnd lncli --network=regtest "$@"
|
||||
'';
|
||||
|
||||
# Connect to Bitcoin CLI
|
||||
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
|
||||
|
|
@ -234,7 +234,7 @@
|
|||
|
||||
# Connect to Alice's LND CLI (second node for testing payments)
|
||||
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
|
||||
|
|
@ -243,46 +243,46 @@
|
|||
echo ""
|
||||
|
||||
# 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')
|
||||
echo "LND pubkey: $LND_PUBKEY"
|
||||
|
||||
# Connect 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
|
||||
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"
|
||||
|
||||
if [ "$ALICE_BALANCE" -lt 1000000 ]; then
|
||||
echo ""
|
||||
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 ""
|
||||
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..."
|
||||
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
|
||||
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"
|
||||
fi
|
||||
|
||||
# Open channel from Alice to LND (1M sats)
|
||||
echo ""
|
||||
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 "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
|
||||
echo ""
|
||||
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 "Channel setup complete! Alice can now pay invoices to Lightning.Pub."
|
||||
'';
|
||||
|
|
@ -294,14 +294,14 @@
|
|||
exit 1
|
||||
fi
|
||||
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)
|
||||
alice-invoice.exec = ''
|
||||
AMOUNT=''${1:-1000}
|
||||
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
|
||||
|
|
@ -324,7 +324,7 @@
|
|||
|
||||
echo ""
|
||||
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 "ATM account funded with $AMOUNT sats!"
|
||||
|
|
@ -334,14 +334,14 @@
|
|||
test-setup.exec = ''
|
||||
echo ""
|
||||
echo "═══════════════════════════════════════════════════════════"
|
||||
echo " Lamassu Next - Test Setup Validation"
|
||||
echo " bitSpire - Test Setup Validation"
|
||||
echo "═══════════════════════════════════════════════════════════"
|
||||
echo ""
|
||||
|
||||
# Mine a block to wake up LND sync (regtest quirk: LND reports
|
||||
# "not synced" when no blocks mined recently)
|
||||
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
|
||||
echo ""
|
||||
|
||||
|
|
@ -362,19 +362,19 @@
|
|||
echo "───────────────────────────────────────────────────────────"
|
||||
|
||||
# Check containers
|
||||
docker ps --format '{{.Names}}' | grep -q lamassu-relay
|
||||
docker ps --format '{{.Names}}' | grep -q bitspire-relay
|
||||
check $? "strfry relay running"
|
||||
|
||||
docker ps --format '{{.Names}}' | grep -q lamassu-bitcoind
|
||||
docker ps --format '{{.Names}}' | grep -q bitspire-bitcoind
|
||||
check $? "bitcoind running"
|
||||
|
||||
docker ps --format '{{.Names}}' | grep -q lamassu-lnd
|
||||
docker ps --format '{{.Names}}' | grep -q bitspire-lnd
|
||||
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"
|
||||
|
||||
docker ps --format '{{.Names}}' | grep -q lamassu-lightning-pub
|
||||
docker ps --format '{{.Names}}' | grep -q bitspire-lightning-pub
|
||||
check $? "Lightning.Pub running"
|
||||
|
||||
echo ""
|
||||
|
|
@ -386,32 +386,32 @@
|
|||
check $? "Nostr relay port open"
|
||||
|
||||
# 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 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 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"
|
||||
|
||||
echo ""
|
||||
echo "3. Blockchain State"
|
||||
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 ]
|
||||
check $? "Block height >= 100 (current: $BLOCKS)"
|
||||
|
||||
# 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" ]
|
||||
check $? "LND synced to chain"
|
||||
|
||||
# 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" ]
|
||||
check $? "LND Alice synced to chain"
|
||||
|
||||
|
|
@ -420,17 +420,17 @@
|
|||
echo "───────────────────────────────────────────────────────────"
|
||||
|
||||
# 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 ]
|
||||
check $? "Alice has active channels (count: $ALICE_CHANNELS)"
|
||||
|
||||
# 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" ]
|
||||
check $? "Channel is active"
|
||||
|
||||
# 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 ]
|
||||
check $? "Alice has outbound capacity ($ALICE_LOCAL sats)"
|
||||
|
||||
|
|
@ -439,12 +439,12 @@
|
|||
echo "───────────────────────────────────────────────────────────"
|
||||
|
||||
# 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
|
||||
check 0 "Created 100 sat test invoice"
|
||||
|
||||
# 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
|
||||
check 0 "Payment Alice → LND succeeded"
|
||||
else
|
||||
|
|
@ -478,7 +478,7 @@
|
|||
|
||||
# Create invoice on Alice (simulating customer'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}..."
|
||||
|
||||
# Use test-pay.mjs to pay via Lightning.Pub
|
||||
|
|
@ -490,7 +490,7 @@
|
|||
echo ""
|
||||
echo "3. Verifying payment on Alice..."
|
||||
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
|
||||
echo " ✓ Payment received!"
|
||||
else
|
||||
|
|
@ -507,15 +507,15 @@
|
|||
echo ""
|
||||
|
||||
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 "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 "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 "Lightning.Pub Nostr pubkey:"
|
||||
|
|
@ -533,7 +533,7 @@
|
|||
|
||||
enterShell = ''
|
||||
echo ""
|
||||
echo " ⚡ Lamassu Next - Nostr-Native Lightning ATM"
|
||||
echo " ⚡ bitSpire - Nostr-Native Lightning ATM"
|
||||
echo " ─────────────────────────────────────────────"
|
||||
echo " Node.js: $(node --version)"
|
||||
echo " Rust: $(rustc --version | cut -d' ' -f2)"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue