diff --git a/test/http-test.js b/test/http-test.js index 0fe7d88f..a7a8214d 100644 --- a/test/http-test.js +++ b/test/http-test.js @@ -11,30 +11,38 @@ const Outpoint = require('../lib/primitives/outpoint'); const MTX = require('../lib/primitives/mtx'); const FullNode = require('../lib/node/fullnode'); const pkg = require('../lib/pkg'); -const Network = require('../lib/protocol/network'); -const network = Network.get('regtest'); if (process.browser) return; +const ports = { + p2p: 49331, + node: 49332, + wallet: 49333 +}; + const node = new FullNode({ network: 'regtest', apiKey: 'foo', walletAuth: true, memory: true, workers: true, - plugins: [require('../lib/wallet/plugin')] -}); + plugins: [require('../lib/wallet/plugin')], + port: ports.p2p, + httpPort: ports.node, + env: { + 'BCOIN_WALLET_HTTP_PORT': ports.wallet.toString() + }}); const {NodeClient, WalletClient} = require('bclient'); const nclient = new NodeClient({ - port: network.rpcPort, + port: ports.node, apiKey: 'foo' }); const wclient = new WalletClient({ - port: network.walletPort, + port: ports.wallet, apiKey: 'foo' }); diff --git a/test/node-test.js b/test/node-test.js index a5ab9579..c46a13fa 100644 --- a/test/node-test.js +++ b/test/node-test.js @@ -16,12 +16,23 @@ const Peer = require('../lib/net/peer'); const InvItem = require('../lib/primitives/invitem'); const invTypes = InvItem.types; +const ports = { + p2p: 49331, + node: 49332, + wallet: 49333 +}; + const node = new FullNode({ memory: true, apiKey: 'foo', network: 'regtest', workers: true, - plugins: [require('../lib/wallet/plugin')] + plugins: [require('../lib/wallet/plugin')], + port: ports.p2p, + httpPort: ports.node, + env: { + 'BCOIN_WALLET_HTTP_PORT': ports.wallet.toString() + } }); const chain = node.chain;