-
Notifications
You must be signed in to change notification settings - Fork 189
Simplify the initialisation and starting by following the tendermint way #244
Comments
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
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
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 |
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 ```
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 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. |
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 ```
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 |
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 I see, I'll have to think of how I can implement your suggestion. |
would be great of |
yeah, currently this line is false, but it'd be tremendously useful if it were true |
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 ```
@adrianbrink did you delete your comment in regards to starting |
They are in #179 |
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 ```
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 ```
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 ```
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 ```
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>
* 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]>
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:
$ tendermint init --home ~/.ethermint/tendermint
cd $GOPATH/src/github.com/tendermint/ethermint
ethermint --datadir ~/.ethermint init setup/genesis.json
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 liketendermint 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 diskThis will fold steps 2) and 3) into one.
I am on the fence though about whether we should also fold in step 4) Thoughts?
The text was updated successfully, but these errors were encountered: