Skip to content

Commit

Permalink
Fix args on starting geth service for donut (#167)
Browse files Browse the repository at this point in the history
* Fix geth args

* Bump versions for new release

* Change default back to --networkid
  • Loading branch information
eelanagaraj committed May 11, 2021
1 parent 9aae491 commit d201d34
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ You also need the following dependencies to be met:
Prerequisites:

- Checkout `celo-blockchain` tag `v1.3.2` (`git fetch --all && git checkout v1.3.2`) (NOTE: check that this matches the version specified in `rosetta`'s `go.mod` file) and `make geth`
- Checkout `rosetta` tag `v0.8.3` (`git fetch --all && git checkout v0.8.3`) (or latest released tag) and `make all`
- Checkout `rosetta` tag `v0.8.4` (`git fetch --all && git checkout v0.8.4`) (or latest released tag) and `make all`
- Run `make alfajores-env` to create an empty datadir with the genesis block (only needs to be run the first time, upon initializing the service). The output should look something like this:

```sh
Expand Down
14 changes: 13 additions & 1 deletion service/geth/geth.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
"syscall"

"github.com/celo-org/celo-blockchain/log"
"github.com/celo-org/celo-blockchain/params"
"github.com/celo-org/kliento/utils/chain"
"github.com/celo-org/rosetta/internal/fileutils"
"github.com/celo-org/rosetta/service"
Expand Down Expand Up @@ -194,7 +195,6 @@ func (gs *gethService) ensureGethInit() error {

func (gs *gethService) startGeth(stdErr *os.File) error {
gethArgs := []string{
"--networkid", gs.chainParams.ChainId.String(),
"--nousb",
"--rpc",
"--rpcaddr", gs.opts.RpcAddr,
Expand All @@ -211,6 +211,18 @@ func (gs *gethService) startGeth(stdErr *os.File) error {
// "--consoleoutput", "split",
}

// Fix necessary flag for node to hardfork properly (temp fix)
switch gs.chainParams.ChainId.String() {
case params.AlfajoresChainConfig.ChainID.String():
gethArgs = append([]string{"--alfajores"}, gethArgs...)
case params.BaklavaChainConfig.ChainID.String():
gethArgs = append([]string{"--baklava"}, gethArgs...)
case params.MainnetChainConfig.ChainID.String():
break
default:
gethArgs = append(gethArgs, "--networkid", gs.chainParams.ChainId.String())
}

if gs.opts.Verbosity != "" {
gethArgs = append(gethArgs, "--verbosity", gs.opts.Verbosity)
}
Expand Down
2 changes: 1 addition & 1 deletion service/rpc/versions.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ const (
)

var (
MiddlewareVersion = "0.8.3"
MiddlewareVersion = "0.8.4"
NodeVersion = params.Version
)

0 comments on commit d201d34

Please sign in to comment.