Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

Start other network without forking #293

Closed
yihuang opened this issue Jul 15, 2021 · 6 comments · Fixed by #378
Closed

Start other network without forking #293

yihuang opened this issue Jul 15, 2021 · 6 comments · Fixed by #378
Assignees

Comments

@yihuang
Copy link
Contributor

yihuang commented Jul 15, 2021

Proposal: Run other networks without forking

Current behavior: Several chain parameters are static constants, not easy to change if not fork or significant copy-paste code.

Desired behavior: easy to start another network by import ethermint as a module

Use case: start other network with ethermint codebase.

Approach 1

New network re-use the whole ethermint scaffolding, just make some constants customizable, mainly these things.

Approach 2

New network start with cosmos-sdk simapp standard scaffolding, possibly with it's own customization, only add necessary stuff for ethermint to run, mainly:

  • add evm module
  • custom ante handler
  • extra app configuration (evm-rpc listen addresses)
  • start evm rpc server in cli start command
  • anything else?
@yihuang yihuang changed the title make several chain parameters customizable Support for other network to import ethermint repository directly Jul 15, 2021
@yihuang yihuang changed the title Support for other network to import ethermint repository directly Support other network without forking Jul 15, 2021
@yihuang yihuang changed the title Support other network without forking Start other network without forking Jul 15, 2021
@leejw51crypto
Copy link
Contributor

how about approach 1,
what's the benefit of approach 2 ?

@yihuang
Copy link
Contributor Author

yihuang commented Jul 15, 2021

how about approach 1,
what's the benefit of approach 2 ?

with approach 2, we would be more clear on what changes ethermint does on top of cosmos-sdk standard scaffolding, currently ethermint scaffolding is significantly different from cosmos-sdk one, I'm not sure which part is necessary which part is accidental. With this approach we can also do our own customization, for example add other native modules.

Actually I'd like to try approach 2, and record the change list we have to do for ethermint to run.

@fedekunze
Copy link
Contributor

Several chain parameters are static constants, not easy to change if not fork or significant copy-paste code.

what are the chain parameters that you would like to change?

@yihuang
Copy link
Contributor Author

yihuang commented Jul 15, 2021

Several chain parameters are static constants, not easy to change if not fork or significant copy-paste code.

what are the chain parameters that you would like to change?

Normally just these things https://github.com/tharsis/ethermint/blob/main/app/app.go#L109:

  • address prefix
  • bip44 coin type
  • default home directory name

But for the testnet, we decide not change, the decision for the mainnet is not made yet.
There's also possibility that we might want to add new native modules in the future though.

@fedekunze
Copy link
Contributor

fedekunze commented Jul 15, 2021

Normally just these things https://github.com/tharsis/ethermint/blob/main/app/app.go#L109:

but you can change those by defining them in your app.go, you just need to define your prefix and home directory. The approach 2 is what chains would usually use when importing external modules

@yihuang
Copy link
Contributor Author

yihuang commented Jul 15, 2021

Normally just these things https://github.com/tharsis/ethermint/blob/main/app/app.go#L109:

but you can change those by defining them in your app.go, you just need to define your prefix and home directory. The approach 2 is what chains would usually use when importing external modules

Do you mean embed the EthermintApp and override some methods?

Another issue is the cli commands is defined in main package, which seems to be not importable.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants