Skip to content
This repository has been archived by the owner on Oct 24, 2024. It is now read-only.

Commit

Permalink
Restore README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
foxytanuki committed Feb 6, 2024
1 parent 8daf25a commit 20885e0
Showing 1 changed file with 147 additions and 21 deletions.
168 changes: 147 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,153 @@
# Scripts
# Mycel
**Mycel** is a Decentralized ID Infrastructure solution that resolves addresses such as websites, crypto wallets, IPFS, among many more accessible through a single domain with name resolution support in DNS, IBC and smart contracts.

Generally we should avoid shell scripting and write tests purely in Golang.
However, some libraries are not Goroutine-safe (e.g. app simulations cannot be run safely in parallel),
and OS-native threading may be more efficient for many parallel simulations, so we use shell scripts here.
## Get started

## Validate Gentxs
```
ignite chain serve
```

`serve` command installs dependencies, builds, initializes, and starts your blockchain in development.

### Test
Test a specific module
```
make test-module-{MODULE_NAME}
```

Test all keepers
```
make test-all-keepers
```

Test all types
```
make test-all-types
```

### Build with Docker
Build Docker Image
```
make docker-build
```

Build chain
```
make build
```

Serve Chains
```
make serve
```


### Configure

Your blockchain in development can be configured with `config.yml`. To learn more, see the [Ignite CLI docs](https://docs.ignite.com).

<!-- ### Web Frontend
Ignite CLI has scaffolded a React-based web app in the `react` directory. Run the following commands to install dependencies and start the app:
```
cd react
yarn
yarn dev
``` -->

For details, see the [monorepo for Ignite front-end development](https://github.com/ignite/web).

## Start Nodes with Docker
### Single node
Build
```
docker build . -t mycel -f dockerfile-node
```

Run
```
docker run -it --rm \
-p26657:26657 \
-p1317:1317 \
-p4500:4500 \
-v ~/.mycel:/root/.mycel \
mycel
```
You can generate your `.mycel` config directory with `ignite chain init`

### Multiple nodes
#### Setup node1 using `docker compose`:
```
docker compose up
```

#### Setup node2:
Initialize node2
```
docker compose exec node2 myceld init node2
```
Copy genesis.json
```
docker compose cp node1:/root/.mycel/config/genesis.json /tmp/genesis.json
docker compose cp /tmp/genesis.json node2:/root/.mycel/config/genesis.json
```
Update config.toml
```
docker compose exec node2 sed -i "s/persistent_peers = \"\"/persistent_peers = \"$(docker compose exec node1 myceld tendermint show-node-id)@node1:26656\"/g" /root/.mycel/config/config.toml
```
Setup key
```
docker compose exec node2 myceld keys add validator
NODE2_ADDR=$(docker compose exec node2 myceld keys show validator --output json | jq -r '.address') # enter password
```
Send stake token from node1
```
docker compose exec node1 myceld tx bank send alice $NODE2_ADDR 50000000stake
```
Stake
```
docker compose exec node2 myceld tx staking create-validator \
--amount 50000000stake \
--from validator --pubkey=$(docker compose exec node2 myceld tendermint show-validator) \
--moniker="node2" \
--commission-rate="0.1" \
--commission-max-rate="0.2" \
--commission-max-change-rate="0.01" \
--min-self-delegation="50000000" \
--node tcp://node1:26657
```

Check validators
```
docker compose exec node1 myceld q staking validators
```
Start node2
```
docker compose exec node2 myceld start
```

A custom utility script is available to [validate gentxs](./validate-gentxs.sh). Though we have
`ValidateBasic()` for validating gentx data, it cannot validate signatures. This custom script helps
to validate all the gentxs by collecting them one by one and starting a local network.
It requires the following env settings.

```shell
export DAEMON=gaiad
export CHAIN_ID=cosmoshub-1
export DENOM=uatom
export GH_URL=https://github.com/cosmos/gaia
export BINARY_VERSION=v1.0.0
export GO_VERSION=1.17
export PRELAUNCH_GENESIS_URL=https://raw.githubusercontent.com/cosmos/mainnet/main/cosmoshub-1/genesis-prelaunch.json
export GENTXS_DIR=~/go/src/github.com/cosmos/mainnet/$CHAIN_ID/gentxs

## Release
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.

### Install
To install the latest version of your blockchain node's binary, execute the following command on your machine:

```
curl https://get.ignite.com/mycel-domain/mycel@latest! | sudo bash
```

Though this script is handy for verifying the gentxs locally, it is advised to use Github Action to validate gentxs.
An example can be found here:
https://github.com/regen-network/mainnet/blob/0bcd387671b9574e893289e39c08a1643cac7d62/.github/workflows/validate-gentx.yml
## Learn more
- [Website](https://mycel.domains)
- [Mycel Docs](https://docs.mycel.domains)
- [Discord](https://discord.gg/h2jSkBETan)
- [X](https://twitter.com/myceldomain)

0 comments on commit 20885e0

Please sign in to comment.