Skip to content

Commit

Permalink
Merge PR: change okchain to okexchain (#328)
Browse files Browse the repository at this point in the history
* change okchaincli to okexchaincli & okchaind to okexchaind

* update .circleci

* update Makefile

* change address prefix

* fix address checksum failed

* change okchain package to okexchain package

* update go.mod

* change okchain to okexchain

* fix-operator-address

* bump to:
	github.com/okex/cosmos-sdk v0.37.9-okchain11
	github.com/okex/tendermint v0.32.10-okchain2

* update tags to okexchain

Co-authored-by: meng <[email protected]>
Co-authored-by: Zhong Qiu <[email protected]>
Co-authored-by: zhongqiuwood <[email protected]>
  • Loading branch information
4 people authored Sep 14, 2020
1 parent 8fee18b commit 7d194c4
Show file tree
Hide file tree
Showing 378 changed files with 1,103 additions and 1,062 deletions.
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
export GO111MODULE=on
mkdir -p /tmp/logs /tmp/workspace/profiles
excluded_packages_expr="(okchain/x/.*/client)|(x/simulation)"
excluded_packages_expr="(okexchain/x/.*/client)|(x/simulation)"
included_packages=("./app" "./x/common" "./x/dex" "./x/backend" "./x/distribution" "./x/gov" "./x/order" "./x/params" "./x/staking" "./x/token" "./x/upgrade" "./x/ammswap")
for pkg in ${included_packages[@]}; do
package_lines=`go list ${pkg}/... | grep -v -E "${excluded_packages_expr}"`
Expand All @@ -85,7 +85,7 @@ jobs:
echo "--> Filter out DONTCOVER:"
excludelist="$(find . -type f -name '*.go' | xargs grep -l 'DONTCOVER')"
for filename in ${excludelist}; do
filename=$(echo $filename | sed 's/^./github.com\/okex\/okchain/g')
filename=$(echo $filename | sed 's/^./github.com\/okex\/okexchain/g')
echo "Excluding ${filename} from coverage report..."
sed -i.bak "/$(echo $filename | sed 's/\//\\\//g')/d" coverage.txt
done
Expand Down Expand Up @@ -122,7 +122,7 @@ jobs:
# command: |
# excludelist="$(find . -type f -name '*.go' | xargs grep -l 'DONTCOVER')"
# for filename in ${excludelist}; do
# filename=$(echo $filename | sed 's/^./github.com\/okex\/okchain/g')
# filename=$(echo $filename | sed 's/^./github.com\/okex\/okexchain/g')
# echo "Excluding ${filename} from coverage report..."
# sed -i.bak "/$(echo $filename | sed 's/\//\\\//g')/d" coverage.txt
# done
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ v Please also ensure that this is not a duplicate issue :)

## Version

<!-- git commit hash, output of `okchaincli --version`, output of `okchaind --version` -->
<!-- git commit hash, output of `okexchaincli --version`, output of `okexchaind --version` -->

## Steps to Reproduce

Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature-request.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ v without deliberation

<!-- Why do we need this feature?
What problems may be addressed by introducing this feature?
What benefits does okchain stand to gain by including this feature?
What benefits does okexchain stand to gain by including this feature?
Are there any disadvantages of including this feature? -->

## Proposal
Expand Down
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ v Before smashing the submit button please review the checkboxes.
v If a checkbox is n/a - please still include it but + a little note why
☺ > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -->

- Targeted PR against correct branch (see [CONTRIBUTING.md](https://github.com/okex/okchain/blob/develop/CONTRIBUTING.md#pr-targeting))
- Targeted PR against correct branch (see [CONTRIBUTING.md](https://github.com/okex/okexchain/blob/develop/CONTRIBUTING.md#pr-targeting))

- [ ] Linked to github-issue with discussion and accepted design OR link to spec that describes this work.
- [ ] Wrote tests
Expand Down
13 changes: 8 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
.idea

# Build
okchaind
okchaincli
vendor
build
tools/
Expand All @@ -23,17 +25,18 @@ doc
# Data - ideally these don't exist
baseapp/data/*
client/lcd/keys/*
cmd/okchaincli/statik/statik.go
cmd/okexchaincli/statik/statik.go
mytestnet
doc/statik/statik.go
dev/cache
cmd/launch/launch
cmd/okchaincli/okchaincli
cmd/okchaind/okchaind
cmd/okchaintool/okchaintool
cmd/okexchaincli/okexchaincli
cmd/okexchaind/okexchaind
cmd/okexchaintool/okexchaintool
cmd/tiger/tiger
cmd/okexchaind/testnet_okchain.go
dev/testnet/cache
testnet_okchain.go
testnet_okexchain.go
tools


Expand Down
12 changes: 6 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ Contributing to this repo can mean many things such as participated in
discussion or proposing code changes. To ensure a smooth workflow for all
contributors, the general procedure for contributing has been established:

1. Either [open](https://github.com/okex/okchain/issues/new/choose) or
[find](https://github.com/okex/okchain/issues) an issue you'd like to help with
1. Either [open](https://github.com/okex/okexchain/issues/new/choose) or
[find](https://github.com/okex/okexchain/issues) an issue you'd like to help with
2. Participate in thoughtful discussion on that issue
3. If you would like to contribute:
1. If a the issue is a proposal, ensure that the proposal has been accepted
Expand Down Expand Up @@ -54,7 +54,7 @@ tools` for installing the linting tools.

Other notes:
- Looking for a good place to start contributing? How about checking out some
[good first issues](https://github.com/okex/okchain/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22)
[good first issues](https://github.com/okex/okexchain/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22)
- Please make sure to use `gofmt` before every commit - the easiest way to do
this is have your editor run it for you upon saving a file. Additionally
please ensure that your code is lint compliant by running `make lint`
Expand Down Expand Up @@ -95,12 +95,12 @@ Please note that Go requires code to live under absolute paths, which complicate
While my fork lives at `https://github.com/rigeyrigerige/OKChain`,
the code should never exist at `$GOPATH/src/github.com/rigeyrigerige/OKChain`.
Instead, we use `git remote` to add the fork as a new remote for the original repo,
`$GOPATH/src/github.com/okex/okchain `, and do all the work there.
`$GOPATH/src/github.com/okex/okexchain `, and do all the work there.

For instance, to create a fork and work on a branch of it, I would:

- Create the fork on github, using the fork button.
- Go to the original repo checked out locally (i.e. `$GOPATH/src/github.com/okex/okchain`)
- Go to the original repo checked out locally (i.e. `$GOPATH/src/github.com/okex/okexchain`)
- `git remote rename origin upstream`
- `git remote add origin [email protected]:rigeyrigerige/OKChain.git`

Expand Down Expand Up @@ -180,7 +180,7 @@ only pull requests targeted directly against master.
- `master` must never fail `make test` or `make test_cli`
- `master` should not fail `make lint`
- no `--force` onto `master` (except when reverting a broken commit, which should seldom happen)
- create a development branch either on github.com/okex/okchain, or your fork (using `git remote add origin`)
- create a development branch either on github.com/okex/okexchain, or your fork (using `git remote add origin`)
- before submitting a pull request, begin `git rebase` on top of `master`
### Pull Merge Procedure
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Simple usage with a mounted data directory:
# > docker build -t okchain .
# > docker run -it -p 36657:36657 -p 36656:36656 -v ~/.okchaind:/root/.okchaind -v ~/.okchaincli:/root/.okchaincli okchain okchaind init mynode
# > docker run -it -p 36657:36657 -p 36656:36656 -v ~/.okchaind:/root/.okchaind -v ~/.okchaincli:/root/.okchaincli okchain okchaind start
# > docker run -it -p 36657:36657 -p 36656:36656 -v ~/.okexchaind:/root/.okexchaind -v ~/.okexchaincli:/root/.okexchaincli okchain okexchaind init mynode
# > docker run -it -p 36657:36657 -p 36656:36656 -v ~/.okexchaind:/root/.okexchaind -v ~/.okexchaincli:/root/.okexchaincli okchain okexchaind start
FROM golang:alpine AS build-env

# Install minimum necessary dependencies, remove packages
Expand All @@ -25,5 +25,5 @@ WORKDIR /root
COPY --from=build-env /go/bin/okchaind /usr/bin/okchaind
COPY --from=build-env /go/bin/okchaincli /usr/bin/okchaincli

# Run okchaind by default, omit entrypoint to ease using container with okchaincli
# Run okexchaind by default, omit entrypoint to ease using container with okexchaincli
CMD ["okchaind"]
34 changes: 17 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ Version=v0.11.1
CosmosSDK=v0.37.9
Tendermint=v0.32.10
Iavl=v0.12.4
Name=okchain
ServerName=okchaind
ClientName=okchaincli
Name=okexchain
ServerName=okexchaind
ClientName=okexchaincli
# the height of the 1st block is GenesisHeight+1
GenesisHeight=0

Expand Down Expand Up @@ -49,15 +49,15 @@ BUILD_TESTNET_FLAGS := $(BUILD_FLAGS)

all: install

install: okchain
install: okexchain

okchain:
go install -v $(BUILD_FLAGS) -tags "$(BUILD_TAGS)" ./cmd/okchaind
go install -v $(BUILD_FLAGS) -tags "$(BUILD_TAGS)" ./cmd/okchaincli
okexchain:
go install -v $(BUILD_FLAGS) -tags "$(BUILD_TAGS)" ./cmd/okexchaind
go install -v $(BUILD_FLAGS) -tags "$(BUILD_TAGS)" ./cmd/okexchaincli

testnet:
go install -v $(BUILD_TESTNET_FLAGS) -tags "$(BUILD_TAGS)" ./cmd/okchaind
go install -v $(BUILD_TESTNET_FLAGS) -tags "$(BUILD_TAGS)" ./cmd/okchaincli
go install -v $(BUILD_TESTNET_FLAGS) -tags "$(BUILD_TAGS)" ./cmd/okexchaind
go install -v $(BUILD_TESTNET_FLAGS) -tags "$(BUILD_TAGS)" ./cmd/okexchaincli

test-unit:
@VERSION=$(VERSION) go test -mod=readonly -tags='ledger test_ledger_mock' ./app/...
Expand Down Expand Up @@ -95,32 +95,32 @@ go.sum: go.mod
@go mod tidy

cli:
go install -v $(BUILD_FLAGS) -tags "$(BUILD_TAGS)" ./cmd/okchaincli
go install -v $(BUILD_FLAGS) -tags "$(BUILD_TAGS)" ./cmd/okexchaincli

server:
go install -v $(BUILD_FLAGS) -tags "$(BUILD_TAGS)" ./cmd/okchaind
go install -v $(BUILD_FLAGS) -tags "$(BUILD_TAGS)" ./cmd/okexchaind

format:
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/lcd/statik/statik.go" | xargs gofmt -w -s

build:
ifeq ($(OS),Windows_NT)
go build $(BUILD_FLAGS) -o build/okchaind.exe ./cmd/okchaind
go build $(BUILD_FLAGS) -o build/okchaincli.exe ./cmd/okchaincli
go build $(BUILD_FLAGS) -o build/okexchaind.exe ./cmd/okexchaind
go build $(BUILD_FLAGS) -o build/okexchaincli.exe ./cmd/okexchaincli
else
go build $(BUILD_FLAGS) -o build/okchaind ./cmd/okchaind
go build $(BUILD_FLAGS) -o build/okchaincli ./cmd/okchaincli
go build $(BUILD_FLAGS) -o build/okexchaind ./cmd/okexchaind
go build $(BUILD_FLAGS) -o build/okexchaincli ./cmd/okexchaincli
endif

build-linux:
LEDGER_ENABLED=false GOOS=linux GOARCH=amd64 $(MAKE) build

build-docker-okchainnode:
build-docker-okexchainnode:
$(MAKE) -C networks/local

# Run a 4-node testnet locally
localnet-start: build-linux localnet-stop
@if ! [ -f build/node0/okchaind/config/genesis.json ]; then docker run --rm -v $(CURDIR)/build:/okchaind:Z okchain/node testnet --v 4 -o . --starting-ip-address 192.168.10.2 ; fi
@if ! [ -f build/node0/okexchaind/config/genesis.json ]; then docker run --rm -v $(CURDIR)/build:/okexchaind:Z okexchain/node testnet --v 4 -o . --starting-ip-address 192.168.10.2 ; fi
docker-compose up -d

# Stop testnet
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ See the [documentation](https://okexchain-docs.readthedocs.io/en/latest/index.ht

## OKExChain Testnet

To run a full-node for the testnet of the OKExChain, first [install `okexchaind`](https://okexchain-docs.readthedocs.io/en/latest/getting-start/install-okchain.html), then follow [the guide](https://okexchain-docs.readthedocs.io/en/latest/getting-start/join-okchain-testnet.html).
To run a full-node for the testnet of the OKExChain, first [install `okexchaind`](https://okexchain-docs.readthedocs.io/en/latest/getting-start/install-okexchain.html), then follow [the guide](https://okexchain-docs.readthedocs.io/en/latest/getting-start/join-okexchain-testnet.html).

For status updates and genesis file, see the [genesis](https://okexchain-docs.readthedocs.io/en/latest/getting-start/join-okchain-testnet.html#genesis-seeds).
For status updates and genesis file, see the [genesis](https://okexchain-docs.readthedocs.io/en/latest/getting-start/join-okexchain-testnet.html#genesis-seeds).

## Quick Start

Expand Down
18 changes: 9 additions & 9 deletions app/abci.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ package app
import (
"fmt"

"github.com/okex/okchain/x/common/perf"
"github.com/okex/okexchain/x/common/perf"

"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/x/auth"
"github.com/okex/okchain/app/protocol"
"github.com/okex/okexchain/app/protocol"
abci "github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/crypto/tmhash"
)

// DeliverTx implements the Application interface
func (app *OKChainApp) DeliverTx(req abci.RequestDeliverTx) (res abci.ResponseDeliverTx) {
func (app *OKExChainApp) DeliverTx(req abci.RequestDeliverTx) (res abci.ResponseDeliverTx) {
protocol.GetEngine().GetCurrentProtocol().CheckStopped()

resp := app.BaseApp.DeliverTx(req)
Expand All @@ -26,14 +26,14 @@ func (app *OKChainApp) DeliverTx(req abci.RequestDeliverTx) (res abci.ResponseDe
}

// InitChain implements the Application interface
func (app *OKChainApp) InitChain(req abci.RequestInitChain) (res abci.ResponseInitChain) {
func (app *OKExChainApp) InitChain(req abci.RequestInitChain) (res abci.ResponseInitChain) {

app.log("[ABCI interface] ---> InitChain")
return app.BaseApp.InitChain(req)
}

// BeginBlock implements the Application interface
func (app *OKChainApp) BeginBlock(req abci.RequestBeginBlock) (res abci.ResponseBeginBlock) {
func (app *OKExChainApp) BeginBlock(req abci.RequestBeginBlock) (res abci.ResponseBeginBlock) {

protocol.GetEngine().GetCurrentProtocol().CheckStopped()

Expand All @@ -47,7 +47,7 @@ func (app *OKChainApp) BeginBlock(req abci.RequestBeginBlock) (res abci.Response
}

// EndBlock implements the Application interface
func (app *OKChainApp) EndBlock(req abci.RequestEndBlock) (res abci.ResponseEndBlock) {
func (app *OKExChainApp) EndBlock(req abci.RequestEndBlock) (res abci.ResponseEndBlock) {
protocol.GetEngine().GetCurrentProtocol().CheckStopped()

seq := perf.GetPerf().OnAppEndBlockEnter(app.LastBlockHeight() + 1)
Expand All @@ -57,7 +57,7 @@ func (app *OKChainApp) EndBlock(req abci.RequestEndBlock) (res abci.ResponseEndB
}

// Commit implements the Application interface
func (app *OKChainApp) Commit() abci.ResponseCommit {
func (app *OKExChainApp) Commit() abci.ResponseCommit {
protocol.GetEngine().GetCurrentProtocol().CheckStopped()

seq := perf.GetPerf().OnCommitEnter(app.LastBlockHeight() + 1)
Expand All @@ -68,7 +68,7 @@ func (app *OKChainApp) Commit() abci.ResponseCommit {
}

// sync txBytes to backend module
func (app *OKChainApp) syncTx(txBytes []byte) {
func (app *OKExChainApp) syncTx(txBytes []byte) {
if tx, err := auth.DefaultTxDecoder(protocol.GetEngine().GetCurrentProtocol().GetCodec())(txBytes); err == nil {
if stdTx, ok := tx.(auth.StdTx); ok {
txHash := fmt.Sprintf("%X", tmhash.Sum(txBytes))
Expand All @@ -83,6 +83,6 @@ func (app *OKChainApp) syncTx(txBytes []byte) {
}

// log format
func (app *OKChainApp) log(format string, a ...interface{}) {
func (app *OKExChainApp) log(format string, a ...interface{}) {
app.Logger().Info(fmt.Sprintf(format, a...))
}
6 changes: 3 additions & 3 deletions app/alias.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
package app

import (
"github.com/okex/okchain/app/protocol"
"github.com/okex/okexchain/app/protocol"
)

var (
// MakeCodec is the function alias for codec maker
MakeCodec = protocol.MakeCodec
// ModuleBasics is the variable alias for NewBasicManager
ModuleBasics = protocol.ModuleBasics
// DefaultCLIHome is the directory for okchaincli
// DefaultCLIHome is the directory for okexchaincli
DefaultCLIHome = protocol.DefaultCLIHome
// DefaultNodeHome is the directory for okchaind
// DefaultNodeHome is the directory for okexchaind
DefaultNodeHome = protocol.DefaultNodeHome
)
Loading

0 comments on commit 7d194c4

Please sign in to comment.