diff --git a/gno_github_agent/.dockerignore b/gno_github_agent/.dockerignore new file mode 100644 index 000000000..7b21a66fd --- /dev/null +++ b/gno_github_agent/.dockerignore @@ -0,0 +1,2 @@ +.env +github.db \ No newline at end of file diff --git a/gno_github_agent/.env b/gno_github_agent/.env index 4d48a6b1c..d0abb68d7 100644 --- a/gno_github_agent/.env +++ b/gno_github_agent/.env @@ -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 \ No newline at end of file +GNO_TX_INDEXER=https://indexer.test4.gno.testnet.teritori.com \ No newline at end of file diff --git a/gno_github_agent/Dockerfile b/gno_github_agent/Dockerfile new file mode 100644 index 000000000..9f497dd44 --- /dev/null +++ b/gno_github_agent/Dockerfile @@ -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" ] + diff --git a/gno_github_agent/Makefile b/gno_github_agent/Makefile index eef75603a..4dfbaf37e 100644 --- a/gno_github_agent/Makefile +++ b/gno_github_agent/Makefile @@ -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} - - \ No newline at end of file +.PHONY: publish +publish: + docker build . --platform linux/amd64 -t $(AGENT_DOCKER_IMAGE) + docker push $(AGENT_DOCKER_IMAGE) diff --git a/gno_github_agent/main.go b/gno_github_agent/main.go index f97c598b9..1ebc9a7fd 100644 --- a/gno_github_agent/main.go +++ b/gno_github_agent/main.go @@ -1,7 +1,6 @@ package main import ( - "log" "os" "time" @@ -9,7 +8,6 @@ import ( "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" ) @@ -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)