-
Notifications
You must be signed in to change notification settings - Fork 127
New issue
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
chore: update ipfs (now with typing) dependencies #1337
chore: update ipfs (now with typing) dependencies #1337
Conversation
Thanks @achingbrain looking forward to having native ipfs typings! Will let others review this PR in depth.
I assume this PR is a draft until new IPFS versions are release? :) |
Yes! Sorry, I should have opened it as a draft.. |
The following commands in this repo now work for me: $ npm install
$ npm run build
$ npm test Please let me know if there's anything else I should be running.. |
What node version are you on @achingbrain ? What errors are you seeing when running npm install? |
None, like I said, the commands above work without error 😄 |
Oh, haha! I misread 😹 |
You should also run |
There's one |
That's been merged & released as an rc, linting is happy now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few very minor comments but overall this looks really great. I'm excited to get this merged in.
I'd still like @ukstv to take a look as well to double-check me, especially around the serialization/deserialization stuff in pubsub.
@stbrody I think I've removed all the outstanding ts-ignores now, as well as the double-serialization of the pubsub message. I'm going to flesh out the test suite for |
Everything's been released so this should be good to go, pending anything further review uncovers. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm :)
import type { IPFS } from 'ipfs-core-types' | ||
export type IpfsApi = IPFS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is nice. We should probably just start importing this type everywhere in the furtue, rather than reexporting it :)
@@ -148,9 +142,8 @@ export class IpfsDaemon { | |||
...configuration.ipfsEnableApi && {API: `/ip4/${configuration.tcpHost}/tcp/${configuration.ipfsApiPort}`}, | |||
...configuration.ipfsEnableGateway && {Gateway: `/ip4/${configuration.tcpHost}/tcp/${configuration.ipfsGatewayPort}`} | |||
, | |||
Announce: configuration.announceAddressList, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this passed to both config
and libp2p.config
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was actually wondering the same thing, it shouldn't be necessary to pass the list in both places.
We should make sure that all of these work:
|
): Promise<void> { | ||
// Don't want to swarm connect to ourself | ||
const myPeerId = (await ipfs.id()).id | ||
const filteredBootstrapList = bootstrapList.filter((addr) => { | ||
return !addr.endsWith(myPeerId) | ||
return !addr.getPeerId()?.endsWith(myPeerId) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@achingbrain, I pulled down this PR and updated all the ipfs deps in the various package.json
files to use next
. The tests all passed, but running ceramic daemon
in a terminal causes this line to throw the error:
Connecting to peers found in 'https://raw.githubusercontent.com/ceramicnetwork/peerlist/main/testnet-clay.json'
(node:126315) UnhandledPromiseRejectionWarning: TypeError: addr.getPeerId is not a function
at /home/spencer/js-ceramic4/packages/ipfs-topology/lib/ipfs-topology.js:105:33
at Array.filter (<anonymous>)
at IpfsTopology._forceBootstrapConnection (/home/spencer/js-ceramic4/packages/ipfs-topology/lib/ipfs-topology.js:103:53)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async IpfsTopology.forceConnection (/home/spencer/js-ceramic4/packages/ipfs-topology/lib/ipfs-topology.js:78:9)
at async IpfsTopology.start (/home/spencer/js-ceramic4/packages/ipfs-topology/lib/ipfs-topology.js:81:9)
at async Ceramic._init (/home/spencer/js-ceramic4/packages/core/lib/ceramic.js:257:13)
at async Function.create (/home/spencer/js-ceramic4/packages/cli/lib/ceramic-daemon.js:124:9)
at async Command.<anonymous> (/home/spencer/js-ceramic4/packages/cli/lib/bin/ceramic.js:34:5)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The multiaddress in the file from there are in string and needs to be converted into a Multiaddress instance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep that was it. Pushed a fix to this PR branch, seems to be working now. I was able to run a node on the clay testnet, create and update a stream, and then load that stream from the clay gateway
Done. All working |
This follows on from #1194 with a few extra bits and pieces (can target that branch for merging if it's preferable):
ipfs
foripfs-core
- no need to pull down cli deps etc if they're not being usedipld-dag-cbor
to the latest versionnext
foripfs-*
to get the latest rc