Skip to content

gridironOne/gridiron-rdk

Repository files navigation

Gridiron Rollapp

banner license

Gridiron RDK, which stands for RollApp Development Kit is based on the Cosmos SDK framework, modified and enhanced for building autonomous RollApps (app-specific-rollups) on top of the Gridiron Hub.

The RDK provides the following capabilities on top of the Cosmos SDK framework:

  • The RDK is coupled with the Furyint client to form RollApp's blazing speed consensus and networking layer, while the Gridiron Hub is securing the rollapp
  • Custom modules that convert a cosmos based PoS (proof-of-stake) chain to a rollapp
  • wasm and EVM support (based on CosmWasm and Ethermint)

Learn more

For more information about Gridiron RollApps please visit the documentation center

To learn how the Cosmos SDK works from a high-level perspective, see the Cosmos SDK High-Level Intro.

If you want to get started quickly and learn how to build on top of Cosmos SDK, visit Cosmos SDK Tutorials. You can also fork the tutorial's repository to get started building your own Cosmos SDK application.


This repository hosts rollappd, the first implementation of a gridiron rollapp.

Note: Requires Go 1.18

Quick guide

Get started with building RollApps

Installing / Getting started

Build and install the rollappd binary:

make install

Initial configuration

Set custom configuration params at scripts/shared.sh This will initialize the rollapp:

sh scripts/init_rollapp.sh

Run rollapp

sh scripts/run_rollapp.sh

Run a rollapp with local settlement node

Run local gridiron hub node

Follow the instructions on Gridiron Hub docs to run local gridiron hub node

Configure the rollapp

Set the settlement configuration params in scripts/shared.sh or by export

export SETTLEMENT_LAYER="gridiron"
export SETTLEMENT_RPC="tcp://127.0.0.1:36657"

sh scripts/init_rollapp.sh

Register rollapp on settlement

sh scripts/settlement/register_rollapp_to_hub.sh

Register sequencer for rollapp on settlement

sh scripts/settlement/register_sequencer_to_hub.sh

Run rollapp

sh scripts/run_rollapp.sh

Running EVM-based rollapp

🚧 To run an EVM-based rollapp, one should:

  1. Build and EVM binary instead of default binary:

    make install_evm

    This will build and install the rollapp_evm binary

  2. EVM-based configuration:

    Uncomment the EVM section in scripts/shared.sh, then initializing the rollapp

    sh scripts/init_rollapp.sh

Establish IBC channel between hub and rollapp

The following script will create all the dependencies for IBC channel between the hub and the rollapp. It will create dedicated accounts for the relayer on both the hub and the rollapp, and transfer some funds to them from the genesis accounts.

sh scripts/ibc/setup_ibc.sh

after it finishes (it might take few mins), run the relayer:

sh scripts/run_relayer.sh

To run ibc-transfers between rollapp and the hub, first check and set the connection name:

//check the connectionID of the rollapp and the hub on the active path
rly paths show hub-rollapp --json | jq '.chains.src'
rly paths show hub-rollapp --json | jq '.chains.dst'

//check the channel_ID based on the connectionID
rollappd q ibc channel connections <connectionID from rly command> -o json | jq '.channels[0].channel_id'
furyd q ibc channel connections <connectionID from rly command> -o json | jq '.channels[0].channel_id'

//Use the above result
export ROLLAPP_CHANNEL_NAME=<channel_id>
export HUB_CHANNEL_NAME=<channel_id>

Now you can do ibc transfers

sh scripts/ibc/ibc_transfer.sh [arg]

Available:
-q:         query balances of local-user on hub and rol-user on rollapp
rol2hub:    ibc-transfer of 5555urap to local-user from rol-user
hub_back:   transfer back the tokens from the hub to the rollapp
hub2rol:    ibc-transfer of 5555fury to rol-user from local-user
hub_back:   transfer back the tokens from the hub to the rollapp

Run rollapp with IBC native token

To run a rollapp based on foreign IBC token, set the following when initializing the rollapp:

DENOM=IBC/<denom trace>
TOKEN_AMOUNT = 0$DENOM

Running multiple rollapp instances locally

Run the first rollapp as described above.

For the 2nd rollapp, run the following in a new tab:

export CHAIN_ID=rollapp2
export CHAIN_DIR="$HOME/.rollapp2"
export ROLLAPP_ID=rollapp2
export RPC_PORT="0.0.0.0:27667"
export P2P_PORT="0.0.0.0:27668"
export GRPC_PORT="0.0.0.0:9180"
export GRPC_WEB_PORT="0.0.0.0:9181"

Then run the scripts as described in the readme

Developers guide

TODO