Skip to main content
Version: 3.9

ScalarDL Client Command Reference

This page introduces scalardl, which is a client command for interacting with ScalarDL components.

Overview of commands

register-cert

Register a specified certificate.

Options

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

Common utility options are also available.

Examples

scalardl register-cert --properties client.properties

register-secret

Register a specified secret.

Options

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

Common utility options are also available.

Examples

scalardl register-secret --properties client.properties

register-contract

Register a specified contract.

Options

OptionDescription
--config, --propertiesA configuration file in properties format.
--contract-binary-nameA binary name of a contract to register.
--contract-class-fileA contract class file to register.
--contract-idAn ID of a contract to register.
--contract-propertiesContract properties in a serialized format.
--deserialization-formatA deserialization format for contract properties. Valid values: JSON or STRING (default: JSON)

Common utility options are also available.

Examples

scalardl register-contract --properties client.properties --contract-id StateUpdater --contract-binary-name com.org1.contract.StateUpdater --contract-class-file build/classes/java/main/com/org1/contract/StateUpdater.class

register-contracts

Register specified contracts.

Options

OptionDescription
--config, --propertiesA configuration file in properties format.
--contracts-fileA file that includes contracts to register in TOML format.

Common utility options are also available.

Examples

scalardl register-contracts --properties client.properties --contracts-file /path/to/contracts-file

An example of the contracts file is as follows.

[[contracts]]
contract-id = "StateUpdater"
contract-binary-name = "com.org1.contract.StateUpdater"
contract-class-file = "build/classes/java/main/com/org1/contract/StateUpdater.class"

[[contracts]]
contract-id = "StateReader"
contract-binary-name = "com.org1.contract.StateReader"
contract-class-file = "build/classes/java/main/com/org1/contract/StateReader.class"

register-function

Register a specified function.

Options

OptionDescription
--config, --propertiesA configuration file in properties format.
--function-binary-nameA binary name of a function to register.
--function-class-fileA function class file to register.
--function-idAn ID of a function to register.

Common utility options are also available.

Examples

scalardl register-function --properties client.properties --function-id test-function --function-binary-name com.example.function.TestFunction --function-class-file /path/to/TestFunction.class

register-functions

Register specified functions.

Options

OptionDescription
--config, --propertiesA configuration file in properties format.
--functions-fileA file that includes functions to register in TOML format.

Common utility options are also available.

Examples

scalardl register-functions --properties client.properties --functions-file /path/to/functions-file

An example of the functions file is as follows.

[[functions]]
function-id = "TestFunction1"
function-binary-name = "com.org1.function.TestFunction1"
function-class-file = "build/classes/java/main/com/org1/function/TestFunction1.class"

[[functions]]
function-id = "TestFunction2"
function-binary-name = "com.org1.function.TestFunction2"
function-class-file = "build/classes/java/main/com/org1/function/TestFunction2.class"

execute-contract

Execute a specified contract.

Options

OptionDescription
--config, --propertiesA configuration file in properties format.
--contract-argumentAn argument for a contract to execute in a serialized format.
--contract-idAn ID of a contract to execute.
--deserialization-formatA deserialization format for contract and function arguments. Valid values: JSON or STRING (default: JSON)
--function-idAn ID of a function to execute.

Common utility options are also available.

Examples

Execute a contract without a function.

scalardl execute-contract --properties client.properties --contract-id StateUpdater --contract-argument '{"asset_id":"some_asset", "state":3}'

Execute a contract with a function.

scalardl execute-contract --properties client.properties --contract-id TestContract --contract-argument '{...}' --function-id TestFunction --function-argument '{...}'

list-contracts

List registered contracts.

Options

OptionDescription
--config, --propertiesA configuration file in properties format.
--contract-idThe ID of a contract to show.

Common utility options are also available.

Examples

List all contracts registered by the specified entity.

scalardl list-contracts --properties client.properties

Show a specified contract only.

scalardl list-contracts --properties client.properties --contract-id StateUpdater

validate-ledger

Validate a specified asset in a ledger.

Options

OptionDescription
--config, --propertiesA configuration file in properties format.
--asset-idThe ID of an asset or the ID and the ages of an asset. Format: 'ASSET_ID', the ID of an asset to validate, or 'ASSET_ID,START_AGE,END_AGE', the ID and the ages of an asset to validate.

Common utility options are also available.

Examples

Validate an asset for all ages.

scalardl validate-ledger --properties client.properties --asset-id 'some_asset'

Validate an asset from age 0 to age 10 only.

scalardl validate-ledger --properties client.properties --asset-id 'some_asset,0,10'

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 Java Stack Trace to stderr stream.