fairyring is a blockchain built using Cosmos SDK and Tendermint and created with Ignite CLI.
ignite chain serve
Optionally add rv tag to reset and have verbose output.
serve command installs dependencies, builds, initializes, and starts your blockchain in development.
export alice=$(fairyringd keys show alice -a)
export bob=$(fairyringd keys show bob -a)
Register the account as a validator
fairyringd tx fairyring register-validator --from $alice --gas auto
Send a keyshare message from validator
fairyringd tx fairyring send-keyshare <Message> <BlockHeight> --from $alice --gas auto
Submit an encrypted tx message
fairyringd tx pep submit-encrypted-tx <TxData> <TargetBlockHeight> --from $alice --gas auto
- Copy DistributedIBE inside fairyring directory
cp -r ../DistributedIBE ./
- Build docker image
docker build -t fairyring .
- Setup validator
docker run -it -p 1317:1317 -p 9090:9090 -p 26657:26657 -p 26656:26656 -v ~/.fairyring:/root/.fairyring fairyring setup.sh <moniker>
- Create new genesis.json
docker run -it -p 1317:1317 -p 9090:9090 -p 26657:26657 -p 26656:26656 -v ~/.fairyring:/root/.fairyring fairyring fairyringd collect-gentxs
- Start the validator
docker run -it -p 1317:1317 -p 9090:9090 -p 26657:26657 -p 26656:26656 -v ~/.fairyring:/root/.fairyring fairyring fairyringd start
-
Repeat step 1 - 3 on all the machines,
-
Run the following command for all the address created in other machine in the master validator:
docker run -it -p 1317:1317 -p 9090:9090 -p 26657:26657 -p 26656:26656 -v ~/.fairyring:/root/.fairyring fairyring fairyringd add-genesis-account <address> 100000000stake
-
Add all the gentx.json at
~/.fairyring/config/gentx/gentx-{node_id}.jsonfrom all the machines to master validator, then run the command on step 4 -
replace the old
genesis.jsonwith the new one created in master validator -
Open config.toml at
~/.fairyring/config/config.tomlon master validator and replace the IP Address & Port of the peers -
Update the config.toml for all the other machine to include all the validator peers:
presistent_peers = "node_id@ip:port,node_id2@ip:port"
You can get the node id by the following command:
docker run -it -p 1317:1317 -p 9090:9090 -p 26657:26657 -p 26656:26656 -v ~/.fairyring:/root/.fairyring fairyring fairyringd tendermint show-node-id
- Start the validator on all the machines
-
Follow step 1 - 3 on Run validator locally
-
Make sure you have enough coins in your account
-
Replace the
genesis.jsonandconfig.toml -
Send the
fairyringd tx staking create-validatorcommand with the address created to become validator, for example:
fairyringd tx staking create-validator \
--amount=100000000stake \
--pubkey=$(fairyringd tendermint show-validator) \
--moniker="choose a moniker" \
--chain-id="fairyring" \
--commission-rate="0.10" \
--commission-max-rate="0.20" \
--commission-max-change-rate="0.01" \
--min-self-delegation="1000000" \
--from validator_account
- Start the validator
Get all validators
fairyringd query fairyring list-validator-set
Get all broadcasted keyshares
fairyringd query fairyring list-key-share
Get specific validator
fairyringd query fairyring show-validator-set <Index>
Get specific keyshare
fairyringd query fairyring show-key-share <Validator> <BlockHeight>
Get all encrypted tx in state
fairyringd query pep list-encrypted-tx
Get all encrypted tx in state from a specific block height
fairyringd query pep list-encrypted-tx-from-block <blockHeight>
Get a single encrypted tx in state with a specific block height & tx index
fairyringd query pep show-encrypted-tx <blockHeight> <index>
It is recommended to run fairyringclient so that validator registration and key share submissions are automated.
It is recommended to run fairyringrelay to listen to broadcast keyshare events and aggregate the keys in each block.
Your blockchain in development can be configured with config.yml. To learn more, see the Ignite CLI docs.
Ignite CLI has scaffolded a Vue.js-based web app in the vue directory. Run the following commands to install dependencies and start the app:
cd vue
npm install
npm run serve
The frontend app is built using the @starport/vue and @starport/vuex packages. For details, see the monorepo for Ignite front-end development.
To release a new version of your blockchain, create and push a new tag with v prefix. A new draft release with the configured targets will be created.
git tag v0.1
git push origin v0.1
After a draft release is created, make your final changes from the release page and publish it.
To install the latest version of your blockchain node's binary, execute the following command on your machine:
curl https://get.ignite.com/username/fairyring@latest! | sudo bash
username/fairyring should match the username and repo_name of the Github repository to which the source code was pushed. Learn more about the install process.