Skip to content

Commit

Permalink
Structure overhaul
Browse files Browse the repository at this point in the history
  • Loading branch information
a-zorina committed Jul 24, 2024
1 parent f2cd210 commit 1a49167
Show file tree
Hide file tree
Showing 48 changed files with 376 additions and 394 deletions.
349 changes: 174 additions & 175 deletions .vitepress/config.mts

Large diffs are not rendered by default.

File renamed without changes.
File renamed without changes.
12 changes: 6 additions & 6 deletions src/guide/blockchain/assets.md → src/blockchain/assets.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ same as a £1 bill signed by the King of Spades).

The assets can also be **mintable** (you can make more of them) and
**non-mintable** (you can only specify their initial quantity in the
[genesis block](/guide/configure/genesis.md)).
[genesis block](/guide/configure/genesis)).

## Value Types

Expand Down Expand Up @@ -76,8 +76,8 @@ Assets can be [registered](./instructions.md#un-register),
Refer to one of the language-specific guides to walk you through the
process of registering and minting assets in a blockchain:

- [CLI](/guide/get-started/operate-iroha-via-cli.md#_6-registering-and-minting-assets)
- [Rust](/guide/get-started/rust.md#_5-registering-and-minting-assets)
- [Kotlin/Java](/guide/get-started/kotlin-java.md#_5-registering-and-minting-assets)
- [Python](/guide/get-started/python.md#_5-registering-and-minting-assets)
- [JavaScript/TypeScript](/guide/get-started/javascript.md#_5-registering-and-minting-assets)
- [CLI](/get-started/operate-iroha-via-cli.md#_6-register-and-mint-assets)
- [Rust](/guide/tutorials/rust.md#_5-registering-and-minting-assets)
- [Kotlin/Java](/guide/tutorials/kotlin-java.md#_5-registering-and-minting-assets)
- [Python](/guide/tutorials/python.md#_5-registering-and-minting-assets)
- [JavaScript/TypeScript](/guide/tutorials/javascript.md#_5-registering-and-minting-assets)
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,11 @@ domain_looking_glass *-- account_rabbit : registered in

| Language | Guide |
| --------------------- |--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| CLI | Register a [domain](/guide/get-started/operate-iroha-via-cli.md#_3-registering-a-domain), an [account](/guide/get-started/operate-iroha-via-cli.md#_4-registering-an-account), an [asset](/guide/get-started/operate-iroha-via-cli.md#_6-registering-and-minting-assets) |
| Rust | Register a [domain](/guide/get-started/rust.md#_3-registering-a-domain), an [account](/guide/get-started/rust.md#_4-registering-an-account), an [asset](/guide/get-started/rust.md#_5-registering-and-minting-assets) |
| Kotlin/Java | Register a [domain](/guide/get-started/kotlin-java.md#_3-querying-and-registering-domains), an [account](/guide/get-started/kotlin-java.md#_4-registering-an-account), an [asset](/guide/get-started/kotlin-java.md#_5-registering-and-minting-assets) |
| Python | Register a [domain](/guide/get-started/python.md#_3-registering-a-domain), an [account](/guide/get-started/python.md#_4-registering-an-account), an [asset](/guide/get-started/python.md#_5-registering-and-minting-assets) |
| JavaScript/TypeScript | Register a [domain](/guide/get-started/javascript.md#_3-registering-a-domain), an [account](/guide/get-started/javascript.md#_4-registering-an-account), an [asset](/guide/get-started/javascript.md#_5-registering-and-minting-assets) |
| CLI | Register a [domain](/get-started/operate-iroha-via-cli.md#_3-register-a-domain), an [account](/get-started/operate-iroha-via-cli.md#_4-register-an-account), an [asset](/get-started/operate-iroha-via-cli.md#_6-register-and-mint-assets) |
| Rust | Register a [domain](/guide/tutorials/rust.md#_3-registering-a-domain), an [account](/guide/tutorials/rust.md#_4-registering-an-account), an [asset](/guide/tutorials/rust.md#_5-registering-and-minting-assets) |
| Kotlin/Java | Register a [domain](/guide/tutorials/kotlin-java.md#_3-querying-and-registering-domains), an [account](/guide/tutorials/kotlin-java.md#_4-registering-an-account), an [asset](/guide/tutorials/kotlin-java.md#_5-registering-and-minting-assets) |
| Python | Register a [domain](/guide/tutorials/python.md#_3-registering-a-domain), an [account](/guide/tutorials/python.md#_4-registering-an-account), an [asset](/guide/tutorials/python.md#_5-registering-and-minting-assets) |
| JavaScript/TypeScript | Register a [domain](/guide/tutorials/javascript.md#_3-registering-a-domain), an [account](/guide/tutorials/javascript.md#_4-registering-an-account), an [asset](/guide/tutorials/javascript.md#_5-registering-and-minting-assets) |

:::

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,25 @@

To understand how Iroha operates, let's draw parallels between a blockchain
and a computer. If the blockchain is the computer, then in this metaphor of
ours the client binary (for example: [`iroha_client_cli`](/guide/get-started/operate-iroha-via-cli.md))
ours the client binary (for example: [`iroha_client_cli`](/get-started/operate-iroha-via-cli))
is the keyboard, the blockchain is the hard drive, and the Iroha peer
software is the processor. Like a processor, Iroha accepts portable
instructions that modify what's written to the blockchain, allow certain
users to use the network, and lock others out.

Any operation that is run on-chain is written in terms of
[Iroha Special Instructions (ISI)](/guide/blockchain/instructions.md), and
[Iroha Special Instructions (ISI)](/blockchain/instructions), and
there is no other way of modifying the world state.

Each interaction with the blockchain is done via a _transaction_. A
transaction is a collection of _instructions_, which are either glued
together in sequence or compiled into what we affectionately call a
[WASM](/guide/blockchain/wasm.md) blob. You need these instructions to
[WASM](/blockchain/wasm) blob. You need these instructions to
register an account, remove an account, add X amount of Y currency, and so
on.

To read the information encoded in the blocks of a blockchain (the current
world state), you use [queries](/guide/blockchain/queries.md). Queries are
world state), you use [queries](/blockchain/queries). Queries are
submitted like instructions, but they're not tracked and recorded in
blocks, so they're much more lightweight. If you use queries as part of
complicated logic (e.g. inside WASM), they have a non-negligible impact on
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Iroha Special Instructions

When we spoke about [how Iroha operates](/guide/blockchain/how-iroha-works), we
When we spoke about [how Iroha operates](/blockchain/how-iroha-works), we
said that Iroha Special Instructions are the only way to modify the world
state. So, what kind of special instructions do we have? If you've read the
language-specific guides in this tutorial, you've already seen a couple of
Expand Down Expand Up @@ -40,7 +40,7 @@ all you need is the object that you want to register.
| [Mint/Burn](#mint-burn) | assets, triggers (trigger repetitions), permission tokens | accounts |
| [SetKeyValue/RemoveKeyValue](#setkeyvalue-removekeyvalue) | any objects that have [metadata](./metadata.md): accounts, domains, assets, asset definitions, triggers, transactions | |
| [NewParameter/SetParameter](#newparameter-setparameter) | Iroha configuration parameters | |
| [Grant/Revoke](#grant-revoke) | [roles, permission tokens](/guide/blockchain/permissions.md) | accounts |
| [Grant/Revoke](#grant-revoke) | [roles, permission tokens](/blockchain/permissions) | accounts |
| [Transfer](#transfer) | assets | accounts |
| [ExecuteTrigger](#executetrigger) | triggers | |
| [If, Pair, Sequence](#composite-instructions) | any instructions | |
Expand Down Expand Up @@ -79,7 +79,7 @@ restrictions put on entity names.
::: info

Note that depending on how you decide to set up your
[genesis block](/guide/configure/genesis.md) in `genesis.json`
[genesis block](/guide/configure/genesis) in `genesis.json`
(specifically, whether or not you include registration of permission
tokens), the process for registering an account can be very different. In
general, we can summarise it like this:
Expand All @@ -91,7 +91,7 @@ general, we can summarise it like this:
register another account.

We discuss these differences in great detail when we
[compare private and public blockchains](/guide/configure/modes.md).
[compare private and public blockchains](/guide/configure/modes).

:::

Expand All @@ -109,11 +109,11 @@ process of registering objects in a blockchain:

| Language | Guide |
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| CLI | Register a [domain](/guide/get-started/operate-iroha-via-cli.md#_3-registering-a-domain), an [account](/guide/get-started/operate-iroha-via-cli.md#_4-registering-an-account), an [asset](/guide/get-started/operate-iroha-via-cli.md#_6-registering-and-minting-assets) |
| Rust | Register a [domain](/guide/get-started/rust.md#_3-registering-a-domain), an [account](/guide/get-started/rust.md#_4-registering-an-account), an [asset](/guide/get-started/rust.md#_5-registering-and-minting-assets) |
| Kotlin/Java | Register a [domain](/guide/get-started/kotlin-java.md#_3-querying-and-registering-domains), an [account](/guide/get-started/kotlin-java.md#_4-registering-an-account), an [asset](/guide/get-started/kotlin-java.md#_5-registering-and-minting-assets) |
| Python | Register a [domain](/guide/get-started/python.md#_3-registering-a-domain), an [account](/guide/get-started/python.md#_4-registering-an-account), an [asset](/guide/get-started/python.md#_5-registering-and-minting-assets) |
| JavaScript/TypeScript | Register a [domain](/guide/get-started/javascript.md#_3-registering-a-domain), an [account](/guide/get-started/javascript.md#_4-registering-an-account), an [asset](/guide/get-started/javascript.md#_5-registering-and-minting-assets) |
| CLI | Register a [domain](/get-started/operate-iroha-via-cli.md#_3-register-a-domain), an [account](/get-started/operate-iroha-via-cli.md#_4-register-an-account), an [asset](/get-started/operate-iroha-via-cli.md#_6-register-and-mint-assets) |
| Rust | Register a [domain](/guide/tutorials/rust.md#_3-registering-a-domain), an [account](/guide/tutorials/rust.md#_4-registering-an-account), an [asset](/guide/tutorials/rust.md#_5-registering-and-minting-assets) |
| Kotlin/Java | Register a [domain](/guide/tutorials/kotlin-java.md#_3-querying-and-registering-domains), an [account](/guide/tutorials/kotlin-java.md#_4-registering-an-account), an [asset](/guide/tutorials/kotlin-java.md#_5-registering-and-minting-assets) |
| Python | Register a [domain](/guide/tutorials/python.md#_3-registering-a-domain), an [account](/guide/tutorials/python.md#_4-registering-an-account), an [asset](/guide/tutorials/python.md#_5-registering-and-minting-assets) |
| JavaScript/TypeScript | Register a [domain](/guide/tutorials/javascript.md#_3-registering-a-domain), an [account](/guide/tutorials/javascript.md#_4-registering-an-account), an [asset](/guide/tutorials/javascript.md#_5-registering-and-minting-assets) |

## Mint/Burn

Expand All @@ -130,26 +130,26 @@ are assumed to be non-negative as well, so you can never have $-1.0$ of
Refer to one of the language-specific guides to walk you through the
process of minting assets in a blockchain:

- [CLI](/guide/get-started/operate-iroha-via-cli.md#_6-registering-and-minting-assets)
- [Rust](/guide/get-started/rust.md#_5-registering-and-minting-assets)
- [Kotlin/Java](/guide/get-started/kotlin-java.md#_5-registering-and-minting-assets)
- [Python](/guide/get-started/python.md#_5-registering-and-minting-assets)
- [JavaScript/TypeScript ](/guide/get-started/javascript.md#_5-registering-and-minting-assets)
- [CLI](/get-started/operate-iroha-via-cli.md#_6-register-and-mint-assets)
- [Rust](/guide/tutorials/rust.md#_5-registering-and-minting-assets)
- [Kotlin/Java](/guide/tutorials/kotlin-java.md#_5-registering-and-minting-assets)
- [Python](/guide/tutorials/python.md#_5-registering-and-minting-assets)
- [JavaScript/TypeScript ](/guide/tutorials/javascript.md#_5-registering-and-minting-assets)

Here are examples of burning assets:

- [CLI](/guide/get-started/operate-iroha-via-cli.md#_8-burning-assets)
- [Rust](/guide/get-started/rust.md#_7-burning-assets)
- [CLI](/get-started/operate-iroha-via-cli.md#_8-burn-assets)
- [Rust](/guide/tutorials/rust.md#_7-burning-assets)

## Transfer

Similar to mint and burn instructions, transferring refers to assets. You
can transfer assets between different accounts.

To do this, an account have to be granted the
[permission to transfer assets](/reference/permissions.md).
[permission to transfer assets](/reference/permissions).
Refer to an example on how to
transfer assets with [CLI](/guide/get-started/operate-iroha-via-cli.md#_7-transferring-assets) or [Rust](/guide/get-started/rust.md#_6-transferring-assets).
transfer assets with [CLI](/get-started/operate-iroha-via-cli.md#_7-transfer-assets) or [Rust](/guide/tutorials/rust.md#_6-transferring-assets).

<!--TODO: add links to transferring assets example in which guide after https://github.com/hyperledger/iroha-2-docs/issues/81 is addressed -->

Expand All @@ -166,15 +166,15 @@ be used carefully.
## `SetKeyValue`/`RemoveKeyValue`

These instructions are used with the key/value
[`Store` asset type](/guide/blockchain/metadata.md#store-asset). This use
[`Store` asset type](/blockchain/metadata.md#store-asset). This use
case has not received much attention so far, because storing data in the
blockchain is a rather advanced topic that we shall cover separately.

## `NewParameter`/`SetParameter`

With these instructions, you can create (`NewParameter`) and change
(`SetParameter`) chain-wide
[configuration parameters](./../configure/client-configuration.md) for
[configuration parameters](/guide/configure/client-configuration) for
Iroha.

## `ExecuteTrigger`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ The metadata can be of very different types, such as:
- request results

The object's metadata can be transferred one by one, or in bulk via a
[WASM](/guide/blockchain/wasm.md) transaction. The `Store` asset type is
[WASM](/blockchain/wasm) transaction. The `Store` asset type is
used for working with metadata. Let's take a closer look at this asset
type.

Expand Down Expand Up @@ -91,7 +91,7 @@ let set_hat_color = SetKeyValueBox::new(
## Working with metadata

The following example showcases how to register and grant a
[role](/guide/blockchain/permissions.md#permission-groups-roles) to access
[role](/blockchain/permissions.md#permission-groups-roles) to access
another account's metadata.

::: details Example
Expand Down Expand Up @@ -148,7 +148,7 @@ fn register_and_grant_role_for_metadata_access() -> Result<()> {
## Queries

You can get the key value of an object metadata using
[queries](/guide/blockchain/queries.md):
[queries](/blockchain/queries):

- [`FindAccountKeyValueByIdAndKey`](/reference/queries.md#findaccountkeyvaluebyidandkey)
- [`FindAssetKeyValueByIdAndKey`](/reference/queries.md#findassetkeyvaluebyidandkey)
Expand All @@ -159,4 +159,4 @@ You can get the key value of an object metadata using
## Permissions

Pre-configured tokens in Iroha 2 that allow to set or remove
key-values in accounts, assets, asset definitions, and so on are described in [`Permissions`](/reference/permissions.md).
key-values in accounts, assets, asset definitions, and so on are described in [`Permissions`](/reference/permissions).
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ Before granting a role to an account, the role should be registered first.
### Register a new role

Let's register a new role that, when granted, will allow another account
access to the [metadata](/guide/blockchain/metadata.md) in Mouse's account:
access to the [metadata](/blockchain/metadata) in Mouse's account:

```rust
let role_id = RoleId::from_str("ACCESS_TO_MOUSE_METADATA")?;
Expand Down
6 changes: 3 additions & 3 deletions src/guide/blockchain/queries.md → src/blockchain/queries.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,19 +77,19 @@ that match the specified filter.

## Sorting

Iroha 2 can sort items with [metadata](/guide/blockchain/metadata.md)
Iroha 2 can sort items with [metadata](/blockchain/metadata)
lexicographically if you provide a key to sort by during the construction
of the query. A typical use case is for accounts to have a `registered-on`
metadata entry, which, when sorted, allows you to view the account
registration history.

Sorting only applies to entities that have
[metadata](/guide/blockchain/metadata.md), as the metadata key is used to
[metadata](/blockchain/metadata), as the metadata key is used to
sort query results.

You can combine sorting with pagination and filters. Note that sorting is
an optional feature, most queries with pagination won't need it.

## Reference

Check the [list of existing queries](/reference/queries.md) for detailed information about them.
Check the [list of existing queries](/reference/queries) for detailed information about them.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ accounts, domains, assets, or transactions. This is the storage for trigger
data.

You can learn more about metadata in a
[dedicated section](/guide/blockchain/metadata.md).
[dedicated section](/blockchain/metadata).

## How Triggers Work

Expand Down
4 changes: 2 additions & 2 deletions src/guide/blockchain/wasm.md → src/blockchain/wasm.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ on-chain, as we explained earlier.

In theory, you can do anything you want just using ISI as it is a
Turing-complete language. However, it'll be less convenient and efficient
since you'd need to use [metadata](/guide/blockchain/metadata.md) as memory
since you'd need to use [metadata](/blockchain/metadata) as memory
and write complex conditionals using just the tools that we've provided in
the `Expression` and ISI infrastructure. We highly recommend choosing a
well-known programming language, such as Rust, to build the necessary logic
Expand Down Expand Up @@ -78,7 +78,7 @@ non-portable architecture and OS-specific static manner, but WASM is a
portable format. Since C ABI is the _lingua franca_ of the programming
world and there is no other stable Rust ABI (yet), Iroha relies on the
C-linkage to generate WASM bindings. Thankfully, `iroha_wasm` takes care of
everything related to [foreign function interfaces](/reference/ffi.md) (FFI), so
everything related to [foreign function interfaces](/reference/ffi) (FFI), so
you don't have to worry about things like `unsafe`, `repr(C)`, padding,
alignment, and others.

Expand Down
Loading

0 comments on commit 1a49167

Please sign in to comment.