2

In the documentation you can specify a network param, but the default main network name isn't the same as bitcoind (livenet). What is the name of testnet on bcoin?

EDIT: When going by the documentation and adding network: testnet to bcoin.conf, I get the error

AssertionError [ERR_ASSERTION]: Unknown network.
at Function.create (/usr/local/lib/node_modules/bcoin/lib/protocol/network.js:161:3)
at Function.get (/usr/local/lib/node_modules/bcoin/lib/protocol/network.js:207:20)
at FullNode.Node (/usr/local/lib/node_modules/bcoin/lib/node/node.js:43:26)
at new FullNode (/usr/local/lib/node_modules/bcoin/lib/node/fullnode.js:46:8)
at Object.<anonymous> (/usr/local/lib/node_modules/bcoin/bin/node:12:8)
at Module._compile (module.js:569:30)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:503:32)
at tryModuleLoad (module.js:466:12)
at Function.Module._load (module.js:458:3)

My bcoin.conf file is

network: testnet
prefix: ~/.bcoin
prune: true
http-port: 8332
api-key: ******
uri: http://localhost
arshbot
  • 1,710
  • 14
  • 35
  • Are you referring to http://bcoin.io/ ?? – Marc Alexander Jul 16 '17 at 19:16
  • Yep! And alternate to bitcoind – arshbot Jul 16 '17 at 19:45
  • Just curious what is the advantage of bcoin to bitcoind? – Marc Alexander Jul 17 '17 at 19:00
  • Very modular, entirely written in node.js, has an extensive api built out so you can easily build on top of a node (previously only possible with bitcore), and has an active team whose focus seems to be making this more developer friendly. For example, I'm building a mobile wallet with bcoin as a local backend (without using the node functionality). You can't do that with bitcoind. – arshbot Jul 18 '17 at 14:42

2 Answers2

0

As stated by the configuration page, you set

network: testnet

In your bcoin.conf file.

MattyAB
  • 21
  • 3
  • See the question again, I updated it with an error related to this solution (provided by the documentation) – arshbot Jul 16 '17 at 19:44
  • Did you add the `network: testnet` to your config file? – MattyAB Jul 16 '17 at 19:46
  • Yes, the error occurs when using that config file. The command I use to specify the conf file is `bcoin -config=~/.bcoin/bcoin.conf` – arshbot Jul 16 '17 at 19:49
0

This might be as a result of a previous ChainDB having been initialized at ~/.bcoin/chain.ldb/ . You can find information inside of the debug.log file. e.g.

[I:2017-07-17T09:11:47Z] (chaindb) Opening ChainDB... [E:2017-07-17T09:11:47Z] (node) Network mismatch for chain.

  1. create a new location for the chain, e.g. ~/.bcoin/testnet/
  2. copy the above config with the updated prefix as per the above
  3. execute bcoin --prefix ~/.bcoin/testnet/

Default prefix is "~/.bcoin/", you can override this by using the prefix cli flag

  • To add to this, you can specify a config file with `bcoin --config=~/.bcoin/bcoin.conf` (your config location) or you can set a different config file in the testnet or main folder and bcoin should pick it up – arshbot Jul 18 '17 at 14:46