If your chain is not yet connected to Union , then you can permissionlessly add support. Union supports L1s, L2s, L3s, and Rollups. The steps to connect are simple:
Upload Union contracts
Configure a relayer
Open the connection
Send assets and data
You’ll need to upload two contracts:
To upload CosmWasm contracts to your Cosmos chain, you need your chain’s binary. We’ll use starsd
in this example.
nix build github:unionlabs/union#union-ibc -L
./starsd init --chain-id elgafar-1 --home ./starsd-home cor-systems
./starsd keys add cor-systems --home ./starsd-home
# this will give you your address: stars1qcvavxpxw3t8d9j7mwaeq9wgytkf5vwputv5x4
Upload your contract:
./starsd tx wasm store ./contracts/union_ibc.wasm --from cor-systems --home ./starsd-home --gas auto --gas-adjustment 1.4 --gas-prices 1ustars --node https://rpc.elgafar-1.stargaze.chain.kitchen --chain-id elgafar-1 -y
# => tx_hash: C6D45BE9A40F92D82E94C0B4D2AFA48812A9FE28E5761700E496ED29F8D53977
Query your contract’s code_id:
./starsd query tx C6D45BE9A40F92D82E94C0B4D2AFA48812A9FE28E5761700E496ED29F8D53977 --node https://rpc.elgafar-1.stargaze.chain.kitchen
Instantiate union-ibc
./starsd tx wasm instantiate 5011 '{}' --node https://rpc.elgafar-1.stargaze.chain.kitchen --home ./starsd-home --from cor-systems --gas auto --gas-adjustment 1.4 --gas-prices 1ustars --label union-ibc-1 --admin stars1qcvavxpxw3t8d9j7mwaeq9wgytkf5vwputv5x4 --chain-id elgafar-1 -y
# => txhash: D3E0D991E3874C83B43E0828C693F8E0A1E2A8C8CB518DFFF2F5F87FB6E1A7BC
Query the union-ibc contract address:
./starsd query tx D3E0D991E3874C83B43E0828C693F8E0A1E2A8C8CB518DFFF2F5F87FB6E1A7BC --node https://rpc.elgafar-1.stargaze.chain.kitchen
# => contract_address: stars1s0x3yq0pmltxq56f4yppgmd02ret3uj5k9ftj6ug9c7lc379sw7qv396zm
Upload cometbls-light-client
contract:
./starsd tx wasm store ./contracts/cometbls_light_client.wasm --from cor-systems --home ./starsd-home --gas auto --gas-adjustment 1.4 --gas-prices 1ustars --node https://rpc.elgafar-1.stargaze.chain.kitchen --chain-id elgafar-1 -y
# => tx_hash: 187227FF10BA93B75063C9E72FBB188FA6403F43CFA80346DFC1B2F268C7C022
Query cometbls-light-client
code_id:
./starsd query tx 187227FF10BA93B75063C9E72FBB188FA6403F43CFA80346DFC1B2F268C7C022 --node https://rpc.elgafar-1.stargaze.chain.kitchen
Instantiate cometbls-light-client
, specifying the union-ibc address acquired in step 4
./starsd tx wasm instantiate 5012 '{"ibc_host": "stars1s0x3yq0pmltxq56f4yppgmd02ret3uj5k9ftj6ug9c7lc379sw7qv396zm"}' --node https://rpc.elgafar-1.stargaze.chain.kitchen --home ./starsd-home --from cor-systems --gas auto --gas-adjustment 1.4 --gas-prices 1ustars --label union-ibc-1 --admin stars1qcvavxpxw3t8d9j7mwaeq9wgytkf5vwputv5x4 --chain-id elgafar-1 -y
# => tx_hash: 7B6874CD6D68B735230E4F4F5C80BC92CF1AF690605C799569C01CCB7C403019
Query the cometbls-light-client
contract address:
./starsd query tx 7B6874CD6D68B735230E4F4F5C80BC92CF1AF690605C799569C01CCB7C403019 --node https://rpc.elgafar-1.stargaze.chain.kitchen
# => contract_address: stars16khctrjjnm5nn5503hhqlcu7h4pngzpzc5g3d4ej25pz47eqsnjqdctmt7
Register the cometbls-light-client
to union-ibc
:
./starsd tx wasm execute stars1s0x3yq0pmltxq56f4yppgmd02ret3uj5k9ftj6ug9c7lc379sw7qv396zm '{"register_client":{"client_type":"cometbls","client_address":"stars16khctrjjnm5nn5503hhqlcu7h4pngzpzc5g3d4ej25pz47eqsnjqdctmt7"}}' --home ./starsd-home --node https://rpc.elgafar-1.stargaze.chain.kitchen --chain-id elgafar-1 --from cor-systems --gas auto --gas-adjustment 1.4 --gas-prices 1ustars -y