This repository was archived by the owner on Feb 12, 2024. It is now read-only.
This repository was archived by the owner on Feb 12, 2024. It is now read-only.
node.stop() is thrwing the libp2p node not started error #841
Closed
Description
Installed the ipfs node module locally
then wrote this code,
const IPFS = require('ipfs')
const node = new IPFS();
node.on('ready', () => {
// Your now is ready to use \o/
console.log("node is ready")
// stopping a node
node.stop(() => {
console.log("node is now 'offline'");
})
})
After running the code, getting the below error
Ins:nodeipfs insmobility$ node ipfs.js
Swarm listening on /ip4/127.0.0.1/tcp/4003/ws/ipfs/QmdVzXoFxNJbQ3pR3TvWFuHP2KGEpyL3z7339G98VQhAVy
Swarm listening on /ip4/127.0.0.1/tcp/4002/ipfs/QmdVzXoFxNJbQ3pR3TvWFuHP2KGEpyL3z7339G98VQhAVy
Swarm listening on /ip4/192.168.1.15/tcp/4002/ipfs/QmdVzXoFxNJbQ3pR3TvWFuHP2KGEpyL3z7339G98VQhAVy
node is ready
assert.js:85
throw new assert.AssertionError({
^
AssertionError: The libp2p node is not started yet
at Node.dialByPeerInfo (/Users/insmobility/seethadev/blockchain/ipfsleaning/nodeipfs/node_modules/libp2p/src/index.js:219:5)
at EventEmitter.self._libp2pNode.discovery.on (/Users/insmobility/seethadev/blockchain/ipfsleaning/nodeipfs/node_modules/ipfs/src/core/components/libp2p.js:37:32)
at emitOne (events.js:96:13)
at EventEmitter.emit (events.js:188:7)
at Railing.discovery.on (/Users/insmobility/seethadev/blockchain/ipfsleaning/nodeipfs/node_modules/libp2p/src/index.js:70:26)
at emitOne (events.js:96:13)
at Railing.emit (events.js:188:7)
at PeerInfo.create (/Users/insmobility/seethadev/blockchain/ipfsleaning/nodeipfs/node_modules/libp2p-railing/src/index.js:52:16)
at Function.PeerInfo.create (/Users/insmobility/seethadev/blockchain/ipfsleaning/nodeipfs/node_modules/peer-info/src/index.js:115:3)
at bootstrapers.forEach.e (/Users/insmobility/seethadev/blockchain/ipfsleaning/nodeipfs/node_modules/libp2p-railing/src/index.js:45:18)
can someone explain this.