# Using the CLI
# Installing the TRST deamon
Download trstd from the main repo (opens new window) (when it is public) with wget https://github.com/trstlabs/Trustless-Hub.git and perform make deb to build a binary. Then install the binary with sudo apt install ./trst_VERSION_amd64.deb -y. Test if it is installed correctly by running trstd.
You can configure the RPC endpoint with trstd config node https://endpoint or start the chain locally by running the ./inittest.sh script.
# Local Triggers
Fees are denominated in utrst. Similar to other Cosmos chains, it is a 6-decimal denomination of TRST.
trstd tx autoibctx submit-auto-tx takes one argument, a JSON-encoded Cosmos message. @type can be retreived from the destination chain's /proto directory.
For parsing a message to automate with the CLI, use snake case. fromAddress will be from_address.
the Cosmos message type should be a registered type on Trustless Hub
This "type url" is based of the proto package name, in this example it is cosmos.bank.v1beta1 and the name of the message is MsgSend. TRST Labs has registerd types of CosmWasm types and the Osmosis types. Any message should be registered before it can be encoded correctly on Trustless Hub.
--duration and --interval flags must contain either s,mor h, which stand for seconds, minutes and hours. It can be a combination of all of these. Like so: 48h30m30s.
--start_at can be specified to create a custom start time for the first execution. It is in nanoseconds since UNIX epoch such as 1678199141.
When an AutoTx should execute once, duration will be the time between now and the execution time.
If the AutoTx is recurring, duration will be the time execution will be unavailable.
# With Interchain Accounts
Message flow is similar to the above. A connection_id should be specified. You can find all available connections with trstd q ibc connection connections.
# What is a connection and how does it differ from a channel?
A connection is the direct link between two chains, while a channel is a specific path within that connection that enables communication between two specific modules on different chains. Using a connection, multiple channels can be created. Both connections and channels are usually different for on source chain and on the destination chain.
Channels have ports such as icacontroller-trust1... or transfer. By using a connection, Trustless Hub creates an IBC port ID for your address and the destination chain.
This source port is denoted as icacontroller-trust1.... For an Interchain Account host, the destination port is host.
A connection is needed to create the channels and ports.
# Register and Submit AutoTx
When you submit an AutoTx for the first time using interchain Accounts, you should perfrom register-ica-and-submit-auto-tx instead of submit-auto-tx.
Alternatively you can trstd tx autoibctx register and specify the --connection-id flag.
You can submit an AutoTx with the following command:
use ICA_ADDR as a `from_address` or any other field in an AutoTX and Trustless Hub will parse the to-be defined Interchain Account Address.
You can get the Interchain Account address with the following command:
to get more info you can query the events related to the packet for packet and message info `trstd q interchain-accounts host packet-events channel-0 1 --node tcp://localhost:36657`
# With AuthZ
Message flow is similar to interchain acccounts. For using AuthZ, it is required to create a grant on the host chain. In the messages below, the grantee is the interchain account address.
For this we use another local Trustless Hub chain. On a host chain you can create a grant with a command like the following:
Hereafter, on Trustless Hub you can execute the message with the ICA as the grantee and the Msgs array in the MsgExec should include the --msg-type from before.