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

Examples for the documentation #130

Open
7 tasks
6r1d opened this issue Oct 18, 2022 · 4 comments
Open
7 tasks

Examples for the documentation #130

6r1d opened this issue Oct 18, 2022 · 4 comments

Comments

@6r1d
Copy link
Contributor

6r1d commented Oct 18, 2022

Hello.

I'd like to add the common language guide to the Iroha documentation.
Since Iroha-JS very convenient for the users, it is necessary for the examples.

How stable are the examples displayed in the JavaScript tutorial?

I am mostly interested in:

  • Loading the JSON configuration for Iroha so it could be used by the JavaScript library
  • Client setup, given the configuration above
  • Registering an Iroha domain
  • Registering an Iroha account
  • Registering an asset
  • Minting an asset mentioned above
  • Listing domains / accounts / assets, displaying an output

Potentially, it'll be great to enable these examples as tests, marking the parts useful for the end user with the comments.

@6r1d 6r1d self-assigned this Oct 18, 2022
@0x009922
Copy link
Contributor

Hello!

Currently the repo already has documentation examples here: https://github.com/hyperledger/iroha-javascript/tree/iroha2/packages/docs-recipes/src

They are not a part of end-2-end tests, but they are type-checked. Tests has a significant part of this functionality, but I don't think it makes sense to write everything you've listed as tests. They have a bit different goal.

Anyway, I think it is worth to re-write current "documentation recipes" to both align your interests and to include them into documentation via snippets mechanism.

0x009922 added a commit to 0x009922/iroha-javascript that referenced this issue Nov 8, 2022
- restructure recipes to be more compliant with hyperledger-iroha#130
- extend "maintenance" section in the root README
- include `lint` command into CI/CD
- fix lint errors

Signed-off-by: 0x009922 <[email protected]>
@0x009922
Copy link
Contributor

@6r1d, I think the issue was resolved with hyperledger-iroha/iroha-2-docs#234. Could you verify it?

@matisalimbene
Copy link

Hello!

These links appear empty:

  • packages/docs-recipes/src/5.1.register-asset.ts
  • packages/docs-recipes/src/5.2.mint-registered-asset.ts

So there are no samples for registering assets. In particular, I'm looking for an example of working with stores. There seems to be none.

I was able to figure out how to register new store data by looking at a sample from rust:

const storeAssetInstruction = SetKeyValueExpr({
    object_id: Expression('Raw', Value('Id', IdBox('AssetId', assetId))),
    key: Expression('Raw', Value('Name', 'ping')),
    value: Expression('Raw', Value('String', 'pong')),
  });

But it'd be great to have a sample for JS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants