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

Small change: explain the use of keys in JS documentation #275

Open
6r1d opened this issue Mar 1, 2023 · 2 comments
Open

Small change: explain the use of keys in JS documentation #275

6r1d opened this issue Mar 1, 2023 · 2 comments
Assignees
Labels
T-javascript JavaScript-related documentation

Comments

@6r1d
Copy link
Contributor

6r1d commented Mar 1, 2023

URL.

Text sections:

Let's assume that you have stringified public & private keys (more on that later)

const keyPair = crypto.KeyPair.fromJSON({
  public_key: 'ed0120e555d194e8822da35ac541ce9eec8b45058f4d294d9426ef97ba92698766f7d3',
  private_key: {
    digest_function: 'ed25519',
    payload:
      'de757bcb79f4c63e8fa0795edc26f86dfdba189b846e903d0b732bb644607720e555d194e8822da35ac541ce9eec8b45058f4d294d9426ef97ba92698766f7d3',
  },
})

Denis Kitaev requested the documentation update because it looks inconsistent for new users, specifically how keys were obtained for this code section.
I believe this key pair is taken from the Iroha JSON configuration file, but if it's more elaborate here, that'll greatly help the users.

@6r1d
Copy link
Contributor Author

6r1d commented Mar 1, 2023

I could add another issue for this code, but I feel those topics are intertwined.

import { cryptoTypes } from '@iroha2/crypto-core'
import { Signer } from '@iroha2/client'
import { AccountId, DomainId } from '@iroha2/data-model'

// Key pair from previous step
declare const keyPair: cryptoTypes.KeyPair

const accountId = AccountId({
  // Account name
  name: 'alice',
  // The domain where this account is registered
  domain_id: DomainId({
    name: 'wonderland',
  }),
})

const signer = new Signer(accountId, keyPair)

Denis Kitaev also requested this information to be added to the JS SDK docs:

  • Where does the alice account name come from?
  • Is alice pre-set in the container peers?
  • What about the wonderland domain?
  • What about the key pair?

@kidys
Copy link

kidys commented Mar 1, 2023

Yes it would be great if the documentation would explain step by step what to do... how to make requests from Node.js/JavaScript environment... Exactly step by step...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-javascript JavaScript-related documentation
Projects
None yet
Development

No branches or pull requests

5 participants