We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
const FullNode = require('./lib/node/fullnode'); async function test() { const ports = { p2p: 49331, node: 49332, wallet: 49333 }; const node1 = new FullNode({ network: 'regtest', apiKey: 'bar', walletAuth: true, memory: true, workers: true, workersSize: 2, indexTX: true, indexAddress: true, plugins: [require('./lib/wallet/plugin')], port: ports.p2p, httpPort: ports.node, env: { 'BCOIN_WALLET_HTTP_PORT': ports.wallet.toString() } }); node1.pool.on('packet', (packet) => { if (!nodePackets[packet.cmd]) nodePackets[packet.cmd] = [packet]; else nodePackets[packet.cmd].push(packet); }); await node1.open(); await node1.connect(); node1.startSync(); } test();
Here's the js code , and i ran the Bitcoin core V23.0 with command ./bitcoin-qt -regtest -server -connect=127.0.0.1:49331
./bitcoin-qt -regtest -server -connect=127.0.0.1:49331
They cannot communicate with each other , and i find the peers in Bitoin-qt and there is no peer.
But,
when i ran the bcoin command , which in the bin folder, ./bin/bcoin --network=regtest
./bin/bcoin --network=regtest
with bconf.conf below
# Sample bcoin config file (~/.bcoin/bcoin.conf) # # Options # # network: main # # Node # prefix: ~/.bcoin db: leveldb max-files: 64 cache-size: 100 # # Workers # workers: true # workers-size: 4 # workers-timeout: 5000 # # Logger # log-level: debug log-console: true log-file: true # # Chain # prune: false checkpoints: true entry-cache: 5000 index-tx: true index-address: true index-filter: true # # Mempool # mempool-size: 100 limit-free: true limit-free-relay: 15 reject-absurd-fees: true replace-by-fee: false persistent-mempool: false # # Pool # selfish: false compact: true bip37: false listen: true max-outbound: 8 max-inbound: 30 # Proxy Server (browser=websockets, node=socks) # proxy: foo:bar@127.0.0.1:9050 # onion: true # upnp: true # Custom list of DNS seeds # seeds: seed.bitcoin.sipa.be # Local Host & Port (to listen on) host: 127.0.0.1 port: 28444 # Public Host & Port (to advertise to peers) public-host: 127.0.0.1 public-port: 48444 # Always try to connect to these nodes. # nodes: 127.0.0.1,127.0.0.2 # Only try to connect to these nodes. # only: 127.0.0.1,127.0.0.2 # # Miner # coinbase-flags: mined by bcoin # coinbase-address: 1111111111111111111114oLvT2,1111111111111111111114oLvT2 preverify: false max-block-weight: 4000000 reserved-block-weight: 4000 reserved-block-sigops: 400 # # HTTP # http-host: 127.0.0.1 http-port: 8332 # ssl: true # ssl-cert: @/ssl/cert.crt # ssl-key: @/ssl/priv.key api-key: bikeshed # no-auth: false # cors: false
and with the ./bitcoin-qt -regtest -server -connect=127.0.0.1:28444
./bitcoin-qt -regtest -server -connect=127.0.0.1:28444
they can connect with each other.
So i wonder if there is something wrong with my js code.
The text was updated successfully, but these errors were encountered:
I think you need to add a peer using node1.pool.hosts.addNode('127.0.0.1:18445') I'm able to connect using this script
node1.pool.hosts.addNode('127.0.0.1:18445')
const {FullNode} = require("bcoin"); async function test() { const ports = { p2p: 49331, node: 49332, wallet: 49333 }; const node1 = new FullNode({ network: 'regtest', memory: true, workers: true, workersSize: 2, port: ports.p2p, httpPort: ports.node }); node1.pool.hosts.addNode('127.0.0.1:18445') node1.on('connect', (entry, block) => { console.log('%s (%d) added to chain.', entry.rhash(), entry.height); }); await node1.open(); await node1.connect(); node1.startSync(); } test();
I can also see peer info using bitcoin-cli -regtest getpeerinfo which shows an inbound connection.
bitcoin-cli -regtest getpeerinfo
Sorry, something went wrong.
No branches or pull requests
Here's the js code , and i ran the Bitcoin core V23.0 with command
./bitcoin-qt -regtest -server -connect=127.0.0.1:49331
They cannot communicate with each other , and i find the peers in Bitoin-qt and there is no peer.
But,
when i ran the bcoin command , which in the bin folder,
./bin/bcoin --network=regtest
with bconf.conf below
and with the
./bitcoin-qt -regtest -server -connect=127.0.0.1:28444
they can connect with each other.
So i wonder if there is something wrong with my js code.
The text was updated successfully, but these errors were encountered: