Getting an error Unknown Network running a bcoin node, but I'm not sure what's causing it since I'm defining the network very quickly.
Error Message:
(node:10579) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Unknown network.
(node:10579) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Here is the bcoin script
var bcoin = require('bcoin').set('testnet');
(async () => {
var full = new bcoin.node.FullNode({
network: bcoin.network.get().toString(),
httpPort: 18332,
httpHost: '127.0.0.1',
bip37: true,
listen: true,
passphrase: "secret",
logLevel: "info",
loader: require
});
if (!full.config.bool('no-wallet') && !full.has('walletdb')) {
const plugin = require('/Users/<user>/Projects/bcoin/lib/wallet/plugin');
full.use(plugin);
}
await full.open();
setUpWalletWatcher(full.pool, full.walletdb);
await full.connect();
await full.http.open();
full.startSync();
})();