Skip to content

Commit

Permalink
Merge branch 'main' into feat/teardown-script
Browse files Browse the repository at this point in the history
  • Loading branch information
parketh authored Nov 12, 2024
2 parents a60025c + 45c4a16 commit de0aeda
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 7 deletions.
6 changes: 4 additions & 2 deletions .env.babylon-integration.example
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

### Bitcoin Configuration
BITCOIN_NETWORK=signet
BITCOIN_NODE_IP=11.22.33.44 # devnet-only
BITCOIN_RPC_HOST=11.22.33.44:38332 # gRPC
BITCOIN_RPC_USER=snapchain
BITCOIN_RPC_PASS=rpcpass
Expand Down Expand Up @@ -49,8 +50,9 @@ CONTRACT_LABEL=op-finality-gadget
CONSUMER_EOTS_MANAGER_ADDRESS=11.22.33.44:15813 # gRPC
CONSUMER_FINALITY_PROVIDER_KEY=consumer-finality-provider
# amount to fund the consumer-finality-provider account
CONSUMER_FP_FUND_AMOUNT_UBBN=100000000 # 100 BBN
CONSUMER_FP_FUND_AMOUNT_UBBN=3000000000 # 3000 BBN
L2_RPC_URL=http://11.22.33.44:8545
L2_BLOCK_TIME=2
FINALITY_GADGET_ADDRESS=bbn14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9sw76fy2
FINALITY_GADGET_RPC=11.22.33.44:50051 # gRPC
OP_FP_MONIKER="Tohma Finality Provider"
Expand All @@ -62,4 +64,4 @@ STAKING_TIME=10000 # ~70 days
STAKING_AMOUNT=10000 # 0.0001 BTC

# Finality Explorer Configuration
NEXT_PUBLIC_FINALITY_GADGET_API_URL=http://11.22.33.44:8545
NEXT_PUBLIC_FINALITY_GADGET_API_URL=http://11.22.33.44:18080
4 changes: 2 additions & 2 deletions configs/babylon-integration/consumer-fpd.conf
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ MaxSubmissionRetries = 100
FastSyncInterval = 20s

; The maximum number of blocks to catch up for each fast sync
FastSyncLimit = 10
FastSyncLimit = 100

; The block gap that will trigger the fast sync
FastSyncGap = 6
Expand All @@ -56,7 +56,7 @@ SyncFpStatusInterval = 30s
BufferSize = 1000

; The interval between each polling of OP L2 blocks
PollInterval = 2s
PollInterval = ${L2_BLOCK_TIME}s

; The static height from which we start polling the chain
StaticChainScanningStartHeight = 1
Expand Down
2 changes: 1 addition & 1 deletion docker/docker-compose-bitcoin.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
bitcoind:
image: snapchain/bitcoind:d3854d9
image: snapchain/bitcoind:1ce21c1
container_name: bitcoind
env_file:
- "${PWD}/.env.bitcoin"
Expand Down
5 changes: 3 additions & 2 deletions scripts/babylon-integration/register-op-consumer-fp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ echo
sleep 5

echo "Registering OP consumer finality provider..."
docker exec consumer-finality-provider /bin/sh \
-c "/bin/fpd register-finality-provider $OP_FP_EOTS_PK_HEX"
OP_FP_REGISTRATION_TX_OUTPUT=$(docker exec consumer-finality-provider /bin/sh \
-c "/bin/fpd register-finality-provider $OP_FP_EOTS_PK_HEX")
echo "$OP_FP_REGISTRATION_TX_OUTPUT"
echo
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ if [ ! -d "$CONSUMER_FINALITY_PROVIDER_DIR" ]; then
sed -i.bak "s|\${BITCOIN_NETWORK}|$BITCOIN_NETWORK|g" $FINALITY_PROVIDER_CONF
sed -i.bak "s|\${CONSUMER_FINALITY_PROVIDER_KEY}|$CONSUMER_FINALITY_PROVIDER_KEY|g" $FINALITY_PROVIDER_CONF
sed -i.bak "s|\${L2_RPC_URL}|$L2_RPC_URL|g" $FINALITY_PROVIDER_CONF
sed -i.bak "s|\${L2_BLOCK_TIME}|$L2_BLOCK_TIME|g" $FINALITY_PROVIDER_CONF
sed -i.bak "s|\${FINALITY_GADGET_RPC}|$FINALITY_GADGET_RPC|g" $FINALITY_PROVIDER_CONF
sed -i.bak "s|\${FINALITY_GADGET_ADDRESS}|$FINALITY_GADGET_ADDRESS|g" $FINALITY_PROVIDER_CONF
sed -i.bak "s|\${BABYLON_CHAIN_ID}|$BABYLON_CHAIN_ID|g" $FINALITY_PROVIDER_CONF
Expand Down
3 changes: 3 additions & 0 deletions scripts/babylon-integration/utils/register-consumer-chain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,13 @@ if echo "$CONSUMER_IDS" | grep -q "^${CONSUMER_ID}$"; then
fi

# register the consumer chain
# TODO: for now, we can use the consumer chain name as the consumer description,
# remove it after issue #255 (https://github.com/babylonlabs-io/babylon/issues/255) is fixed
echo "Registering consumer chain $CONSUMER_ID..."
CONSUMER_REGISTRATION_TX_HASH=$(babylond tx btcstkconsumer register-consumer \
"$CONSUMER_ID" \
"$CONSUMER_CHAIN_NAME" \
"$CONSUMER_CHAIN_NAME" \
--chain-id $BABYLON_CHAIN_ID \
--node $BABYLON_RPC_URL \
--from $BABYLON_PREFUNDED_KEY \
Expand Down

0 comments on commit de0aeda

Please sign in to comment.