Buidl BTC Node Operator

2023年3月10日 13:32:00

1. bitcoin core

1.1 download

wget https://bitcoin.org/bin/bitcoin-core-22.0/bitcoin-22.0-x86_64-linux-gnu.tar.gz

1.2 edit config

vim bitcoin.conf

# Specify data directory
datadir=/home/ubuntu/.bitcoin/data

# Location of the auth cookie
rpccookiefile=/home/ubuntu/.bitcoin/data/.cookie

# Run in the background as a daemon and accept commands
daemon=1

# Maintain a full transaction index, used by the getrawtransaction rpc
txindex=1

# Accept public REST requests
rest=1

# Accept command line and JSON-RPC commands
server=1

1.3 start server

./bin/bitcoind --conf=/home/ubuntu/bitcoin/bitcoin.conf --daemon

1.4 wait to sync block(~500G)

tail -f /home/ubuntu/.bitcoin/data/debug.log

2023-03-02T03:17:27Z UpdateTip: new best=0000000000000000000567e5374d59bed7ab18f65856599f4cef924e3fc2e923 height=778914 version=0x2ae44000 log2_work=94.033371 tx=810050282 date='2023-03-02T03:17:12Z' progress=1.000000 cache=68.8MiB(500391txo)
bitcoin-log

1.5 usage

./bin/bitcoin-cli --rpccookiefile=/home/ubuntu/.bitcoin/data/.cookie getblockchaininfo
bitcoin-cli

2. ordinals

2.1 download

wget https://github.com/casey/ord/releases/download/0.5.1/ord-0.5.1-x86_64-unknown-linux-gnu.tar.gz

2.2 usage

./ord --cookie-file /home/ubuntu/.bitcoin/data/.cookie -h
****
./ord --cookie-file /home/ubuntu/.bitcoin/data/.cookie wallet restore <MNEMONIC>
ord-cli ord-sub

2.3 inscribe

inscription.txt
{
    "p": "sns",
    "op": "reg",
    "name": "xiaorun.sats",
}

./ord wallet inscribe <FILE> --fee-rate <FEE_RATE>