forked from cerc-io/laconicd-deprecated
change photon to aphoton (#476)
* change photon to aphoton * fix test * photon docs * update doc Co-authored-by: Federico Kunze <federico.kunze94@gmail.com>
This commit is contained in:
parent
a6e152bbb6
commit
4344dc10c7
@ -96,7 +96,7 @@ func (emfd EthMempoolFeeDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simula
|
||||
minGasPrices := ctx.MinGasPrices()
|
||||
|
||||
// check that fee provided is greater than the minimum
|
||||
// NOTE: we only check if photons are present in min gas prices. It is up to the
|
||||
// NOTE: we only check if aphotons are present in min gas prices. It is up to the
|
||||
// sender if they want to send additional fees in other denominations.
|
||||
var hasEnoughFees bool
|
||||
if fee.Amount.GTE(minGasPrices.AmountOf(emint.DenomDefault)) {
|
||||
|
@ -93,7 +93,7 @@ Note, strict routability for addresses is turned off in the config file.`,
|
||||
cmd.Flags().String(flagNodeCLIHome, "ethermintcli", "Home directory of the node's cli configuration")
|
||||
cmd.Flags().String(flagStartingIPAddress, "192.168.0.1", "Starting IP address (192.168.0.1 results in persistent peers list ID0@192.168.0.1:46656, ID1@192.168.0.2:46656, ...)")
|
||||
cmd.Flags().String(flags.FlagChainID, "", "genesis file chain-id, if left blank will be randomly created")
|
||||
cmd.Flags().String(server.FlagMinGasPrices, fmt.Sprintf("0.000006%s", types.DenomDefault), "Minimum gas prices to accept for transactions; All fees in a tx must meet this minimum (e.g. 0.01photon,0.001stake)")
|
||||
cmd.Flags().String(server.FlagMinGasPrices, fmt.Sprintf("0.000006%s", types.DenomDefault), "Minimum gas prices to accept for transactions; All fees in a tx must meet this minimum (e.g. 0.01aphoton,0.001stake)")
|
||||
cmd.Flags().String(flags.FlagKeyringBackend, flags.DefaultKeyringBackend, "Select keyring's backend (os|file|test)")
|
||||
cmd.Flags().String(flagKeyAlgo, string(crypto.EthSecp256k1), "Key signing algorithm to generate keys for")
|
||||
return cmd
|
||||
|
@ -11,5 +11,6 @@ This repository contains reference documentation on the basic concepts of Etherm
|
||||
1. [Accounts](./accounts.md)
|
||||
2. [Gas and Fees](./gas.md)
|
||||
3. [Lifecycle of a transaction](./transactions.md)
|
||||
4. [Photon](./photon.md)
|
||||
|
||||
After reading the basics, head on to the [Core Reference](../core/README.md) for more advanced material.
|
||||
|
@ -26,4 +26,4 @@ The `AnteHandler` is a special `handler` that is run for every transaction durin
|
||||
|
||||
## Next {hide}
|
||||
|
||||
Learn about the [encoding](./../core/encoding.md) formats used on Ethermint {hide}
|
||||
Learn about the [Photon](./photon.md) token {hide}
|
||||
|
BIN
docs/basics/img/photon.png
Normal file
BIN
docs/basics/img/photon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 19 KiB |
33
docs/basics/photon.md
Normal file
33
docs/basics/photon.md
Normal file
@ -0,0 +1,33 @@
|
||||
<!--
|
||||
order: 4
|
||||
-->
|
||||
|
||||
# Photon
|
||||
|
||||
Learn about the Photon, Ethermint's staking token. {synopsis}
|
||||
|
||||
## Introduction
|
||||
|
||||
::: tip
|
||||
The photon's initial distribution and supply is still TBD and will be announced in the future.
|
||||
:::
|
||||
|
||||
The photon is the staking token used in Ethermint.
|
||||
|
||||
## Base Denomination
|
||||
|
||||
Ethermint uses [Atto](https://en.wikipedia.org/wiki/Atto-) Photon as the base denomination to maintain parity with Ethereum.
|
||||
|
||||
```
|
||||
1 photon = 1×10⁻¹⁸ aphoton
|
||||
```
|
||||
|
||||
This matches Ethereum denomination of:
|
||||
|
||||
```
|
||||
1 ETH = 1x10⁻¹⁸ wei
|
||||
```
|
||||
|
||||
## Next {hide}
|
||||
|
||||
Learn about the [encoding](./../core/encoding.md) formats used on Ethermint {hide}
|
@ -50,7 +50,7 @@ ethermintcli keys unsafe-export-eth-key mykey
|
||||
Go back to the browser and select the `Private Key` option. Then paste the private key exported from
|
||||
the `unsafe-export-eth-key` command.
|
||||
|
||||
Your account balance should show up as `1 PHOTON` and do transfers as usual.
|
||||
Your account balance should show up as `1 APHOTON` and do transfers as usual.
|
||||
|
||||
::: tip
|
||||
If it takes some time to load the balance of the account, change the network to `Main Ethereum
|
||||
@ -63,4 +63,4 @@ to see metamask logs, go to top right circle -> settings -> advanced -> download
|
||||
|
||||
## Known issues
|
||||
|
||||
Currently, it's not possible to add custom tokens (even for Photons) unless you deploy a token contract (eg: ERC20).
|
||||
Currently, it's not possible to add custom tokens (even for APhotons) unless you deploy a token contract (eg: ERC20).
|
||||
|
@ -48,7 +48,7 @@ You can edit the `$HOME/.ethermintd/config/app.toml` file in order to enable the
|
||||
|
||||
# The minimum gas prices a validator is willing to accept for processing a
|
||||
# transaction. A transaction's fees must meet the minimum of any denomination
|
||||
# specified in this config (e.g. 10photon).
|
||||
# specified in this config (e.g. 10aphoton).
|
||||
|
||||
minimum-gas-prices = ""
|
||||
```
|
||||
@ -62,7 +62,7 @@ ethermintcli keys add $KEY
|
||||
# Add that key into the genesis.app_state.accounts array in the genesis file
|
||||
# NOTE: this command lets you set the number of coins. Make sure this account has some coins
|
||||
# with the genesis.app_state.staking.params.bond_denom denom, the default is staking
|
||||
ethermintd add-genesis-account $(ethermintcli keys show validator -a) 1000000000stake,10000000000photon
|
||||
ethermintd add-genesis-account $(ethermintcli keys show validator -a) 1000000000stake,10000000000aphoton
|
||||
|
||||
# Generate the transaction that creates your validator
|
||||
ethermintd gentx --name $KEY
|
||||
@ -319,7 +319,7 @@ Once the ethermint daemon is up and running, you can request tokens to your addr
|
||||
ethermintcli q bank balances $(ethermintcli keys show <mykey> -a)
|
||||
|
||||
# send a tx to request tokens to your account address
|
||||
ethermintcli tx faucet request 100photon --from <mykey>
|
||||
ethermintcli tx faucet request 100aphoton --from <mykey>
|
||||
|
||||
# query your balance after the request
|
||||
ethermintcli q bank balances $(ethermintcli keys show <mykey> -a)
|
||||
|
@ -33,7 +33,7 @@ To create your validator, just use the following command:
|
||||
|
||||
```bash
|
||||
ethermintcli tx staking create-validator \
|
||||
--amount=1000000photon \
|
||||
--amount=1000000aphoton \
|
||||
--pubkey=$(ethermintd tendermint show-validator) \
|
||||
--moniker=<ethermint_validator> \
|
||||
--chain-id=<chain_id> \
|
||||
@ -51,7 +51,7 @@ When specifying commission parameters, the `commission-max-change-rate` is used
|
||||
:::
|
||||
|
||||
::: tip
|
||||
`Min-self-delegation` is a stritly positive integer that represents the minimum amount of self-delegated voting power your validator must always have. A `min-self-delegation` of 1 means your validator will never have a self-delegation lower than `1000000photon`
|
||||
`Min-self-delegation` is a stritly positive integer that represents the minimum amount of self-delegated voting power your validator must always have. A `min-self-delegation` of 1 means your validator will never have a self-delegation lower than `1000000aphoton`
|
||||
:::
|
||||
|
||||
You can confirm that you are in the validator set by using a third party explorer.
|
||||
|
4
init.sh
4
init.sh
@ -24,7 +24,7 @@ ethermintcli keys add $KEY
|
||||
ethermintd init $MONIKER --chain-id $CHAINID
|
||||
|
||||
# Allocate genesis accounts (cosmos formatted addresses)
|
||||
ethermintd add-genesis-account $(ethermintcli keys show $KEY -a) 1000000000000000000photon,1000000000000000000stake
|
||||
ethermintd add-genesis-account $(ethermintcli keys show $KEY -a) 1000000000000000000aphoton,1000000000000000000stake
|
||||
|
||||
# Sign genesis transaction
|
||||
ethermintd gentx --name $KEY --keyring-backend test
|
||||
@ -37,7 +37,7 @@ cat $HOME/.ethermintd/config/genesis.json | jq '.app_state["faucet"]["enable_fa
|
||||
|
||||
echo -e '\n\ntestnet faucet enabled'
|
||||
echo -e 'to transfer tokens to your account address use:'
|
||||
echo -e "ethermintcli tx faucet request 100photon --from $KEY\n"
|
||||
echo -e "ethermintcli tx faucet request 100aphoton --from $KEY\n"
|
||||
|
||||
|
||||
# Run this to ensure everything worked and that the genesis file is setup correctly
|
||||
|
@ -84,7 +84,7 @@ init_func() {
|
||||
"$PWD"/build/ethermintcli config trust-node true --home "$DATA_CLI_DIR$i"
|
||||
echo "prepare genesis: Allocate genesis accounts"
|
||||
"$PWD"/build/ethermintd add-genesis-account \
|
||||
"$("$PWD"/build/ethermintcli keys show "$KEY$i" -a --home "$DATA_CLI_DIR$i" )" 1000000000000000000photon,1000000000000000000stake \
|
||||
"$("$PWD"/build/ethermintcli keys show "$KEY$i" -a --home "$DATA_CLI_DIR$i" )" 1000000000000000000aphoton,1000000000000000000stake \
|
||||
--home "$DATA_DIR$i" --home-client "$DATA_CLI_DIR$i"
|
||||
echo "prepare genesis: Sign genesis transaction"
|
||||
"$PWD"/build/ethermintd gentx --name $KEY"$i" --keyring-backend test --home "$DATA_DIR$i" --home-client "$DATA_CLI_DIR$i"
|
||||
|
@ -756,7 +756,7 @@ func TestEth_EstimateGas(t *testing.T) {
|
||||
err := json.Unmarshal(rpcRes.Result, &gas)
|
||||
require.NoError(t, err)
|
||||
|
||||
require.Equal(t, "0xffac", gas.String())
|
||||
require.Equal(t, "0xffdf", gas.String())
|
||||
}
|
||||
|
||||
func TestEth_EstimateGas_ContractDeployment(t *testing.T) {
|
||||
|
@ -56,7 +56,7 @@ func (acc EthAccount) Balance() sdk.Int {
|
||||
return acc.GetCoins().AmountOf(DenomDefault)
|
||||
}
|
||||
|
||||
// SetBalance sets an account's balance of photons
|
||||
// SetBalance sets an account's balance of aphotons
|
||||
func (acc *EthAccount) SetBalance(amt sdk.Int) {
|
||||
coins := acc.GetCoins()
|
||||
diff := amt.Sub(coins.AmountOf(DenomDefault))
|
||||
|
@ -8,5 +8,5 @@ const (
|
||||
|
||||
// DenomDefault defines the single coin type/denomination supported in
|
||||
// Ethermint.
|
||||
DenomDefault = "photon"
|
||||
DenomDefault = "aphoton"
|
||||
)
|
||||
|
@ -47,7 +47,7 @@ func GetTxCmd(cdc *codec.Codec) *cobra.Command {
|
||||
// GetCmdSendTx generates an Ethermint transaction (excludes create operations)
|
||||
func GetCmdSendTx(cdc *codec.Codec) *cobra.Command {
|
||||
return &cobra.Command{
|
||||
Use: "send [to_address] [amount (in photons)] [<data>]",
|
||||
Use: "send [to_address] [amount (in aphotons)] [<data>]",
|
||||
Short: "send transaction to address (call operations included)",
|
||||
Args: cobra.RangeArgs(2, 3),
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
@ -104,7 +104,7 @@ func GetCmdSendTx(cdc *codec.Codec) *cobra.Command {
|
||||
// GetCmdGenCreateTx generates an Ethermint transaction (excludes create operations)
|
||||
func GetCmdGenCreateTx(cdc *codec.Codec) *cobra.Command {
|
||||
return &cobra.Command{
|
||||
Use: "create [contract bytecode] [<amount (in photons)>]",
|
||||
Use: "create [contract bytecode] [<amount (in aphotons)>]",
|
||||
Short: "create contract through the evm using compiled bytecode",
|
||||
Args: cobra.RangeArgs(1, 2),
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
|
Loading…
Reference in New Issue
Block a user