diff --git a/docs/use-generic-contracts.mdx b/docs/use-generic-contracts.mdx index 945deef3..f74e7028 100644 --- a/docs/use-generic-contracts.mdx +++ b/docs/use-generic-contracts.mdx @@ -131,7 +131,7 @@ You should get the following hash value: You can put the hash value by running the following command: ```console -scalardl execute-contract --properties client.properties \ +client/bin/scalardl execute-contract --properties client.properties \ --contract-id object.Put \ --contract-argument '{"object_id": "a.txt", "hash_value": "5c7440fb2273a247f78aadefbc511c680a84e7d44004abfaedef2b145151dab0", "metadata": {"note": "created"}}' ``` @@ -154,7 +154,7 @@ b97a42c87a46ffebe1439f8c1cd2f86e2f9b84dad89c8e9ebb257a19b6fdfe1c a.txt You can then update the hash value as follows: ```console -scalardl execute-contract --properties client.properties \ +client/bin/scalardl execute-contract --properties client.properties \ --contract-id object.Put \ --contract-argument '{"object_id": "a.txt", "hash_value": "b97a42c87a46ffebe1439f8c1cd2f86e2f9b84dad89c8e9ebb257a19b6fdfe1c", "metadata": {"note": "updated"}}' ``` @@ -162,7 +162,7 @@ scalardl execute-contract --properties client.properties \ You can also get the latest status of the object with the [`object.Get` contract](generic-contracts-reference.mdx#objectget-contract) by running the following command: ```console -scalardl execute-contract --properties client.properties \ +client/bin/scalardl execute-contract --properties client.properties \ --contract-id object.Get \ --contract-argument '{"object_id": "a.txt"}' ``` @@ -191,7 +191,7 @@ If you cannot get an older version in your file system, you can specify the hash ::: ```console -scalardl execute-contract --properties client.properties \ +client/bin/scalardl execute-contract --properties client.properties \ --contract-id object.Validate \ --contract-argument \ '{"object_id": "a.txt", "versions": [{"version_id": "v2", "hash_value": "b97a42c87a46ffebe1439f8c1cd2f86e2f9b84dad89c8e9ebb257a19b6fdfe1c"}, {"version_id": "v1", "hash_value": "5c7440fb2273a247f78aadefbc511c680a84e7d44004abfaedef2b145151dab0"}]}' @@ -217,7 +217,7 @@ Alice updated this file Now the hash value of the latest version is `1f75d715648a3b4b3a33ecd7428a3e7139d9357da7d38735c23bf38618ecf9c7`. You can execute validation by running the following command: ```console -scalardl execute-contract --properties client.properties \ +client/bin/scalardl execute-contract --properties client.properties \ --contract-id object.Validate \ --contract-argument \ '{"object_id": "a.txt", "versions": [{"version_id": "v2", "hash_value": "1f75d715648a3b4b3a33ecd7428a3e7139d9357da7d38735c23bf38618ecf9c7"}, {"version_id": "v1", "hash_value": "5c7440fb2273a247f78aadefbc511c680a84e7d44004abfaedef2b145151dab0"}]}' @@ -248,7 +248,7 @@ Think about a situation where you would like to store hash values of updated obj The third step above can be done in an ACID manner by executing the following command for the [`object.Put` contract](generic-contracts-reference.mdx#objectput-contract) with the [`object.PutToMutableDatabase` function](generic-contracts-reference.mdx#objectputtomutabledatabase-function): ```console -scalardl execute-contract --properties client.properties \ +client/bin/scalardl execute-contract --properties client.properties \ --contract-id object.Put \ --contract-argument '{"object_id": "a.txt", "hash_value": "5c7440fb2273a247f78aadefbc511c680a84e7d44004abfaedef2b145151dab0"}' \ --function-id object.PutToMutableDatabase \ @@ -283,7 +283,7 @@ As an example of collection authenticity management, think about managing an aud To create a collection for an audit set, use the [`collection.Create` contract](generic-contracts-reference.mdx#collectioncreate-contract) by running the following command: ```console -scalardl execute-contract --properties client.properties \ +client/bin/scalardl execute-contract --properties client.properties \ --contract-id collection.Create \ --contract-argument '{"collection_id":"audit_set", "object_ids": ["a.txt", "b.txt"]}' ``` @@ -293,10 +293,12 @@ The collection ID must be a unique ID that identifies the collection. You can sp You can also add and remove objects to or from the collection by using the [`collection.Add` contract](generic-contracts-reference.mdx#collectionadd-contract) and the [`collection.Remove` contract](generic-contracts-reference.mdx#collectionremove-contract). To do this, run the following commands: ```console -scalardl execute-contract --properties client.properties \ +client/bin/scalardl execute-contract --properties client.properties \ --contract-id collection.Add \ --contract-argument '{"collection_id":"audit_set", "object_ids": ["c.txt", "d.txt"]}' -scalardl execute-contract --properties client.properties \ +``` +```console +client/bin/scalardl execute-contract --properties client.properties \ --contract-id collection.Remove \ --contract-argument '{"collection_id":"audit_set", "object_ids": ["a.txt"]}' ``` @@ -304,7 +306,7 @@ scalardl execute-contract --properties client.properties \ You can get the latest status of the collection by using the [`collection.Get` contract](generic-contracts-reference.mdx#collectionget-contract). To do this, run the following command: ```console -scalardl execute-contract --properties client.properties \ +client/bin/scalardl execute-contract --properties client.properties \ --contract-id collection.Get \ --contract-argument '{"collection_id":"audit_set"}' ``` @@ -319,7 +321,7 @@ Contract result: To confirm that the audit set has not been changed unexpectedly, you can check the update history of the audit set by using the [`collection.GetHistory` contract](generic-contracts-reference.mdx#collectiongethistory-contract). To do this, run the following command: ```console -scalardl execute-contract --properties client.properties \ +client/bin/scalardl execute-contract --properties client.properties \ --contract-id collection.GetHistory \ --contract-argument '{"collection_id":"audit_set"}' ```