趣旨
BitcoinのNodeを自分で建てているとInscriptionサイトがアクセス過剰でダウンしていても自分のNodeを経由してInscribeできるみたいなので、Runeが実装される前ですし、面白そうだし、Umbrelをもっと使いこなしてみたいのでぜひやり方を把握しておこうと思い、リサーチし実践した結果を備忘録として残します。
使用したもの
- Mac
- Umbrel
RPC接続の手順
Macでの作業
まずはMacでHomebrewでordをインストールします。
brew install ord
あとで使うのでMacのローカルIPを取得します。
ipconfig getifaddr en0
こちらもあとで使うのでUmbrelのローカルIPを取得しておきます。
ping umbrel.local
Umbrelでの作業
UmbrelでRPC関連情報を取得します。
umbrel@umbrel:~/umbrel/app-data/bitcoin/data/bitcoin$ sudo docker inspect -f '{{ .Config.Env }}' bitcoin_server_1
以下の項目を探します。
BITCOIN_RPC_PASSWORD
BITCOIN_RPC_USER
BITCOIN_RPC_PORT
以下のようにbitcoin.confにrpcallowipを書き込みます。
umbrel@umbrel:~/umbrel/app-data/bitcoin/data/bitcoin$ cat bitcoin.conf
# Load additional configuration file, relative to the data directory.
includeconf=umbrel-bitcoin.conf
rpcallowip=MACLOCALIP/24
configurationの弄り方のリサーチにかなり時間がかかりました。以下のXに載せておいたコミュニティページ以外に解決策を提示しているWebサイトはみつけられませんでした。GPT先生に聞いてもDockerの大元のconfiguration弄りに行く複雑な方法ばかり提示されていたので、このコミュニティページは本当に助かりました。
再起動して変更を反映させます。
sudo docker stop bitcoin_server_1
sudo docker start bitcoin_server_1
Macでの作業
再びMacに戻り、Macで以下のコマンドをうちます。
ord --bitcoin-rpc-username RPCUsername --bitcoin-rpc-password RPCPassword --bitcoin-rpc-url http://<UMBRELLOCALIP>:<BITCOIN_RPC_PORT> server
[indexing blocks] ███████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 47727/839500
indexing blocksのあとにordコマンドを打つと、毎回以下のエラーが出てきたので加えてリサーチしました。
error: cookie file `/Users/daniel/Library/Application Support/Bitcoin/.cookie` does not exist
以下のように毎回UsernameとPasswordとURLを添えてコマンドを書けばとりあえず動きます。
ord --bitcoin-rpc-username RPCUsername --bitcoin-rpc-password RPCPassword --bitcoin-rpc-url http://<UMBRELLOCALIP>:<BITCOIN_RPC_PORT> COMMAND
環境変数にセットしてもダメだったので、とりあえず僕は添字をあてがってコマンド打っていきます。
もしMacにBitcoin Core入れてもいいんだったら、多分そっちの方がはるかに簡単です。以下のポストのURLからどうぞ。