cw-basic-tooling
v1.0.17
Published
A basic npm package for checking the block production and ibc transfers
Downloads
7
Readme
Description
This project includes a set of tools for testing and verifying Inter-Blockchain Communication (IBC) in Cosmos chains. It provides functionality to check block production and IBC connections between chains.
Features
- Block Production Check: Ensures that specified Cosmos chains are producing blocks.
- IBC Connection Check: Verifies IBC connections by initiating token transfers between chains and confirming balance changes.
Installation
git clone [Your Repository URL]
cd [Your Repository Directory]
npm install
Usage
Check Cosmos Chains Block Production
const { checkCosmosChainsBlockProduction } = require('[Your Main File]'); // Optional: Provide a custom configuration checkCosmosChainsBlockProduction(customConfig).then(() => { console.log('Block production check complete.'); }).catch(err => { console.error('Error checking block production:', err); });
Check Ibc Connection Activation
const { checkIbcConnections } = require('[Your Main File]'); // Optional: Provide a custom configuration checkIbcConnections(customConfig).then(() => { console.log('IBC connection check complete.'); }).catch(err => { console.error('Error checking IBC connections:', err); });
Check channel status
queryChannelStates(yourTestConfig, 120)
.then(() => console.log('Channel states queried successfully'))
.catch(error => console.error(error));
Configuration
An example configuration is as follows:
{
"mnemonic": "<mnemonic for cosmos wallet>",
"chainInfos": {
"centauri": {
"chainName": "centauri",
"chainPrefix": "centauri",
"rpcEndpoint": "http://127.0.0.1:26657",
"baseToken": "ppica",
"channels": {
"osmosis": {
"channelId": 1,
"memo": {
"channelId": 0,
"endChain": "centauri"
}
}
}
},
"osmosis": {
"chainName": "osmosis",
"chainPrefix": "osmo",
"rpcEndpoint": "http://127.0.0.1:38093",
"baseToken": "uosmo",
"channels": {
"centauri": {
"channelId": 0
}
}
}
}
}