Skip to content

Commit

Permalink
Merge branch 'master' of github.com:gnolang/gno into r/foo20-airdrop
Browse files Browse the repository at this point in the history
  • Loading branch information
albttx committed Nov 27, 2024
2 parents 4d65479 + c1ae90b commit 125f9a7
Show file tree
Hide file tree
Showing 434 changed files with 4,929 additions and 5,050 deletions.
103 changes: 73 additions & 30 deletions .github/goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# yaml-language-server: $schema=https://goreleaser.com/static/schema-pro.json
project_name: gno
version: 2

Expand Down Expand Up @@ -86,6 +87,8 @@ builds:
goarm:
- "6"
- "7"
# Gno Contribs
# NOTE: Contribs binary will be added in a single docker image below: gnocontribs
- id: gnobro
dir: ./contribs/gnodev/cmd/gnobro
binary: gnobro
Expand All @@ -101,6 +104,21 @@ builds:
goarm:
- "6"
- "7"
- id: gnogenesis
dir: ./contribs/gnogenesis
binary: gnogenesis
env:
- CGO_ENABLED=0
goos:
- linux
- darwin
goarch:
- amd64
- arm64
- arm
goarm:
- "6"
- "7"

gomod:
proxy: true
Expand Down Expand Up @@ -300,6 +318,7 @@ dockers:
- gno.land/genesis/genesis_txs.jsonl
- examples
- gnovm/stdlibs

# gnokey
- use: buildx
dockerfile: Dockerfile.release
Expand Down Expand Up @@ -504,73 +523,97 @@ dockers:
ids:
- gnofaucet

# gnobro
# gnocontribs
- use: buildx
dockerfile: Dockerfile.release
goos: linux
goarch: amd64
image_templates:
- "ghcr.io/gnolang/{{ .ProjectName }}/gnobro:{{ .Version }}-amd64"
- "ghcr.io/gnolang/{{ .ProjectName }}/gnobro:{{ .Env.TAG_VERSION }}-amd64"
- "ghcr.io/gnolang/{{ .ProjectName }}/gnocontribs:{{ .Version }}-amd64"
- "ghcr.io/gnolang/{{ .ProjectName }}/gnocontribs:{{ .Env.TAG_VERSION }}-amd64"
build_flag_templates:
- "--target=gnobro"
- "--target=gnocontribs"
- "--platform=linux/amd64"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.title={{.ProjectName}}/gnobro"
- "--label=org.opencontainers.image.title={{.ProjectName}}/gnocontribs"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
ids:
- gnobro
- gnogenesis
extra_files:
- gno.land/genesis/genesis_balances.txt
- gno.land/genesis/genesis_txs.jsonl
- examples
- gnovm/stdlibs
- use: buildx
dockerfile: Dockerfile.release
goos: linux
goarch: arm64
image_templates:
- "ghcr.io/gnolang/{{ .ProjectName }}/gnobro:{{ .Version }}-arm64v8"
- "ghcr.io/gnolang/{{ .ProjectName }}/gnobro:{{ .Env.TAG_VERSION }}-arm64v8"
- "ghcr.io/gnolang/{{ .ProjectName }}/gnocontribs:{{ .Version }}-arm64v8"
- "ghcr.io/gnolang/{{ .ProjectName }}/gnocontribs:{{ .Env.TAG_VERSION }}-arm64v8"
build_flag_templates:
- "--target=gnobro"
- "--target=gnocontribs"
- "--platform=linux/arm64/v8"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.title={{.ProjectName}}/gnobro"
- "--label=org.opencontainers.image.title={{.ProjectName}}/gnocontribs"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
ids:
- gnobro
- gnogenesis
extra_files:
- gno.land/genesis/genesis_balances.txt
- gno.land/genesis/genesis_txs.jsonl
- examples
- gnovm/stdlibs
- use: buildx
dockerfile: Dockerfile.release
goos: linux
goarch: arm
goarm: 6
image_templates:
- "ghcr.io/gnolang/{{ .ProjectName }}/gnobro:{{ .Version }}-armv6"
- "ghcr.io/gnolang/{{ .ProjectName }}/gnobro:{{ .Env.TAG_VERSION }}-armv6"
- "ghcr.io/gnolang/{{ .ProjectName }}/gnocontribs:{{ .Version }}-armv6"
- "ghcr.io/gnolang/{{ .ProjectName }}/gnocontribs:{{ .Env.TAG_VERSION }}-armv6"
build_flag_templates:
- "--target=gnobro"
- "--target=gnocontribs"
- "--platform=linux/arm/v6"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.title={{.ProjectName}}/gnobro"
- "--label=org.opencontainers.image.title={{.ProjectName}}/gnocontribs"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
ids:
- gnobro
- gnogenesis
extra_files:
- gno.land/genesis/genesis_balances.txt
- gno.land/genesis/genesis_txs.jsonl
- examples
- gnovm/stdlibs
- use: buildx
dockerfile: Dockerfile.release
goos: linux
goarch: arm
goarm: 7
image_templates:
- "ghcr.io/gnolang/{{ .ProjectName }}/gnobro:{{ .Version }}-armv7"
- "ghcr.io/gnolang/{{ .ProjectName }}/gnobro:{{ .Env.TAG_VERSION }}-armv7"
- "ghcr.io/gnolang/{{ .ProjectName }}/gnocontribs:{{ .Version }}-armv7"
- "ghcr.io/gnolang/{{ .ProjectName }}/gnocontribs:{{ .Env.TAG_VERSION }}-armv7"
build_flag_templates:
- "--target=gnobro"
- "--target=gnocontribs"
- "--platform=linux/arm/v7"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.title={{.ProjectName}}/gnobro"
- "--label=org.opencontainers.image.title={{.ProjectName}}/gnocontribs"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
ids:
- gnobro
- gnogenesis
extra_files:
- gno.land/genesis/genesis_balances.txt
- gno.land/genesis/genesis_txs.jsonl
- examples
- gnovm/stdlibs

docker_manifests:
# https://goreleaser.com/customization/docker_manifest/
Expand Down Expand Up @@ -645,19 +688,19 @@ docker_manifests:
- ghcr.io/gnolang/{{ .ProjectName }}/gnofaucet:{{ .Env.TAG_VERSION }}-armv6
- ghcr.io/gnolang/{{ .ProjectName }}/gnofaucet:{{ .Env.TAG_VERSION }}-armv7

# gnobro
- name_template: ghcr.io/gnolang/{{ .ProjectName }}/gnobro:{{ .Version }}
image_templates:
- ghcr.io/gnolang/{{ .ProjectName }}/gnobro:{{ .Version }}-amd64
- ghcr.io/gnolang/{{ .ProjectName }}/gnobro:{{ .Version }}-arm64v8
- ghcr.io/gnolang/{{ .ProjectName }}/gnobro:{{ .Version }}-armv6
- ghcr.io/gnolang/{{ .ProjectName }}/gnobro:{{ .Version }}-armv7
- name_template: ghcr.io/gnolang/{{ .ProjectName }}/gnobro:{{ .Env.TAG_VERSION }}
image_templates:
- ghcr.io/gnolang/{{ .ProjectName }}/gnobro:{{ .Env.TAG_VERSION }}-amd64
- ghcr.io/gnolang/{{ .ProjectName }}/gnobro:{{ .Env.TAG_VERSION }}-arm64v8
- ghcr.io/gnolang/{{ .ProjectName }}/gnobro:{{ .Env.TAG_VERSION }}-armv6
- ghcr.io/gnolang/{{ .ProjectName }}/gnobro:{{ .Env.TAG_VERSION }}-armv7
# gnocontribs
- name_template: ghcr.io/gnolang/{{ .ProjectName }}/gnocontribs:{{ .Version }}
image_templates:
- ghcr.io/gnolang/{{ .ProjectName }}/gnocontribs:{{ .Version }}-amd64
- ghcr.io/gnolang/{{ .ProjectName }}/gnocontribs:{{ .Version }}-arm64v8
- ghcr.io/gnolang/{{ .ProjectName }}/gnocontribs:{{ .Version }}-armv6
- ghcr.io/gnolang/{{ .ProjectName }}/gnocontribs:{{ .Version }}-armv7
- name_template: ghcr.io/gnolang/{{ .ProjectName }}/gnocontribs:{{ .Env.TAG_VERSION }}
image_templates:
- ghcr.io/gnolang/{{ .ProjectName }}/gnocontribs:{{ .Env.TAG_VERSION }}-amd64
- ghcr.io/gnolang/{{ .ProjectName }}/gnocontribs:{{ .Env.TAG_VERSION }}-arm64v8
- ghcr.io/gnolang/{{ .ProjectName }}/gnocontribs:{{ .Env.TAG_VERSION }}-armv6
- ghcr.io/gnolang/{{ .ProjectName }}/gnocontribs:{{ .Env.TAG_VERSION }}-armv7

docker_signs:
- cmd: cosign
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: examples
on:
pull_request:
push:
branches: [ "master" ]
branches: ["master"]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
Expand Down Expand Up @@ -70,7 +70,7 @@ jobs:
strategy:
fail-fast: false
matrix:
goversion: [ "1.22.x" ]
goversion: ["1.22.x"]
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
Expand All @@ -86,7 +86,7 @@ jobs:
strategy:
fail-fast: false
matrix:
go-version: [ "1.22.x" ]
go-version: ["1.22.x"]
# unittests: TODO: matrix with contracts
runs-on: ubuntu-latest
timeout-minutes: 10
Expand Down
56 changes: 56 additions & 0 deletions .github/workflows/genesis-verify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: genesis-verify

on:
pull_request:
branches:
- master
paths:
- "misc/deployments/**/genesis.json"

jobs:
verify:
strategy:
fail-fast: false
matrix:
testnet: ["test5.gno.land"]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v41
with:
files: "misc/deployments/${{ matrix.testnet }}/genesis.json"

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.22"

- name: Build gnogenesis
run: make -C contribs/gnogenesis

- name: Verify each genesis file
run: |
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
echo "Verifying $file"
gnogenesis verify -genesis-path $file
done
- name: Build gnoland
run: make -C gno.land install.gnoland

- name: Running latest gnoland with each genesis file
run: |
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
echo "Running gnoland with $file"
timeout 60s gnoland start -lazy --genesis $file || exit_code=$?
if [ $exit_code -eq 124 ]; then
echo "Gnoland genesis state generated successfully"
else
echo "Gnoland failed to start with $file"
exit 1
fi
done
2 changes: 2 additions & 0 deletions .github/workflows/gnovm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ jobs:
uses: ./.github/workflows/main_template.yml
with:
modulepath: "gnovm"
# in pull requests, append -short so that the CI runs quickly.
tests-extra-args: ${{ github.event_name == 'pull_request' && '-short' || '' }}
secrets:
codecov-token: ${{ secrets.CODECOV_TOKEN }}
fmt:
Expand Down
20 changes: 9 additions & 11 deletions .github/workflows/misc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,15 @@ on:
jobs:
main:
strategy:
fail-fast: false
matrix:
# fixed list because we have some non go programs on that misc folder
program:
- autocounterd
# - devdeps
- docker-integration
- genproto
- genstd
- goscan
- loop
fail-fast: false
matrix:
# fixed list because we have some non go programs on that misc folder
program:
- autocounterd
- genproto
- genstd
- goscan
- loop
name: Run Main
uses: ./.github/workflows/main_template.yml
with:
Expand Down
40 changes: 23 additions & 17 deletions Dockerfile.release
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ CMD [ "" ]
## ghcr.io/gnolang/gno/gnoland
FROM base as gnoland

COPY ./gnoland /usr/bin/gnoland
COPY ./examples /gnoroot/examples/
COPY ./gnovm/stdlibs /gnoroot/gnovm/stdlibs/
COPY ./gno.land/genesis/genesis_balances.txt /gnoroot/gno.land/genesis/genesis_balances.txt
COPY ./gno.land/genesis/genesis_txs.jsonl /gnoroot/gno.land/genesis/genesis_txs.jsonl
COPY ./gnoland /usr/bin/gnoland
COPY ./examples /gnoroot/examples/
COPY ./gnovm/stdlibs /gnoroot/gnovm/stdlibs/
COPY ./gno.land/genesis/genesis_balances.txt /gnoroot/gno.land/genesis/genesis_balances.txt
COPY ./gno.land/genesis/genesis_txs.jsonl /gnoroot/gno.land/genesis/genesis_txs.jsonl

EXPOSE 26656 26657

Expand Down Expand Up @@ -44,21 +44,27 @@ COPY ./gnofaucet /usr/bin/gnofaucet
EXPOSE 5050
ENTRYPOINT [ "/usr/bin/gnofaucet" ]

#
## ghcr.io/gnolang/gno/gnobro
FROM base as gnobro

COPY ./gnobro /usr/bin/gnobro
EXPOSE 22
ENTRYPOINT [ "/usr/bin/gnobro" ]

#
## ghcr.io/gnolang/gno
FROM base as gno

COPY ./gno /usr/bin/gno
COPY ./examples /gnoroot/examples/
COPY ./gnovm/stdlibs /gnoroot/gnovm/stdlibs/
COPY ./gnovm/tests/stdlibs /gnoroot/gnovm/tests/stdlibs/
COPY ./gno /usr/bin/gno
COPY ./examples /gnoroot/examples/
COPY ./gnovm/stdlibs /gnoroot/gnovm/stdlibs/
COPY ./gnovm/tests/stdlibs /gnoroot/gnovm/tests/stdlibs/

ENTRYPOINT [ "/usr/bin/gno" ]

#
## ghcr.io/gnolang/gnocontribs
FROM base as gnocontribs

COPY ./gnobro /usr/bin/gnobro
COPY ./gnogenesis /usr/bin/gnogenesis
COPY ./examples /gnoroot/examples/
COPY ./gnovm/stdlibs /gnoroot/gnovm/stdlibs/
COPY ./gno.land/genesis/genesis_balances.txt /gnoroot/gno.land/genesis/genesis_balances.txt
COPY ./gno.land/genesis/genesis_txs.jsonl /gnoroot/gno.land/genesis/genesis_txs.jsonl
EXPOSE 22

ENTRYPOINT [ "/bin/sh", "-c" ]
2 changes: 1 addition & 1 deletion contribs/gnodev/cmd/gnodev/setup_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func setupDevNode(
nodeConfig.InitialTxs[index] = nodeTx
}

logger.Info("genesis file loaded", "path", devCfg.genesisFile, "txs", len(nodeConfig.InitialTxs))
logger.Info("genesis file loaded", "path", devCfg.genesisFile, "txs", len(stateTxs))
}

return gnodev.NewDevNode(ctx, nodeConfig)
Expand Down
Loading

0 comments on commit 125f9a7

Please sign in to comment.