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

Simplify the initialisation and starting by following the tendermint way #244

Closed
odeke-em opened this issue Aug 13, 2017 · 9 comments
Closed
Assignees

Comments

@odeke-em
Copy link
Contributor

From our Friday Ethermint meeting between @adrianbrink @ebuchman @jaekwon and myself, we realized that currently setting up Ethermint is tricky to do.

Problem statement

It currently consists of these steps:

  1. $ tendermint init --home ~/.ethermint/tendermint
  2. cd $GOPATH/src/github.com/tendermint/ethermint
  3. ethermint --datadir ~/.ethermint init setup/genesis.json
  4. cp -r setup/keystore ~/.ethermint

Notice that steps 2) and 3) require going into the directories and copying a default file.
This dance is tedious even for us the developers of Ethermint. Tendermint is easier to setup
and uses a default file

Problem solution

Let's make ethermint init act like tendermint init in which we can optionally specify a a private key validator file, otherwise if the file doesn't exist, we create one and make defaults for it https://github.com/tendermint/tendermint/blob/f8035441951a8d1cbdbc97ba295ea3b85e3c1981/cmd/tendermint/commands/init.go#L23-L43, then serialize it to disk

This will fold steps 2) and 3) into one.

I am on the fence though about whether we should also fold in step 4) Thoughts?

odeke-em added a commit to orijtech/tmlibs that referenced this issue Aug 13, 2017
For cosmos/ethermint-archive#244.

ParseGenesisOrDefault replaces the step in which while
init-ing ethermint, we have to
* cd $GOPATH/src/github.com/tendermint/ethermint
* ethermint --datadir ~/.ethermint init setup/genesis.json
so we have the serialized record of the setup/genesis.json
that will be used by default, if the file:
a) doesn't exist
b) doesn't have content ie less than {}

+ Why here:
Since $GOPATH/src/tendermint/ethermint/cmd/ethermint
has a bunch of initializers that depend on os.Args[0]
so we can't be running tests in there without periliously
trying to change os.Args that isn't populated when we run
```shell
$ go test -run=TestParse
```
or in our CI
so extract and move that utility to here, the common utilities area
odeke-em added a commit to orijtech/tmlibs that referenced this issue Aug 13, 2017
For cosmos/ethermint-archive#244.

ParseGenesisOrDefault replaces the step in which while
init-ing ethermint, we have to
* cd $GOPATH/src/github.com/tendermint/ethermint
* ethermint --datadir ~/.ethermint init setup/genesis.json
so we have the serialized record of the setup/genesis.json
that will be used by default, if the file:
a) doesn't exist
b) doesn't have content ie less than {}

+ Why here:
Since $GOPATH/src/tendermint/ethermint/cmd/ethermint
has a bunch of initializers in:
ethUtils "github.com/ethereum/go-ethereum/cmd/utils"
```go
app = ethUtils.NewApp(version.Version, "the ethermint command line interface")
```
whose definition in flags.go
```go
func NewApp(gitcommit, usage string) *cli.App {
  app := cli.NewApp()
  app.Name = filepath.Base(os.Args[0])
```
that depend on os.Args[0]

so we can't be running tests in there without periliously
trying to change os.Args that isn't populated when we run
```shell
$ go test -run=TestParse
```
or in our CI
thus extract and move that utility to here, the common utilities area
@odeke-em
Copy link
Contributor Author

IMO I vote that we fold steps 2), 3) and 4) into one since by step 3) we've already replaced just one step of having to cd into $GOPATH/src/github.com/tendermint/ethermint; then using setup/genesis.json, so it only makes sense to do step 4) otherwise users will still have to cd there

odeke-em added a commit to orijtech/ethermint that referenced this issue Aug 13, 2017
Requires tendermint/tmlibs#35
Fixes cosmos#244

Act like `tendermint init` so that if we don't have
a genesis-path, and also move to $HOME/.ethermint/keystore, the
files that are currently contained in
$GOPATH/src/github.com/tendermint/ethermint/setup/keystore

Therefore now `ethermint init` should be one step e.g
```shell
$ ethermint --datadir ~/.ethermint init
```
instead of the formerly tedious
```shell
$ cd $GOPATH/src/github.com/tendermint/ethermint
$ ethermint --datadir ~/.ethermint init setup/genesis.json
$ cp -r setup/keystore ~/.ethermint
```
odeke-em added a commit to orijtech/ethermint that referenced this issue Aug 13, 2017
Requires tendermint/tmlibs#35
Fixes cosmos#244

Act like `tendermint init` so that if we don't have
a genesis-path, and also move to $HOME/.ethermint/keystore, the
files that are currently contained in
$GOPATH/src/github.com/tendermint/ethermint/setup/keystore

Therefore now `ethermint init` should be one step e.g
```shell
$ ethermint --datadir ~/.ethermint init
```
instead of the formerly tedious
```shell
$ cd $GOPATH/src/github.com/tendermint/ethermint
$ ethermint --datadir ~/.ethermint init setup/genesis.json
$ cp -r setup/keystore ~/.ethermint
```
@adrianbrink adrianbrink changed the title init should not need manual copying of genesis file or use a default genesis file when unspecified Simplify the initialisation and starting by following the tendermint way Aug 14, 2017
@adrianbrink
Copy link

@odeke-em I agree with you on this one. Could you also generalise the problem description here, since I would like this issue to track the progress on the entire simplification of the initialisation and starting of ethermint.

@adrianbrink adrianbrink added this to the 0.5.0 milestone Aug 14, 2017
odeke-em added a commit to orijtech/ethermint that referenced this issue Aug 14, 2017
Requires tendermint/tmlibs#35
Fixes cosmos#244

Act like `tendermint init` so that if we don't have
a genesis-path, and also move to $HOME/.ethermint/keystore, the
files that are currently contained in
$GOPATH/src/github.com/tendermint/ethermint/setup/keystore

Therefore now `ethermint init` should be one step e.g
```shell
$ ethermint --datadir ~/.ethermint init
```
instead of the formerly tedious
```shell
$ cd $GOPATH/src/github.com/tendermint/ethermint
$ ethermint --datadir ~/.ethermint init setup/genesis.json
$ cp -r setup/keystore ~/.ethermint
```
@ebuchman
Copy link
Member

in which we can optionally specify a a private key validator file

Note we can't really do this, since we're trying to init an ethereum account which is different than a tendermint validator. Perhaps we should integrate with the basecli style key handling though, since I think that lets you make secp256k1 keys

odeke-em added a commit to orijtech/ethermint that referenced this issue Aug 15, 2017
Fixes cosmos#244

Act like `tendermint init` so that if we don't have
a genesis-path, and also move to $HOME/.ethermint/keystore, the
files that are currently contained in
$GOPATH/src/github.com/tendermint/ethermint/setup/keystore

Therefore now `ethermint init` should be one step e.g
```shell
$ ethermint --datadir ~/.ethermint init
```
instead of the formerly tedious
```shell
$ cd $GOPATH/src/github.com/tendermint/ethermint
$ ethermint --datadir ~/.ethermint init setup/genesis.json
$ cp -r setup/keystore ~/.ethermint
```
@odeke-em
Copy link
Contributor Author

@ebuchman I see, I'll have to think of how I can implement your suggestion.

@zramsay
Copy link
Contributor

zramsay commented Aug 18, 2017

would be great of ethermint/tendermint init each had --testnets venus/mercury/etc flag to write the files (rather than cloning from the testnets repo)

@adrianbrink
Copy link

adrianbrink commented Aug 18, 2017

@zramsay is referring to #179 & #270

@zramsay
Copy link
Contributor

zramsay commented Aug 18, 2017

yeah, currently this line is false, but it'd be tremendously useful if it were true

odeke-em added a commit that referenced this issue Aug 20, 2017
Fixes #244

Act like `tendermint init` so that if we don't have
a genesis-path, and also move to $HOME/.ethermint/keystore, the
files that are currently contained in
$GOPATH/src/github.com/tendermint/ethermint/setup/keystore

Therefore now `ethermint init` should be one step e.g
```shell
$ ethermint --datadir ~/.ethermint init
```
instead of the formerly tedious
```shell
$ cd $GOPATH/src/github.com/tendermint/ethermint
$ ethermint --datadir ~/.ethermint init setup/genesis.json
$ cp -r setup/keystore ~/.ethermint
```
@odeke-em
Copy link
Contributor Author

@adrianbrink did you delete your comment in regards to starting tendermint as a subprocess? Otherwise I think I recall the excellent suggestion posted up by you.

@adrianbrink
Copy link

They are in #179

odeke-em added a commit to orijtech/ethermint that referenced this issue Aug 24, 2017
Fixes cosmos#244

Act like `tendermint init` so that if we don't have
a genesis-path, and also move to $HOME/.ethermint/keystore, the
files that are currently contained in
$GOPATH/src/github.com/tendermint/ethermint/setup/keystore

Therefore now `ethermint init` should be one step e.g
```shell
$ ethermint --datadir ~/.ethermint init
```
instead of the formerly tedious
```shell
$ cd $GOPATH/src/github.com/tendermint/ethermint
$ ethermint --datadir ~/.ethermint init setup/genesis.json
$ cp -r setup/keystore ~/.ethermint
```
odeke-em added a commit to orijtech/ethermint that referenced this issue Aug 24, 2017
Fixes cosmos#244

Act like `tendermint init` so that if we don't have
a genesis-path, and also move to $HOME/.ethermint/keystore, the
files that are currently contained in
$GOPATH/src/github.com/tendermint/ethermint/setup/keystore

Therefore now `ethermint init` should be one step e.g
```shell
$ ethermint --datadir ~/.ethermint init
```
instead of the formerly tedious
```shell
$ cd $GOPATH/src/github.com/tendermint/ethermint
$ ethermint --datadir ~/.ethermint init setup/genesis.json
$ cp -r setup/keystore ~/.ethermint
```
adrianbrink pushed a commit that referenced this issue Aug 28, 2017
Fixes #244

Act like `tendermint init` so that if we don't have
a genesis-path, and also move to $HOME/.ethermint/keystore, the
files that are currently contained in
$GOPATH/src/github.com/tendermint/ethermint/setup/keystore

Therefore now `ethermint init` should be one step e.g
```shell
$ ethermint --datadir ~/.ethermint init
```
instead of the formerly tedious
```shell
$ cd $GOPATH/src/github.com/tendermint/ethermint
$ ethermint --datadir ~/.ethermint init setup/genesis.json
$ cp -r setup/keystore ~/.ethermint
```
odeke-em added a commit to orijtech/ethermint that referenced this issue Aug 28, 2017
Fixes cosmos#244

Act like `tendermint init` so that if we don't have
a genesis-path, and also move to $HOME/.ethermint/keystore, the
files that are currently contained in
$GOPATH/src/github.com/tendermint/ethermint/setup/keystore

Therefore now `ethermint init` should be one step e.g
```shell
$ ethermint --datadir ~/.ethermint init
```
instead of the formerly tedious
```shell
$ cd $GOPATH/src/github.com/tendermint/ethermint
$ ethermint --datadir ~/.ethermint init setup/genesis.json
$ cp -r setup/keystore ~/.ethermint
```
i-norden pushed a commit to vulcanize/old_ethermint that referenced this issue Aug 31, 2020
Bumps [github.com/spf13/viper](https://github.com/spf13/viper) from 1.6.2 to 1.6.3.
- [Release notes](https://github.com/spf13/viper/releases)
- [Commits](spf13/viper@v1.6.2...v1.6.3)

Signed-off-by: dependabot-preview[bot] <[email protected]>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
faddat pushed a commit to faddat/ethermint that referenced this issue Aug 24, 2022
* Implement `eth_getPendingTransactions`

Closes cosmos#244

* refactor repeatitive code

* Update ethereum/rpc/namespaces/eth/api.go

Co-authored-by: Federico Kunze Küllmer <[email protected]>

* Update ethereum/rpc/namespaces/eth/api.go

Co-authored-by: Federico Kunze Küllmer <[email protected]>

* Update ethereum/rpc/namespaces/eth/api.go

Co-authored-by: Federico Kunze Küllmer <[email protected]>

* Update ethereum/rpc/namespaces/eth/api.go

Co-authored-by: Federico Kunze Küllmer <[email protected]>

* test UnwrapEthereumMsg

Co-authored-by: Federico Kunze Küllmer <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants