Skip to content

Commit 5a976ef

Browse files
fix: move gnofaucet to contribs (gnolang#1955)
## Description This PR moves the `gnofaucet` codebase from `gno.land/cmd/gnofaucet` to `./contribs/gnofaucet`, as this is causing API shenanigans when any `gno` API used by the `gnolang/faucet` library is changed. Thank you @gfanton for resolving the Docker funny business 🙏 <details><summary>Contributors' checklist...</summary> - [x] Added new tests, or not needed, or not feasible - [x] Provided an example (e.g. screenshot) to aid review or the PR is self-explanatory - [x] Updated the official documentation or not needed - [x] No breaking changes were made, or a `BREAKING CHANGE: xxx` message was included in the description - [ ] Added references to related issues and PRs - [ ] Provided any useful hints for running manual tests - [ ] Added new benchmarks to [generated graphs](https://gnoland.github.io/benchmarks), if any. More info [here](https://github.com/gnolang/gno/blob/master/.benchmarks/README.md). </details> --------- Signed-off-by: gfanton <[email protected]> Co-authored-by: gfanton <[email protected]>
1 parent 67c437f commit 5a976ef

18 files changed

+306
-29
lines changed

.github/workflows/contribs.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,12 @@ jobs:
2020
strategy:
2121
fail-fast: false
2222
matrix:
23-
goversion: # two latest versions
23+
goversion:
2424
- "1.22.x"
2525
program:
2626
- "gnomd"
2727
- "gnodev"
28+
- "gnofaucet"
2829
runs-on: ubuntu-latest
2930
timeout-minutes: 5
3031
steps:

.github/workflows/gnoland.yml

-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ jobs:
4040
- gnoland
4141
- gnokey
4242
- gnoweb
43-
- gnofaucet
4443
runs-on: ubuntu-latest
4544
timeout-minutes: 5
4645
steps:

Dockerfile

+23-13
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,28 @@
1-
# build
2-
FROM golang:1.22 AS build
1+
# build gno
2+
FROM golang:1.22 AS build-gno
33
RUN mkdir -p /opt/gno/src /opt/build
44
WORKDIR /opt/build
5-
ADD go.mod go.sum ./
5+
ADD go.mod go.sum .
66
RUN go mod download
77
ADD . ./
88
RUN go build -o ./build/gnoland ./gno.land/cmd/gnoland
99
RUN go build -o ./build/gnokey ./gno.land/cmd/gnokey
10-
RUN go build -o ./build/gnofaucet ./gno.land/cmd/gnofaucet
1110
RUN go build -o ./build/gnoweb ./gno.land/cmd/gnoweb
1211
RUN go build -o ./build/gno ./gnovm/cmd/gno
1312
RUN ls -la ./build
1413
ADD . /opt/gno/src/
1514
RUN rm -rf /opt/gno/src/.git
1615

16+
# build faucet
17+
FROM golang:1.22 AS build-faucet
18+
RUN mkdir -p /opt/gno/src /opt/build
19+
WORKDIR /opt/build
20+
ADD contribs/gnofaucet/go.mod contribs/gnofaucet/go.sum .
21+
RUN go mod download
22+
ADD contribs/gnofaucet ./
23+
RUN go build -o ./build/gnofaucet .
24+
25+
1726
# runtime-base + runtime-tls
1827
FROM debian:stable-slim AS runtime-base
1928
ENV PATH="${PATH}:/opt/gno/bin" \
@@ -25,32 +34,33 @@ RUN apt-get update && apt-get install -y expect ca-certificates && updat
2534
# slim images
2635
FROM runtime-base AS gnoland-slim
2736
WORKDIR /opt/gno/src/gno.land/
28-
COPY --from=build /opt/build/build/gnoland /opt/gno/bin/
37+
COPY --from=build-gno /opt/build/build/gnoland /opt/gno/bin/
2938
ENTRYPOINT ["gnoland"]
3039
EXPOSE 26657 36657
3140

3241
FROM runtime-base AS gnokey-slim
33-
COPY --from=build /opt/build/build/gnokey /opt/gno/bin/
42+
COPY --from=build-gno /opt/build/build/gnokey /opt/gno/bin/
3443
ENTRYPOINT ["gnokey"]
3544

3645
FROM runtime-base AS gno-slim
37-
COPY --from=build /opt/build/build/gno /opt/gno/bin/
46+
COPY --from=build-gno /opt/build/build/gno /opt/gno/bin/
3847
ENTRYPOINT ["gno"]
3948

4049
FROM runtime-tls AS gnofaucet-slim
41-
COPY --from=build /opt/build/build/gnofaucet /opt/gno/bin/
50+
COPY --from=build-faucet /opt/build/build/gnofaucet /opt/gno/bin/
4251
ENTRYPOINT ["gnofaucet"]
4352
EXPOSE 5050
4453

4554
FROM runtime-tls AS gnoweb-slim
46-
COPY --from=build /opt/build/build/gnoweb /opt/gno/bin/
47-
COPY --from=build /opt/gno/src/gno.land/cmd/gnoweb /opt/gno/src/gnoweb
55+
COPY --from=build-gno /opt/build/build/gnoweb /opt/gno/bin/
56+
COPY --from=build-gno /opt/gno/src/gno.land/cmd/gnoweb /opt/gno/src/gnoweb
4857
ENTRYPOINT ["gnoweb"]
4958
EXPOSE 8888
5059

5160
# all, contains everything.
5261
FROM runtime-tls AS all
53-
COPY --from=build /opt/build/build/* /opt/gno/bin/
54-
COPY --from=build /opt/gno/src /opt/gno/src
62+
COPY --from=build-gno /opt/build/build/* /opt/gno/bin/
63+
COPY --from=build-faucet /opt/build/build/* /opt/gno/bin/
64+
COPY --from=build-gno /opt/gno/src /opt/gno/src
5565
# gofmt is required by `gnokey maketx addpkg`
56-
COPY --from=build /usr/local/go/bin/gofmt /usr/bin
66+
COPY --from=build-gno /usr/local/go/bin/gofmt /usr/bin

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ repository offers more resources to dig into. We are eager to see your first PR!
8585
* [gno](./gnovm/cmd/gno) - handy tool for developing gno packages & realms
8686
* [goscan](./misc/goscan) - dumps imports from specified file’s AST
8787
* [genproto](./misc/genproto) - helper for generating .proto implementations
88-
* [gnofaucet](./gno.land/cmd/gnofaucet) - serves GNOT faucet
88+
* [gnofaucet](./contribs/gnofaucet) - serves GNOT faucet
8989
</details>
9090

9191
<details><summary>CI/CD/Tools badges and links</summary>

contribs/Makefile

+2-1
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,11 @@ GOTEST_FLAGS ?= -v -p 1 -timeout=30m
2525
########################################
2626
# Dev tools
2727
.PHONY: install
28-
install: install.gnomd install.gnodev
28+
install: install.gnomd install.gnodev install.gnofaucet
2929

3030
install.gnomd:; cd gnomd && go install .
3131
install.gnodev:; $(MAKE) -C ./gnodev install
32+
install.gnofaucet:; $(MAKE) -C ./gnofaucet install
3233

3334
.PHONY: clean
3435
clean:

contribs/gnofaucet/Makefile

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.PHONY: install
2+
install:
3+
go install .
4+
5+
.PHONY: build
6+
build:
7+
go build -o build/gnofaucet .

contribs/gnofaucet/go.mod

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
module github.com/gnolang/gno/contribs/gnofaucet
2+
3+
go 1.21
4+
5+
require (
6+
github.com/gnolang/faucet v0.2.0
7+
github.com/gnolang/gno v0.0.0-20240418134550-6f54d2b3d06c
8+
github.com/stretchr/testify v1.9.0
9+
go.uber.org/zap v1.27.0
10+
golang.org/x/time v0.5.0
11+
)
12+
13+
require (
14+
github.com/btcsuite/btcd/btcec/v2 v2.3.3 // indirect
15+
github.com/btcsuite/btcd/btcutil v1.1.5 // indirect
16+
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
17+
github.com/davecgh/go-spew v1.1.1 // indirect
18+
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect
19+
github.com/gnolang/overflow v0.0.0-20170615021017-4d914c927216 // indirect
20+
github.com/go-chi/chi/v5 v5.0.12 // indirect
21+
github.com/go-logr/logr v1.4.1 // indirect
22+
github.com/go-logr/stdr v1.2.2 // indirect
23+
github.com/gorilla/websocket v1.5.1 // indirect
24+
github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0 // indirect
25+
github.com/jaekwon/testify v1.6.1 // indirect
26+
github.com/libp2p/go-buffer-pool v0.1.0 // indirect
27+
github.com/peterbourgon/ff/v3 v3.4.0 // indirect
28+
github.com/pmezard/go-difflib v1.0.0 // indirect
29+
github.com/rs/cors v1.10.1 // indirect
30+
go.opentelemetry.io/otel v1.25.0 // indirect
31+
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.25.0 // indirect
32+
go.opentelemetry.io/otel/metric v1.25.0 // indirect
33+
go.opentelemetry.io/otel/sdk v1.25.0 // indirect
34+
go.opentelemetry.io/otel/sdk/metric v1.25.0 // indirect
35+
go.opentelemetry.io/otel/trace v1.25.0 // indirect
36+
go.opentelemetry.io/proto/otlp v1.1.0 // indirect
37+
go.uber.org/multierr v1.11.0 // indirect
38+
go.uber.org/zap/exp v0.2.0 // indirect
39+
golang.org/x/crypto v0.21.0 // indirect
40+
golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect
41+
golang.org/x/mod v0.16.0 // indirect
42+
golang.org/x/net v0.23.0 // indirect
43+
golang.org/x/sync v0.7.0 // indirect
44+
golang.org/x/sys v0.18.0 // indirect
45+
golang.org/x/term v0.18.0 // indirect
46+
golang.org/x/text v0.14.0 // indirect
47+
google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de // indirect
48+
google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect
49+
google.golang.org/grpc v1.63.0 // indirect
50+
google.golang.org/protobuf v1.33.0 // indirect
51+
gopkg.in/yaml.v3 v3.0.1 // indirect
52+
)

0 commit comments

Comments
 (0)