Skip to content

Commit f587714

Browse files
authored
merge v0.10.9 to master (#135)
2 parents 53273fc + 255a595 commit f587714

File tree

113 files changed

+35725
-2215
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+35725
-2215
lines changed

.github/workflows/artifacts.yml

+19-7
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
jobs:
1010

1111
build:
12-
runs-on: ubuntu-latest
12+
runs-on: ubuntu-20.04
1313
steps:
1414
- uses: actions/checkout@v4
1515

@@ -18,19 +18,31 @@ jobs:
1818
with:
1919
go-version: '1.19'
2020

21+
- name: Setup packages
22+
run: |
23+
sudo apt-get update
24+
sudo apt-get install -y libjemalloc-dev liblz4-dev libsnappy-dev libzstd-dev libudev-dev
25+
sudo apt remove -y bzip2 libbz2-dev zlib1g-dev
26+
2127
- name: Build Go-WEMIX tarball
2228
run: USE_ROCKSDB=YES make gwemix.tar.gz
2329

24-
- name: Stat Go-WEMIX tarball
30+
- name: Set version
2531
run: |
26-
ls -l build/gwemix.tar.gz
27-
tar tf build/gwemix.tar.gz
32+
GWEMIX_VERSION_META="v$(build/bin/gwemix version | awk '/^Version/{ print $2 }')"
33+
echo "GWEMIX_VERSION_META=$GWEMIX_VERSION_META" >> "$GITHUB_ENV"
34+
echo "GWEMIX_VERSION=$(echo $GWEMIX_VERSION_META | cut -d'-' -f1)" >> "$GITHUB_ENV"
35+
echo "GWEMIX_META=$(echo $GWEMIX_VERSION_META | cut -d'-' -f2-)" >> "$GITHUB_ENV"
36+
echo "GWEMIX_COMMITHASH=$(echo ${{ github.sha }} | cut -c1-8)" >> "$GITHUB_ENV"
37+
38+
- name: Display ELF info
39+
run: readelf -dV build/bin/gwemix
2840

2941
- name: Move results to artifact
30-
run: mv build/gwemix.tar.gz gwemix-${{ github.ref_name }}-${{ github.sha }}-linux-amd64-rocksdb.tar.gz
42+
run: mv build/gwemix.tar.gz gwemix-${{ env.GWEMIX_VERSION_META }}-${{ env.GWEMIX_COMMITHASH }}-linux-amd64-rocksdb.tar.gz
3143

3244
- name: Upload Go-WEMIX
3345
uses: actions/upload-artifact@v4
3446
with:
35-
name: artifact-${{ github.ref_name }}-${{ github.sha }}
36-
path: gwemix-${{ github.ref_name }}-${{ github.sha }}-linux-amd64-rocksdb.tar.gz
47+
name: artifact-${{ env.GWEMIX_VERSION_META }}-${{ env.GWEMIX_COMMITHASH }}
48+
path: gwemix-${{ env.GWEMIX_VERSION_META }}-${{ env.GWEMIX_COMMITHASH }}-linux-amd64-rocksdb.tar.gz

.github/workflows/dev-ci.yml

+5-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
strategy:
2828
fail-fast: false
2929
matrix:
30-
version: [1.17, 1.18, 1.19]
30+
version: [1.18, 1.19]
3131
runs-on: ubuntu-20.04
3232
steps:
3333
- uses: actions/checkout@v3
@@ -38,7 +38,7 @@ jobs:
3838
uses: actions/setup-go@v3
3939
with:
4040
go-version: ${{ matrix.version }}
41-
41+
4242
- name: Check Lint
4343
run: make lint
4444

@@ -49,6 +49,9 @@ jobs:
4949
with:
5050
ref: ${{ github.event.pull_request.head.sha }}
5151

52+
- name: Set up Wemix Submodules
53+
run: git submodule update --init wemix/
54+
5255
- name: Set up Go
5356
uses: actions/setup-go@v3
5457
with:

.github/workflows/gwemix-ci.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
strategy:
2828
fail-fast: false
2929
matrix:
30-
version: [1.17, 1.18, 1.19]
30+
version: [1.18, 1.19]
3131
runs-on: ubuntu-20.04
3232
steps:
3333
- uses: actions/checkout@v3
@@ -49,6 +49,9 @@ jobs:
4949
with:
5050
ref: ${{ github.event.pull_request.head.sha }}
5151

52+
- name: Set up Wemix Submodules
53+
run: git submodule update --init wemix/
54+
5255
- name: Set up Go
5356
uses: actions/setup-go@v3
5457
with:

.github/workflows/master-ci.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
strategy:
2828
fail-fast: false
2929
matrix:
30-
version: [1.17, 1.18, 1.19]
30+
version: [1.18, 1.19]
3131
runs-on: ubuntu-20.04
3232
steps:
3333
- uses: actions/checkout@v3
@@ -49,6 +49,9 @@ jobs:
4949
with:
5050
ref: ${{ github.event.pull_request.head.sha }}
5151

52+
- name: Set up Wemix Submodules
53+
run: git submodule update --init wemix/
54+
5255
- name: Set up Go
5356
uses: actions/setup-go@v3
5457
with:

.github/workflows/release.yml

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: "Release a tag as draft"
2+
3+
on:
4+
push:
5+
tags:
6+
- w*
7+
8+
jobs:
9+
10+
build:
11+
runs-on: ubuntu-20.04
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Set up Go
16+
uses: actions/setup-go@v4
17+
with:
18+
go-version: '1.19'
19+
20+
- name: Setup packages
21+
run: |
22+
sudo apt-get update
23+
sudo apt-get install -y libjemalloc-dev liblz4-dev libsnappy-dev libzstd-dev libudev-dev
24+
sudo apt remove -y bzip2 libbz2-dev zlib1g-dev
25+
26+
- name: Build Go-WEMIX tarball (rocksdb)
27+
run: USE_ROCKSDB=YES make gwemix.tar.gz
28+
29+
- name: Set version
30+
run: |
31+
GWEMIX_VERSION_META="v$(build/bin/gwemix version | awk '/^Version/{ print $2 }')"
32+
echo "GWEMIX_VERSION_META=$GWEMIX_VERSION_META" >> "$GITHUB_ENV"
33+
echo "GWEMIX_VERSION=$(echo $GWEMIX_VERSION_META | cut -d'-' -f1)" >> "$GITHUB_ENV"
34+
echo "GWEMIX_META=$(echo $GWEMIX_VERSION_META | cut -d'-' -f2-)" >> "$GITHUB_ENV"
35+
echo "GWEMIX_COMMITHASH=$(echo ${{ github.sha }} | cut -c1-8)" >> "$GITHUB_ENV"
36+
37+
- name: Display ELF info (rocksdb)
38+
run: readelf -dV build/bin/gwemix
39+
40+
- name: Move results to artifact (rocksdb)
41+
run: mv build/gwemix.tar.gz gwemix-${{ env.GWEMIX_VERSION_META }}-${{ env.GWEMIX_COMMITHASH }}-linux-amd64-rocksdb.tar.gz
42+
43+
- name: Build Go-WEMIX tarball (leveldb)
44+
run: USE_ROCKSDB=NO make gwemix.tar.gz
45+
46+
- name: Display ELF info (leveldb)
47+
run: readelf -dV build/bin/gwemix
48+
49+
- name: Move results to artifact (leveldb)
50+
run: mv build/gwemix.tar.gz gwemix-${{ env.GWEMIX_VERSION_META }}-${{ env.GWEMIX_COMMITHASH }}-linux-amd64-leveldb.tar.gz
51+
52+
- name: GH Release
53+
uses: softprops/[email protected]
54+
with:
55+
name: WEMIX3.0 Mainnet and Testnet Build (${{ env.GWEMIX_VERSION }})
56+
draft: true
57+
files: |
58+
gwemix-${{ env.GWEMIX_VERSION_META }}-${{ env.GWEMIX_COMMITHASH }}-linux-amd64-rocksdb.tar.gz
59+
gwemix-${{ env.GWEMIX_VERSION_META }}-${{ env.GWEMIX_COMMITHASH }}-linux-amd64-leveldb.tar.gz

.gitmodules

+6
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,9 @@
1212
[submodule "etcd"]
1313
path = etcd
1414
url = https://github.com/metadium/etcd
15+
[submodule "wemix/governance-contract/contracts/openzeppelin/contracts-upgradeable"]
16+
path = wemix/governance-contract/contracts/openzeppelin/contracts-upgradeable
17+
url = https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable
18+
[submodule "wemix/governance-contract/contracts/openzeppelin/contracts"]
19+
path = wemix/governance-contract/contracts/openzeppelin/contracts
20+
url = https://github.com/OpenZeppelin/openzeppelin-contracts

Makefile

+5-74
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,14 @@ endif
3131

3232
gwemix.tar.gz: gwemix logrot
3333
@[ -d build/conf ] || mkdir -p build/conf
34-
@cp -p wemix/scripts/gwemix.sh wemix/scripts/solc.sh build/bin/
34+
@cp -p wemix/scripts/gwemix.sh build/bin/
3535
@cp -p wemix/scripts/config.json.example \
3636
wemix/scripts/genesis-template.json \
37-
wemix/contracts/WemixGovernance.js \
38-
wemix/scripts/deploy-governance.js \
3937
build/conf/
4038
@(cd build; tar cfz gwemix.tar.gz bin conf)
4139
@echo "Done building build/gwemix.tar.gz"
4240

43-
gwemix: rocksdb wemix/governance_abi.go
41+
gwemix: rocksdb
4442
ifeq ($(USE_ROCKSDB), NO)
4543
$(GORUN) build/ci.go install $(ROCKSDB_TAG) ./cmd/gwemix
4644
else
@@ -68,7 +66,7 @@ else
6866
$(GORUN) build/ci.go install $(ROCKSDB_TAG) ./cmd/dbbench
6967
endif
7068

71-
all: wemix/governance_abi.go
69+
all:
7270
$(GORUN) build/ci.go install
7371

7472
android:
@@ -89,12 +87,12 @@ test: all
8987
test-short: all
9088
$(GORUN) build/ci.go test -short
9189

92-
lint: wemix/governance_abi.go ## Run linters.
90+
lint: ## Run linters.
9391
$(GORUN) build/ci.go lint
9492

9593
clean:
9694
env GO111MODULE=on go clean -cache
97-
rm -fr build/_workspace/pkg/ $(GOBIN)/* build/conf wemix/admin_abi.go wemix/governance_abi.go
95+
rm -fr build/_workspace/pkg/ $(GOBIN)/* build/conf
9896
@ROCKSDB_DIR=$(ROCKSDB_DIR); \
9997
if [ -e $${ROCKSDB_DIR}/Makefile ]; then \
10098
cd $${ROCKSDB_DIR}; \
@@ -132,70 +130,3 @@ rocksdb:
132130
@[ ! -e rocksdb/.git ] && git submodule update --init rocksdb; \
133131
cd $(ROCKSDB_DIR) && PORTABLE=1 make -j8 static_lib;
134132
endif
135-
136-
AWK_CODE=' \
137-
BEGIN { print "package wemix"; bin = 0; name = ""; abi = ""; } \
138-
/^{/ { bin = 1; abi = ""; name = ""; } \
139-
/^}/ { bin = 0; abi = abi "}"; print "var " name "Abi = `" abi "`"; } \
140-
{ \
141-
if (bin == 1) { \
142-
abi = abi $$0; \
143-
if ($$1 == "\"contractName\":") { \
144-
name = $$2; \
145-
gsub(",|\"", "", name); \
146-
} \
147-
} \
148-
}'
149-
150-
wemix/admin_abi.go: wemix/contracts/WemixAdmin-template.sol build/bin/solc
151-
@PATH=${PATH}:build/bin wemix/scripts/solc.sh -f abi $< /tmp/junk.$$$$; \
152-
cat /tmp/junk.$$$$ | awk $(AWK_CODE) > $@; \
153-
rm -f /tmp/junk.$$$$;
154-
155-
AWK_CODE_2=' \
156-
BEGIN { print "package wemix\n"; } \
157-
/^var Registry_contract/ { \
158-
sub("^var[^(]*\\(","",$$0); sub("\\);$$","",$$0); \
159-
n = "Registry"; \
160-
print "var " n "Abi = `{ \"contractName\": \"" n "\", \"abi\": " $$0 "}`"; \
161-
} \
162-
/^var StakingImp_contract/ { \
163-
sub("^var[^(]*\\(","",$$0); sub("\\);$$","",$$0); \
164-
n = "Staking"; \
165-
print "var " n "Abi = `{ \"contractName\": \"" n "\", \"abi\": " $$0 "}`"; \
166-
} \
167-
/^var EnvStorageImp_contract/ { \
168-
sub("^var[^(]*\\(","",$$0); sub("\\);$$","",$$0); \
169-
n = "EnvStorageImp"; \
170-
print "var " n "Abi = `{ \"contractName\": \"" n "\", \"abi\": " $$0 "}`"; \
171-
} \
172-
/^var GovImp_contract/ { \
173-
sub("^var[^(]*\\(","",$$0); sub("\\);$$","",$$0); \
174-
n = "Gov"; \
175-
print "var " n "Abi = `{ \"contractName\": \"" n "\", \"abi\": " $$0 "}`"; \
176-
}'
177-
178-
wemix/governance_abi.go: wemix/contracts/WemixGovernance.js
179-
@cat $< | awk $(AWK_CODE_2) > $@
180-
181-
ifneq ($(shell uname), Linux)
182-
183-
build/bin/solc:
184-
@test 1
185-
186-
else
187-
188-
SOLC_URL=https://github.com/ethereum/solidity/releases/download/v0.4.24/solc-static-linux
189-
build/bin/solc:
190-
@[ -d build/bin ] || mkdir -p build/bin; \
191-
if [ ! -x build/bin/solc ]; then \
192-
if which curl > /dev/null 2>&1; then \
193-
curl -Ls -o build/bin/solc $(SOLC_URL); \
194-
chmod +x build/bin/solc; \
195-
elif which wget > /dev/null 2>&1; then \
196-
wget -nv -o build/bin/solc $(SOLC_URL); \
197-
chmod +x build/bin/solc; \
198-
fi \
199-
fi
200-
201-
endif

0 commit comments

Comments
 (0)