laconicd-deprecated/docs/guides/metamask.md
Federico Kunze d4fe9b234c
docs: vuepress setup and section titles (#311)
* vuepress

* docs: vuepress setup and TODOs

* doc scripts

* update Makefile and gitignore

* more docs updates

* gitignore

* metamask instructions

* update image

* updates

* updates from call

* docs: vuepress config and home.vue (#350)

* update uncles return (#337)

* x/evm: fix EndBlock consensus failure (#334)

* add test for sending tx w/ 21000 gas

* improve rpc transfer test

* use ctx in EndBlock

* UpdateAccounts and ClearStateObjects with passed in context

* log ethereum address on error

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: Federico Kunze <federico.kunze94@gmail.com>

* update Ethermint color variables

* add header and footer logo

* tweak config.js

* WIP custom homepage.vue

* add layout to docs/README

* update color variables

* add eth logo black and white

* tweak docs/README

* update logo and logo-bw svg

* bump 1.0.167

* homepage → home

* add icon-code, icon-rocket

* layout: home, remove configurable frontmatter: label, read, use

* clean up config.js

* bump 1.0.168

* fix missing comma from resolving conflicts

* update sidebar, config nav, path

* remove left whitespace on the header and footer logos

* clean up home.vue, docs/README

* update ethermint forum url in footer.links

* comment out custom true to enable searchbar in subpages

* remove external link icon for Guides

* comments, revert custom true

* clean up config.js, add specifications icon

Co-authored-by: noot <36753753+noot@users.noreply.github.com>
Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: Federico Kunze <federico.kunze94@gmail.com>

* final touches

Co-authored-by: Cyrus Goh <hello@lovincyrus.com>
Co-authored-by: noot <36753753+noot@users.noreply.github.com>
2020-07-02 04:22:45 -04:00

67 lines
2.4 KiB
Markdown

<!--
order: 1
-->
# Metamask
Connect your Metamask wallet with Ethermint on a localnet mode. {synopsis}
## Start node and REST server
Start the Ethermint node using your terminal:
```bash
emintd start --pruning=nothing --rpc.unsafe --log_level "main:info,state:info,mempool:info"
```
::: tip
You can also start a node from scratch by running `./init.sh` from the Ethermint repository directory. This will generate a key called `mykey` that you can use on the next step.
:::
In another tab start the REST server. Here replace `mykey` with the name of the key that you want to use and set the `chain-id` the chain identifier of your application.
```bash
emintcli rest-server --laddr "tcp://localhost:8545" --unlock-key mykey --chain-id 1
```
## Adding a custom Network for Ethermint
One og the main limitations of using the default `Localhost 8545` network is that the tokens will be represented as `ETH`.
Open the Metamask extension on your browser, you may have to log in to your Metamask account if you
are not already. Then click the top right circle and go to `Settings` > `Networks`. Press the `Add
Network` button and fill the form as shown below with your application `ChainID`.
![metamask networks settings](./img/metamask_network_settings.png)
## Import Account to Metamask
Then close the settings, and go to `My Accounts` (top right circle) and select `Import Account`. You should see and image like the following one:
![metamask import account page](./img/metamask_import.png)
Now you can export your private key from the terminal using the following command. Again, make sure
to replace `mykey` with the name of the key that you want to export:
```bash
emintcli 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.
::: tip
If it takes some time to load the balance of the account, change the network to `Main Ethereum
Network` (or any other than `Localhost 8545` or `Ethermint`) and then switch back to `Ethermint`.
:::
## Downloading State
to see metamask logs, go to top right circle -> settings -> advanced -> download state logs. if you search through the json file for the account address you'll find the tx history
## Known issues
Currently, it's not possible to add custom tokens (even for Photons) unless you deploy a token contract (eg: ERC20).