% SCABBARD-EXEC(1) Cargill, Incorporated | Splinter Commands
scabbard-exec — Executes a Sabre smart contract.
scabbard exec [FLAGS] [OPTIONS]
This command executes a smart contract on the targeted scabbard service. The name and version of the contract must be provided, and they must match a registered smart contract in the targeted scabbard service. A payload file provides the data for the smart contract execution, and one or more input/output addresses must be specified for the transaction.
- Prints help information.
- Prints version information
- Increases verbosity. Specify multiple times for more output.
- Specifies the smart contract to execute, using the format
NAME:VERSION. The given name and version must exactly match a smart contract that has been uploaded and registered in the scabbard service’s state. This option is required.
- Specifies an input address for the execution of the smart contract. Inputs are state addresses that this transaction is allowed to read from; the smart contract must have read permissions for the namespace of each input. This option may be provided multiple times to specify multiple input addresses. One or more input addresses must be provided.
- Indicates the key file to use for signing scabbard transactions. The
FILEcan be a relative or absolute file path, or it can be the name of a .priv file in the
$HOME/.splinter/keysdirectory. The target file must contain a valid secp256k1 private key. This option is required.
- Specifies an output address for the execution of the smart contract. Outputs are state addresses that this transaction is allowed to write to; the smart contract must have write permissions for the namespace of each output. This option may be provided multiple times to specify multiple output addresses. One or more output addresses must be provided.
- Provides the payload in the file to the smart contract for execution. This option is required.
- Specifies the fully-qualified service ID of the targeted scabbard service,
using the format
CIRCUIT_ID::SERVICE_ID. This option is required.
- Specifies the URL for the
splinterdREST API that is running the targeted scabbard service. (default
http://localhost:8080) This option is required.
- If provided, waits the given number of seconds for the batch to commit. Displays an error message if the batch does not commit in time.
The following command executes version
0.1.0 of the
xo smart contract in a
scabbard service on circuit
01234-ABCDE with service ID
abcd, running on the
node with the REST API endpoint
http://localhost:8088. The transaction will be
signed with the key located in the file
~/user.priv. Three addresses are
provided as both inputs and outputs, and the payload file at
will be used.
$ scabbard exec \ --url http://localhost:8088 \ --service-id 01234-ABCDE::abcd \ --key ~/user.priv \ --contract xo:0.1.0 \ --inputs 00ec03 \ --inputs cad11d \ --inputs 5b7349 \ --outputs 00ec03 \ --outputs cad11d \ --outputs 5b7349 \ --payload ~/xo-payload-1
The next command executes version
0.1.2 of the
intkey_multiply contract in
the same scabbard service, but specifies a key in the
directory by name. It also waits up to 10 seconds for the contract execution
batch to commit.
$ scabbard exec \ --url http://localhost:8088 \ --service-id 01234-ABCDE::abcd \ --key user \ --wait 10 \ --contract intkey_multiply:0.1.2 \ --inputs abcdef \ --outputs abcdef \ --payload ~/intkey-multiply-payload-1
| Splinter documentation: https://www.splinter.dev/docs/0.6/