A simple client CLI that uses the Construction API of Concordium Rosetta to perform a transfer transaction from one account to another. The transfer may optionally include a memo.
Its main purpose is to test the Rosetta implementation, but it also serves to demonstrate how Rosetta does transactions.
It's not meant to be used to do real transfers as there are other tools that are better suited for that
(e.g. concordium-client
).
The tool is specifically built to integrate with the Concordium Rosetta implementation;
implementations for other blockchains are not supported.
The main Concordium-specific parts are key handling and the signature index quirk
in the combine
endpoint.
The client is a simple Rust application, so all the usual cargo
commands apply.
The application has the following CLI parameters:
--url
: URL of the Rosetta server (default:http://localhost:8080
).--network
: Network name to be used in network identifier (default:testnet
).--sender-account-file
: Path of JSON file containing the address and keys for the sender account.--receiver
: Address of the account receiving the transfer.--amount
: Amount of CCD to transfer.--memo-hex
: Optional hex-encoded message to attach to the transfer transaction as a memo.--memo-string
: Optional string to attach to the transfer transaction as a memo. The string is encoded as CBOR.
The options --memo-hex
and --memo-string
are mutually exclusive.
The expected JSON format of the keys file is
{
"address": ...,
"accountKeys": {
"keys": {
<credential-index>: {
"keys": {
<key-index>: {
"signKey": ...,
"verifyKey": ...
},
...
},
"threshold": <key-threshold>
},
...
},
"threshold": <credential-threshold>
}
}
In the browser wallet, go to:
Account Settings -> Export private key -> Export
This will give you an unencrypted file that can be passed to the transfer-client
program with the --keys-file
flag.
This is only intended to be used for testing - keys holding actual value should always be stored securely.