Merge pull request #719 from braydonf/tests
test: avoid port collision with a running regtest node
This commit is contained in:
commit
c65eec566f
@ -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'
|
||||
});
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user