Skip to content

rickiey/cosmos-chain-minimal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

98 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mini - A minimal Cosmos SDK chain

This repository contains an example of a tiny, but working Cosmos SDK chain. It uses the least modules possible and is intended to be used as a starting point for building your own chain, without all the boilerplate that other tools generate. It is a simpler version of Cosmos SDK's simapp.

Minid uses the latest version of the Cosmos-SDK.

How to use

In addition to learn how to build a chain thanks to minid, you can as well directly run minid.

Installation

Install and run minid:

git clone git@github.com:cosmosregistry/chain-minimal.git
cd chain-minimal
make install # install the minid binary
make init # initialize the chain
minid start # start the chain

Useful links

mini chain sync node (first node)

  • copy minid binary file or compile from source code
  1. stop minid node ,and minid snapshots export
  2. cat snapshot
$ minid snapshots list
height: 946 format: 3 chunks: 1  
  1. dump snapshot minid snapshots dump 946 3

946-3.tar.gz

  1. copy 946-3.tar.gz to other node

start second minid (other node)

  1. load snapshot

minid snapshots load 946-3.tar.gz

  1. copy minid binary file or compile from source code copy ~/.minid/config/genesis.json

  2. add seeds .minid/config/config.toml

or

minid start --p2p.seeds 619a20b42812e4e156795d66af0738a09fafa975@172.17.0.1:26656 |tee -a minid.log

[p2p]
laddr = "tcp://0.0.0.0:26656"
external_address = ""
seeds = "eb24be3ac35037260b91906000606442b0e0c803@192.168.0.182:26656"
  1. start second minid node

minid start

minid config set client chain-id demo
minid config set client keyring-backend test
  1. add validator

minid comet show-validator minid tx bank send mini1577sjzu9z522tc9jv2hgn2kckztf3cln22m9lr mini1wtnf95x9ywdhv984fdpfs0ya0k074wf3ytkzyf 200000000mini minid tx staking create-validator ./validator.json --from mini1wtnf95x9ywdhv984fdpfs0ya0k074wf3ytkzyf

{
 "pubkey": {"@type":"/cosmos.crypto.ed25519.PubKey","key":"xGlA/3aa/9812EwB30rf0PQzgu++qPPHWEp/MT+Vgpo="},
 "amount": "1000000mini",
 "moniker": "myvalidator3",
 "commission-rate": "0.1",
 "commission-max-rate": "0.2",
 "commission-max-change-rate": "0.01",
 "min-self-delegation": "1"
}
                                                                                                                                                                
  1. start third minid node, and create-validator
minid config set client chain-id demo
minid config set client keyring-backend test

minid start --p2p.seeds ddde1ff60f2e7a82d6aaf3512f91919662605960@172.17.0.2:26656,619a20b42812e4e156795d66af0738a09fafa975@172.17.0.1:26656 |tee -a minid.log minid start --p2p.seeds 619a20b42812e4e156795d66af0738a09fafa975@172.17.0.1:26656,a5e695453ea30aa4af9fb61609b330f28ce45ca8@172.17.0.3:26656 |tee -a minid.log minid start --p2p.seeds ddde1ff60f2e7a82d6aaf3512f91919662605960@172.17.0.2:26656,a5e695453ea30aa4af9fb61609b330f28ce45ca8@172.17.0.3:26656 |tee -a minid.log

  • At least three nodes are started, three validator are staking, three nodes are connected (by p2p.seeds), if one of nodes is down, the other two nodes are available

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •