Skip to content

Latest commit

 

History

History
 
 

gaia-rs

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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.

Getting Started

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).

Requirements

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

Running a local chain

  1. Clone this repo:
git clone https://github.com/rumos-io/gears
cd gears
  1. Initialize a new chain:
make init
  1. Build and start the application:
make run

The application will listen for connections on tcp://127.0.0.1:26658.

  1. 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.

Querying the chain

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).

  1. Install gaia-rs:
make install
  1. 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.

  1. 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
  1. Send tokens:
gaia-rs tx --keyring local --from-key alice bank send cosmos180tr8wmsk8ugt32yynj8efqwg3yglmpwp22rut 10uatom --fees 1uatom
  1. 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
}