-
Notifications
You must be signed in to change notification settings - Fork 446
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
Issue while creating node #1613
Labels
need/triage
Needs initial labeling and prioritization
Comments
You need to create a proper PeerId object. You can create it from an existing json.
Now you can pass it to your createLibp2p Function
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm trying to create a libp2p node with a known peerId
peerId:
12D3KooWDKBMHRiAXPQK6Xr4cdT7WGp927DUiuNJV4jFBNd2yKkM
code to create libp2p node:-
import { createLibp2p } from "libp2p";
import { webRTCStar } from "@libp2p/webrtc-star";
import { noise } from "@chainsafe/libp2p-noise";
import { mplex } from "@libp2p/mplex";
import { Multiaddr } from "multiaddr";
import { webSockets } from "@libp2p/websockets";
import { kadDHT } from "@libp2p/kad-dht";
import PeerId from "peer-id";
import { floodsub } from "@libp2p/floodsub";
let node = await createLibp2p({
PeerId: peerId,
addresses: {
listen: [
"/dns4/wrtc-star1.par.dwebops.pub/tcp/443/wss/p2p-webrtc-star",
],
},
transports: [webSockets(), wrtcStar.transport],
connectionEncryption: [noise()],
streamMuxers: [mplex()],
peerDiscovery: [wrtcStar.discovery],
dht: kadDHT(),
pubsub: floodsub(),
});
But, the created node have a different peerId from what I have mention, How can I solve it, any suggestions...
The text was updated successfully, but these errors were encountered: