Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example: Showcase rename chain #1

Draft
wants to merge 3 commits into
base: rename-chain/original
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM --platform=linux/amd64 golang:1.20.2-bullseye AS build-env

WORKDIR /go/src/github.com/EscanBE/evermint
WORKDIR /go/src/github.com/VictorTrustyDev/nevermind

RUN apt-get update -y
RUN apt-get install git -y
@@ -16,8 +16,8 @@ RUN apt-get install ca-certificates jq -y

WORKDIR /root

COPY --from=build-env /go/src/github.com/EscanBE/evermint/build/evmd /usr/bin/evmd
COPY --from=build-env /go/src/github.com/VictorTrustyDev/nevermind/build/nvmd /usr/bin/nvmd

EXPOSE 26656 26657 1317 9090 8545 8546

CMD ["evmd"]
CMD ["nvmd"]
42 changes: 21 additions & 21 deletions Makefile
Original file line number Diff line number Diff line change
@@ -6,12 +6,12 @@ TMVERSION := $(shell go list -m github.com/tendermint/tendermint | sed 's:.* ::'
COMMIT := $(shell git log -1 --format='%H')
LEDGER_ENABLED ?= true
BINDIR ?= $(GOPATH)/bin
APP_BINARY = evmd
APP_BINARY = nvmd
BUILDDIR ?= $(CURDIR)/build
HTTPS_GIT := https://github.com/EscanBE/evermint.git
HTTPS_GIT := https://github.com/VictorTrustyDev/nevermind.git
DOCKER := $(shell which docker)
NAMESPACE := evermint
PROJECT := evermint
NAMESPACE := nevermind
PROJECT := nevermind
DOCKER_IMAGE := $(NAMESPACE)/$(PROJECT)
COMMIT_HASH := $(shell git rev-parse --short=7 HEAD)
DOCKER_TAG := $(COMMIT_HASH)
@@ -60,7 +60,7 @@ build_tags := $(strip $(build_tags))

# process linker flags

ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=evermint \
ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=nevermind \
-X github.com/cosmos/cosmos-sdk/version.AppName=$(APP_BINARY) \
-X github.com/cosmos/cosmos-sdk/version.Version=$(VERSION) \
-X github.com/cosmos/cosmos-sdk/version.Commit=$(COMMIT) \
@@ -132,7 +132,7 @@ build-reproducible: go.sum
$(DOCKER) rm latest-build || true
$(DOCKER) run --volume=$(CURDIR):/sources:ro \
--env TARGET_PLATFORMS='linux/amd64' \
--env APP=evmd \
--env APP=nvmd \
--env VERSION=$(VERSION) \
--env COMMIT=$(COMMIT) \
--env CGO_ENABLED=1 \
@@ -147,12 +147,12 @@ build-docker:
$(DOCKER) tag ${DOCKER_IMAGE}:${DOCKER_TAG} ${DOCKER_IMAGE}:latest
# docker tag ${DOCKER_IMAGE}:${DOCKER_TAG} ${DOCKER_IMAGE}:${COMMIT_HASH}
# update old container
$(DOCKER) rm evermint || true
$(DOCKER) rm nevermind || true
# create a new container from the latest image
$(DOCKER) create --name evermint -t -i ${DOCKER_IMAGE}:latest evermint
$(DOCKER) create --name nevermind -t -i ${DOCKER_IMAGE}:latest nevermind
# move the binaries to the ./build directory
mkdir -p ./build/
$(DOCKER) cp evermint:/usr/bin/evmd ./build/
$(DOCKER) cp nevermind:/usr/bin/nvmd ./build/

push-docker: build-docker
$(DOCKER) push ${DOCKER_IMAGE}:${DOCKER_TAG}
@@ -278,7 +278,7 @@ update-swagger-docs: statik
.PHONY: update-swagger-docs

godocs:
@echo "--> Wait a few seconds and visit http://localhost:6060/pkg/github.com/EscanBE/evermint"
@echo "--> Wait a few seconds and visit http://localhost:6060/pkg/github.com/VictorTrustyDev/nevermind"
godoc -http=:6060

###############################################################################
@@ -312,7 +312,7 @@ test-e2e:
make build-docker; \
fi
@mkdir -p ./build
@rm -rf build/.evermint
@rm -rf build/.nevermind
@INITIAL_VERSION=$(INITIAL_VERSION) TARGET_VERSION=$(TARGET_VERSION) \
E2E_SKIP_CLEANUP=$(E2E_SKIP_CLEANUP) MOUNT_PATH=$(MOUNT_PATH) CHAIN_ID=$(CHAIN_ID) \
go test -v ./tests/e2e -run ^TestIntegrationTestSuite$
@@ -488,7 +488,7 @@ localnet-build:

# Start a 4-node testnet locally
localnet-start: localnet-stop localnet-build
@if ! [ -f build/node0/$(APP_BINARY)/config/genesis.json ]; then docker run --rm -v $(CURDIR)/build:/evermint:Z evermint/node "./evmd testnet init-files --v 4 -o /evermint --keyring-backend=test --starting-ip-address 192.167.10.2"; fi
@if ! [ -f build/node0/$(APP_BINARY)/config/genesis.json ]; then docker run --rm -v $(CURDIR)/build:/nevermind:Z nevermind/node "./nvmd testnet init-files --v 4 -o /nevermind --keyring-backend=test --starting-ip-address 192.167.10.2"; fi
docker-compose up -d

# Stop testnet
@@ -504,15 +504,15 @@ localnet-clean:
localnet-unsafe-reset:
docker-compose down
ifeq ($(OS),Windows_NT)
@docker run --rm -v $(CURDIR)\build\node0\evmd:/evermint\Z evermint/node "./evmd tendermint unsafe-reset-all --home=/evermint"
@docker run --rm -v $(CURDIR)\build\node1\evmd:/evermint\Z evermint/node "./evmd tendermint unsafe-reset-all --home=/evermint"
@docker run --rm -v $(CURDIR)\build\node2\evmd:/evermint\Z evermint/node "./evmd tendermint unsafe-reset-all --home=/evermint"
@docker run --rm -v $(CURDIR)\build\node3\evmd:/evermint\Z evermint/node "./evmd tendermint unsafe-reset-all --home=/evermint"
@docker run --rm -v $(CURDIR)\build\node0\nvmd:/nevermind\Z nevermind/node "./nvmd tendermint unsafe-reset-all --home=/nevermind"
@docker run --rm -v $(CURDIR)\build\node1\nvmd:/nevermind\Z nevermind/node "./nvmd tendermint unsafe-reset-all --home=/nevermind"
@docker run --rm -v $(CURDIR)\build\node2\nvmd:/nevermind\Z nevermind/node "./nvmd tendermint unsafe-reset-all --home=/nevermind"
@docker run --rm -v $(CURDIR)\build\node3\nvmd:/nevermind\Z nevermind/node "./nvmd tendermint unsafe-reset-all --home=/nevermind"
else
@docker run --rm -v $(CURDIR)/build/node0/evmd:/evermint:Z evermint/node "./evmd tendermint unsafe-reset-all --home=/evermint"
@docker run --rm -v $(CURDIR)/build/node1/evmd:/evermint:Z evermint/node "./evmd tendermint unsafe-reset-all --home=/evermint"
@docker run --rm -v $(CURDIR)/build/node2/evmd:/evermint:Z evermint/node "./evmd tendermint unsafe-reset-all --home=/evermint"
@docker run --rm -v $(CURDIR)/build/node3/evmd:/evermint:Z evermint/node "./evmd tendermint unsafe-reset-all --home=/evermint"
@docker run --rm -v $(CURDIR)/build/node0/nvmd:/nevermind:Z nevermind/node "./nvmd tendermint unsafe-reset-all --home=/nevermind"
@docker run --rm -v $(CURDIR)/build/node1/nvmd:/nevermind:Z nevermind/node "./nvmd tendermint unsafe-reset-all --home=/nevermind"
@docker run --rm -v $(CURDIR)/build/node2/nvmd:/nevermind:Z nevermind/node "./nvmd tendermint unsafe-reset-all --home=/nevermind"
@docker run --rm -v $(CURDIR)/build/node3/nvmd:/nevermind:Z nevermind/node "./nvmd tendermint unsafe-reset-all --home=/nevermind"
endif

# Clean testnet
@@ -525,7 +525,7 @@ localnet-show-logstream:
### Releasing ###
###############################################################################

PACKAGE_NAME:=github.com/EscanBE/evermint
PACKAGE_NAME:=github.com/VictorTrustyDev/nevermind
GOLANG_CROSS_VERSION = v1.20
GOPATH ?= '$(HOME)/go'
release-dry-run:
32 changes: 16 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
This is branch [rename-chain/original](https://github.com/EscanBE/evermint/tree/rename-chain/original), the original Evermint chain before renamed as example in [PR #1](https://github.com/EscanBE/evermint/pull/1)
This is branch [rename-chain/after](https://github.com/EscanBE/evermint/tree/rename-chain/after), the new chain Nevermind after renamed from Escan/Evermint as example in [PR #1](https://github.com/EscanBE/evermint/pull/1)

Summary original symbols of the chain before rename:
Summary new symbols of the chain after renamed:
```golang
const (
ApplicationName = "evermint"
ApplicationBinaryName = "evmd"
ApplicationHome = ".evermint"
ApplicationName = "nevermind" // renamed from "evermint"
ApplicationBinaryName = "nvmd" // renamed from "evmd"
ApplicationHome = ".nevermind" // renamed from ".evermint"

GitHubRepo = "https://github.com/EscanBE/evermint" // must be well-formed url pattern: "https://github.com/owner/repo"
GitHubRepo = "https://github.com/VictorTrustyDev/nevermind" // renamed from "https://github.com/EscanBE/evermint"

BaseDenom = "wei"
DisplayDenom = "ether"
SymbolDenom = "ETH"
BaseDenom = "uever" // renamed from "wei"
DisplayDenom = "ever" // renamed from "ether"
SymbolDenom = "EVER" // renamed from "ETH"
BaseDenomExponent = 18

Bech32Prefix = "evm"
Bech32Prefix = "ever" // renamed from "evm"

MainnetFullChainId = "evermint_90909-1"
TestnetFullChainId = "evermint_80808-1"
DevnetFullChainId = "evermint_70707-1"
MainnetFullChainId = "nevermind_123567-1" // renamed from "evermint_90909-1"
TestnetFullChainId = "nevermind_5678-1" // renamed from "evermint_80808-1"
DevnetFullChainId = "nevermind_1234-1" // renamed from "evermint_70707-1"

MainnetEIP155ChainId = 90909
TestnetEIP155ChainId = 80808
DevnetEIP155ChainId = 70707
MainnetEIP155ChainId = 123567 // renamed from 90909
TestnetEIP155ChainId = 5678 // renamed from 80808
DevnetEIP155ChainId = 1234 // renamed from 70707
)
```
8 changes: 4 additions & 4 deletions RENAME_CHAIN.md
Original file line number Diff line number Diff line change
@@ -8,13 +8,13 @@ Step 2: Run `./rename-chain.sh`

Done, you have your own chain now. Try running tests to make sure everything is working fine.

[View example after rename](https://github.com/EscanBE/evermint/pull/1)
[View example after rename](https://github.com/VictorTrustyDev/nevermind/pull/1)
___
Cleanup notes to be checked after running script:
- Directory `./rename_chain` is deleted.
- Script `./rename-chain.sh` is deleted.
- Make sure the following words, which belong to definition of evermint, are no longer exists:
- evmd (binary name)
- evermint (git repo + application name)
- Make sure the following words, which belong to definition of nevermind, are no longer exists:
- nvmd (binary name)
- nevermind (git repo + application name)
- evm1 (bech32 prefix)
- EscanBE (git owner name)
8 changes: 4 additions & 4 deletions app/ante/cosmos/authz_test.go
Original file line number Diff line number Diff line change
@@ -15,10 +15,10 @@ import (
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"

cosmosante "github.com/EscanBE/evermint/v12/app/ante/cosmos"
testutil "github.com/EscanBE/evermint/v12/testutil"
utiltx "github.com/EscanBE/evermint/v12/testutil/tx"
evmtypes "github.com/EscanBE/evermint/v12/x/evm/types"
cosmosante "github.com/VictorTrustyDev/nevermind/v12/app/ante/cosmos"
testutil "github.com/VictorTrustyDev/nevermind/v12/testutil"
utiltx "github.com/VictorTrustyDev/nevermind/v12/testutil/tx"
evmtypes "github.com/VictorTrustyDev/nevermind/v12/x/evm/types"
)

func TestAuthzLimiterDecorator(t *testing.T) {
14 changes: 7 additions & 7 deletions app/ante/cosmos/eip712.go
Original file line number Diff line number Diff line change
@@ -5,9 +5,9 @@ import (

errorsmod "cosmossdk.io/errors"

"github.com/EscanBE/evermint/v12/crypto/ethsecp256k1"
"github.com/EscanBE/evermint/v12/ethereum/eip712"
"github.com/EscanBE/evermint/v12/types"
"github.com/VictorTrustyDev/nevermind/v12/crypto/ethsecp256k1"
"github.com/VictorTrustyDev/nevermind/v12/ethereum/eip712"
"github.com/VictorTrustyDev/nevermind/v12/types"
"github.com/cosmos/cosmos-sdk/codec"
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
@@ -21,15 +21,15 @@ import (
"github.com/ethereum/go-ethereum/crypto/secp256k1"
"github.com/ethereum/go-ethereum/signer/core/apitypes"

evmtypes "github.com/EscanBE/evermint/v12/x/evm/types"
evmtypes "github.com/VictorTrustyDev/nevermind/v12/x/evm/types"
)

var evermintCodec codec.ProtoCodecMarshaler
var nevermindCodec codec.ProtoCodecMarshaler

func init() {
registry := codectypes.NewInterfaceRegistry()
types.RegisterInterfaces(registry)
evermintCodec = codec.NewProtoCodec(registry)
nevermindCodec = codec.NewProtoCodec(registry)
}

// Deprecated: LegacyEip712SigVerificationDecorator Verify all signatures for a tx and return an error if any are invalid. Note,
@@ -224,7 +224,7 @@ func VerifySignature(
FeePayer: feePayer,
}

typedData, err := eip712.LegacyWrapTxToTypedData(evermintCodec, extOpt.TypedDataChainID, msgs[0], txBytes, feeDelegation)
typedData, err := eip712.LegacyWrapTxToTypedData(nevermindCodec, extOpt.TypedDataChainID, msgs[0], txBytes, feeDelegation)
if err != nil {
return errorsmod.Wrap(err, "failed to create EIP-712 typed data from tx")
}
2 changes: 1 addition & 1 deletion app/ante/cosmos/fees.go
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ import (
"math"

errorsmod "cosmossdk.io/errors"
anteutils "github.com/EscanBE/evermint/v12/app/ante/utils"
anteutils "github.com/VictorTrustyDev/nevermind/v12/app/ante/utils"
sdk "github.com/cosmos/cosmos-sdk/types"
errortypes "github.com/cosmos/cosmos-sdk/types/errors"
authante "github.com/cosmos/cosmos-sdk/x/auth/ante"
8 changes: 4 additions & 4 deletions app/ante/cosmos/fees_test.go
Original file line number Diff line number Diff line change
@@ -2,13 +2,13 @@ package cosmos_test

import (
"fmt"
"github.com/EscanBE/evermint/v12/constants"
"github.com/VictorTrustyDev/nevermind/v12/constants"
"time"

"cosmossdk.io/math"
cosmosante "github.com/EscanBE/evermint/v12/app/ante/cosmos"
"github.com/EscanBE/evermint/v12/testutil"
testutiltx "github.com/EscanBE/evermint/v12/testutil/tx"
cosmosante "github.com/VictorTrustyDev/nevermind/v12/app/ante/cosmos"
"github.com/VictorTrustyDev/nevermind/v12/testutil"
testutiltx "github.com/VictorTrustyDev/nevermind/v12/testutil/tx"
sdktestutil "github.com/cosmos/cosmos-sdk/testutil/testdata"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/feegrant"
2 changes: 1 addition & 1 deletion app/ante/cosmos/min_price.go
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ import (
"math/big"

errorsmod "cosmossdk.io/errors"
evmante "github.com/EscanBE/evermint/v12/app/ante/evm"
evmante "github.com/VictorTrustyDev/nevermind/v12/app/ante/evm"
sdk "github.com/cosmos/cosmos-sdk/types"
errortypes "github.com/cosmos/cosmos-sdk/types/errors"
)
14 changes: 7 additions & 7 deletions app/ante/cosmos/min_price_test.go
Original file line number Diff line number Diff line change
@@ -2,11 +2,11 @@ package cosmos_test

import (
sdkmath "cosmossdk.io/math"
cosmosante "github.com/EscanBE/evermint/v12/app/ante/cosmos"
"github.com/EscanBE/evermint/v12/constants"
"github.com/EscanBE/evermint/v12/rename_chain/marker"
"github.com/EscanBE/evermint/v12/testutil"
testutiltx "github.com/EscanBE/evermint/v12/testutil/tx"
cosmosante "github.com/VictorTrustyDev/nevermind/v12/app/ante/cosmos"
"github.com/VictorTrustyDev/nevermind/v12/constants"

"github.com/VictorTrustyDev/nevermind/v12/testutil"
testutiltx "github.com/VictorTrustyDev/nevermind/v12/testutil/tx"
sdk "github.com/cosmos/cosmos-sdk/types"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
)
@@ -23,8 +23,8 @@ var execTypes = []struct {
func (suite *AnteTestSuite) TestMinGasPriceDecorator() {
denom := constants.BaseDenom
testMsg := banktypes.MsgSend{
FromAddress: marker.ReplaceAbleAddress("evm1x8fhpj9nmhqk8z9kpgjt95ck2xwyue0ppeqynn"),
ToAddress: marker.ReplaceAbleAddress("evm1dx67l23hz9l0k9hcher8xz04uj7wf3yuqpfj0p"),
FromAddress: "ever1x8fhpj9nmhqk8z9kpgjt95ck2xwyue0pdz47ur",
ToAddress: "ever1dx67l23hz9l0k9hcher8xz04uj7wf3yuv6ugq3",
Amount: sdk.Coins{sdk.Coin{Amount: sdkmath.NewInt(10), Denom: denom}},
}

2 changes: 1 addition & 1 deletion app/ante/cosmos/reject_msgs.go
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@ package cosmos

import (
errorsmod "cosmossdk.io/errors"
evmtypes "github.com/EscanBE/evermint/v12/x/evm/types"
evmtypes "github.com/VictorTrustyDev/nevermind/v12/x/evm/types"
sdk "github.com/cosmos/cosmos-sdk/types"
errortypes "github.com/cosmos/cosmos-sdk/types/errors"
)
28 changes: 14 additions & 14 deletions app/ante/cosmos/setup_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package cosmos_test

import (
"github.com/EscanBE/evermint/v12/constants"
"github.com/VictorTrustyDev/nevermind/v12/constants"
"math"
"testing"
"time"
@@ -20,24 +20,24 @@ import (
"github.com/ethereum/go-ethereum/common"
ethtypes "github.com/ethereum/go-ethereum/core/types"

"github.com/EscanBE/evermint/v12/app"
"github.com/EscanBE/evermint/v12/app/ante"
evmante "github.com/EscanBE/evermint/v12/app/ante/evm"
"github.com/EscanBE/evermint/v12/crypto/ethsecp256k1"
"github.com/EscanBE/evermint/v12/encoding"
"github.com/EscanBE/evermint/v12/ethereum/eip712"
"github.com/EscanBE/evermint/v12/testutil"
"github.com/EscanBE/evermint/v12/types"
"github.com/EscanBE/evermint/v12/x/evm/statedb"
evmtypes "github.com/EscanBE/evermint/v12/x/evm/types"
feemarkettypes "github.com/EscanBE/evermint/v12/x/feemarket/types"
"github.com/VictorTrustyDev/nevermind/v12/app"
"github.com/VictorTrustyDev/nevermind/v12/app/ante"
evmante "github.com/VictorTrustyDev/nevermind/v12/app/ante/evm"
"github.com/VictorTrustyDev/nevermind/v12/crypto/ethsecp256k1"
"github.com/VictorTrustyDev/nevermind/v12/encoding"
"github.com/VictorTrustyDev/nevermind/v12/ethereum/eip712"
"github.com/VictorTrustyDev/nevermind/v12/testutil"
"github.com/VictorTrustyDev/nevermind/v12/types"
"github.com/VictorTrustyDev/nevermind/v12/x/evm/statedb"
evmtypes "github.com/VictorTrustyDev/nevermind/v12/x/evm/types"
feemarkettypes "github.com/VictorTrustyDev/nevermind/v12/x/feemarket/types"
)

type AnteTestSuite struct {
suite.Suite

ctx sdk.Context
app *app.Evermint
app *app.Nevermind
clientCtx client.Context
anteHandler sdk.AnteHandler
ethSigner ethtypes.Signer
@@ -61,7 +61,7 @@ func (suite *AnteTestSuite) SetupTest() {
suite.Require().NoError(err)
suite.priv = priv

suite.app = app.EthSetup(checkTx, func(app *app.Evermint, genesis simapp.GenesisState) simapp.GenesisState {
suite.app = app.EthSetup(checkTx, func(app *app.Nevermind, genesis simapp.GenesisState) simapp.GenesisState {
if suite.enableFeemarket {
// setup feemarketGenesis params
feemarketGenesis := feemarkettypes.DefaultGenesisState()
6 changes: 3 additions & 3 deletions app/ante/cosmos/utils_test.go
Original file line number Diff line number Diff line change
@@ -4,9 +4,9 @@ import (
"time"

sdkmath "cosmossdk.io/math"
"github.com/EscanBE/evermint/v12/app"
"github.com/EscanBE/evermint/v12/crypto/ethsecp256k1"
"github.com/EscanBE/evermint/v12/encoding"
"github.com/VictorTrustyDev/nevermind/v12/app"
"github.com/VictorTrustyDev/nevermind/v12/crypto/ethsecp256k1"
"github.com/VictorTrustyDev/nevermind/v12/encoding"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/tx"
cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
Loading