Skip to content

Commit

Permalink
Add makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
Villaquiranm committed Oct 7, 2024
1 parent bbf81ac commit 0cbe6ef
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 98 deletions.
1 change: 1 addition & 0 deletions gno_github_agent/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.env
8 changes: 4 additions & 4 deletions gno_github_agent/.env
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
GNO_MNEMONIC=scissors razor beauty delay derive chronic toss burger gravity shallow couch slogan change tray connect frame token slight zone usage sad monkey pyramid change
GNO_CHAIN_ID=dev
GNO_RPC_ADDR=http://127.0.0.1:26657
GNO_MNEMONIC=source bonus chronic canvas draft south burst lottery vacant surface solve popular case indicate oppose farm nothing bullet exhibit title speed wink action roast
GNO_CHAIN_ID=test4
GNO_RPC_ADDR=https://rpc.test4.gno.land:443
GNO_REALM_PATH=gno.land/r/teritori/ghverify
GNO_TX_INDEXER=http://localhost:8546/graphql/query
GNO_TX_INDEXER=https://indexer.test4.gno.testnet.teritori.com
14 changes: 14 additions & 0 deletions gno_github_agent/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Start from the latest golang base image
FROM golang:1.23-bullseye

# Set the Current Working Directory inside the container
WORKDIR /app

# Copy everything from the current directory to the Working Directory inside the container
COPY . .

ENV CGO_ENABLED=1
RUN --mount=type=cache,target=/root/.cache/go-build --mount=type=cache,target=/go go build -o bin/main main.go

CMD [ "/app/bin/main" ]

100 changes: 6 additions & 94 deletions gno_github_agent/Makefile
Original file line number Diff line number Diff line change
@@ -1,95 +1,7 @@
KEY = MyKey
BASE = teritori
REMOTE = http://127.0.0.1:26657
CHAIN_ID = dev
DOCKER_REGISTRY=rg.nl-ams.scw.cloud/teritori
AGENT_DOCKER_IMAGE=$(DOCKER_REGISTRY)/gno-gh-verify-agent:$(shell git rev-parse --short HEAD)

.PHONY: add_social_feeds_realm add_utf16_pkg add_ujson_pkg add_flags_index_pkg add_dao_interfaces_pkg add_social_feed all

add_gh_verify_realm:
gnokey maketx addpkg \
-deposit="1ugnot" \
-gas-fee="1ugnot" \
-gas-wanted="50000000" \
-broadcast="true" \
-chainid="${CHAIN_ID}" \
-remote="${REMOTE}" \
-pkgdir="./r/gnoland/ghverify" \
-pkgpath="gno.land/r/${BASE}/ghverify" \
${KEY}

request_verification:
gnokey maketx call \
-pkgpath "gno.land/r/${BASE}/ghverify" \
-func="RequestVerification" \
-gas-fee="1000000ugnot" \
-gas-wanted="3000000" \
-remote="${REMOTE}" \
-chainid="${CHAIN_ID}" \
-broadcast \
-args "villaquiranm" \
MyKey

check_current_feeds:
gnokey query vm/qeval --data 'gno.land/r/${BASE}/ghverify.GnorkleEntrypoint("request")'
-remote="${REMOTE}" \
${KEY}

set_owner:
gnokey maketx call \
-pkgpath "gno.land/r/${BASE}/ghverify" \
-func="SetOwner" \
-gas-fee="1000000ugnot" \
-gas-wanted="3000000" \
-remote="${REMOTE}" \
-chainid="${CHAIN_ID}" \
-broadcast \
-args "g1yr5sts6w9k2arsuk858lh6phegcfvg0y4d0pgf" \
${KEY}

verify:
gnokey maketx call \
-pkgpath "gno.land/r/${BASE}/ghverify" \
-func="GnorkleEntrypoint" \
-gas-fee="1000000ugnot" \
-gas-wanted="3000000" \
-remote="${REMOTE}" \
-chainid="${CHAIN_ID}" \
-broadcast \
-args "ingest,g1pwxuhltfqxcumjmuquuue6y3f2g3f2d0rcq52x,OK" \
${KEY}
relay_verify:
gnokey maketx call \
-pkgpath "gno.land/r/${BASE}/ghverify" \
-func="GnorkleEntrypoint" \
-gas-fee="1000000ugnot" \
-gas-wanted="3000000" \
-remote="${REMOTE}" \
-chainid="${CHAIN_ID}" \
-broadcast \
-args "relay,gpub1pgfj7ard9eg82cjtv4u4xetrwqer2dntxyfzxz3pqgfakcapzvuux7vug9vagyjmvj6k2w2xu723qnue69z9r7wlt9c6zeyxvt8,dd4b4012daddb14fe7587f4bbb5bef5f16d123032e5c6dc718528907c8f71ee267c1a051328d42991fe6f82cdba424efd3866251cf9411c8f38ebb1e144f10ce,ingest,g14vxq5e5pt5sev7rkz2ej438scmxtylnzv5vnkw,OK" \
newkey

check:
gnokey maketx call \
-pkgpath "gno.land/r/${BASE}/ghverify" \
-func="GnorkleEntrypoint" \
-gas-fee="1000000ugnot" \
-gas-wanted="3000000" \
-remote="${REMOTE}" \
-chainid="${CHAIN_ID}" \
-broadcast \
-args "request" \
${KEY}

send:
gnokey maketx send \
-gas-fee="1000000ugnot" \
-gas-wanted="3000000" \
-remote="${REMOTE}" \
-chainid="${CHAIN_ID}" \
-send="100000ugnot" \
-to "g1yr5sts6w9k2arsuk858lh6phegcfvg0y4d0pgf" \
-broadcast \
${KEY}


.PHONY: publish
publish:
docker build . --platform linux/amd64 -t $(AGENT_DOCKER_IMAGE)
docker push $(AGENT_DOCKER_IMAGE)

0 comments on commit 0cbe6ef

Please sign in to comment.