Skip to content

Commit 77ce51e

Browse files
authored
Merge branch 'master' into feat/support-arbitrary-fields
2 parents 32778e0 + dd2d374 commit 77ce51e

File tree

95 files changed

+6476
-1114
lines changed

Some content is hidden

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

95 files changed

+6476
-1114
lines changed

.github/workflows/portal-loop.yml

+59-1
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
name: portal-loop
22

33
on:
4+
pull_request:
5+
branches:
6+
- master
47
push:
58
paths:
69
- "misc/loop/**"
710
- ".github/workflows/portal-loop.yml"
811
branches:
912
- "master"
10-
- "ops/portal-loop"
13+
# NOTE(albttx): branch name to simplify tests for this workflow
14+
- "ci/portal-loop"
1115
tags:
1216
- "v*"
1317

@@ -46,3 +50,57 @@ jobs:
4650
push: ${{ github.event_name != 'pull_request' }}
4751
tags: ${{ steps.meta.outputs.tags }}
4852
labels: ${{ steps.meta.outputs.labels }}
53+
54+
test-portal-loop-docker-compose:
55+
runs-on: ubuntu-latest
56+
timeout-minutes: 10
57+
steps:
58+
- name: "Checkout"
59+
uses: actions/checkout@v4
60+
61+
- name: "Setup the images"
62+
run: |
63+
cd misc/loop
64+
65+
docker compose build
66+
docker compose pull
67+
docker compose up -d
68+
69+
- name: "Test1 - Portal loop start gnoland"
70+
run: |
71+
while
72+
block_height=$(curl -s localhost:26657/status | jq -r '.result.sync_info.latest_block_height')
73+
echo "Current block height: $block_height"
74+
[[ "$block_height" -lt 10 ]]
75+
do
76+
sleep 1
77+
done
78+
79+
curl -s localhost:26657/status | jq
80+
81+
- name: "Buid new gnolang/gno image"
82+
run: |
83+
docker build -t ghcr.io/gnolang/gno/gnoland:master -f Dockerfile --target gnoland .
84+
85+
- name: "Wait for new docker image"
86+
run: |
87+
ip_addr=$(cat misc/loop/traefik/gno.yml | grep -o "http://.*:26657")
88+
while
89+
new_ip_addr=$(cat misc/loop/traefik/gno.yml | grep -o "http://.*:26657")
90+
echo "${ip_addr} -> ${new_ip_addr}"
91+
[[ "${ip_addr}" == ${new_ip_addr} ]]
92+
do
93+
sleep 5
94+
done
95+
96+
- name: "Test2 - Wait portal-loop start new image"
97+
run: |
98+
while
99+
block_height=$(curl -s localhost:26657/status | jq -r '.result.sync_info.latest_block_height')
100+
echo "Current block height: $block_height"
101+
[[ "$block_height" -lt 10 ]]
102+
do
103+
sleep 5
104+
done
105+
docker ps -a
106+
curl -s localhost:26657/status | jq

Dockerfile

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# build gno
2+
FROM golang:1.22-alpine AS build-gno
3+
RUN go env -w GOMODCACHE=/root/.cache/go-build
4+
WORKDIR /gnoroot
5+
ENV GNOROOT="/gnoroot"
6+
COPY . ./
7+
RUN --mount=type=cache,target=/root/.cache/go-build go mod download
8+
RUN --mount=type=cache,target=/root/.cache/go-build go build -o ./build/gnoland ./gno.land/cmd/gnoland
9+
RUN --mount=type=cache,target=/root/.cache/go-build go build -o ./build/gnokey ./gno.land/cmd/gnokey
10+
RUN --mount=type=cache,target=/root/.cache/go-build go build -o ./build/gnoweb ./gno.land/cmd/gnoweb
11+
RUN --mount=type=cache,target=/root/.cache/go-build go build -o ./build/gno ./gnovm/cmd/gno
12+
13+
# Base image
14+
FROM alpine:3.17 AS base
15+
WORKDIR /gnoroot
16+
ENV GNOROOT="/gnoroot"
17+
RUN apk add ca-certificates
18+
CMD [ "" ]
19+
20+
# alpine images
21+
# gnoland
22+
FROM base AS gnoland
23+
COPY --from=build-gno /gnoroot/build/gnoland /usr/bin/gnoland
24+
COPY --from=build-gno /gnoroot/examples /gnoroot/examples
25+
COPY --from=build-gno /gnoroot/gnovm/stdlibs /gnoroot/gnovm/stdlibs
26+
COPY --from=build-gno /gnoroot/gno.land/genesis/genesis_txs.jsonl /gnoroot/gno.land/genesis/genesis_txs.jsonl
27+
COPY --from=build-gno /gnoroot/gno.land/genesis/genesis_balances.txt /gnoroot/gno.land/genesis/genesis_balances.txt
28+
EXPOSE 26656 26657
29+
ENTRYPOINT ["/usr/bin/gnoland"]
30+
31+
# gnokey
32+
FROM base AS gnokey
33+
COPY --from=build-gno /gnoroot/build/gnokey /usr/bin/gnokey
34+
# gofmt is required by `gnokey maketx addpkg`
35+
COPY --from=build-gno /usr/local/go/bin/gofmt /usr/bin/gofmt
36+
ENTRYPOINT ["/usr/bin/gnokey"]
37+
38+
# gno
39+
FROM base AS gno
40+
COPY --from=build-gno /gnoroot/build/gno /usr/bin/gno
41+
ENTRYPOINT ["/usr/bin/gno"]
42+
43+
# gnoweb
44+
FROM base AS gnoweb
45+
COPY --from=build-gno /gnoroot/build/gnoweb /usr/bin/gnoweb
46+
COPY --from=build-gno /opt/gno/src/gno.land/cmd/gnoweb /opt/gno/src/gnoweb
47+
EXPOSE 8888
48+
ENTRYPOINT ["/usr/bin/gnoweb"]
49+
50+
# all, contains everything.
51+
FROM base AS all
52+
COPY --from=build-gno /gnoroot/build/* /usr/bin/
53+
COPY --from=build-gno /gnoroot/examples /gnoroot/examples
54+
COPY --from=build-gno /gnoroot/gnovm/stdlibs /gnoroot/gnovm/stdlibs
55+
COPY --from=build-gno /gnoroot/gno.land/genesis/genesis_txs.jsonl /gnoroot/gno.land/genesis/genesis_txs.jsonl
56+
COPY --from=build-gno /gnoroot/gno.land/genesis/genesis_balances.txt /gnoroot/gno.land/genesis/genesis_balances.txt
57+
# gofmt is required by `gnokey maketx addpkg`
58+
COPY --from=build-gno /usr/local/go/bin/gofmt /usr/bin

contribs/gnodev/Makefile

+5-3
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@ GOTEST_FLAGS ?= $(GOBUILD_FLAGS) -v -p 1 -timeout=5m
55
rundep := go run -modfile ../../misc/devdeps/go.mod
66
golangci_lint := $(rundep) github.com/golangci/golangci-lint/cmd/golangci-lint
77

8-
install:
8+
install: install.gnodev
9+
install.gnodev:
910
go install $(GOBUILD_FLAGS) ./cmd/gnodev
1011

11-
build:
12-
go build $(GOBUILD_FLAGS) -o build/gnodev ./cmd/gnodev
12+
# keep gnobro out the default install for now
13+
install.gnobro:
14+
go install $(GOBUILD_FLAGS) ./cmd/gnobro
1315

1416
lint:
1517
$(golangci_lint) --config ../../.github/golangci.yml run ./...

contribs/gnodev/README.md

+55-18
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,67 @@
1-
## `gnodev`: Your Gno Companion Tool
1+
## `gnodev`: Your Gno Development Companion
22

3-
`gnodev` is designed to be a robust and user-friendly tool in your realm package development journey, streamlining your workflow and enhancing productivity.
3+
`gnodev` is a robust tool designed to streamline your Gno package development process, enhancing productivity
4+
by providing immediate feedback on code changes.
45

5-
We will only give a quick overview below. You may find the official documentation at [docs/gno-tooling/gnodev.md](../../docs/gno-tooling/cli/gnodev.md).
6+
Please note that this is a quick overview. For a more detailed guide, refer to the official documentation at
7+
[docs/gno-tooling/gnodev.md](../../docs/gno-tooling/cli/gnodev.md).
68

79
### Synopsis
8-
**gnodev** [**-minimal**] [**-no-watch**] [**PKG_PATH ...**]
10+
**gnodev** [**options**] [**PKG_PATH ...**]
911

1012
### Features
11-
- **In-Memory Node**: Gnodev starts an in-memory node, and automatically loads
12-
the **examples** folder and any user-specified paths.
13-
- **Web Interface Server**: Starts a `gnoweb` server on `localhost:8888`.
14-
- **Hot Reload**: Monitors the example packages folder and specified directories for file changes,
15-
reloading the package and automatically restarting the node as needed.
16-
- **State Maintenance**: Ensures the current state is preserved by replaying all transactions.
13+
- **In-Memory Node**: Gnodev starts an in-memory node, automatically loading the **examples** folder and any
14+
user-specified paths.
15+
- **Web Interface Server**: Gnodev starts a `gnoweb` server on [`localhost:8888`](https://localhost:8888).
16+
- **Balances and Keybase Customization**: Set account balances, load them from a file, or add new accounts via a flag.
17+
- **Hot Reload**: Monitors the **examples** folder and specified directories for file changes, reloading the
18+
package and automatically restarting the node as needed.
19+
- **State Maintenance**: Ensures the previous node state is preserved by replaying all transactions.
20+
- **Transaction Manipulation**: Allows for interactive cancellation and redoing of transactions.
21+
- **State Export**: Export the current state at any time in a genesis doc format.
1722

1823
### Commands
19-
While `gnodev` is running, the user can trigger specific actions by pressing
20-
the following combinations:
21-
- **H**: Display help information.
22-
- **R**: Reload the node, without resetting the state.
23-
- **Ctrl+R**: Reset the current node state.
24-
- **Ctrl+C**: Exit `gnodev`.
24+
While `gnodev` is running, trigger specific actions by pressing the following combinations:
25+
- **H**: Display help information.
26+
- **A**: Display account balances.
27+
- **R**: Reload the node manually.
28+
- **P**: Cancel the last action.
29+
- **N**: Redo the last cancelled action.
30+
- **Ctrl+S**: Save the current state.
31+
- **Ctrl+R**: Restore the saved state.
32+
- **E**: Export the current state to a genesis file.
33+
- **Cmd+R**: Reset the current node state.
34+
- **Cmd+C**: Exit `gnodev`.
35+
36+
### Usage
37+
Run `gnodev` followed by any specific options and/or package paths. The **examples** directory is loaded
38+
automatically. Use `--minimal` to prevent this.
39+
40+
Example:
41+
```
42+
gnodev --add-account <bech32/name1>[:<amount1>] ./myrealm
43+
```
44+
45+
### `gnobro`: realm interface
46+
`gnobro` is a terminal user interface (TUI) that allows you to browse realms within your terminal. It
47+
automatically connects to `gnodev` for real-time development. In addition to hot reload, it also has the
48+
ability to execute commands and interact with your realm.
49+
50+
51+
#### Usage
52+
**gnobro** [**options**] [**PKG_PATH **]
53+
54+
Run gnobro followed by any specific options and/or a target pacakge path.
55+
56+
Use `gnobro -h` for a detailed list of options.
57+
58+
Example:
59+
```
60+
gnobro gno.land/r/demo/home
61+
```
2562

26-
### Loading 'examples'
27-
The **examples** directory is loaded automatically. If working within this folder, you don't have to specify any additional paths to `gnodev`. Use `--minimal` to prevent this.
2863

2964
### Installation
3065
Run `make install` to install `gnodev`.
66+
67+
Run `make install.gnobro` to install `gnobro`.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
. +
2+
+ . Hello %s, Welcome to
3+
.
4+
+ .,-:::::/ :::. :::. ... .
5+
. ,;;-'````' `;;;;, `;;; .;;;;;;;.
6+
[[[ [[[[[[/ [[[[[. '[[ ,[[ \[[,
7+
"$$c. "$$ + $$$ "Y$c$$ $$$, $$$
8+
`Y8bo,,,o88o 888 Y88 "888,_ _,88P
9+
. `'YMUP"YMM MMM . YM "YMMMMMP" +
10+
. .
11+
::: + :::. :::. :::. :::::::-.
12+
;;; ;;`;; `;;;;, `;;; ;;, `';,
13+
+ [[[ ,[[ '[[, + [[[[[. '[[ `[[ [[
14+
$$' c$$$cc$$$c $$$ "Y$c$$ $$, $$
15+
o88oo,.__ 888 888, 888 Y88 888_,o8P'
16+
""""YUMMM YMM ""` MMM + YM MMMMP"` +
17+
.
18+
+
19+
press <enter> to continue
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
 · . · ·
2+
. * . . * . ·
3+
· · · · . . .
4+
· . . . . · *
5+
. · . . ·
6+
░░ ░░ ░ ░░ ░ ░░ ░ ░░ ░░░ ░░░░░░ ░░░ ░░░░ ░ ░░
7+
░░▒▒░░░▒▒░░░░░▒░░░░░░▒▒░░▒░░▒▒░▒░░░░░░░ ░░░░░░▒▒░▒▒▒░▒▒▒▒▒▒░░▒▒▒░░░▒▒▒▒░▒░░▒▒░░
8+
▒▒▓▓▒▒▒▓▓▒▒▒▒▒▓▒▒▒▒▒▒▓▓▒▒▓▒▒▓▓▒▓▒▒▒▒▒▒▒░▒▒▒▒▒▒▓▓▒▓▓▓▒▓▓▓▓▓▓▒▒▓▓▓▒▒▒▓▓▓▓▒▓▒▒▓▓▒▒
9+
▓▓██▓▓▓██▓▓▓▓▓█▓▓▓▓▓▓██▓▓█▓▓██▓█▓▓▓▓▓▓▓▒▓▓▓▓▓▓██▓███▓██████▓▓███▓▓▓████▓█▓▓██▓▓
10+
▀██▒███ █████ ██████▌▐██▒██▌██▒███████▓███▓██▌▐██▒██▌██▒█████▒████ ███▒███ ██
11+
 ▐▒▒▒█ █▒█▌ ▐▒███▌ ▐▒▒▒▌ ▐▒▒███▌█▒███▌███▌ ▐▒▒▒▌ ▐▒▒███▌█▒███ █▒▒▒█▌ ▐▒
12+
 ▒▒▒▒▄ ▄▒█ ▒█▒█▄ ▒▒▒░ ▀▒▒█▌ ▐▒██▐ █▒█▄ ▒▒▒░ ▀▒▒█▌ ▐▒ █▄ ▄▒▒ ▒ ▒
13+
 ░ ░ ▄ ▄▄▒▌ ▒█▒▀ ▀▒▒ ▒▒▒▀▄ ▄▒▄▀▀▄▐▒▀ ▀▒▒ ▒▒▒▀▄ ▄▒ █ ▄ ▄▄▄▀▀▄ ▒
14+
 ▀░ ▒░▒▄░ ▀▄▒▀▒▒ ▀█▒▄▄ ▄■▄▒▒▀ ▒▌░░▐░▀ ▒ ▀ ▄ ■▒░▀ ▒ ▀░ ▒░▌░░▐░ ▀▄
15+
▌░░▐ ▌░░▐
16+
▄▄▀▀▀▀▀▀▀▄▄▀▀▄▀▀▀▀▀▄ ▄▀▀▀▀▀▄ ▌▒▒▐ ▄▄▀▀▀▀▀▄ ▄▀▄▄▀▀▀▀▀▄ ▄▄▄▄▄▌▒▒▐
17+
▌▄▓▓▓▓▓▓▓▄ ▓▓▄▓▓▓▓▓▄▀▀▄▓▓▓▓▓▄▀▄ ▌▓▓▐ ▌▄▓▓▓▓▓▄▀▌▓▌▄▓▓▓▓▓▄▀▀▄▄▄▄▄▄▓▓▐
18+
▌█▌ ██ ███▀▄▄▀██ ▐██▀▀▀██▌▐ ▌██▐ ▐▐██▀▀▀██▌ ███▀▄▄▀██ ▐██▀▀▀███▐
19+
▌▀░░░░░░░░ ░░▌▌ ▌░░ ░░ ░░▐ ▌░░▐ ▌░░ ░░ ░░▌█ ▌░░ ░░▌ ▐░░▐
20+
▐ ▒▒ ▒▒▌▌ ▌▒▒ ▒▒▌ ▐▒▒▐▄▀▄▌▒▒▐ ▌▒▒▌ ▐▒▒ ▒▒▌▌ ▌▒▒ ▒▒▌ ▐▒▒▐
21+
▌▄▄ ▓▓ ▓▓▌▌ ▌▓▓ ▓▓▓ ▓▓▓ ▄▓▄ ▓▓ ▀▀ ▓▓▓ ▐▓▓ ▓▓▌▌ ▌▓▓ ▓▓▓ ▐▓▓▐
22+
░ ▌▀███████▀ ███▐ ▐▐██ ▄▀█████▀▄▄▀█▀▄▀████ ▄▀████▀██ ███▐ ▐▐██ ▄▀████▀██▐ ░
23+
▒ ▓▓▄▄▄▄▄▄▄▄▀▄▄▄▀ ▀▄▄▀ ▀▄▄▄▄▄▀ ▀▄▀ ▀▄▄▄▄▀ ▀▄▄▄▄▀▄▄▀▄▄▄▀ ▀▄▄▀ ▀▄▄▄▄▀▄▄▓ ▒
24+
▓ ▓
25+
█▓▒░ ░▒▓█

0 commit comments

Comments
 (0)