Skip to main content
Version: 3.12

ScalarDL HashStore Command Reference

This page introduces scalardl-hashstore, which is a client command for interacting with ScalarDL HashStore.

Overview of commands​

bootstrap​

Bootstrap by registering identity and predefined contracts required to use HashStore.

Options​

OptionDescription
--config, --propertiesA configuration file in the .properties format.

Common utility options are also available.

Examples​

scalardl-hashstore bootstrap --properties client.properties

get-object​

Get an object from HashStore.

Options​

OptionDescription
--config, --propertiesA configuration file in the .properties format.
--object-idThe ID of the object to retrieve.

Common utility options are also available.

Examples​

scalardl-hashstore get-object --properties client.properties --object-id foo

put-object​

Put an object to HashStore.

Options​

OptionDescription
--config, --propertiesA configuration file in the .properties format.
--object-idThe ID of the object to store.
--hashThe hash value of the object.
--metadataOptional metadata as a JSON string.
--put-to-mutableOptional Put operation for a mutable database as a JSON string.

Common utility options are also available.

Examples​

Put an object with a hash value.

scalardl-hashstore put-object --properties client.properties --object-id foo --hash b97a42c87a46ffebe1439f8c1cd2f86e2f9b84dad89c8e9ebb257a19b6fdfe1c

Put an object with metadata.

scalardl-hashstore put-object --properties client.properties --object-id foo --hash b97a42c87a46ffebe1439f8c1cd2f86e2f9b84dad89c8e9ebb257a19b6fdfe1c --metadata '{"note": "updated"}'

compare-object-versions​

Compare object versions.

Options​

OptionDescription
--config, --propertiesA configuration file in the .properties format.
--object-idThe ID of the object to compare versions.
--versionsObject versions to compare as a JSON array.
--allCompare all versions including stored versions in the ledger.
--verboseShow detailed validation information.

Common utility options are also available.

Examples​

Compare the latest versions specified in the arguments.

scalardl-hashstore compare-object-versions --properties client.properties --object-id foo --versions '[{"version_id": "v1", "hash_value": "hash1"}, {"version_id": "v2", "hash_value": "hash2", "metadata": {"note": "updated"}}]'

Compare all versions stored in HashStore.

scalardl-hashstore compare-object-versions --properties client.properties --object-id foo --versions '[{"version_id": "v1", "hash_value": "hash1"}, {"version_id": "v2", "hash_value": "hash2", "metadata": {"note": "updated"}}]' --all

Compare with the verbose output.

scalardl-hashstore compare-object-versions --properties client.properties --object-id foo --versions '[{"version_id": "v1", "hash_value": "hash1"}]' --verbose

create-collection​

Create a new collection.

Options​

OptionDescription
--config, --propertiesA configuration file in the .properties format.
--collection-idThe ID of the collection to create.
--object-idsObject IDs to include in the collection.

Common utility options are also available.

Examples​

Create an empty collection.

scalardl-hashstore create-collection --properties client.properties --collection-id audit_set

Create a collection with initial objects.

scalardl-hashstore create-collection --properties client.properties --collection-id audit_set --object-ids object1 --object-ids object2

get-collection​

Get a collection from HashStore.

Options​

OptionDescription
--config, --propertiesA configuration file in the .properties format.
--collection-idThe ID of the collection to retrieve.

Common utility options are also available.

Examples​

scalardl-hashstore get-collection --properties client.properties --collection-id audit_set

add-to-collection​

Add objects to a collection.

Options​

OptionDescription
--config, --propertiesA configuration file in the .properties format.
--collection-idThe ID of the collection.
--object-idsObject IDs to add to the collection.
--forceSkip validation for duplicate object IDs already in the collection.

Common utility options are also available.

Examples​

Add objects to a collection.

scalardl-hashstore add-to-collection --properties client.properties --collection-id audit_set --object-ids object3 --object-ids object4

Add an object with the force flag.

scalardl-hashstore add-to-collection --properties client.properties --collection-id audit_set --object-ids object3 --force

remove-from-collection​

Remove objects from a collection.

Options​

OptionDescription
--config, --propertiesA configuration file in the .properties format.
--collection-idThe ID of the collection.
--object-idsObject IDs to remove from the collection.
--forceSkip validation for object IDs that are not in the collection.

Common utility options are also available.

Examples​

Remove objects from a collection.

scalardl-hashstore remove-from-collection --properties client.properties --collection-id audit_set --object-ids object1 --object-ids object2

Remove an object with the force flag.

scalardl-hashstore remove-from-collection --properties client.properties --collection-id audit_set --object-ids object1 --force

get-collection-history​

Get the history of a collection.

Options​

OptionDescription
--config, --propertiesA configuration file in the .properties format.
--collection-idThe ID of the collection.
--limitMaximum number of recent history entries to return.

Common utility options are also available.

Examples​

Get all histories of a collection.

scalardl-hashstore get-collection-history --properties client.properties --collection-id audit_set

Get the limited history of a collection.

scalardl-hashstore get-collection-history --properties client.properties --collection-id audit_set --limit 10

validate-ledger​

Validate a specified object or collection in HashStore.

Options​

OptionDescription
--config, --propertiesA configuration file in the .properties format.
--object-idThe ID of the object to validate.
--collection-idThe ID of the collection to validate.
--start-ageThe start age for validation range.
--end-ageThe end age for validation range.

Common utility options are also available.

Examples​

Validate an object for all ages.

scalardl-hashstore validate-ledger --properties client.properties --object-id foo

Validate an object from age 0 to age 10 only.

scalardl-hashstore validate-ledger --properties client.properties --object-id foo --start-age 0 --end-age 10

Validate a collection for all ages.

scalardl-hashstore validate-ledger --properties client.properties --collection-id audit_set

Validate a collection from age 0 to age 5 only.

scalardl-hashstore validate-ledger --properties client.properties --collection-id audit_set --start-age 0 --end-age 5

Common utility options​

You can use the following options in all the commands above.

OptionDescription
-g, --use-gatewayA flag to use the gateway.
-h, --helpDisplay the help message of a command.
--stacktraceOutput the Java stack trace to the stderr stream.