Skip to content

Commit

Permalink
Merge pull request #29 from AlayaNetwork/feature/bump-version-to-0.16.0
Browse files Browse the repository at this point in the history
Feature/bump version to 0.16.0
  • Loading branch information
benbaley committed Jul 16, 2021
2 parents 58a6d43 + 7d5c526 commit c1221a4
Show file tree
Hide file tree
Showing 303 changed files with 5,237 additions and 1,389 deletions.
19 changes: 0 additions & 19 deletions .github/workflows/golangci-lint.yml

This file was deleted.

32 changes: 32 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: golangci-lint
on:
pull_request:
branches: '**'
jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ^1.16
id: go

- uses: actions/checkout@v2

- name: make
run: bash ./build/build_deps.sh

- name: Get dependencies
run : |
go mod download
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
version: 'latest'
args: --no-config --issues-exit-code=0 --timeout=30m --tests=false --skip-dirs="tests" --skip-dirs-use-default=true --disable-all --enable=misspell --enable=goconst --enable=gofmt --enable=goimports --enable=gosec --enable=unconvert --enable=unparam --enable=funlen
skip-go-installation: true
skip-pkg-cache: true
20 changes: 13 additions & 7 deletions .github/workflows/test.yml → .github/workflows/unit_test.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Go
name: unittest

on:
pull_request:
branches: '*'
branches: '**'
env:
GO111MODULE: on
jobs:
Expand All @@ -14,25 +14,31 @@ jobs:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.13
go-version: ^1.15
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v2

- uses: actions/cache@v1
- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Get dependencies
run: |
go get -v -t -d ./...
go mod download
- name: Build
run: make alaya

- name: Test
run: go test -tags=test -covermode=count -coverprofile=coverage.out `go list ./...|grep -v life|grep -v swarm|grep -v tests|grep -v bn256|grep -v mobile`
run: go test -tags=test -covermode=count -coverprofile=coverage.txt `go list ./...`

- name: Upload coverage report
uses: codecov/codecov-action@v1
with:
file: ./coverage.txt
flags: unittests
name: codecov-umbrella
11 changes: 10 additions & 1 deletion AUTHORS
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# This is the official list of PlatON-Go authors for copyright purposes.
# This is the official list of Alaya-Go authors for copyright purposes.

Gavin <meiyan532484710@163.com>
GavinXu <meiyan532484710@163.com>
GavinXu520 <meiyan532484710@163.com>
James QU <junjie.qu@qq.com>
Joey <bglmmz@hotmail.com>
Expand All @@ -15,30 +16,38 @@ alliswell <jianghaitao@juzix.net>
awake <hietel366435@163.com>
benbaley <45843736+benbaley@users.noreply.github.com>
bglmmz <bglmmz@hotmail.com>
bglmmz <lvxiaoyi@juzix.net>
caiguopei <caiguopei@juzix.io>
chenfeixiang <chenfeixiang@juzix.net>
chenfeixiang <mokeyc@163.com>
chinese-wu <1102252651@qq.com>
chinese-wu <41734952+chinese-wu@users.noreply.github.com>
clearly <910372762@qq.com>
gavin <meiyan532484710@163.com>
guodeng <905825932@qq.com>
jianghaitao@192.168.10.68 <jianghaitao@juzix.io>
joey <bglmmz@hotmail.com>
kongwei <55940531+kw805@users.noreply.github.com>
liuzhiqiang <waxs2006>
luo-dahui <934803813@qq.com>
luodahui <934803813@qq.com>
luodahui <luo-dahui@qq.com>
luowei <luowei@juzix.net>
luowei <wei_loy@163.com>
lvxiaoyi <lvxiaoyi@juzix.io>
lvxiaoyi <lvxiaoyi@juzix.net>
mowind <wjinwen.1988@gmail.com>
niuxiaojie81 <30611384+niuxiaojie81@users.noreply.github.com>
niuxiaojie81 <85773309@qq.com>
simonhsj <huangsaijie@wxblockchain.com>
simonhsj <simonhsj@gmail.com>
simonhsj@gmail.com <simonhsj@gmail.com>
wutao <1102252651@qq.com>
wuwei <wuwei@juzix.io>
xujiacan <meiyan532484710@163.com>
yangzhou <yangzhou@juzix.io>
zhuying520 <meiyan532484710@163.com>
zjsunzone <zjsunzone@gmail.com>
姜海涛 <jianghaitao@juzix.net>
张军 <zhangjun@juzix.net>
程林 <chenglin762@gmail.com>
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ ENV P2PPORT=16789
ENV WSPORT=6080
ENV RPCPORT=6789
ENV PPROFPORT=6060
ENV MAXPEERS=43
ENV MAXCONSENSUSPEERS=100
ENV MAXPEERS=80
ENV MAXCONSENSUSPEERS=75
ENV ENABLE_LIGHT_SRV=false
ENV SYNCMODE=full

Expand Down
49 changes: 40 additions & 9 deletions Dockerfile.alltools
Original file line number Diff line number Diff line change
@@ -1,15 +1,46 @@
# Build Geth in a stock Go builder container
FROM golang:1.11-alpine as builder
# Build Alaya in a stock Go builder container
FROM golang:1.15-alpine as builder

RUN apk add --no-cache make gcc musl-dev linux-headers
RUN apk add --no-cache make gcc musl-dev linux-headers g++ llvm bash cmake git gmp-dev openssl-dev

ADD . /go-ethereum
RUN cd /go-ethereum && make all
RUN git clone https://github.com/dfinity/bn.git
RUN cd bn && make && make install

# Pull all binaries into a second stage deploy alpine container
ADD . /Alaya-Go
RUN cd /Alaya-Go && make clean && make alaya

# Pull Alaya into a second stage deploy alpine container
FROM alpine:latest

RUN apk add --no-cache ca-certificates
COPY --from=builder /go-ethereum/build/bin/* /usr/local/bin/
RUN apk add --no-cache ca-certificates libstdc++ bash tzdata gmp-dev
COPY --from=builder /Alaya-Go/build/bin/* /usr/local/bin/
COPY --from=builder /Alaya-Go/entrypoint.sh /usr/local/bin/
COPY --from=builder /usr/local/lib/libbls384.so /usr/local/lib/
COPY --from=builder /usr/local/lib/libmcl.so /usr/local/lib/
RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

ENV ENABLE_DEBUG=false
ENV ENABLE_PPROF=false
ENV ENABLE_WS=false
ENV WSAPI=
ENV ENABLE_RPC=false
ENV RPCAPI=
ENV BOOTNODES=
ENV NEW_ACCOUNT=false
ENV INIT=false
ENV VERBOSITY=3
ENV ENBALE_DISCOVER=false
ENV ENABLE_V5DISC=false
ENV ENABLE_CBFT_TRACING=false
ENV P2PPORT=16789
ENV WSPORT=6080
ENV RPCPORT=6789
ENV PPROFPORT=6060
ENV MAXPEERS=80
ENV MAXCONSENSUSPEERS=75
ENV ENABLE_LIGHT_SRV=false
ENV SYNCMODE=full

EXPOSE 8545 8546 30303 30303/udp
VOLUME /data/alaya
EXPOSE 6060 6080 6789 16789 16789/udp
ENTRYPOINT ["alaya"]
4 changes: 0 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ alaya:
@echo "Done building."
@echo "Run \"$(GOBIN)/alaya\" to launch alaya."

fix-cbft-test:
build/cbft_test.sh
@echo "Done fix."

alaya-with-mpc:
build/build_deps.sh
$(GORUN) build/ci.go install -mpc on ./cmd/alaya
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,20 @@ The requirements to build Alaya-Go are:
- [Golang](https://golang.org/doc/install) :version 1.14+
- [cmake](https://cmake.org/) :version 3.0+
- [g++&gcc](http://gcc.gnu.org/) :version 7.4.0+
> The 'cmake' and 'gcc&g++' are usually included in Ubuntu18.04
> The 'cmake' and 'gcc&g++' are usually built-in with Ubuntu
In addition, the following libraries needs to be installed manually

```
sudo apt install libgmp-dev libssl-dev
```
Then, clone the repository
Then, clone the repository and download dependency

```
git clone https://github.com/AlayaNetwork/Alaya-Go.git --recursive
```
Switch to the Alaya-Go repository root directory.
cd Alaya-Go && go mod download
```

Ubuntu:

Expand All @@ -45,7 +45,7 @@ Windows:
go run build\ci.go install
```

The resulting binary will be placed in '$Alaya-Go/build/bin'(Ubuntu) or in '%GOPATH%\bin'(Windows) .
The resulting binary will be placed in '$Alaya-Go/build/bin' .

## Getting Started

Expand Down Expand Up @@ -117,7 +117,7 @@ Address: {apt1anp4tzmdggdrcf39qvshfq3glacjxcd5mayaa8}
Run the following command to launch a Alaya node connecting to the Alaya's mainnet:

```
$ ./alaya --identity "alaya" --datadir ./data --port {your-p2p-port} --rpcaddr 127.0.0.1 --rpcport {your-rpc-port} --rpcapi "db,platon,net,web3,admin,personal" --rpc --nodiscover --nodekey ./data/nodekey --cbft.blskey ./data/blskey
alaya --identity "alaya" --datadir ./data --port {your-p2p-port} --rpcaddr 127.0.0.1 --rpcport {your-rpc-port} --rpcapi "db,platon,net,web3,admin,personal" --rpc --nodiscover --nodekey ./data/nodekey --cbft.blskey ./data/blskey
```

OK, it seems that the chain is running correctly, we can check it as follow:
Expand Down
12 changes: 6 additions & 6 deletions accounts/abi/bind/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"errors"
"math/big"

platon "github.com/AlayaNetwork/Alaya-Go"
alaya "github.com/AlayaNetwork/Alaya-Go"
"github.com/AlayaNetwork/Alaya-Go/common"
"github.com/AlayaNetwork/Alaya-Go/core/types"
)
Expand Down Expand Up @@ -49,7 +49,7 @@ type ContractCaller interface {
CodeAt(ctx context.Context, contract common.Address, blockNumber *big.Int) ([]byte, error)
// ContractCall executes an Ethereum contract call with the specified data as the
// input.
CallContract(ctx context.Context, call platon.CallMsg, blockNumber *big.Int) ([]byte, error)
CallContract(ctx context.Context, call alaya.CallMsg, blockNumber *big.Int) ([]byte, error)
}

// PendingContractCaller defines methods to perform contract calls on the pending state.
Expand All @@ -59,7 +59,7 @@ type PendingContractCaller interface {
// PendingCodeAt returns the code of the given account in the pending state.
PendingCodeAt(ctx context.Context, contract common.Address) ([]byte, error)
// PendingCallContract executes an Ethereum contract call against the pending state.
PendingCallContract(ctx context.Context, call platon.CallMsg) ([]byte, error)
PendingCallContract(ctx context.Context, call alaya.CallMsg) ([]byte, error)
}

// ContractTransactor defines the methods needed to allow operating with contract
Expand All @@ -79,7 +79,7 @@ type ContractTransactor interface {
// There is no guarantee that this is the true gas limit requirement as other
// transactions may be added or removed by miners, but it should provide a basis
// for setting a reasonable default.
EstimateGas(ctx context.Context, call platon.CallMsg) (gas uint64, err error)
EstimateGas(ctx context.Context, call alaya.CallMsg) (gas uint64, err error)
// SendTransaction injects the transaction into the pending pool for execution.
SendTransaction(ctx context.Context, tx *types.Transaction) error
}
Expand All @@ -91,11 +91,11 @@ type ContractFilterer interface {
// returning all the results in one batch.
//
// TODO(karalabe): Deprecate when the subscription one can return past data too.
FilterLogs(ctx context.Context, query platon.FilterQuery) ([]types.Log, error)
FilterLogs(ctx context.Context, query alaya.FilterQuery) ([]types.Log, error)

// SubscribeFilterLogs creates a background log filtering operation, returning
// a subscription immediately, which can be used to stream the found events.
SubscribeFilterLogs(ctx context.Context, query platon.FilterQuery, ch chan<- types.Log) (platon.Subscription, error)
SubscribeFilterLogs(ctx context.Context, query alaya.FilterQuery, ch chan<- types.Log) (alaya.Subscription, error)
}

// DeployBackend wraps the operations needed by WaitMined and WaitDeployed.
Expand Down
40 changes: 0 additions & 40 deletions appveyor.yml

This file was deleted.

2 changes: 1 addition & 1 deletion build/cbft_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ if [ ! -f "build/cbft_test.sh" ]; then
fi
root=`pwd`

hash=$(go test -v -tags=test github.com/PlatONnetwork/PlatON-Go/consensus/cbft -run TestCbft_CreateGenesis | sed -n '2p')
hash=$(go test -v -tags=test github.com/AlayaNetwork/Alaya-Go/consensus/cbft -run TestCbft_CreateGenesis | sed -n '2p')
echo "replace root $hash"

tmp='Root: common.BytesToHash(hexutil.MustDecode("HASH")),'
Expand Down
6 changes: 3 additions & 3 deletions build/ci.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,19 +92,19 @@ var (
},
{
BinaryName: "bootnode",
Description: "Ethereum bootnode.",
Description: "Alaya bootnode.",
},
{
BinaryName: "alaya",
Description: "PlatON CLI client.",
Description: "Alaya CLI client.",
},
{
BinaryName: "rlpdump",
Description: "Developer utility tool that prints RLP structures.",
},
{
BinaryName: "wnode",
Description: "Ethereum Whisper diagnostic tool",
Description: "Alaya Whisper diagnostic tool",
},
}

Expand Down
Loading

0 comments on commit c1221a4

Please sign in to comment.