Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ VERSION=$(grep SCALARDL_VERSION .env | awk -F= '{print $2}')
```console
curl -OL https://github.com/scalar-labs/scalardl/releases/download/v$VERSION/scalardl-hashstore-java-client-sdk-$VERSION.zip
unzip scalardl-hashstore-java-client-sdk-$VERSION.zip
mv scalardl-hashstore-java-client-sdk-$VERSION client
mv scalardl-hashstore-java-client-sdk-$VERSION hashstore
```

## クライアントプロパティの設定
Expand Down Expand Up @@ -76,7 +76,7 @@ EOF
次に、以下のコマンドを実行して HashStore をブートストラップできます:

```console
client/bin/scalardl-hashstore bootstrap --properties client.properties
hashstore/bin/scalardl-hashstore bootstrap --properties client.properties
```

ブートストラップコマンドは、内部的にアイデンティティ情報 (証明書またはシークレット) と HashStore を使用するために必要な事前定義されたコントラクトを登録します。
Expand Down Expand Up @@ -107,7 +107,7 @@ sha256sum a.txt
以下のコマンドを実行して、ハッシュ値を格納できます:

```console
client/bin/scalardl-hashstore put-object --properties client.properties \
hashstore/bin/scalardl-hashstore put-object --properties client.properties \
--object-id a.txt \
--hash 5c7440fb2273a247f78aadefbc511c680a84e7d44004abfaedef2b145151dab0 \
--metadata '{"note": "created"}'
Expand All @@ -129,7 +129,7 @@ b97a42c87a46ffebe1439f8c1cd2f86e2f9b84dad89c8e9ebb257a19b6fdfe1c a.txt
次に、以下のようにハッシュ値を更新できます:

```console
client/bin/scalardl-hashstore put-object --properties client.properties \
hashstore/bin/scalardl-hashstore put-object --properties client.properties \
--object-id a.txt \
--hash b97a42c87a46ffebe1439f8c1cd2f86e2f9b84dad89c8e9ebb257a19b6fdfe1c \
--metadata '{"note": "updated"}'
Expand All @@ -138,7 +138,7 @@ client/bin/scalardl-hashstore put-object --properties client.properties \
以下のコマンドを実行して、オブジェクトの最新ステータスを取得することもできます:

```console
client/bin/scalardl-hashstore get-object --properties client.properties \
hashstore/bin/scalardl-hashstore get-object --properties client.properties \
--object-id a.txt
```

Expand Down Expand Up @@ -166,7 +166,7 @@ Result:
:::

```console
client/bin/scalardl-hashstore compare-object-versions --properties client.properties \
hashstore/bin/scalardl-hashstore compare-object-versions --properties client.properties \
--object-id a.txt \
--versions '[{"version_id": "v2", "hash_value": "b97a42c87a46ffebe1439f8c1cd2f86e2f9b84dad89c8e9ebb257a19b6fdfe1c"}, {"version_id": "v1", "hash_value": "5c7440fb2273a247f78aadefbc511c680a84e7d44004abfaedef2b145151dab0"}]}'
```
Expand All @@ -192,7 +192,7 @@ Alice updated this file
最新バージョンのハッシュ値は `1f75d715648a3b4b3a33ecd7428a3e7139d9357da7d38735c23bf38618ecf9c7` になります。以下のコマンドを実行して検証を実行できます:

```console
client/bin/scalardl-hashstore compare-object-versions --properties client.properties \
hashstore/bin/scalardl-hashstore compare-object-versions --properties client.properties \
--object-id a.txt \
--versions '[{"version_id": "v2", "hash_value": "1f75d715648a3b4b3a33ecd7428a3e7139d9357da7d38735c23bf38618ecf9c7"}, {"version_id": "v1", "hash_value": "5c7440fb2273a247f78aadefbc511c680a84e7d44004abfaedef2b145151dab0"}]}'
```
Expand Down Expand Up @@ -223,7 +223,7 @@ ScalarDL はデータ (「アセット」と呼ばれる) を改ざん検知可
上記の3番目の手順は、`--put-to-mutable` オプションを使用して以下のコマンドを実行することで ACID 方式で実行する必要があります:

```console
client/bin/scalardl-hashstore put-object --properties client.properties \
hashstore/bin/scalardl-hashstore put-object --properties client.properties \
--object-id a.txt \
--hash 5c7440fb2273a247f78aadefbc511c680a84e7d44004abfaedef2b145151dab0 \
--put-to-mutable '{...}'
Expand Down Expand Up @@ -259,7 +259,7 @@ client/bin/scalardl-hashstore put-object --properties client.properties \
以下のコマンドを実行して、監査セット用のコレクションを作成できます:

```console
client/bin/scalardl-hashstore create-collection --properties client.properties \
hashstore/bin/scalardl-hashstore create-collection --properties client.properties \
--collection-id audit_set --object-ids a.txt --object-ids b.txt
```

Expand All @@ -268,21 +268,21 @@ client/bin/scalardl-hashstore create-collection --properties client.properties \
以下のコマンドを実行して、コレクションにオブジェクトを追加することもできます:

```console
client/bin/scalardl-hashstore add-to-collection --properties client.properties \
hashstore/bin/scalardl-hashstore add-to-collection --properties client.properties \
--collection-id audit_set --object-ids c.txt --object-ids d.txt
```

また、以下のコマンドを実行して、コレクションからオブジェクトを削除できます:

```console
client/bin/scalardl-hashstore remove-from-collection --properties client.properties \
hashstore/bin/scalardl-hashstore remove-from-collection --properties client.properties \
--collection-id audit_set --object-ids a.txt
```

以下のコマンドを実行して、コレクションの最新ステータスを取得できます:

```console
client/bin/scalardl-hashstore get-collection --properties client.properties \
hashstore/bin/scalardl-hashstore get-collection --properties client.properties \
--collection-id audit_set
```

Expand All @@ -296,7 +296,7 @@ Result:
監査セットが予期せず変更されていないことを確認するには、以下のコマンドを実行して監査セットの更新履歴を確認できます:

```console
client/bin/scalardl-hashstore get-collection-history --properties client.properties \
hashstore/bin/scalardl-hashstore get-collection-history --properties client.properties \
--collection-id audit_set
```

Expand Down Expand Up @@ -329,7 +329,7 @@ ScalarDL では、すべてのデータが有効な状態にあることを確
以下のコマンドを実行して、オブジェクトを検証できます:

```console
client/bin/scalardl-hashstore validate-ledger --properties client.properties \
hashstore/bin/scalardl-hashstore validate-ledger --properties client.properties \
--object-id a.txt
```

Expand All @@ -352,7 +352,7 @@ client/bin/scalardl-hashstore validate-ledger --properties client.properties \
以下のコマンドを実行して、コレクションを検証できます:

```console
client/bin/scalardl-hashstore validate-ledger --properties client.properties \
hashstore/bin/scalardl-hashstore validate-ledger --properties client.properties \
--collection-id audit_set
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ VERSION=$(grep SCALARDL_VERSION .env | awk -F= '{print $2}')
```console
curl -OL https://github.com/scalar-labs/scalardl/releases/download/v$VERSION/scalardl-tablestore-java-client-sdk-$VERSION.zip
unzip scalardl-tablestore-java-client-sdk-$VERSION.zip
mv scalardl-tablestore-java-client-sdk-$VERSION client
mv scalardl-tablestore-java-client-sdk-$VERSION tablestore
```

## クライアントプロパティの設定
Expand Down Expand Up @@ -74,7 +74,7 @@ EOF
次に、以下のコマンドを実行して TableStore をブートストラップできます:

```console
client/bin/scalardl-tablestore bootstrap --properties client.properties
tablestore/bin/scalardl-tablestore bootstrap --properties client.properties
```

ブートストラップコマンドは、内部的にアイデンティティ情報 (証明書またはシークレット) と TableStore を使用するために必要な事前定義されたコントラクトを登録します。
Expand All @@ -94,11 +94,11 @@ client/bin/scalardl-tablestore bootstrap --properties client.properties
以下のコマンドを実行して、サンプルテーブルを作成できます:

```console
client/bin/scalardl-tablestore execute-statement --properties client.properties \
tablestore/bin/scalardl-tablestore execute-statement --properties client.properties \
--statement "CREATE TABLE employee (id STRING PRIMARY KEY, department STRING)"
```
```console
client/bin/scalardl-tablestore execute-statement --properties client.properties \
tablestore/bin/scalardl-tablestore execute-statement --properties client.properties \
--statement "CREATE TABLE department (id STRING PRIMARY KEY)"
```

Expand All @@ -107,7 +107,7 @@ client/bin/scalardl-tablestore execute-statement --properties client.properties
以下のコマンドを実行して、作成されたテーブルを表示できます:

```console
client/bin/scalardl-tablestore execute-statement --properties client.properties \
tablestore/bin/scalardl-tablestore execute-statement --properties client.properties \
--statement "SELECT * FROM information_schema.tables"
```

Expand Down Expand Up @@ -136,26 +136,26 @@ Result:
次に、以下のコマンドを実行して、複数の `employee` レコードを挿入します:

```console
client/bin/scalardl-tablestore execute-statement --properties client.properties \
tablestore/bin/scalardl-tablestore execute-statement --properties client.properties \
--statement "INSERT INTO employee VALUES {'id': '1001', 'name': 'Alice', 'department': 'sales', 'salary': 654.3}"
```
```console
client/bin/scalardl-tablestore execute-statement --properties client.properties \
tablestore/bin/scalardl-tablestore execute-statement --properties client.properties \
--statement "INSERT INTO employee VALUES {'id': '1002', 'name': 'Bob', 'department': 'sales', 'salary': 543.2}"
```
```console
client/bin/scalardl-tablestore execute-statement --properties client.properties \
tablestore/bin/scalardl-tablestore execute-statement --properties client.properties \
--statement "INSERT INTO employee VALUES {'id': '1003', 'name': 'Carol', 'department': 'engineering', 'salary': 654.3}"
```

また、以下のコマンドを実行して、対応する `department` レコードも挿入します:

```console
client/bin/scalardl-tablestore execute-statement --properties client.properties \
tablestore/bin/scalardl-tablestore execute-statement --properties client.properties \
--statement "INSERT INTO department VALUES {'id': 'sales', 'location': 'Shinjuku', 'phone': '000-1234'}"
```
```console
client/bin/scalardl-tablestore execute-statement --properties client.properties \
tablestore/bin/scalardl-tablestore execute-statement --properties client.properties \
--statement "INSERT INTO department VALUES {'id': 'engineering', 'location': 'Shibuya', 'phone': '000-4321'}"
```

Expand All @@ -164,7 +164,7 @@ client/bin/scalardl-tablestore execute-statement --properties client.properties
次に、挿入されたレコードを確認します。レコードを選択するには、少なくともプライマリキーまたはインデックスキーを指定する必要があります。例えば、以下のコマンドを実行して、プライマリキーを指定して `employee` レコードを取得できます:

```console
client/bin/scalardl-tablestore execute-statement --properties client.properties \
tablestore/bin/scalardl-tablestore execute-statement --properties client.properties \
--statement "SELECT id, name, department FROM employee WHERE id = '1001'"
```

Expand All @@ -182,7 +182,7 @@ Result:
以下のコマンドを実行して、インデックスキーを指定してレコードを選択することもできます:

```console
client/bin/scalardl-tablestore execute-statement --properties client.properties \
tablestore/bin/scalardl-tablestore execute-statement --properties client.properties \
--statement "SELECT id, name, department FROM employee WHERE department = 'sales'"
```

Expand All @@ -204,7 +204,7 @@ Result:
レコードをフィルタリングしたい場合は、以下のコマンドを実行して追加の条件を指定します:

```console
client/bin/scalardl-tablestore execute-statement --properties client.properties \
tablestore/bin/scalardl-tablestore execute-statement --properties client.properties \
--statement "SELECT id, name, department FROM employee WHERE department = 'sales' AND salary < 600"
```

Expand All @@ -223,7 +223,7 @@ Result:
以下のコマンドを実行して、2つのテーブルを結合することもできます:

```console
client/bin/scalardl-tablestore execute-statement --properties client.properties \
tablestore/bin/scalardl-tablestore execute-statement --properties client.properties \
--statement "SELECT * FROM employee JOIN department ON employee.department = department.id WHERE employee.department = 'engineering'"
```

Expand All @@ -247,7 +247,7 @@ Result:
以下のコマンドを実行して、`employee` レコードを更新できます:

```console
client/bin/scalardl-tablestore execute-statement --properties client.properties \
tablestore/bin/scalardl-tablestore execute-statement --properties client.properties \
--statement "UPDATE employee SET salary = 754.3 WHERE department = 'engineering'"
```

Expand All @@ -258,7 +258,7 @@ client/bin/scalardl-tablestore execute-statement --properties client.properties
以下のコマンドを実行して、レコードの更新履歴を取得できます:

```console
client/bin/scalardl-tablestore execute-statement --properties client.properties \
tablestore/bin/scalardl-tablestore execute-statement --properties client.properties \
--statement "SELECT history() FROM employee WHERE id = '1003'"
```

Expand Down Expand Up @@ -288,7 +288,7 @@ Result:
バージョン数 (age) を制限したい場合は、以下のコマンドを実行して `LIMIT` 句を指定します:

```console
client/bin/scalardl-tablestore execute-statement --properties client.properties \
tablestore/bin/scalardl-tablestore execute-statement --properties client.properties \
--statement "SELECT history() FROM employee WHERE id = '1003' LIMIT 1"
```

Expand All @@ -314,7 +314,7 @@ ScalarDL では、すべてのデータが有効な状態にあることを確
以下のコマンドを実行して、テーブルスキーマを検証できます:

```console
client/bin/scalardl-tablestore validate-ledger --properties client.properties \
tablestore/bin/scalardl-tablestore validate-ledger --properties client.properties \
--table-name employee
```

Expand All @@ -337,7 +337,7 @@ client/bin/scalardl-tablestore validate-ledger --properties client.properties \
以下のコマンドを実行して、レコードを検証できます:

```console
client/bin/scalardl-tablestore validate-ledger --properties client.properties \
tablestore/bin/scalardl-tablestore validate-ledger --properties client.properties \
--table-name employee --primary-key-column-name id --column-value '"1001"'
```

Expand Down Expand Up @@ -366,7 +366,7 @@ client/bin/scalardl-tablestore validate-ledger --properties client.properties \
以下のコマンドを実行して、インデックスレコードを検証できます:

```console
client/bin/scalardl-tablestore validate-ledger --properties client.properties \
tablestore/bin/scalardl-tablestore validate-ledger --properties client.properties \
--table-name employee --index-key-column-name department --column-value '"sales"'
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import DbSpecificSteps from '/src/components/ja-jp/_getting-started-auditor-db-s

<TranslationBanner />

このガイドでは、ScalarDL Ledger と Auditor を介して ScalarDL アプリケーションを実行する方法について説明します。このドキュメントでは、すでに [ScalarDL Ledger をはじめよう](getting-started.mdx)チュートリアルを試し、[Java で ScalarDL アプリケーションを書く](how-to-write-applications.mdx)ガイドを参考にして Client SDK を使用して ScalarDL を統合したアプリケーションを作成したことを前提としています。
このガイドでは、ScalarDL Ledger と Auditor を介して ScalarDL アプリケーションを実行する方法について説明します。このドキュメントでは、すでに[クイックスタート](quickstart-overview.mdx)チュートリアルのいずれかを試し、[アプリケーションを書く](develop-write-an-application-overview.mdx)ガイドを参考にしてクライアント SDK を使用して ScalarDL を統合したアプリケーションを作成したことを前提としています。

## ScalarDL Auditor とは何ですか?

Expand Down
Loading
Loading