You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Made a peerId using the createEd25519PeerId. const peerId = await createEd25519PeerId({ privateKey: privateKey });
Store into json, which eliminates the formats of ed25519, converts the values into string.
Retrieving the data of peerId to instantiate the CreateLibp2p.
Process
When I store the data as hex values, because Uint8Array doesn't store the format, only the values, I'm trying to revert the hex values into a Uint8Array to extract the same peerId using the public and private key.
Error
CreateLibp2p doesn't instantiate the node. Instead, I'm given these error messages: if (publicKey.length === MARSHALLED_ED225519_PUBLIC_KEY_LENGTH) {
^
TypeError: Cannot read properties of undefined (reading 'length')
The pasted details below is the data structure of the peer.meta that I'm using, in order to retrieve the peerId.
Before inputting the meta into createFromPrivKey function, I'm converting the hex values into Uint8Array
Current Method
Made a peerId using the createEd25519PeerId.
const peerId = await createEd25519PeerId({ privateKey: privateKey });
Store into json, which eliminates the formats of ed25519, converts the values into string.
Retrieving the data of peerId to instantiate the CreateLibp2p.
Process
Error
^
TypeError: Cannot read properties of undefined (reading 'length')
The pasted details below is the data structure of the peer.meta that I'm using, in order to retrieve the peerId.
CodeBase
const peerIdForm = await createFromPrivKey(peer.meta);
"meta": {
"id": {
"code": 0,
"size": 36,
"digest": "0x080112202a43350be8249d8a381f85da2e7b0ca661ceb2b3d727ad967cd4903ac3fa5341",
"bytes": "0x0024080112202a43350be8249d8a381f85da2e7b0ca661ceb2b3d727ad967cd4903ac3fa5341"
},
"key": "0x080112401330d9b33b2f6de93088ab2424a36394fa8dc67c706b2f1cac5df80eb66c2a6b2a43350be8249d8a381f85da2e7b0ca661ceb2b3d727ad967cd4903ac3fa5341",
"public": "0x080112202a43350be8249d8a381f85da2e7b0ca661ceb2b3d727ad967cd4903ac3fa5341",
"CID": {
"/": "bafzaajaiaejcaksdguf6qje5ri4b7bo2fz5qzjtbz2zlhvzhvwlhzveqhlb7uu2b"
},
"type": "Ed25519"
},
If I'm missing any details that could help figure out this issue, please let me know. Thank you.
The text was updated successfully, but these errors were encountered: