Opening a Connection
For new chains or rollups, the first step to sending messages or transferring assets is opening a connection.
The connection codifies the security assumptions between Union and your chain and is updated using
consensus proofs. This should be done after having a Cometbls
light client configured.
Relaying
Voyager
is our relayer: an off-chain tool to submit packets and consensus proofs. Voyager can initiate the connection
during initial setup, as well as relaying packets and proofs once the connection is live. First, we need to download the binary:
On top of the relayer, a proving server is necessary to generate the ZKPs:
Finally, Voyager uses a Postgres instance to persist state. You can use an appropriate SaaS solution or a local installation.
Starting galoisd
We need to run galoisd
, our prover to be able to generate ZKPs. We recommend running Galois on a separate server with at least 32 GB of RAM and 8 physical cores.
Setting up Voyager
We recommend running Voyager on a machine co-located with your chain’s RPC nodes, to ensure low latency. Below is an example configuration file (minimal-config.json).
We now need to change the configuration parameters for our chain accordingly. voyager
needs an account with funds to send transactions.
You need to supply your private key to voyager
. Let’s first export it, then add it to the config.
The following command puts the private key in the config. Be aware that the key should be 0x
prefixed.
We also need to specify the $WS_URL
(websocket), $GRPC_URL
, and the denom $DENOM
for our network:
You should change the max_gas
, gas_multiplier
, and gas_price
according to your chain’s configuration.
The final thing about the configuration is to set up the union
account.
If you do not already have one, you could follow this guide.
Let’s set our union
private key too:
Starting Voyager
Voyager manages database migrations internally. Run the following command on startup to set up the database. This command is idempotent and can always be safely run.
Next, we need to start voyager. We recommend daemonizing this or running it under systemd for production usage.
Now in a new window, instruct the voyager to monitor Union and your chain.
Creating the Clients
We first need to create a light client on both chains to track each other’s consensus:
As soon as you run the command, you will see that voyager
will create the clients. You should see similar messages in your logs:
And also the corresponding event:
Opening the IBC Connection
Now we are going to open the IBC connection. Each chain has a single connection to another chain or rollup.
Again, you will see the transactions happening on voyager
’s logs. You can also try tracking ConnectionOpenInit
, ConnectionOpenTry
, ConnectionOpenAck
, and ConnectionOpenConfirm
transactions from the explorers.
You need to confirm that the connection is opened on both sides:
Make sure that the state
is OPEN
on both ends before moving on to channel opening.
Opening the channel
Finally, we can start opening a channel between the ics20 transfer
module on your chain and the ucs01
module on Union
.
Note that the command below only requires the connection ID on Union
to be specified.
This time, the transactions to watch will be ChannelOpenInit
, ChannelOpenTry
, ChannelOpenAck
, and ChannelOpenConfirm
.
Make sure the state
of the channel is OPEN
on both ends:
Alternative Setup
voyager
is also capable of doing all of the above in a single command once:
Verify the Connection
Now that the previous steps are completed, you can start receiving and sending funds to any chain within the Union: