Skip to content

feat: add Node.js peer#268

Merged
achingbrain merged 4 commits intomainfrom
feat/add-nodejs-peer
Apr 22, 2025
Merged

feat: add Node.js peer#268
achingbrain merged 4 commits intomainfrom
feat/add-nodejs-peer

Conversation

@achingbrain
Copy link
Copy Markdown
Member

@achingbrain achingbrain commented Apr 10, 2025

Adds a basic Node.js peer with a terminal user interface.

Lifts some code from the existing js-peer. Doesn't support DMs or dialing peers directly (yet).

Fixes #214

Adds a basic Node.js peer with a terminal user interface.

Lifts some code from the existing js-peer. Doesn't support DMs (yet).
@achingbrain achingbrain requested review from 2color and SgtPooki April 10, 2025 15:33
<View>
<Peer key={libp2p?.peerId?.toString()} peer={libp2p?.peerId} self={true} children={[]} />
{subscribers.map((p) => (
<Peer key={p.toString()} peer={p} self={false} children={[]} />
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know why the empty array children prop is necessary here? Is this a react-curse thing, because I get an error thrown if removed.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it might be a bug in react-curse

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's maybe add a comment about this?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done & have linked to a fix PR'd to react-curse

@2color
Copy link
Copy Markdown
Contributor

2color commented Apr 22, 2025

Very neat! Thanks for the PR

@achingbrain achingbrain merged commit 24e2960 into main Apr 22, 2025
1 check passed
@achingbrain achingbrain deleted the feat/add-nodejs-peer branch April 22, 2025 12:31
dozyio pushed a commit to dozyio/universal-connectivity that referenced this pull request Sep 7, 2025
Adds a basic Node.js peer with a terminal user interface.

Lifts some code from the existing js-peer. Doesn't support DMs or dialing peers directly (yet).

Fixes libp2p#214

---------

Co-authored-by: Daniel N <2color@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a Node.js peer?

2 participants