How do I connect my `bcoin` wallet to `bitcoind`?


I have bitcoind running in regtest mode. I want to connect my bcoin wallet to it and retrieve all UTXOs relevant to the sender's address.

How can I do that?


Posted 2019-02-18T13:28:17.637

Reputation: 23



To run two full nodes on the same machine, they'll need to be bound to different ports. Luckily, bitcoind and bcoin run regtest on different ports already by default (18444 and 48444 respectively). Just note this wouldn't be the case for testnet or main net.

Launch bitcoind

$ bitcoind -daemon -regtest

Launch bcoin in SPV mode

$ bcoin --spv --daemon --network=regtest

Connect bcoin to bitcoind:

$ bcoin-cli --network=regtest rpc addnode add

Get a wallet address from bcoin:

$ bwallet-cli --network=regtest account get default
  "receiveAddress": "n4C5ikvkn5HUNjqAPrPB1udnZPjm9p6xGY",

Generate a block with bitcoind, sending coinbase subsidy to the wallet address:

$ bitcoin-cli -regtest generatetoaddress 1 n4C5ikvkn5HUNjqAPrPB1udnZPjm9p6xGY

Check bcoin wallet balance:

$ bwallet-cli --network=regtest balance
  "account": -1,
  "tx": 1,
  "coin": 1,
  "unconfirmed": 5000000000,
  "confirmed": 5000000000


Posted 2019-02-18T13:28:17.637

Reputation: 4 072