Skip to content

Commit

Permalink
AUTO: Sync ScalarDL docs in Japanese to docs site repo (#508)
Browse files Browse the repository at this point in the history
Co-authored-by: josh-wong <[email protected]>
  • Loading branch information
github-actions[bot] and josh-wong committed Sep 19, 2024
1 parent f66d7fc commit baa28c9
Showing 1 changed file with 46 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,17 @@ import TranslationBanner from '/src/components/_translation-ja-jp.mdx';

![architecture](./docs/img/architecture.jpg)

## このサンプルアプリケーションの前提条件

- [Eclipse Temurin](https://adoptium.net/temurin/releases/) の OpenJDK LTS バージョン (8, 11, 17, or 21)

:::note

- 上記の LTS バージョンの使用をお勧めしますが、他の非 LTS バージョンでも動作する可能性があります。
- また、他の JDK もこのサンプル アプリケーションで動作するはずですが、テストは行っていません。

:::

## アプリケーションを試してみる

[ScalarDL Client SDK](https://github.com/scalar-labs/scalardl-client-sdk)をダウンロードします。 ScalarDL が実行されていることを確認し、必要なコントラクトをすべて実行して登録します。
Expand Down Expand Up @@ -166,7 +177,7 @@ ${SCALAR_SDK_HOME}/client/bin/scalardl register-contracts --properties ../conf/c

### コントラクトの実行

必要に応じて、登録されているコントラクトを実行できるようになります。 たとえば、登録コントラクトを使用していくつかの口座を作成し、そのうちの 1 つの口座に資金を入金し、これらの資金の一部をもう一方の口座に転送します
必要に応じて、登録されているコントラクトを実行できるようになります。 たとえば、登録コントラクトを使用していくつかの口座を作成し、そのうちの 1 つの口座に資金を入金し、これらの資金の一部をもう一方の口座に転送して、口座履歴を確認します

ID が `a111``b222` の 2 つのアカウントを作成します。 (コントラクト ID には任意の文字列を指定できます。)

Expand All @@ -187,6 +198,40 @@ ${SCALAR_SDK_HOME}/client/bin/scalardl execute-contract --properties ../conf/cli
${SCALAR_SDK_HOME}/client/bin/scalardl execute-contract --properties ../conf/client.properties --contract-id transfer --contract-argument '{"from": "a111", "to": "b222", "amount": 100}'
```

`a111` の残高履歴は次のようにして確認できます。

```console
${SCALAR_SDK_HOME}/client/bin/scalardl execute-contract --properties ../conf/client.properties --contract-id account-history --contract-argument '{"id": "a111"}'
```

次のような結果が表示されます:

```console
Contract result:
{
"status" : "succeeded",
"history" : [ {
"id" : "a111",
"age" : 2,
"data" : {
"balance" : 0
}
}, {
"id" : "a111",
"age" : 1,
"data" : {
"balance" : 100
}
}, {
"id" : "a111",
"age" : 0,
"data" : {
"balance" : 0
}
} ]
}
```

アプリケーション自体を実行している場合は、[API エンドポイント](./docs/api_endpoints.mdx) を使用してこれらのコマンドを実行できます。

## 顧客サービス
Expand Down

0 comments on commit baa28c9

Please sign in to comment.