Skip to content

Commit

Permalink
Merge branch 'main' into upgrade-v501
Browse files Browse the repository at this point in the history
  • Loading branch information
antstalepresh committed Aug 11, 2023
2 parents 40a6ab1 + 31d7de9 commit 12875e3
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 19 deletions.
15 changes: 6 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,22 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: '^1.19'
with:
go-version: "^1.19"
env:
GOOS: ${{ matrix.targetos }}
GOARCH: ${{ matrix.arch }}



- name: run tests
run: go test ./...

# we build and install in case we want to run it or capture an artifact as we do in the step below.
# we build and install in case we want to run it or capture an artifact as we do in the step below.
- name: Compile chihuahuad
run: |
go build ./...
go install ./...
# now uploads genesis.json and bin
# now uploads genesis.json and bin
- uses: actions/upload-artifact@v3
with:
name: chihuahuad ${{ matrix.targetos }} ${{ matrix.arch }}
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: "Release"

on:
push:
tags:
- v*
jobs:
draft-release:
runs-on: ubuntu-latest
permissions: write-all
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Copy Binary
run: |
make build-reproducible-all
- name: Draft Release
uses: softprops/action-gh-release@v1
with:
draft: true
files: |
chihuahuad_linux_arm64
chihuahuad_linux_amd64
chihuahuad_sha256.txt
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ARG IMG_TAG=latest
ARG PLATFORM="linux/amd64"
ARG GO_VERSION="1.20"
ARG GO_VERSION="1.19"
ARG RUNNER_IMAGE="gcr.io/distroless/static"

FROM --platform=${PLATFORM} golang:${GO_VERSION}-alpine as builder
Expand Down
10 changes: 6 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
COMMIT := $(shell git log -1 --format='%H')
GO_VERSION := "1.20"

# don't override user values
ifeq (,$(VERSION))
Expand Down Expand Up @@ -111,17 +112,18 @@ build-reproducible-generic: go.sum
$(DOCKER) rm $(subst /,-,latest-build-$(PLATFORM)) || true
DOCKER_BUILDKIT=1 $(DOCKER) build -t latest-build-$(PLATFORM) \
--build-arg ARCH=$(ARCH) \
--build-arg GO_VERSION=$(GO_VERSION) \
--build-arg PLATFORM=$(PLATFORM) \
--build-arg VERSION="$(VERSION)" \
-f Dockerfile .
$(DOCKER) create -ti --name $(subst /,-,latest-build-$(PLATFORM)) latest-build-$(PLATFORM) chihuahuad
mkdir -p $(BUILDDIR)/$(NETWORK)/$(PLATFORM)/
$(DOCKER) cp -a $(subst /,-,latest-build-$(PLATFORM)):/usr/local/bin/chihuahuad $(BUILDDIR)/$(NETWORK)/$(PLATFORM)/chihuahuad
$(DOCKER) cp -a $(subst /,-,latest-build-$(PLATFORM)):/usr/local/bin/chihuahuad chihuahuad_$(subst /,_,$(PLATFORM))
sha256sum chihuahuad_$(subst /,_,$(PLATFORM)) >> ./chihuahuad_sha256.txt

# Add check to make sure we are using the proper Go version before proceeding with anything
check-go-version:
@if ! go version | grep -q "go1.20"; then \
echo "\033[0;31mERROR:\033[0m Go version 1.20 is required for compiling chihuahuad. It looks like you are using" "$(shell go version) \nThere are potential consensus-breaking changes that can occur when running binaries compiled with different versions of Go. Please download Go version 1.19 and retry. Thank you!"; \
@if ! go version | grep -q "go$(GO_VERSION)"; then \
echo "\033[0;31mERROR:\033[0m Go version $(GO_VERSION) is required for compiling chihuahuad. It looks like you are using" "$(shell go version) \nThere are potential consensus-breaking changes that can occur when running binaries compiled with different versions of Go. Please download Go version $(GO_VERSION) and retry. Thank you!"; \
exit 1; \
fi

Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ sudo apt-get install make build-essential gcc git jq chrony -y

```bash
# download the latest version
wget https://go.dev/dl/go1.19.2.linux-amd64.tar.gz
wget https://go.dev/dl/go1.20.6.linux-amd64.tar.gz

# remove old version (if any)
sudo rm -rf /usr/local/go

# install the new version
sudo tar -C /usr/local -xzf go1.19.2.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.20.6.linux-amd64.tar.gz
```

- #### Configure Environmental Variables
Expand All @@ -47,7 +47,7 @@ source ~/.profile

go version
```
The output should be `go version go1.19 linux/amd64`
The output should be `go version go1.20.6 linux/amd64`

- #### Install Chihuahua from sources

Expand All @@ -56,11 +56,11 @@ The output should be `go version go1.19 linux/amd64`
git clone https://github.com/ChihuahuaChain/chihuahua.git
cd chihuahua
git fetch --tags
git checkout v4.2.3
git checkout v5.0.0
make install
```

To verify the installation you can run `chihuahuad version` and it should return `v4.2.3`
To verify the installation you can run `chihuahuad version` and it should return `v5.0.0`

- #### Initialize the Chain
Replace `$MONIKERNAME` with your choosen node name
Expand Down

0 comments on commit 12875e3

Please sign in to comment.