Skip to content
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

Broken examples in README #208

Closed
eth-limo opened this issue Feb 17, 2023 · 3 comments · Fixed by #216
Closed

Broken examples in README #208

eth-limo opened this issue Feb 17, 2023 · 3 comments · Fixed by #216
Labels
need/triage Needs initial labeling and prioritization released

Comments

@eth-limo
Copy link

eth-limo commented Feb 17, 2023

Hi team,

I ran into some issues when attempting to use code from the examples:

$ node --version
v16.18.0
$ npm i ipns
import * as ipns from 'ipns'

const publicKey = ipns.extractPublicKey(peerId, ipnsEntry)
$ node testIpns.js 
file:///home/user/2023/February/tmp/testIpns.js:5
const publicKey = ipns.extractPublicKey(peerId, ipnsEntry)
                 ^

TypeError: ipns.extractPublicKey is not a function
    at file:///home/user/2023/February/tmp/testIpns.js:5:18
    at ModuleJob.run (node:internal/modules/esm/module_job:193:25)
    at async Promise.all (index 0)
    at async ESMLoader.import (node:internal/modules/esm/loader:526:24)
    at async loadESM (node:internal/process/esm_loader:91:5)
    at async handleMainPromise (node:internal/modules/run_main:65:12)

I can only see the following exports:

[Module: null prototype] {
  create: [AsyncFunction: create],
  createWithExpiration: [AsyncFunction: createWithExpiration],
  getLocalKey: [Function: getLocalKey],
  marshal: [Function: marshal],
  namespace: '/ipns/',
  namespaceLength: 6,
  peerIdFromRoutingKey: [Function: peerIdFromRoutingKey],
  peerIdToRoutingKey: [Function: peerIdToRoutingKey],
  unmarshal: [Function: unmarshal]
}

I need to verify a couple of things regarding v2 signatures and this looked like the right library to use. Any pointers to get me going in the right direction?

Thanks!

@eth-limo eth-limo added the need/triage Needs initial labeling and prioritization label Feb 17, 2023
@welcome
Copy link

welcome bot commented Feb 17, 2023

Thank you for submitting your first issue to this repository! A maintainer will be here shortly to triage and review.
In the meantime, please double-check that you have provided all the necessary information to make this process easy! Any information that can help save additional round trips is useful! We currently aim to give initial feedback within two business days. If this does not happen, feel free to leave a comment.
Please keep an eye on how this issue will be labeled, as labels give an overview of priorities, assignments and additional actions requested by the maintainers:

  • "Priority" labels will show how urgent this is for the team.
  • "Status" labels will show if this is ready to be worked on, blocked, or in progress.
  • "Need" labels will indicate if additional input or analysis is required.

Finally, remember to use https://discuss.ipfs.io if you just need general support.

@2color
Copy link
Member

2color commented Mar 24, 2023

Hey @eth-limo,

ipns.extractPublicKey wasn't properly exported fom the package. #216 should fix this once merged.

achingbrain pushed a commit that referenced this issue Jun 14, 2023
* docs: fix errors in README

* fix: export extractPublicKey

* docs: remove non existent methods from readme

* docs: clean readme

Fixes #208 

---------

Co-authored-by: Daniel N <2color@users.noreply.github.com>
github-actions bot pushed a commit that referenced this issue Jun 14, 2023
## [6.0.2](v6.0.1...v6.0.2) (2023-06-14)

### Bug Fixes

* export extractPublicKey and update README ([#216](#216)) ([eb34070](eb34070)), closes [#208](#208)
@github-actions
Copy link

🎉 This issue has been resolved in version 6.0.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need/triage Needs initial labeling and prioritization released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants