Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

can't start ipfs-daemon #4334

Closed
mtiger2k opened this issue Mar 18, 2023 · 1 comment
Closed

can't start ipfs-daemon #4334

mtiger2k opened this issue Mar 18, 2023 · 1 comment
Labels
need/triage Needs initial labeling and prioritization

Comments

@mtiger2k
Copy link

I want to start my own daemon with api with the following:
`
import { Daemon } from 'ipfs-daemon';

const print = (msg) => console.log(msg);
async function startServer() {
let config = {
Addresses: {
Swarm: [
'/ip4/0.0.0.0/tcp/4002',
'/ip4/0.0.0.0/tcp/4003/ws',
],
API: '/ip4/0.0.0.0/tcp/5002',
Gateway: '/ip4/0.0.0.0/tcp/9090',
RPC: '/ip4/127.0.0.1/tcp/5003',
Announce: [],
},
};
const daemon = new Daemon({
config,
repo: './jsipfs',
});

try {
await daemon.start();

const version = await daemon._ipfs.version();

print(`js-ipfs version: ${version.version}`);

} catch (/** @type {any} */ err) {
if (err.code === 'ERR_REPO_NOT_INITIALIZED' || err.message.match(/uninitialized/i)) {
err.message = 'no initialized ipfs repo found in ' + 'jsipfs' + '\nplease run: jsipfs init';
}
throw err;
}

print('Daemon is ready');

const cleanup = async () => {
print('Received interrupt signal, shutting down...');
await daemon.stop();
process.exit(0);
};

// listen for graceful termination
process.on('SIGTERM', cleanup);
process.on('SIGINT', cleanup);
process.on('SIGHUP', cleanup);

}

startServer();
`
using latest ipfs-daemon 0.16.0

but got the following error:
file:///Users/tiansha/ipfs/ipfs-daemon/node_modules/@achingbrain/ssdp/dist/src/commands/notify.js:14
resolveService(ssdp, message.USN, message.NT, message.LOCATION, message.ttl())

TypeError: message.ttl is not a function
at notify (file:///Users/tiansha/ipfs/ipfs-daemon/node_modules/@achingbrain/ssdp/dist/src/commands/notify.js:14:77)
at SSDPImpl.emit (node:events:513:28)
at parseSsdpMessage (file:///Users/tiansha/ipfs/ipfs-daemon/node_modules/@achingbrain/ssdp/dist/src/parse-ssdp-message.js:38:10)
at SSDPImpl.emit (node:events:513:28)
at Socket. (file:///Users/tiansha/ipfs/ipfs-daemon/node_modules/@achingbrain/ssdp/dist/src/create-sockets.js:10:22)
at Socket.emit (node:events:513:28)
at UDP.onMessage [as onmessage] (node:dgram:933:8)

and I tried node 16, 18, with the same error.

@mtiger2k mtiger2k added the need/triage Needs initial labeling and prioritization label Mar 18, 2023
@mtiger2k
Copy link
Author

it's @achingbrain/ssdp issue, had submit it in the repo.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
need/triage Needs initial labeling and prioritization
Projects
None yet
Development

No branches or pull requests

1 participant