Skip to content

Commit

Permalink
[rooch-networkgh-1299] add podman support for running bitcoin local n…
Browse files Browse the repository at this point in the history
…ode.
  • Loading branch information
Feliciss committed Jan 12, 2024
1 parent c076acf commit 77bae1f
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 10 deletions.
16 changes: 8 additions & 8 deletions scripts/bitcoin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,20 @@
This directory contains scripts for setting up a local development environment for Bitcoin Core.

## Prerequisites
1. Install [Docker](https://docs.docker.com/install/)
1. Install [Docker](https://docs.docker.com/install/) or [Podman](https://podman.io/docs/installation)
2. Install [ord](https://docs.ordinals.com/guides/inscriptions.html#installing-ord)

## Setup

1. Run `./run_local_node.sh` to start a local Bitcoin Core node
1. Run `./run_local_node_docker.sh` or `./run_local_node_podman.sh` to start a local Bitcoin Core node
2. Run `source ./cmd_alias.sh` to set up aliases for running `bitcoin-cli` and `ord` commands

## Development on rooch

1. Run `rooch server start --btc-rpc-url http://127.0.0.1:18443 --btc-rpc-username roochuser --btc-rpc-password roochpass --btc-start-block-height 0`
2. Run `rooch rpc request --method rooch_queryGlobalStates --params '[{"object_type":"0x4::utxo::UTXO"},null, "2", true]'` to query the UTXO set
3. Run `rooch rpc request --method rooch_queryGlobalStates --params '[{"object_type":"0x4::ord::Inscription"},null, "2", true]'` to query the Inscription set

## Usage

1. Run `ord wallet create` to create a new ord wallet
Expand All @@ -21,12 +27,6 @@ This directory contains scripts for setting up a local development environment f
6. Run `ord wallet inscribe --fee-rate 1 --file /tmp/hello.txt` to inscribe the file to the blockchain
7. Run `bitcoin-cli generatetoaddress 1 <address>` to generate a block to the address

## Development on rooch

1. Run `rooch server start --btc-rpc-url http://127.0.0.1:18443 --btc-rpc-username roochuser --btc-rpc-password roochpass --btc-start-block-height 0`
2. Run `rooch rpc request --method rooch_queryGlobalStates --params '[{"object_type":"0x4::utxo::UTXO"},null, "2", true]'` to query the UTXO set
3. Run `rooch rpc request --method rooch_queryGlobalStates --params '[{"object_type":"0x4::ord::Inscription"},null, "2", true]'` to query the Inscription set

### References
* [Bitcoin Core](https://bitcoincore.org/en/doc/25.0.0/)
* [ord testing](https://docs.ordinals.com/guides/testing.html): for testing ord inscriptions
2 changes: 1 addition & 1 deletion scripts/bitcoin/cmd_alias.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
# SPDX-License-Identifier: Apache-2.0

alias ord="ord --regtest --rpc-url http://127.0.0.1:18443 --bitcoin-rpc-user roochuser --bitcoin-rpc-pass roochpass"
alias bitcoin-cli="docker exec -it bitcoind bitcoin-cli -regtest"
alias bitcoin-cli="docker exec -it bitcoind bitcoin-cli -regtest"
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# Copyright (c) RoochNetwork
# SPDX-License-Identifier: Apache-2.0

docker run -d --name bitcoind --network host -v $HOME/.bitcoin:/data/.bitcoin lncm/bitcoind:v25.1 -chain=regtest -txindex=1 -fallbackfee=0.00001 -zmqpubrawblock=tcp://0.0.0.0:28332 -zmqpubrawtx=tcp://0.0.0.0:28333 -rpcallowip=0.0.0.0/0 -rpcbind=0.0.0.0 -rpcauth='roochuser:925300af2deda1996d8ff66f2a69dc84$681057d8bdccae2d119411befa9a5f949eff770933fc377816348024d25a2402'
docker run -d --name bitcoind --network host -v $HOME/.bitcoin:/data/.bitcoin lncm/bitcoind:v25.1 -chain=regtest -txindex=1 -fallbackfee=0.00001 -zmqpubrawblock=tcp://0.0.0.0:28332 -zmqpubrawtx=tcp://0.0.0.0:28333 -rpcallowip=0.0.0.0/0 -rpcbind=0.0.0.0 -rpcauth='roochuser:925300af2deda1996d8ff66f2a69dc84$681057d8bdccae2d119411befa9a5f949eff770933fc377816348024d25a2402'
5 changes: 5 additions & 0 deletions scripts/bitcoin/node/run_local_node_podman.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
# Copyright (c) RoochNetwork
# SPDX-License-Identifier: Apache-2.0

podman run -d --name bitcoind -p 127.0.0.1:18443:18443 -v bitcoin:/data/.bitcoin lncm/bitcoind:v25.1 -chain=regtest -txindex=1 -fallbackfee=0.00001 -zmqpubrawblock=tcp://0.0.0.0:28332 -zmqpubrawtx=tcp://0.0.0.0:28333 -rpcallowip=0.0.0.0/0 -rpcbind=0.0.0.0 -rpcauth='roochuser:925300af2deda1996d8ff66f2a69dc84$681057d8bdccae2d119411befa9a5f949eff770933fc377816348024d25a2402'

0 comments on commit 77bae1f

Please sign in to comment.