hyperledger / iroha-javascript

JavaScript library for Iroha, a Distributed Ledger Technology (blockchain) platform.
https://wiki.hyperledger.org/display/iroha
Apache License 2.0
94 stars 64 forks source link

Examples for the documentation #130

Open 6r1d opened 1 year ago

6r1d commented 1 year ago

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:

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

0x009922 commented 1 year ago

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 commented 1 year ago

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

0x009922 commented 1 year ago

Related issues:

matisalimbene commented 7 months ago

Hello!

These links appear empty:

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.