Skip to content

Commit

Permalink
Revert "merge: dev into devnet (#129)"
Browse files Browse the repository at this point in the history
This reverts commit a8bfbe9.
  • Loading branch information
jennwiederholen committed Sep 19, 2024
1 parent a8bfbe9 commit 58e75da
Show file tree
Hide file tree
Showing 113 changed files with 2,215 additions and 35,723 deletions.
25 changes: 7 additions & 18 deletions .github/workflows/artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
jobs:

build:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

Expand All @@ -18,30 +18,19 @@ jobs:
with:
go-version: '1.19'

- name: Setup packages
run: |
sudo apt install -y libjemalloc-dev liblz4-dev libsnappy-dev libzstd-dev libudev-dev
sudo apt remove -y bzip2 libbz2-dev zlib1g-dev
- name: Build Go-WEMIX tarball
run: USE_ROCKSDB=YES make gwemix.tar.gz

- name: Set version
- name: Stat Go-WEMIX tarball
run: |
GWEMIX_VERSION_META="v$(build/bin/gwemix version | awk '/^Version/{ print $2 }')"
echo "GWEMIX_VERSION_META=$GWEMIX_VERSION_META" >> "$GITHUB_ENV"
echo "GWEMIX_VERSION=$(echo $GWEMIX_VERSION_META | cut -d'-' -f1)" >> "$GITHUB_ENV"
echo "GWEMIX_META=$(echo $GWEMIX_VERSION_META | cut -d'-' -f2-)" >> "$GITHUB_ENV"
echo "GWEMIX_COMMITHASH=$(echo ${{ github.sha }} | cut -c1-8)" >> "$GITHUB_ENV"
- name: Display ELF info
run: readelf -dV build/bin/gwemix
ls -l build/gwemix.tar.gz
tar tf build/gwemix.tar.gz
- name: Move results to artifact
run: mv build/gwemix.tar.gz gwemix-${{ env.GWEMIX_VERSION_META }}-${{ env.GWEMIX_COMMITHASH }}-linux-amd64-rocksdb.tar.gz
run: mv build/gwemix.tar.gz gwemix-${{ github.ref_name }}-${{ github.sha }}-linux-amd64-rocksdb.tar.gz

- name: Upload Go-WEMIX
uses: actions/upload-artifact@v4
with:
name: artifact-${{ env.GWEMIX_VERSION_META }}-${{ env.GWEMIX_COMMITHASH }}
path: gwemix-${{ env.GWEMIX_VERSION_META }}-${{ env.GWEMIX_COMMITHASH }}-linux-amd64-rocksdb.tar.gz
name: artifact-${{ github.ref_name }}-${{ github.sha }}
path: gwemix-${{ github.ref_name }}-${{ github.sha }}-linux-amd64-rocksdb.tar.gz
7 changes: 2 additions & 5 deletions .github/workflows/dev-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
strategy:
fail-fast: false
matrix:
version: [1.18, 1.19]
version: [1.17, 1.18, 1.19]
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
Expand All @@ -38,7 +38,7 @@ jobs:
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.version }}

- name: Check Lint
run: make lint

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

- name: Set up Wemix Submodules
run: git submodule update --init wemix/

- name: Set up Go
uses: actions/setup-go@v3
with:
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/gwemix-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
strategy:
fail-fast: false
matrix:
version: [1.18, 1.19]
version: [1.17, 1.18, 1.19]
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
Expand All @@ -49,9 +49,6 @@ jobs:
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Set up Wemix Submodules
run: git submodule update --init wemix/

- name: Set up Go
uses: actions/setup-go@v3
with:
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/master-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
strategy:
fail-fast: false
matrix:
version: [1.18, 1.19]
version: [1.17, 1.18, 1.19]
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
Expand All @@ -49,9 +49,6 @@ jobs:
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Set up Wemix Submodules
run: git submodule update --init wemix/

- name: Set up Go
uses: actions/setup-go@v3
with:
Expand Down
58 changes: 0 additions & 58 deletions .github/workflows/release.yml

This file was deleted.

6 changes: 0 additions & 6 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,3 @@
[submodule "etcd"]
path = etcd
url = https://github.com/metadium/etcd
[submodule "wemix/governance-contract/contracts/openzeppelin/contracts-upgradeable"]
path = wemix/governance-contract/contracts/openzeppelin/contracts-upgradeable
url = https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable
[submodule "wemix/governance-contract/contracts/openzeppelin/contracts"]
path = wemix/governance-contract/contracts/openzeppelin/contracts
url = https://github.com/OpenZeppelin/openzeppelin-contracts
79 changes: 74 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,16 @@ endif

gwemix.tar.gz: gwemix logrot
@[ -d build/conf ] || mkdir -p build/conf
@cp -p wemix/scripts/gwemix.sh build/bin/
@cp -p wemix/scripts/gwemix.sh wemix/scripts/solc.sh build/bin/
@cp -p wemix/scripts/config.json.example \
wemix/scripts/genesis-template.json \
wemix/contracts/WemixGovernance.js \
wemix/scripts/deploy-governance.js \
build/conf/
@(cd build; tar cfz gwemix.tar.gz bin conf)
@echo "Done building build/gwemix.tar.gz"

gwemix: rocksdb
gwemix: rocksdb wemix/governance_abi.go
ifeq ($(USE_ROCKSDB), NO)
$(GORUN) build/ci.go install $(ROCKSDB_TAG) ./cmd/gwemix
else
Expand Down Expand Up @@ -66,7 +68,7 @@ else
$(GORUN) build/ci.go install $(ROCKSDB_TAG) ./cmd/dbbench
endif

all:
all: wemix/governance_abi.go
$(GORUN) build/ci.go install

android:
Expand All @@ -87,12 +89,12 @@ test: all
test-short: all
$(GORUN) build/ci.go test -short

lint: ## Run linters.
lint: wemix/governance_abi.go ## Run linters.
$(GORUN) build/ci.go lint

clean:
env GO111MODULE=on go clean -cache
rm -fr build/_workspace/pkg/ $(GOBIN)/* build/conf
rm -fr build/_workspace/pkg/ $(GOBIN)/* build/conf wemix/admin_abi.go wemix/governance_abi.go
@ROCKSDB_DIR=$(ROCKSDB_DIR); \
if [ -e $${ROCKSDB_DIR}/Makefile ]; then \
cd $${ROCKSDB_DIR}; \
Expand Down Expand Up @@ -130,3 +132,70 @@ rocksdb:
@[ ! -e rocksdb/.git ] && git submodule update --init rocksdb; \
cd $(ROCKSDB_DIR) && PORTABLE=1 make -j8 static_lib;
endif

AWK_CODE=' \
BEGIN { print "package wemix"; bin = 0; name = ""; abi = ""; } \
/^{/ { bin = 1; abi = ""; name = ""; } \
/^}/ { bin = 0; abi = abi "}"; print "var " name "Abi = `" abi "`"; } \
{ \
if (bin == 1) { \
abi = abi $$0; \
if ($$1 == "\"contractName\":") { \
name = $$2; \
gsub(",|\"", "", name); \
} \
} \
}'

wemix/admin_abi.go: wemix/contracts/WemixAdmin-template.sol build/bin/solc
@PATH=${PATH}:build/bin wemix/scripts/solc.sh -f abi $< /tmp/junk.$$$$; \
cat /tmp/junk.$$$$ | awk $(AWK_CODE) > $@; \
rm -f /tmp/junk.$$$$;

AWK_CODE_2=' \
BEGIN { print "package wemix\n"; } \
/^var Registry_contract/ { \
sub("^var[^(]*\\(","",$$0); sub("\\);$$","",$$0); \
n = "Registry"; \
print "var " n "Abi = `{ \"contractName\": \"" n "\", \"abi\": " $$0 "}`"; \
} \
/^var StakingImp_contract/ { \
sub("^var[^(]*\\(","",$$0); sub("\\);$$","",$$0); \
n = "Staking"; \
print "var " n "Abi = `{ \"contractName\": \"" n "\", \"abi\": " $$0 "}`"; \
} \
/^var EnvStorageImp_contract/ { \
sub("^var[^(]*\\(","",$$0); sub("\\);$$","",$$0); \
n = "EnvStorageImp"; \
print "var " n "Abi = `{ \"contractName\": \"" n "\", \"abi\": " $$0 "}`"; \
} \
/^var GovImp_contract/ { \
sub("^var[^(]*\\(","",$$0); sub("\\);$$","",$$0); \
n = "Gov"; \
print "var " n "Abi = `{ \"contractName\": \"" n "\", \"abi\": " $$0 "}`"; \
}'

wemix/governance_abi.go: wemix/contracts/WemixGovernance.js
@cat $< | awk $(AWK_CODE_2) > $@

ifneq ($(shell uname), Linux)

build/bin/solc:
@test 1

else

SOLC_URL=https://github.com/ethereum/solidity/releases/download/v0.4.24/solc-static-linux
build/bin/solc:
@[ -d build/bin ] || mkdir -p build/bin; \
if [ ! -x build/bin/solc ]; then \
if which curl > /dev/null 2>&1; then \
curl -Ls -o build/bin/solc $(SOLC_URL); \
chmod +x build/bin/solc; \
elif which wget > /dev/null 2>&1; then \
wget -nv -o build/bin/solc $(SOLC_URL); \
chmod +x build/bin/solc; \
fi \
fi

endif
Loading

0 comments on commit 58e75da

Please sign in to comment.