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

Update the data model reference to the latest iroha dev revision #485

Merged
merged 4 commits into from
May 15, 2024
Merged
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 etc/meta.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* hyperledger/iroha#iroha2-dev
*/
export const IROHA_REV_DEV = '50fc8baccc3c657b3cc3c926772d71b61040e2a8'
export const IROHA_REV_DEV = 'e7a605c1a926c319d214ef3825524ee6c2e9f076'

/**
* hyperledger/iroha-javascript#iroha2 (rc13)
Expand Down
16 changes: 16 additions & 0 deletions etc/schema/render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,22 @@ function renderSegment(segment: Segment, segmentName: string): string {
),
)
.with(null, () => segmentType('Zero-Size Type (unit type, null type)'))
.with({ Bitmap: P.select() }, ({ repr, masks }) =>
joinDouble(
// .
segmentType('Bitmap'),
segmentProp('Repr', repr),
segmentPropNameOnly('Masks'),
table(
[
{ title: 'Field name', align: 'right' },
{ title: 'Field value', align: 'left' },
],
masks.map((x) => [code(x.name), code('0x' + x.mask.toString(16))]),
{ indent: ' ' },
),
),
)
.exhaustive()

return joinDouble(heading, body)
Expand Down
13 changes: 13 additions & 0 deletions etc/schema/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export type SchemaTypeDefinition =
| IntDefinition
| FixedPointDefinition
| TupleDef
| BitmapDef

export interface MapDefinition {
Map: {
Expand Down Expand Up @@ -77,3 +78,15 @@ export interface FixedPointDefinition {
export type TypePath = string

export type UnitType = null

export interface BitmapMask {
name: string
mask: number
}

export interface BitmapDef {
Bitmap: {
repr: string
masks: Array<BitmapMask>
}
}
10 changes: 5 additions & 5 deletions etc/snippet-sources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,15 +116,15 @@ export default [
src: './src/example_code/lorem.rs',
},
{
src: `https://raw.githubusercontent.com/hyperledger/iroha/${IROHA_REV_DEV}/configs/client/config.json`,
filename: 'client-cli-config.json',
src: `https://raw.githubusercontent.com/hyperledger/iroha/${IROHA_REV_DEV}/configs/client.template.toml`,
filename: 'client-cli-config-template.toml',
},
{
src: `https://raw.githubusercontent.com/hyperledger/iroha/${IROHA_REV_DEV}/configs/peer/config.json`,
filename: 'peer-config.json',
src: `https://raw.githubusercontent.com/hyperledger/iroha/${IROHA_REV_DEV}/configs/peer.template.toml`,
filename: 'peer-config-template.toml',
},
{
src: `https://raw.githubusercontent.com/hyperledger/iroha/${IROHA_REV_DEV}/configs/peer/genesis.json`,
src: `https://raw.githubusercontent.com/hyperledger/iroha/${IROHA_REV_DEV}/configs/swarm/genesis.json`,
},
{
src: `https://raw.githubusercontent.com/hyperledger/iroha/${IROHA_REV_DEV}/client/examples/tutorial.rs`,
Expand Down
4 changes: 2 additions & 2 deletions src/guide/configure/client-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

Let's look at the client configuration options.

::: details Client configuration example
::: details Client configuration template

<<< @/snippets/client-cli-config.json
<<< @/snippets/client-cli-config-template.toml

:::

Expand Down
4 changes: 2 additions & 2 deletions src/guide/configure/peer-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ your blockchain operates.

Here's an example of how peer configuration file looks like:

::: details Peer configuration example
::: details Peer configuration template

<<< @/snippets/peer-config.json
<<< @/snippets/peer-config-template.toml

:::

Expand Down
4 changes: 2 additions & 2 deletions src/guide/configure/sample-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ Here you can find sample configuration files for Iroha 2:

::: code-group

<<< @/snippets/peer-config.json
<<< @/snippets/peer-config-template.toml

<<< @/snippets/genesis.json

<<< @/snippets/client-cli-config.json
<<< @/snippets/client-cli-config-template.toml

:::
44 changes: 27 additions & 17 deletions src/reference/torii-endpoints.md
Original file line number Diff line number Diff line change
Expand Up @@ -319,29 +319,39 @@ A `GET` request to the endpoint.

#### Requests

This endpoint expects the following data:
This endpoint expects requests with two shapes:

Start a query:

- **Body**: [`SignedQuery`](/reference/data-model-schema#signedquery)

OR

Get the next batch of a previously started query:

- **Parameters**:
- `cursor` - specifies a cursor previously returned as part of query response

- **Body**: [`VersionedSignedQuery`](/reference/data-model-schema#versionedsignedquery)
- **Parameters** (optional):
- `start` — Specifies the `id` of a starting entry. A successful response will contain all entries newer than and including the `id` specified.\
- `limit` — Specifies the exact number of retrieved `id` entries.\
- `sort_by_metadata_key` — Specifies the metadata key of the `id` entries that will be returned.\
- `fetch_size` — Specifies the maximum number of results that a response can contain.
Request

#### Responses

| Code | Response | Body |
| :--: | ---------------- | ------------------------------------------------------------------------------------------------ |
| 200 | Success | [`VersionedBatchedResponse<Value>`](/reference/data-model-schema#versionedbatchedresponse-value) |
| 400 | Conversion Error | [`QueryExecutionFail::Conversion(String)`](/reference/data-model-schema#queryexecutionfail) |
| 400 | Evaluate Error | [`QueryExecutionFail::Evaluate(String)`](/reference/data-model-schema#queryexecutionfail) |
| 401 | Signature Error | [`QueryExecutionFail::Signature(String)`](/reference/data-model-schema#queryexecutionfail) |
| 403 | Permission Error | [`QueryExecutionFail::Permission(String)`](/reference/data-model-schema#queryexecutionfail) |
| 404 | Find Error | [`QueryExecutionFail::Find(FindError)`](/reference/data-model-schema#queryexecutionfail) |
| Code | Response | Body | Description |
|:----:|---------------------------------|----------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------|
| 200 | Success | [`BatchedResponse<QueryOutputBox>`](/reference/data-model-schema#batchedresponse-queryoutputbox) | Successful query request |
| 400 | Conversion Error | [`QueryExecutionFail::Conversion(String)`](/reference/data-model-schema#queryexecutionfail) | Invalid asset query for the actual asset type |
| 400 | Cursor Error | [`QueryExecutionFail::UnknownCursor`](/reference/data-model-schema#queryexecutionfail) | An invalid cursor was provided in the batch request |
| 400 | FetchSizeTooBig Error | [`QueryExecutionFail::FetchSizeTooBig`](/reference/data-model-schema#queryexecutionfail) | Fetch size specified in the query request is too large |
| 400 | InvalidSingularParameters Error | [`QueryExecutionFail::InvalidSingularParameters`](/reference/data-model-schema#queryexecutionfail) | Specified query parameters are not applicable to the (singular) query type |
| 401 | Signature Error | [`QueryExecutionFail::Signature(String)`](/reference/data-model-schema#queryexecutionfail) | The signature on the query is incorrect |
| 403 | Permission Error | [`QueryExecutionFail::Permission(String)`](/reference/data-model-schema#queryexecutionfail) | The user does not have permission to execute this query |
| 404 | Find Error | [`QueryExecutionFail::Find(FindError)`](/reference/data-model-schema#queryexecutionfail) | The queried object was not found |

::: info

The `200 Success` response returns results that are ordered by `id`, which use Rust's [PartialOrd](https://doc.rust-lang.org/std/cmp/trait.PartialOrd.html) and [Ord](https://doc.rust-lang.org/std/cmp/trait.Ord.html) traits.
The `200 Success` response returns results that are ordered by `id`, which use
Rust's [PartialOrd](https://doc.rust-lang.org/std/cmp/trait.PartialOrd.html)
and [Ord](https://doc.rust-lang.org/std/cmp/trait.Ord.html) traits.

:::

Expand Down Expand Up @@ -542,7 +552,7 @@ It is also possible to retrieve the data of a specific `struct` group or variabl

This endpoint expects the following data:

- **Body**: [`VersionedSignedTransaction`](/reference/data-model-schema#versionedsignedtransaction)
- **Body**: [`SignedTransaction`](/reference/data-model-schema#signedtransaction)

#### Responses

Expand Down
Loading