added init script with test password (#228)

* added init script with test password

* added make install

* update README
This commit is contained in:
billy rennekamp 2020-03-18 13:42:46 +01:00 committed by GitHub
parent 6fa0b63699
commit 85019f2283
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 44 additions and 5 deletions

View File

@ -45,10 +45,16 @@ $ make build
### Starting a Ethermint daemon (node) ### Starting a Ethermint daemon (node)
First, create a key to use in signing the genesis transaction: The following config steps can be performed all at once by executing the `init.sh` file located in the root directory like this:
```bash
./init.sh
```
> This bash file removes previous blockchain data from `~/.emintd` and `~/.emintcli`. It uses the `keyring-backend` called `test` that should prevent you from needing to enter a passkey. The `keyring-backend` `test` is unsecured and should not be used in production.
To initalize your chain manually, first create a key to use in signing the genesis transaction:
```bash ```bash
emintcli keys add mykey emintcli keys add mykey --keyring-backend test
``` ```
> replace mykey with whatever you want to name the key > replace mykey with whatever you want to name the key
@ -58,6 +64,7 @@ Then, run these commands to start up a node
emintd init mymoniker --chain-id 8 emintd init mymoniker --chain-id 8
# Set up config for CLI # Set up config for CLI
emintcli config keyring-backend test
emintcli config chain-id 8 emintcli config chain-id 8
emintcli config output json emintcli config output json
emintcli config indent true emintcli config indent true
@ -67,7 +74,7 @@ emintcli config trust-node true
emintd add-genesis-account $(emintcli keys show mykey -a) 1000000000000000000photon,1000000000000000000stake emintd add-genesis-account $(emintcli keys show mykey -a) 1000000000000000000photon,1000000000000000000stake
# Sign genesis transaction # Sign genesis transaction
emintd gentx --name mykey emintd gentx --name mykey --keyring-backend test
# Collect genesis tx # Collect genesis tx
emintd collect-gentxs emintd collect-gentxs
@ -108,7 +115,7 @@ To clear all data except key storage (if keyring backend chosen) and then you ca
#### Keyring backend options #### Keyring backend options
Ethermint supports using a file or OS keyring backend for key storage. To create and use a file stored key instead of defaulting to the OS keyring, add the flag `--keyring-backend file` to any relevant command and the password prompt will occur through the command line. This can also be saved as a CLI config option with: The instructions above include commands to use `test` as the `keyring-backend`. This is an unsecured keyring that doesn't require entering a password and should not be used in production. Otherwise, Ethermint supports using a file or OS keyring backend for key storage. To create and use a file stored key instead of defaulting to the OS keyring, add the flag `--keyring-backend file` to any relevant command and the password prompt will occur through the command line. This can also be saved as a CLI config option with:
```bash ```bash
emintcli config keyring-backend file emintcli config keyring-backend file
@ -159,5 +166,5 @@ via the `--blockchain` flag. See `TestImportBlocks` for further documentation.
The following chat channels and forums are a great spot to ask questions about Ethermint: The following chat channels and forums are a great spot to ask questions about Ethermint:
- [Cosmos Riot Chat Channel](https://riot.im/app/#/group/+cosmos:matrix.org) - [Cosmos Discord](https://discord.gg/W8trcGV)
- Cosmos Forum [![Discourse status](https://img.shields.io/discourse/https/forum.cosmos.network/status.svg)](https://forum.cosmos.network) - Cosmos Forum [![Discourse status](https://img.shields.io/discourse/https/forum.cosmos.network/status.svg)](https://forum.cosmos.network)

32
init.sh Executable file
View File

@ -0,0 +1,32 @@
#!/bin/bash
rm -rf ~/.emintcli
rm -rf ~/.emintd
make install
emintcli config keyring-backend test
emintcli keys add mykey
# Set moniker and chain-id for Ethermint (Moniker can be anything, chain-id must be an integer)
emintd init mymoniker --chain-id 8
# Set up config for CLI
emintcli config chain-id 8
emintcli config output json
emintcli config indent true
emintcli config trust-node true
# Allocate genesis accounts (cosmos formatted addresses)
emintd add-genesis-account $(emintcli keys show mykey -a) 1000000000000000000photon,1000000000000000000stake
# Sign genesis transaction
emintd gentx --name mykey --keyring-backend test
# Collect genesis tx
emintd collect-gentxs
# Run this to ensure everything worked and that the genesis file is setup correctly
emintd validate-genesis
# Start the node (remove the --pruning=nothing flag if historical queries are not needed)
emintd start --pruning=nothing