Skip to content
This repository has been archived by the owner on Nov 30, 2021. It is now read-only.

Commit

Permalink
faucet: remove module (#678)
Browse files Browse the repository at this point in the history
* changelog v0.4.0

* faucet: remove module

* changelog

* codecov
  • Loading branch information
fedekunze authored Jan 8, 2021
1 parent 153478e commit 4a619b1
Show file tree
Hide file tree
Showing 25 changed files with 66 additions and 974 deletions.
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,13 @@ Ref: https://keepachangelog.com/en/1.0.0/

### API Breaking

* (faucet) [\#678](https://github.com/cosmos/ethermint/pull/678) Faucet module has been removed in favor of client libraries such as [`@cosmjs/faucet`](https://github.com/cosmos/cosmjs/tree/master/packages/faucet).
* (evm) [\#670](https://github.com/cosmos/ethermint/pull/670) Migrate types to the ones defined by the protobuf messages, which are required for the stargate release.

### Bug Fixes

* (evm) [\#672](https://github.com/cosmos/ethermint/issues/672) Fix panic of `wrong Block.Header.AppHash` when restart a node with snapshot
* (evm) [\#674](https://github.com/cosmos/ethermint/issues/674) Reset all cache after account data has been committed in `EndBlock` to make sure every node state consistent
* (evm) [\#674](https://github.com/cosmos/ethermint/issues/674) Reset all cache after account data has been committed in `EndBlock` to make sure every node state consistent.
* (evm) [\#672](https://github.com/cosmos/ethermint/issues/672) Fix panic of `wrong Block.Header.AppHash` when restart a node with snapshot.

## [v0.4.0] - 2020-12-15

Expand Down
11 changes: 1 addition & 10 deletions app/ethermint.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import (
ethermintcodec "github.com/cosmos/ethermint/codec"
ethermint "github.com/cosmos/ethermint/types"
"github.com/cosmos/ethermint/x/evm"
"github.com/cosmos/ethermint/x/faucet"

abci "github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/libs/log"
Expand Down Expand Up @@ -74,7 +73,6 @@ var (
evidence.AppModuleBasic{},
upgrade.AppModuleBasic{},
evm.AppModuleBasic{},
faucet.AppModuleBasic{},
)

// module account permissions
Expand All @@ -85,7 +83,6 @@ var (
staking.BondedPoolName: {supply.Burner, supply.Staking},
staking.NotBondedPoolName: {supply.Burner, supply.Staking},
gov.ModuleName: {supply.Burner},
faucet.ModuleName: {supply.Minter},
}

// module accounts that are allowed to receive tokens
Expand Down Expand Up @@ -126,7 +123,6 @@ type EthermintApp struct {
ParamsKeeper params.Keeper
EvidenceKeeper evidence.Keeper
EvmKeeper *evm.Keeper
FaucetKeeper faucet.Keeper

// the module manager
mm *module.Manager
Expand Down Expand Up @@ -157,7 +153,7 @@ func NewEthermintApp(
bam.MainStoreKey, auth.StoreKey, staking.StoreKey,
supply.StoreKey, mint.StoreKey, distr.StoreKey, slashing.StoreKey,
gov.StoreKey, params.StoreKey, upgrade.StoreKey, evidence.StoreKey,
evm.StoreKey, faucet.StoreKey,
evm.StoreKey,
)

tkeys := sdk.NewTransientStoreKeys(params.TStoreKey)
Expand Down Expand Up @@ -215,9 +211,6 @@ func NewEthermintApp(
app.EvmKeeper = evm.NewKeeper(
app.cdc, keys[evm.StoreKey], app.subspaces[evm.ModuleName], app.AccountKeeper,
)
app.FaucetKeeper = faucet.NewKeeper(
app.cdc, keys[faucet.StoreKey], app.SupplyKeeper,
)

// create evidence keeper with router
evidenceKeeper := evidence.NewKeeper(
Expand Down Expand Up @@ -261,7 +254,6 @@ func NewEthermintApp(
staking.NewAppModule(app.StakingKeeper, app.AccountKeeper, app.SupplyKeeper),
evidence.NewAppModule(app.EvidenceKeeper),
evm.NewAppModule(app.EvmKeeper, app.AccountKeeper),
faucet.NewAppModule(app.FaucetKeeper),
)

// During begin block slashing happens after distr.BeginBlocker so that
Expand All @@ -281,7 +273,6 @@ func NewEthermintApp(
auth.ModuleName, distr.ModuleName, staking.ModuleName, bank.ModuleName,
slashing.ModuleName, gov.ModuleName, mint.ModuleName, supply.ModuleName,
evm.ModuleName, crisis.ModuleName, genutil.ModuleName, evidence.ModuleName,
faucet.ModuleName,
)

app.mm.RegisterInvariants(&app.CrisisKeeper)
Expand Down
1 change: 0 additions & 1 deletion codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ ignore:
- "docs"
- "*.md"
- "cmd"
- "x/faucet"
- "**/*.pb.go"
- "types/*.pb.go"
- "tests/*"
Expand Down
108 changes: 60 additions & 48 deletions docs/guides/join_network.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,67 +2,79 @@
order: 5
-->


# Joining Chainsafe's Public Testnet

This document outlines the steps to join the public testnet hosted by [Chainsafe](https://chainsafe.io).
This document outlines the steps to join the public testnet hosted by [Chainsafe](https://chainsafe.io).

## Steps:
1. Install the Ethermint binaries (ethermintd & ethermint cli):
```
git clone https://github.com/cosmos/ethermint
cd ethermint
make install
```
## Steps

2. Create an Ethermint account:
```
ethermintcli keys add <keyname>
```
1. Install the Ethermint binaries (ethermintd & ethermint cli)

3. Copy genesis file:
Follow this [link](https://gist.github.com/araskachoi/43f86f3edff23729b817e8b0bb86295a) and copy it over to the directory ~/.ethermintd/config/genesis.json
```bash
git clone https://github.com/cosmos/ethermint
cd ethermint
make install
```

4. Add peers:
Edit the file located in ~/.ethermintd/config/config.toml and edit line 350 (persistent_peers) to the following;
```
"7678d52de4a724e468e503a7743664d12a78b5b0@18.204.206.179:26656,c62fadc76b7fa1ab25669b64fdc00c8d8d422bd0@3.86.104.251:26656,5fa7d4550b57298b059d1dd8af01829482e7d097@54.210.246.165:26656"
```
2. Create an Ethermint account

5. Validate genesis and start the Ethermint network:
```
ethermintd validate-genesis
```
```
ethermintd start --pruning=nothing --rpc.unsafe --log_level "main:info,state:info,mempool:info" --trace
```
(we recommend running the command in the background for convenience)
```bash
ethermintcli keys add <keyname>
```

6. Start the RPC server:
```
ethermintcli rest-server --laddr "tcp://localhost:8545" --unlock-key $KEY --chain-id etherminttestnet-777 --trace
```
where `$KEY` is the key name that was used in step 2.
(we recommend running the command in the background for convenience)
3. Copy genesis file

7. Request funds from the faucet:
You will need to know the Ethereum hex address, and it can be found with the following command:
Follow this [link](https://gist.github.com/araskachoi/43f86f3edff23729b817e8b0bb86295a) and copy it over to the directory ~/.ethermintd/config/genesis.json

```
curl -X POST --data '{"jsonrpc":"2.0","method":"eth_accounts","params":[],"id":1}' -H "Content-Type: application/json" http://localhost:8545
```
Using the output of the above command, you will then send the command with your valid Ethereum address:
```
curl --header "Content-Type: application/json" --request POST --data '{"address":"0xYourEthereumHexAddress"}' 3.95.21.91:3000
```
4. Add peers

Edit the file located in ~/.ethermintd/config/config.toml and edit line 350 (persistent_peers) to the following

```toml
"7678d52de4a724e468e503a7743664d12a78b5b0@18.204.206.179:26656,c62fadc76b7fa1ab25669b64fdc00c8d8d422bd0@3.86.104.251:26656,5fa7d4550b57298b059d1dd8af01829482e7d097@54.210.246.165:26656"
```

5. Validate genesis and start the Ethermint network

```bash
ethermintd validate-genesis
ethermintd start --pruning=nothing --rpc.unsafe --log_level "main:info,state:info,mempool:info" --trace
```

(we recommend running the command in the background for convenience)

6. Start the RPC server

```bash
ethermintcli rest-server --laddr "tcp://localhost:8545" --unlock-key $KEY --chain-id etherminttestnet-777 --trace
```

where `$KEY` is the key name that was used in step 2.
(we recommend running the command in the background for convenience)

7. Request funds from the faucet

You will need to know the Ethereum hex address, and it can be found with the following command:

```bash
curl -X POST --data '{"jsonrpc":"2.0","method":"eth_accounts","params":[],"id":1}' -H "Content-Type: application/json" http://localhost:8545
```

Using the output of the above command, you will then send the command with your valid Ethereum address

```bash
curl --header "Content-Type: application/json" --request POST --data '{"address":"0xYourEthereumHexAddress"}' 3.95.21.91:3000
```

## Public Testnet Node RPC Endpoints

Node0: `54.210.246.165:8545`
Node1: `3.86.104.251:8545`
Node2: `18.204.206.179:8545`
- **Node0**: `54.210.246.165:8545`
- **Node1**: `3.86.104.251:8545`
- **Node2**: `18.204.206.179:8545`

example:
```

```bash
curl -X POST --data '{"jsonrpc":"2.0","method":"eth_chainId","params":[],"id":1}' -H "Content-Type: application/json" 54.210.246.165:8545
```
```
2 changes: 1 addition & 1 deletion docs/quickstart/run_node.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Run a local node and start the REST and JSON-RPC clients {synopsis}

## Automated deployment

Run the local node with faucet enabled:
Run the local node

::: warning
The script below will remove any pre-existing binaries installed. Use the manual deploy if you want
Expand Down
25 changes: 0 additions & 25 deletions docs/quickstart/testnet.md
Original file line number Diff line number Diff line change
Expand Up @@ -311,31 +311,6 @@ For more information on seeds and peers, you can the Tendermint [P2P documentati

The final step is to [start the nodes](./run_node.md#start-node). Once enough voting power (+2/3) from the genesis validators is up-and-running, the testnet will start producing blocks.

## Testnet faucet

Once the ethermint daemon is up and running, you can request tokens to your address using the `faucet` module:

```bash
# query your initial balance
ethermintcli q bank balances $(ethermintcli keys show <mykey> -a)

# send a tx to request tokens to your account address
ethermintcli tx faucet request 100aphoton --from <mykey>

# query your balance after the request
ethermintcli q bank balances $(ethermintcli keys show <mykey> -a)
```

You can also check to total amount funded by the faucet and the total supply of the chain via:

```bash
# total amount funded by the faucet
ethermintcli q faucet funded

# total supply
ethermintcli q supply total
```

## Next {hide}

Learn about how to setup a [validator](./validator-setup.md) node on Ethermint {hide}
8 changes: 0 additions & 8 deletions init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ cat $HOME/.ethermintd/config/genesis.json | jq '.app_state["crisis"]["constant_f
cat $HOME/.ethermintd/config/genesis.json | jq '.app_state["gov"]["deposit_params"]["min_deposit"][0]["denom"]="aphoton"' > $HOME/.ethermintd/config/tmp_genesis.json && mv $HOME/.ethermintd/config/tmp_genesis.json $HOME/.ethermintd/config/genesis.json
cat $HOME/.ethermintd/config/genesis.json | jq '.app_state["mint"]["params"]["mint_denom"]="aphoton"' > $HOME/.ethermintd/config/tmp_genesis.json && mv $HOME/.ethermintd/config/tmp_genesis.json $HOME/.ethermintd/config/genesis.json

# Enable faucet
cat $HOME/.ethermintd/config/genesis.json | jq '.app_state["faucet"]["enable_faucet"]=true' > $HOME/.ethermintd/config/tmp_genesis.json && mv $HOME/.ethermintd/config/tmp_genesis.json $HOME/.ethermintd/config/genesis.json

# increase block time (?)
cat $HOME/.ethermintd/config/genesis.json | jq '.consensus_params["block"]["time_iota_ms"]="30000"' > $HOME/.ethermintd/config/tmp_genesis.json && mv $HOME/.ethermintd/config/tmp_genesis.json $HOME/.ethermintd/config/genesis.json

Expand All @@ -56,11 +53,6 @@ ethermintd gentx --name $KEY --amount=1000000000000000000aphoton --keyring-backe
# Collect genesis tx
ethermintd collect-gentxs

echo -e '\n\ntestnet faucet enabled'
echo -e 'to transfer tokens to your account address use:'
echo -e "ethermintcli tx faucet request 100aphoton --from $KEY\n"


# Run this to ensure everything worked and that the genesis file is setup correctly
ethermintd validate-genesis

Expand Down
5 changes: 1 addition & 4 deletions scripts/contract-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ cat $HOME/.ethermintd/config/genesis.json | jq '.app_state["crisis"]["constant_f
cat $HOME/.ethermintd/config/genesis.json | jq '.app_state["gov"]["deposit_params"]["min_deposit"][0]["denom"]="aphoton"' > $HOME/.ethermintd/config/tmp_genesis.json && mv $HOME/.ethermintd/config/tmp_genesis.json $HOME/.ethermintd/config/genesis.json
cat $HOME/.ethermintd/config/genesis.json | jq '.app_state["mint"]["params"]["mint_denom"]="aphoton"' > $HOME/.ethermintd/config/tmp_genesis.json && mv $HOME/.ethermintd/config/tmp_genesis.json $HOME/.ethermintd/config/genesis.json

# Enable faucet
cat $HOME/.ethermintd/config/genesis.json | jq '.app_state["faucet"]["enable_faucet"]=true' > $HOME/.ethermintd/config/tmp_genesis.json && mv $HOME/.ethermintd/config/tmp_genesis.json $HOME/.ethermintd/config/genesis.json

# Allocate genesis accounts (cosmos formatted addresses)
$PWD/build/ethermintd add-genesis-account "$("$PWD"/build/ethermintcli keys show "$KEY$i" -a)" 100000000000000000000aphoton

Expand All @@ -51,7 +48,7 @@ $PWD/build/ethermintd start --pruning=nothing --rpc.unsafe --log_level "main:inf

sleep 1

# Start the rest server with unlocked faucet key in background and log to file
# Start the rest server with unlocked key in background and log to file
$PWD/build/ethermintcli rest-server --laddr "tcp://localhost:8545" --unlock-key $KEY --chain-id $CHAINID --trace > ethermintcli.log &

solcjs --abi $PWD/tests-solidity/suites/basic/contracts/Counter.sol --bin -o $PWD/tests-solidity/suites/basic/counter
Expand Down
8 changes: 0 additions & 8 deletions tests-solidity/init-test-node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,6 @@ ethermintd gentx --name $VAL_KEY --keyring-backend test
# Collect genesis tx
ethermintd collect-gentxs

# Enable faucet
cat $HOME/.ethermintd/config/genesis.json | jq '.app_state["faucet"]["enable_faucet"]=true' > $HOME/.ethermintd/config/tmp_genesis.json && mv $HOME/.ethermintd/config/tmp_genesis.json $HOME/.ethermintd/config/genesis.json

echo -e '\n\ntestnet faucet enabled'
echo -e 'to transfer tokens to your account address use:'
echo -e "ethermintcli tx faucet request 100aphoton --from $VAL_KEY\n"


# Run this to ensure everything worked and that the genesis file is setup correctly
ethermintd validate-genesis

Expand Down
24 changes: 0 additions & 24 deletions x/faucet/alias.go

This file was deleted.

53 changes: 0 additions & 53 deletions x/faucet/client/cli/query.go

This file was deleted.

Loading

0 comments on commit 4a619b1

Please sign in to comment.