Examples for the documentation
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.
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.
@6r1d, I think the issue was resolved with https://github.com/hyperledger/iroha-2-docs/pull/234. Could you verify it?
Related issues:
- https://github.com/hyperledger/iroha-2-docs/issues/275
- https://github.com/hyperledger/iroha-2-docs/issues/276
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.