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 472bf06
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 105 deletions.
2 changes: 2 additions & 0 deletions gno_github_agent/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.env
github.db
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)
7 changes: 0 additions & 7 deletions gno_github_agent/main.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
package main

import (
"log"
"os"
"time"

"github.com/TERITORI/gh-verify-agent/clientql"
"github.com/TERITORI/gh-verify-agent/db"
"github.com/TERITORI/gh-verify-agent/signer"
"github.com/go-co-op/gocron"
"github.com/joho/godotenv"
"go.uber.org/zap"
)

Expand All @@ -21,11 +19,6 @@ func main() {
panic(err)
}

err = godotenv.Load()
if err != nil {
log.Fatal("Error loading .env file")
}

db, err := db.New()
if err != nil {
panic(err)
Expand Down

0 comments on commit 472bf06

Please sign in to comment.