Skip to content

Example in README errors #234

Closed
Closed
@vmx

Description

@vmx
  • Version: 0.23.0
  • Platform: Linux

Type: Question/enhancement

Severity: Low

Description:

I tried to use the example of the README as a template. I then got an error like

/home/vmx/src/pl/js-graphsync/node_modules/libp2p-pnet/src/crypto.js:81
    throw new Error(Errors.INVALID_PSK)
    ^

Error: Your private shared key is invalid
    at module.exports.decodeV1PSK (/home/vmx/src/pl/js-graphsync/node_modules/libp2p-pnet/src/crypto.js:81:11)
    at new Protector (/home/vmx/src/pl/js-graphsync/node_modules/libp2p-pnet/src/index.js:24:24)
    at new Node (/home/vmx/src/pl/js-graphsync/libp2pnode.js:39:24)
    at PeerId.createFromJSON (/home/vmx/src/pl/js-graphsync/consumer.js:17:22)
    at waterfall (/home/vmx/src/pl/js-graphsync/node_modules/peer-id/src/index.js:271:7)
    at /home/vmx/src/pl/js-graphsync/node_modules/async/internal/once.js:12:16
    at next (/home/vmx/src/pl/js-graphsync/node_modules/async/waterfall.js:21:29)
    at /home/vmx/src/pl/js-graphsync/node_modules/async/internal/onlyOnce.js:12:16
    at pub.hash (/home/vmx/src/pl/js-graphsync/node_modules/peer-id/src/index.js:252:13)
    at Multihashing.Multihashing.digest (/home/vmx/src/pl/js-graphsync/node_modules/multihashing-async/src/index.js:33:5)

I thought my peer-id was wrong. I then figured out that the problem was the

connProtector: new Protector(/*protector specific opts*/),

what about commenting that out and adding a comment that this is for private networks?

Once commenting it out I get another error:


[1] "peerRouting" is not allowed
[2] "contentRouting" is not allowed
    at Object.exports.process (/home/vmx/src/pl/js-graphsync/node_modules/joi/lib/errors.js:196:19)
    at internals.Object._validateWithOptions (/home/vmx/src/pl/js-graphsync/node_modules/joi/lib/types/any/index.js:675:31)
    at module.exports.internals.Any.root.validate (/home/vmx/src/pl/js-graphsync/node_modules/joi/lib/index.js:138:23)
    at module.exports.internals.Any.root.attempt (/home/vmx/src/pl/js-graphsync/node_modules/joi/lib/index.js:167:29)
    at module.exports.validate (/home/vmx/src/pl/js-graphsync/node_modules/libp2p/src/config.js:42:17)
    at new Node (/home/vmx/src/pl/js-graphsync/node_modules/libp2p/src/index.js:32:16)
    at new Node (/home/vmx/src/pl/js-graphsync/libp2pnode.js:82:5)
    at PeerId.createFromJSON (/home/vmx/src/pl/js-graphsync/consumer.js:17:22)
    at waterfall (/home/vmx/src/pl/js-graphsync/node_modules/peer-id/src/index.js:271:7)
    at /home/vmx/src/pl/js-graphsync/node_modules/async/internal/once.js:12:16

I don't know what they are for, but commenting both occurrences makes things not error anymore.

Metadata

Metadata

Assignees

Labels

exp/noviceSomeone with a little familiarity can pick up

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions