aboutsummaryrefslogtreecommitdiffstats
path: root/fund-and-settle.sh
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-02-03 09:15:39 -0800
committerAdam Soltys <[email protected]>2026-02-06 08:58:12 -0800
commit5e3bfba5eb3d54cc03551f98624a2e92dca5825f (patch)
tree723e0be4e4f0a987fa2375fcf0360022f1232eaa /fund-and-settle.sh
parent4850177f50b7ff5a0f37acaa92190219d6f72da5 (diff)
downloadcoinos-server-5e3bfba5eb3d54cc03551f98624a2e92dca5825f.tar.gz
coinos-server-5e3bfba5eb3d54cc03551f98624a2e92dca5825f.zip
custodial ark payments
Diffstat (limited to 'fund-and-settle.sh')
-rw-r--r--fund-and-settle.sh31
1 files changed, 31 insertions, 0 deletions
diff --git a/fund-and-settle.sh b/fund-and-settle.sh
new file mode 100644
index 00000000..103ef055
--- /dev/null
+++ b/fund-and-settle.sh
@@ -0,0 +1,31 @@
+#!/bin/bash
+set -e
+
+# 1. Send BTC to boarding address and mine
+echo "Funding boarding address..."
+docker exec bc bitcoin-cli -regtest -rpcuser=admin1 -rpcpassword=123 -rpcwallet=coinos sendtoaddress "bcrt1p4pm6myqffj07g8quw9er2vdnvf8rj7ns4nwwt9l5gxjf8pmjkueqh9hezk" 1
+docker exec bc bitcoin-cli -regtest -rpcuser=admin1 -rpcpassword=123 generatetoaddress 1 "$(docker exec bc bitcoin-cli -regtest -rpcuser=admin1 -rpcpassword=123 -rpcwallet=coinos getnewaddress)"
+echo "Funded and confirmed."
+
+# 2. Start settle in background
+echo "Starting settle..."
+cd /home/adam/coinos-server && bun inspect-ark.ts &
+SETTLE_PID=$!
+
+# 3. Wait for intent to register then mine blocks
+echo "Waiting for intent registration..."
+for i in $(seq 1 60); do
+ sleep 5
+ INTENTS=$(docker exec arkd arkd intents 2>&1)
+ if echo "$INTENTS" | grep -q "boardingInputs"; then
+ echo "Intent registered! Mining block..."
+ docker exec bc bitcoin-cli -regtest -rpcuser=admin1 -rpcpassword=123 generatetoaddress 1 "$(docker exec bc bitcoin-cli -regtest -rpcuser=admin1 -rpcpassword=123 -rpcwallet=coinos getnewaddress)"
+ break
+ fi
+ echo "No intent yet (attempt $i)..."
+done
+
+# 4. Wait for settle to complete
+echo "Waiting for settle..."
+wait $SETTLE_PID
+echo "Done."