Skip to content

Commit

Permalink
Create README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
0xsuryansh authored Jul 3, 2023
1 parent 97db770 commit ef386e3
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
EVMStoreChain
EVMStoreChain is a Cosmos SDK-based blockchain that allows users to read state from Ethereum, post the Ethereum state to the Cosmos blockchain, and query the agreed-upon state. This application interacts with the Compound protocol to fetch the borrowIndex of the cUSDT token of the latest block and post it as a vote to the Cosmos blockchain.

Prerequisites
Go (version 1.19 or higher)
Cosmos-sdk
Infura account
Installation
Install the Ignite CLI:

curl https://get.ignite.com/cli! | bash
Clone this repository:

git clone https://github.com/0xsuryansh/EVMStoreChain
Repository Structure
There are 2 directories in this repository:

EVMStateVoteClient - A Go client to query Ethereum for a state (borrowIndex of Compound's cUSDT token contract), post Ethereum state to the Cosmos blockchain, and query the state based on the block number.

EVMStoreChain - Cosmos SDK-based blockchain code.

Usage
Starting the Blockchain
Navigate to the EVMStoreChain directory and run the following command to start the blockchain:


cd EVMStoreChain
ignite chain serve
Interacting with Ethereum and Cosmos Chains
Navigate to the EVMStateVoteClient directory:


cd EVMStateVoteClient
go mod tidy
Set up your Infura URL for connecting to the Ethereum node:


export INFURA_URL="YOUR_INFURA_URL"
Run the client:


go run main.go
This client fetches the borrowIndex of the Compound's cUSDT token of the latest block and posts it as a vote to the Cosmos blockchain using the SubmitEthereumState function. You can then query the state with the highest vote.





0 comments on commit ef386e3

Please sign in to comment.