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

Weakly organised notes and JS tutorial rewriting #302

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ function getGuideSidebar(): DefaultTheme.SidebarItem[] {
link: '/guide/kotlin-java',
},
{
text: 'JavaScript',
text: 'TypeScript/JavaScript',
link: '/guide/javascript',
},
],
Expand Down
12 changes: 12 additions & 0 deletions .vitepress/theme/style/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,16 @@ html.dark {
code {
font-variant-ligatures: none;
}

// patch footnotes - they increase line height and uglify layout
sup.footnote-ref {

display: inline-block;
margin-top: -4px;
}


.custom-block ul li + li {
margin-top: 4px;
}
}
5 changes: 4 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{
"eslint.workingDirectories": [".vitepress", "."]
"eslint.workingDirectories": [".vitepress", "."],
"markdown.validate.enabled": true,
"markdown.preview.typographer": false,
"markdown.extension.completion.root": "src"
}
188 changes: 97 additions & 91 deletions etc/snippet_sources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,97 +4,103 @@ import { IROHA_JAVA_REV_DEV, IROHA_REV_STABLE, IROHA_JS_REV, IROHA_REV_DEV, IROH

// *****

const javascriptSnippets = [
{
src: 'packages/docs-recipes/src/1.client-install.ts',
local: '1-client-install.ts',
},
{
src: 'packages/docs-recipes/src/2.1.1.key-pair.ts',
local: '2-1-1-key-pair.ts',
},
{
src: 'packages/docs-recipes/src/2.1.2.signer.ts',
local: '2-1-2-signer.ts',
},
{
src: 'packages/docs-recipes/src/2.2.1.torii-usage-example.ts',
local: '2-2-1-torii-usage-example.ts',
},
{
src: 'packages/docs-recipes/src/2.2.2.torii-pre-node.ts',
local: '2-2-2-torii-pre-node.ts',
},
{
src: 'packages/docs-recipes/src/2.2.3.torii-pre-web.ts',
local: '2-2-3-torii-pre-web.ts',
},
{
src: 'packages/docs-recipes/src/2.3.client.ts',
local: '2-3-client.ts',
},
{
src: 'packages/docs-recipes/src/3.register-domain.ts',
local: '3-register-domain.ts',
},
{
src: 'packages/docs-recipes/src/4.register-account.ts',
local: '4-register-account.ts',
},
{
src: 'packages/docs-recipes/src/5.1.register-asset.ts',
local: '5-1-register-asset.ts',
},
{
src: 'packages/docs-recipes/src/5.2.mint-registered-asset.ts',
local: '5-2-mint-asset.ts',
},
{
src: 'packages/docs-recipes/src/6.transfer-assets.ts',
local: '6-transfer-assets.ts',
},
{
src: 'packages/docs-recipes/src/7.query-domains-accounts-assets.ts',
local: '7-querying.ts',
},
{
src: 'packages/client/test/integration/test-web/src/main.ts',
local: '8-main.ts',
},
{
src: 'packages/client/test/integration/config/client_config.json',
local: '8-config.json',
},
{
src: 'packages/client/test/integration/test-web/src/App.vue',
local: '8-App.vue',
},
{
src: 'packages/client/test/integration/test-web/src/client.ts',
local: '8-client.ts',
},
{
src: 'packages/client/test/integration/test-web/src/crypto.ts',
local: '8-crypto.ts',
},
{
src: 'packages/client/test/integration/test-web/src/components/CreateDomain.vue',
local: '8-components-CreateDomain.vue',
},
{
src: 'packages/client/test/integration/test-web/src/components/StatusChecker.vue',
local: '8-components-StatusChecker.vue',
},
{
src: 'packages/client/test/integration/test-web/src/components/EventListener.vue',
local: '8-components-EventListener.vue',
},
{
src: 'packages/docs-recipes/src/9.blocks-stream.ts',
local: '9-blocks-stream.ts',
},
].map<SnippetSourceDefinition>(({ src, local }) => ({
src: `https://raw.githubusercontent.com/hyperledger/iroha-javascript/${IROHA_JS_REV}/${src}`,
const javascriptSnippets = (
[
{
src: 'packages/docs-recipes/src/1.client-install.ts',
local: '1-client-install.ts',
},
{
src: 'packages/docs-recipes/src/2.1.1.key-pair.ts',
local: '2-1-1-key-pair.ts',
},
{
src: 'packages/docs-recipes/src/2.1.2.signer.ts',
local: '2-1-2-signer.ts',
},
{
src: 'packages/docs-recipes/src/2.1.3.free.ts',
local: '2-1-3-free.ts',
},
{
src: 'packages/docs-recipes/src/2.2.1.torii-usage-example.ts',
local: '2-2-1-torii-usage-example.ts',
},
{
src: 'packages/docs-recipes/src/2.2.2.torii-pre-node.ts',
local: '2-2-2-torii-pre-node.ts',
},
{
src: 'packages/docs-recipes/src/2.2.3.torii-pre-web.ts',
local: '2-2-3-torii-pre-web.ts',
},
{
src: 'packages/docs-recipes/src/2.3.client.ts',
local: '2-3-client.ts',
},
{
src: 'packages/docs-recipes/src/3.register-domain.ts',
local: '3-register-domain.ts',
},
{
src: 'packages/docs-recipes/src/4.register-account.ts',
local: '4-register-account.ts',
},
{
src: 'packages/docs-recipes/src/5.register-and-mint-asset.ts',
local: '5-register-and-mint-asset.ts',
},
{
src: 'packages/docs-recipes/src/6.transfer-assets.ts',
local: '6-transfer-assets.ts',
},
{
src: 'packages/docs-recipes/src/7.query-domains-accounts-assets.ts',
local: '7-querying.ts',
},
{
src: 'packages/client/test/integration/test-web/src/main.ts',
local: '8-main.ts',
},
{
src: 'packages/client/test/integration/config/client_config.json',
local: '8-config.json',
},
{
src: 'packages/client/test/integration/test-web/src/App.vue',
local: '8-App.vue',
},
{
src: 'packages/client/test/integration/test-web/src/client.ts',
local: '8-client.ts',
},
{
src: 'packages/client/test/integration/test-web/src/crypto.ts',
local: '8-crypto.ts',
},
{
src: 'packages/client/test/integration/test-web/src/components/CreateDomain.vue',
local: '8-components-CreateDomain.vue',
},
{
src: 'packages/client/test/integration/test-web/src/components/StatusChecker.vue',
local: '8-components-StatusChecker.vue',
},
{
src: 'packages/client/test/integration/test-web/src/components/EventListener.vue',
local: '8-components-EventListener.vue',
},
{
src: 'packages/docs-recipes/src/9.blocks-stream.ts',
local: '9-blocks-stream.ts',
},
{
src: `packages/client/test/integration/test-node/test/multisignature.ts`,
local: 'multisignature-transaction.ts',
},
] satisfies { src: string; local: string }[]
).map<SnippetSourceDefinition>(({ src, local }) => ({
src: `https://raw.githubusercontent.com/0x009922/iroha-javascript/9367e562a74748a8d32e5473248548a02f7ca03c/${src}`,
filename: `js-sdk-${local}`,
}))

Expand Down
4 changes: 2 additions & 2 deletions src/guide/blockchain/assets.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ related to [metadata](metadata.md).

## Asset Structure

![Untitled](/img/asset-diagram.png)
![Asset Diagram](/img/asset-diagram.png)

## Instructions

Expand All @@ -41,4 +41,4 @@ process of registering and minting assets in a blockchain:
- [Rust](/guide/rust.md#_5-registering-and-minting-assets)
- [Kotlin/Java](/guide/kotlin-java.md#_5-registering-and-minting-assets)
- [Python](/guide/python.md#_5-registering-and-minting-assets)
- [JavaScript/TypeScript](/guide/javascript.md#_5-registering-and-minting-assets)
- [TypeScript/JavaScript](/guide/javascript.md#_5-registering-and-minting-assets)
8 changes: 4 additions & 4 deletions src/guide/blockchain/data-model.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,17 @@ relationship between various objects in the blockchain.
The following example shows the relationship between domains, accounts, and
assets.

![Untitled](/img/domains-example.png)
![Domains Example](/img/domains-example.png)

::: details Language-specific guidance on registering these objects

| Language | Guide |
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|-----------------------| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Bash | Register a [domain](/guide/bash.md#_3-registering-a-domain), an [account](/guide/bash.md#_4-registering-an-account), an [asset](/guide/bash.md#_5-registering-and-minting-assets) |
| Rust | Register a [domain](/guide/rust.md#_3-registering-a-domain), an [account](/guide/rust.md#_4-registering-an-account), an [asset](/guide/rust.md#_5-registering-and-minting-assets) |
| Kotlin/Java | Register a [domain](/guide/kotlin-java.md#_3-registering-a-domain), an [account](/guide/kotlin-java.md#_4-registering-an-account), an [asset](/guide/kotlin-java.md#_5-registering-and-minting-assets) |
| Python | Register a [domain](/guide/python.md#_3-registering-a-domain), an [account](/guide/python.md#_4-registering-an-account), an [asset](/guide/python.md#_5-registering-and-minting-assets) |
| JavaScript/TypeScript | Register a [domain](/guide/javascript.md#_3-registering-a-domain), an [account](/guide/javascript.md#_4-registering-an-account), an [asset](/guide/javascript.md#_5-registering-and-minting-assets) |
| TypeScript/JavaScript | Register a [domain](/guide/javascript.md#_3-registering-a-domain), an [account](/guide/javascript.md#_4-registering-an-account), an [asset](/guide/javascript.md#_5-registering-and-minting-assets) |

:::

Expand All @@ -50,4 +50,4 @@ about [permissions and roles](./permissions.md) and [metadata](metadata.md)
in the corresponding sections. The asset structure is illustrated in a
[dedicated chapter](./assets.md).

![Untitled](/img/domain-account-asset-diagram.png)
![Domain, Account and Asset Diagram](/img/domain-account-asset-diagram.png)
4 changes: 2 additions & 2 deletions src/guide/blockchain/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ process of registering objects in a blockchain:
| Rust | Register a [domain](/guide/rust.md#_3-registering-a-domain), an [account](/guide/rust.md#_4-registering-an-account), an [asset](/guide/rust.md#_5-registering-and-minting-assets) |
| Kotlin/Java | Register a [domain](/guide/kotlin-java.md#_3-registering-a-domain), an [account](/guide/kotlin-java.md#_4-registering-an-account), an [asset](/guide/kotlin-java.md#_5-registering-and-minting-assets) |
| Python | Register a [domain](/guide/python.md#_3-registering-a-domain), an [account](/guide/python.md#_4-registering-an-account), an [asset](/guide/python.md#_5-registering-and-minting-assets) |
| JavaScript/TypeScript | Register a [domain](/guide/javascript.md#_3-registering-a-domain), an [account](/guide/javascript.md#_4-registering-an-account), an [asset](/guide/javascript.md#_5-registering-and-minting-assets) |
| TypeScript/JavaScript | Register a [domain](/guide/javascript.md#_3-registering-a-domain), an [account](/guide/javascript.md#_4-registering-an-account), an [asset](/guide/javascript.md#_5-registering-and-minting-assets) |

## Mint/Burn

Expand All @@ -140,7 +140,7 @@ process of minting assets in a blockchain:
- [Rust](/guide/rust.md#_5-registering-and-minting-assets)
- [Kotlin/Java](/guide/kotlin-java.md#_5-registering-and-minting-assets)
- [Python](/guide/python.md#_5-registering-and-minting-assets)
- [JavaScript/TypeScript ](/guide/javascript.md#_5-registering-and-minting-assets)
- [TypeScript/JavaScript](../javascript.md#_5-registering-and-minting-assets)

Here are examples of burning assets:

Expand Down
2 changes: 2 additions & 0 deletions src/guide/configure/genesis.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ several permission tokens and roles. Both new accounts are signed with the
`ed01207233bfc89dcbd68c19fde6ce6158225298ec1131b6a130d1aeb454c1ab5183c0`
public key.

[//]: # (TODO current genesis block sample contains much more that just this. Describe it here?)

::: info Note

Iroha is **case-sensitive**, meaning that _Alice_@wonderland is different
Expand Down
5 changes: 1 addition & 4 deletions src/guide/configure/keys.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,7 @@ register a non-genesis account (for example, _alice_@wonderland) and
`iroha_client_cli` currently doesn't support unregister instructions. If
you plan on creating a private blockchain, you should consider writing your
own client based on the `client` Rust crate, or any of the provided client
libraries: [iroha-python](https://github.com/hyperledger/iroha-python),
[iroha-iOS](https://github.com/hyperledger/iroha-ios),
[iroha-java](https://github.com/hyperledger/iroha-java), or
[iroha-javascript](https://github.com/hyperledger/iroha-javascript/tree/iroha2).
libraries: [Python](../python.md), [Kotlin/Java](../kotlin-java.md), [TypeScript/JavaScript](../javascript.md).

:::

Expand Down
2 changes: 1 addition & 1 deletion src/guide/glossary.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Here you can find definitions of all Iroha-related entities.
- [Sumeragi (Emperor)](#sumeragi-emperor)
- [Torii (Gate)](#torii-gate)
- [Kura (Warehouse)](#kura-warehouse)
- [Kagami(Teacher and Exemplar and/or looking glass)](#kagamiteacher-and-exemplar-andor-looking-glass)
- [Kagami (Teacher and Exemplar and/or looking glass)](#kagamiteacher-and-exemplar-andor-looking-glass)
- [Merkle tree (hash tree)](#merkle-tree-hash-tree)
- [Smart contracts](#smart-contracts)
- [Triggers](#triggers)
Expand Down
2 changes: 1 addition & 1 deletion src/guide/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ You can choose to work with one of the following versions of Iroha: `dev`,

To install Iroha from GitHub, you need:

- [git](https://githowto.com/)
- [Git](https://githowto.com/)
- [OpenSSL](https://www.openssl.org/)

### Install OpenSSL
Expand Down
2 changes: 1 addition & 1 deletion src/guide/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ We invite you to follow the tutorial in this order:
- [Python](/guide/python.md)
- [Rust](/guide/rust.md)
- [Kotlin/Java](/guide/kotlin-java.md)
- [Javascript (TypeScript)](/guide/javascript.md)
- [TypeScript/JavaScript](/guide/javascript.md)

## Tutorial Updates

Expand Down
Loading