Skip to content

Commit

Permalink
Sync recent changes to new structure
Browse files Browse the repository at this point in the history
Signed-off-by: a-zorina <[email protected]>
  • Loading branch information
a-zorina committed Sep 18, 2024
1 parent 101c269 commit 201de7a
Show file tree
Hide file tree
Showing 40 changed files with 700 additions and 263 deletions.
9 changes: 4 additions & 5 deletions .vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,14 @@ function sidebarGuide(): DefaultTheme.SidebarItem[] {
link: '/guide/tutorials/',
items: [
/* a common lang-agnostic section will go here */

{
text: 'Python 3',
link: '/guide/tutorials/python',
},
{
text: 'Rust',
link: '/guide/tutorials/rust',
},
{
text: 'Python 3',
link: '/guide/tutorials/python',
},
{
text: 'Kotlin/Java',
link: '/guide/tutorials/kotlin-java',
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ This repository contains the source files for [Hyperledger Iroha 2 Documentation

The tutorial is suitable for both experienced and novice users. It explains Iroha 2 concepts and features, and also offers language-specific step-by-step guides for these programming languages:

- [CLI](https://hyperledger.github.io/iroha-2-docs/guide/operate-iroha-via-cli.html)
- [CLI](https://hyperledger.github.io/iroha-2-docs/guide/operate-iroha-2-via-cli.html)
- [Python](https://hyperledger.github.io/iroha-2-docs/guide/python.html)
- [Rust](https://hyperledger.github.io/iroha-2-docs/guide/rust.html)
- [Kotlin/Java](https://hyperledger.github.io/iroha-2-docs/guide/kotlin-java.html)
- [Javascript (TypeScript)](https://hyperledger.github.io/iroha-2-docs/guide/javascript.html)

If you are already familiar with Hyperledger Iroha, we invite you to read about [how Iroha 2 is different](https://hyperledger.github.io/iroha-2-docs/guide/iroha-2.html) from its previous version.
If you are already familiar with Hyperledger Iroha, we invite you to read about [how Iroha 2 is different](https://hyperledger.github.io/iroha-2-docs/get-started/iroha-2.html) from its previous version.

Check the [Hyperledger Iroha 2](https://github.com/hyperledger/iroha/tree/iroha2-dev#hyperledger-iroha) repository for more detailed information about API and available features.
Check the [Hyperledger Iroha](https://github.com/hyperledger/iroha/) repository for more detailed information about API and available features.

## Contribution

Expand Down
4 changes: 2 additions & 2 deletions 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)).
[genesis block](/guide/configure/genesis.md)).

## Value Types

Expand Down Expand Up @@ -76,7 +76,7 @@ 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](/get-started/operate-iroha-via-cli.md#_6-register-and-mint-assets)
- [CLI](/get-started/operate-iroha-2-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)
Expand Down
2 changes: 1 addition & 1 deletion src/blockchain/consensus.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ fail. The same thing happens if the peers have different instructions.

[^1]:
For prospective wizards, the
[Iroha 2 Whitepaper](https://github.com/hyperledger/iroha/blob/iroha2-dev/docs/source/iroha_2_whitepaper.md)
[Iroha 2 Whitepaper](https://github.com/hyperledger/iroha/blob/main/docs/source/iroha_2_whitepaper.md)
is a good start.
2 changes: 1 addition & 1 deletion src/blockchain/data-model.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ domain_looking_glass *-- account_rabbit : registered in

| Language | Guide |
| --------------------- |--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 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) |
| CLI | Register a [domain](/get-started/operate-iroha-2-via-cli.md#_3-register-a-domain), an [account](/get-started/operate-iroha-2-via-cli.md#_4-register-an-account), an [asset](/get-started/operate-iroha-2-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) |
Expand Down
8 changes: 4 additions & 4 deletions src/blockchain/how-iroha-works.md
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`](/get-started/operate-iroha-via-cli))
ours the client binary (for example: [`iroha`](/get-started/operate-iroha-2-via-cli.md))
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)](/blockchain/instructions), and
[Iroha Special Instructions (ISI)](/blockchain/instructions.md), 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](/blockchain/wasm) blob. You need these instructions to
[WASM](/blockchain/wasm.md) 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](/blockchain/queries). Queries are
world state), you use [queries](/blockchain/queries.md). 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
18 changes: 9 additions & 9 deletions src/blockchain/instructions.md
Original file line number Diff line number Diff line change
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](/blockchain/permissions) | accounts |
| [Grant/Revoke](#grant-revoke) | [roles, permission tokens](/blockchain/permissions.md) | 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) in `genesis.json`
[genesis block](/guide/configure/genesis.md) 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).
[compare private and public blockchains](/guide/configure/modes.md).

:::

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

| Language | Guide |
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| 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) |
| CLI | Register a [domain](/get-started/operate-iroha-2-via-cli.md#_3-register-a-domain), an [account](/get-started/operate-iroha-2-via-cli.md#_4-register-an-account), an [asset](/get-started/operate-iroha-2-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) |
Expand All @@ -130,15 +130,15 @@ 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](/get-started/operate-iroha-via-cli.md#_6-register-and-mint-assets)
- [CLI](/get-started/operate-iroha-2-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](/get-started/operate-iroha-via-cli.md#_8-burn-assets)
- [CLI](/get-started/operate-iroha-2-via-cli.md#_8-burn-assets)
- [Rust](/guide/tutorials/rust.md#_7-burning-assets)

## Transfer
Expand All @@ -147,9 +147,9 @@ 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).
[permission to transfer assets](/reference/permissions.md).
Refer to an example on how to
transfer assets with [CLI](/get-started/operate-iroha-via-cli.md#_7-transfer-assets) or [Rust](/guide/tutorials/rust.md#_6-transferring-assets).
transfer assets with [CLI](/get-started/operate-iroha-2-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 @@ -174,7 +174,7 @@ blockchain is a rather advanced topic that we shall cover separately.

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

## `ExecuteTrigger`
Expand Down
6 changes: 3 additions & 3 deletions src/blockchain/metadata.md
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](/blockchain/wasm) transaction. The `Store` asset type is
[WASM](/blockchain/wasm.md) 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 @@ -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](/blockchain/queries):
[queries](/blockchain/queries.md):

- [`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).
key-values in accounts, assets, asset definitions, and so on are described in [`Permissions`](/reference/permissions.md).
2 changes: 1 addition & 1 deletion src/blockchain/permissions.md
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](/blockchain/metadata) in Mouse's account:
access to the [metadata](/blockchain/metadata.md) in Mouse's account:

```rust
let role_id = RoleId::from_str("ACCESS_TO_MOUSE_METADATA")?;
Expand Down
6 changes: 3 additions & 3 deletions 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](/blockchain/metadata)
Iroha 2 can sort items with [metadata](/blockchain/metadata.md)
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](/blockchain/metadata), as the metadata key is used to
[metadata](/blockchain/metadata.md), 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) for detailed information about them.
Check the [list of existing queries](/reference/queries.md) for detailed information about them.
4 changes: 2 additions & 2 deletions src/blockchain/triggers.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ contains the necessary information:
The documentation on the `EventFilter` types is under construction, as
we are likely to make major changes to that particular architecture.
For now, suffice it to say that you can look at the
[source code](https://github.com/hyperledger/iroha/blob/iroha2-dev/data_model/src/events/data/filters.rs)
[source code](https://github.com/hyperledger/iroha/blob/main/data_model/src/events/data/filters.rs)
in `iroha_data_model` and see a few particularly interesting
applications.

Expand Down 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](/blockchain/metadata).
[dedicated section](/blockchain/metadata.md).

## How Triggers Work

Expand Down
6 changes: 3 additions & 3 deletions 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](/blockchain/metadata) as memory
since you'd need to use [metadata](/blockchain/metadata.md) 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 @@ -70,15 +70,15 @@ edition = "2021"
crate-type = ['cdylib']

[dependencies]
iroha_wasm = { git = "https://github.com/hyperledger/iroha/", branch = "iroha2-dev" }
iroha_wasm = { git = "https://github.com/hyperledger/iroha/"}
```

Note that the crate type is `cdylib`. Most Rust code is linked in a
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) (FFI), so
everything related to [foreign function interfaces](/reference/ffi.md) (FFI), so
you don't have to worry about things like `unsafe`, `repr(C)`, padding,
alignment, and others.

Expand Down
4 changes: 2 additions & 2 deletions src/blockchain/world.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
`World` is the global entity that contains other entities. The `World`
consists of:

- Iroha [configuration parameters](/guide/configure/client-configuration)
- Iroha [configuration parameters](/guide/configure/client-configuration.md)
- the list of
[trusted peers](/guide/configure/peer-configuration#trusted-peers)
- registered domains
- registered [triggers](/blockchain/triggers)
- registered [triggers](/blockchain/triggers.md)
- registered
[roles](/blockchain/permissions.md#permission-groups-roles)
- registered
Expand Down
7 changes: 3 additions & 4 deletions src/documenting/snippets.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,13 @@ located in other repositories, where they are built, run, and tested.
### Snippet Sources

Snippet sources are defined in
[`snippet_sources.ts`](https://github.com/hyperledger/iroha-2-docs/blob/main/etc/snippet_sources.ts).
The `snippet_sources.ts` file is located at the documentation repository
and has the following format:
[`snippet_sources.ts`](https://github.com/hyperledger/iroha-2-docs/blob/main/etc/snippet-sources.ts).
The `snippet_sources.ts` file is located in the documentation repository and has the following format:

```ts
export default [
{
src: 'https://raw.githubusercontent.com/hyperledger/iroha/iroha2-stable/MAINTAINERS.md',
src: 'https://raw.githubusercontent.com/hyperledger/iroha/main/MAINTAINERS.md',
filename: 'iroha-maintainers-at-stable.md',
},
{
Expand Down
Loading

0 comments on commit 201de7a

Please sign in to comment.