Gaia-rs is a Cosmos Hub (Gaia) node built on Gears.
NOTE: This is a WIP. Although it correctly replicates state for a subset of v0.7.1.0 of the Gaia state machine, the full state machine has not yet been implemented.
Gears uses the tendermint-abci crate to communicate with a Tendermint instance which runs as a separate process. This means that to run a full node, Tendermint must be installed and run separately (see instructions below).
Rust compiler
The minimum supported Rust version is 1.79
. Follow the installation instructions.
Tendermint
Gaia v0.7.1.0 uses Tendermint version v0.34.21. After cloning the Tendermint repo checkout v0.34.21 then follow the installation instructions.
libclang and llvm
This is needed by the rocks db crate.
Ubuntu
sudo apt install llvm clang libclang-dev build-essential libhidapi-dev
OpenSUSE
sudo zypper in libclang13 clang18 libLLVM18 libhidapi-devel
- Clone this repo:
git clone https://github.com/rumos-io/gears
cd gears
- Initialize a new chain:
make init
- Build and start the application:
make run
The application will listen for connections on tcp://127.0.0.1:26658.
- From a different terminal window start Tendermint:
make tendermint-start
Tendermint will connect to the application and bind it's RPC server to 127.0.0.1:26657.
The chain (consisting of one node) is now up and running.
So far we've been running gaia-rs indirectly using make commands and the rust build tool, Cargo. In this section we'll install gaia-rs and use it to query the chain (just like cosmos-sdk based chains the gaia-rs binary serves as a node and client).
- Install gaia-rs:
make install
- Query a balance:
gaia-rs query bank balances cosmos1syavy2npfyt9tcncdtsdzf7kny9lh777pahuux
Which returns:
{
"balances": [
{
"denom": "uatom",
"amount": "990000000000"
}
],
"pagination": null
}
The balance of this address was set in the genesis file.
- Import the key corresponding to the above address into the gaia-rs key store:
echo "race draft rival universe maid cheese steel logic crowd fork comic easy truth drift tomorrow eye buddy head time cash swing swift midnight borrow" | gaia-rs keys add alice --recover
- Send tokens:
gaia-rs tx --keyring local --from-key alice bank send cosmos180tr8wmsk8ugt32yynj8efqwg3yglmpwp22rut 10uatom --fees 1uatom
- Query the address balance and observe that it has decreased by 11uatom which is the sum of the amount transferred and the fee:
gaia-rs query bank balances cosmos1syavy2npfyt9tcncdtsdzf7kny9lh777pahuux
Which returns:
{
"balances": [
{
"denom": "uatom",
"amount": "989999999989"
}
],
"pagination": null
}