ScalarDL Client Command Reference
This page introduces scalardl
, which is a client command for interacting with ScalarDL components.
Overview of commands​
- Register identity information
register-cert
: Register a specified certificate.register-secret
: Register a specified secret.
- Register business logic
register-contract
: Register a specified contract.register-contracts
: Register specified contracts.register-function
: Register a specified function.register-functions
: Register specified functions.
- Execute and list the registered business logic
execute-contract
: Execute a specified contract.list-contracts
: List registered contracts.
- Validate a ledger
validate-ledger
: Validate a specified asset in a ledger.
register-cert
​
Register a specified certificate.
Options​
Option | Description |
---|---|
--config , --properties | A 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​
Option | Description |
---|---|
--config , --properties | A 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​
Option | Description |
---|---|
--config , --properties | A configuration file in properties format. |
--contract-binary-name | A binary name of a contract to register. |
--contract-class-file | A contract class file to register. |
--contract-id | An ID of a contract to register. |
--contract-properties | Contract properties in a serialized format. |
--deserialization-format | A 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​
Option | Description |
---|---|
--config , --properties | A configuration file in properties format. |
--contracts-file | A 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​
Option | Description |
---|---|
--config , --properties | A configuration file in properties format. |
--function-binary-name | A binary name of a function to register. |
--function-class-file | A function class file to register. |
--function-id | An 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​
Option | Description |
---|---|
--config , --properties | A configuration file in properties format. |
--functions-file | A 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​
Option | Description |
---|---|
--config , --properties | A configuration file in properties format. |
--contract-argument | An argument for a contract to execute in a serialized format. |
--contract-id | An ID of a contract to execute. |
--deserialization-format | A deserialization format for contract and function arguments. Valid values: JSON or STRING (default: JSON) |
--function-id | An 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​
Option | Description |
---|---|
--config , --properties | A configuration file in properties format. |
--contract-id | The 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​
Option | Description |
---|---|
--config , --properties | A configuration file in properties format. |
--asset-id | The 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.
Option | Description |
---|---|
-g , --use-gateway | A flag to use the gateway. |
-h , --help | Display the help message of a command. |
--stacktrace | Output Java Stack Trace to stderr stream. |