diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..9fcf3305 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,3 @@ +.tmp +.git +*.gen.go diff --git a/.github/workflows/deploy-realm.yml b/.github/workflows/deploy-realm.yml deleted file mode 100644 index 1eb662ca..00000000 --- a/.github/workflows/deploy-realm.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: realm - -on: - push: - paths: - - "realm/**" - branches: - - main - -env: - GNOKEY: "go run github.com/gnolang/gno/gno.land/cmd/gnokey" - GNOCHESS_REALM: gno.land/r/demo/chess_${GITHUB_SHA} - 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" - -jobs: - deploy-realm: - runs-on: ubuntu-latest - timeout-minutes: 10 - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-go@v4 - with: - go-version: "stable" - - run: go mod download -x - - run: | - printf '\n\n%s\n\n' "$MNEMONIC" | $GNOKEY add --recover --insecure-password-stdin test1' - cd realm - echo "" | $GNOKEY maketx addpkg \ - --gas-wanted 50000000 \ - --gas-fee 1ugnot \ - --pkgpath $GNOCHESS_REALM \ - --pkgdir . \ - --insecure-password-stdin \ - --remote \ - --broadcast test1' diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 382e97ce..190ba59f 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -19,4 +19,4 @@ jobs: - uses: actions/setup-go@v4 with: go-version: 'stable' - - run: go test -v -run='TestIntegration/.*' . + - run: make test.integration diff --git a/.github/workflows/rules.yml b/.github/workflows/perft.yml similarity index 69% rename from .github/workflows/rules.yml rename to .github/workflows/perft.yml index ab4b62a1..f1def1e5 100644 --- a/.github/workflows/rules.yml +++ b/.github/workflows/perft.yml @@ -1,9 +1,11 @@ -name: rules +name: perft on: pull_request: paths: - - "realm/rules.gno" + - "package/**" + - "Makefile" + - "go.sum" push: branches: - master @@ -19,4 +21,4 @@ jobs: with: go-version: 'stable' - run: go mod download -x - - run: go run github.com/gnolang/gno/gnovm/cmd/gno test -verbose -run 'TestPerft' ./realm + - run: make test.perft diff --git a/.github/workflows/realm.yml b/.github/workflows/test.yml similarity index 75% rename from .github/workflows/realm.yml rename to .github/workflows/test.yml index 498e717e..fa6a548b 100644 --- a/.github/workflows/realm.yml +++ b/.github/workflows/test.yml @@ -1,9 +1,10 @@ -name: realm +name: test on: pull_request: paths: - "realm/**" + - "package/**" - "Makefile" - "go.sum" push: @@ -21,4 +22,4 @@ jobs: with: go-version: 'stable' - run: go mod download -x - - run: go run github.com/gnolang/gno/gnovm/cmd/gno test -verbose -run 'Test([^P]|P[^e])' ./realm + - run: make test diff --git a/.gitignore b/.gitignore index 80ab2c26..6f4b5a61 100644 --- a/.gitignore +++ b/.gitignore @@ -120,7 +120,11 @@ web/public/**/*.xml realm/*.go +*.gen.go +.*.gen.go +*.gen_test.go *.vim +/.test .tmp/ # Local Netlify folder diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..a370dd54 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,5 @@ +FROM ghcr.io/gnolang/gno:latest + +COPY ./util/node-config.toml ./gno.land/testdir/config/config.toml +COPY ./package ./examples/gno.land/p/demo/chess +COPY ./realm ./examples/gno.land/r/demo/chess diff --git a/Makefile b/Makefile index 73fbdac7..29043f72 100644 --- a/Makefile +++ b/Makefile @@ -1,112 +1,116 @@ +.PHONY: default default: help GNOKEY ?= go run github.com/gnolang/gno/gno.land/cmd/gnokey GNOLAND ?= go run github.com/gnolang/gno/gno.land/cmd/gnoland +GNOCMD ?= go run github.com/gnolang/gno/gnovm/cmd/gno +GNODEV ?= go run github.com/gnolang/gno/contribs/gnodev +GNOROOT ?= `$(GNOCMD) env GNOROOT` +GNO_TEST_FLAGS ?= -verbose +GNO_TEST_PKGS ?= gno.land/p/demo/chess/... gno.land/r/demo/chess + +MNEMONIC_TEST1 ?= source bonus chronic canvas draft south burst lottery vacant surface solve popular case indicate oppose farm nothing bullet exhibit title speed wink action roast + +.PHONY: help help: ## Display this help message. - @awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m\033[0m\n"} /^[0-9a-zA-Z_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 }' $(MAKEFILE_LIST) - -0_setup_gnokey: ## Add an account that will be used for Realm deployment (to gnokey). - printf '\n\n%s\n\n' "source bonus chronic canvas draft south burst lottery vacant surface solve popular case indicate oppose farm nothing bullet exhibit title speed wink action roast" | $(GNOKEY) add --recover --insecure-password-stdin DeployKey || true - $(GNOKEY) list | grep DeployKey - -1_run_gnoland: ## Run the gnoland node. - go mod download -x - rm -rf .tmp/gnoland - mkdir -p .tmp/gnoland - cp -rf `go list -m -mod=mod -f '{{.Dir}}' github.com/gnolang/gno`/gno.land .tmp/gnoland/gno.land - cp -rf `go list -m -mod=mod -f '{{.Dir}}' github.com/gnolang/gno`/examples .tmp/gnoland/examples - chmod -R u+w .tmp/gnoland - ( \ - echo g1plqds6kxnfaqcpky0gtt6fpntfhjgcfx8r73a0=100000000000000000ugnot; \ - echo g1sgy2zhqg2wecuz3qt8th63d539afagjnhs4zj3=100000000000000000ugnot; \ - echo g1unk9a8yt595p4yxpfpejewvf9lx6yrvd2ylgtm=100000000000000000ugnot; \ - echo g17x4qwuhmc6fyp6ut2qtscc9265xe5jnj83s8c6=100000000000000000ugnot; \ - echo g1agq8t3289xxmm63z55axykmmve2pz87yqgyn5n=100000000000000000ugnot; \ - echo g153xesqpfvr5y35l0aykew3796kz452zttp0xt2=100000000000000000ugnot; \ - echo g18epncd7avkhmdlf930e4t2p7c7j9qdv3yda93f=100000000000000000ugnot; \ - echo g1elguymy8sjjy246u09qddtx587934k6uzf8mc4=100000000000000000ugnot; \ - echo g1sl70rzvu49mp0lstxaptmvle8h2a8rx8pu56uk=100000000000000000ugnot; \ - echo g18dgugclk93v65qtxxus82eg30af59fgk246nqy=100000000000000000ugnot; \ - ) >> .tmp/gnoland/gno.land/genesis/genesis_balances.txt - ln -s `go list -m -mod=mod -f '{{.Dir}}' github.com/gnolang/gno`/gnovm .tmp/gnoland/gnovm - #mkdir -p .tmp/gnoland/gno.land/testdir/config - #cp ./util/devnet/config.toml .tmp/gnoland/gno.land/testdir/config/config.toml - cd .tmp/gnoland/gno.land; $(GNOLAND) start \ - -genesis-max-vm-cycles 100000000 - -2_run_faucet: ## Run the GnoChess faucet. + @awk 'BEGIN {FS = ":.*##"; printf "Usage: make [\033[36m\033[0m...]\n"} /^[[0-9a-zA-Z_\.-]+:.*?##/ { printf " \033[36m%-20s\033[0m %s\n", $$1, $$2 }' $(MAKEFILE_LIST) + +.PHONY: clean +clean: ## Remove temporary files. + find . -name '*.gen.go' -exec rm -rf {} + + rm -rf .test + +.PHONY: test.prepare +test.prepare: + rm -rf .test + # Create fake GNOROOT with stdlibs, testing stdlibs, and p/ dependencies. + # This is currently necessary as gno.mod's `replace` functionality is not linked with the VM. + mkdir -p .test/gnovm/tests .test/examples/gno.land/p/demo .test/examples/gno.land/r/demo + cp -r "$(GNOROOT)/gnovm/stdlibs" .test/gnovm/stdlibs + cp -r "$(GNOROOT)/gnovm/tests/stdlibs" .test/gnovm/tests/stdlibs + for i in gno.land/p/demo/ufmt gno.land/p/demo/avl gno.land/r/demo/users; do \ + cp -r "$(GNOROOT)/examples/$$i" ".test/examples/$$i";\ + done + # Copy over gnochess code. + cp -r "$(PWD)/package" ".test/examples/gno.land/p/demo/chess" + cp -r "$(PWD)/realm" ".test/examples/gno.land/r/demo/chess" + +.PHONY: test +test: test.prepare ## Test packages and realms using gno, excluding perft tests. + cd .test/examples; GNOROOT="$(PWD)/.test" $(GNOCMD) test -run '^Test(?:[^P]|P[^e]|Pe[^r])' $(GNO_TEST_FLAGS) $(GNO_TEST_PKGS) + +.PHONY: test.perft +test.perft: test.prepare ## Run perft tests. + cd .test/examples; GNOROOT="$(PWD)/.test" $(GNOCMD) test -run 'TestPerft' $(GNO_TEST_FLAGS) gno.land/p/demo/chess + +.PHONY: test.integration +test.integration: ## Test the realm using integration tests. + go test -v ./util/integration + +.PHONY: test.all +test.all: test test.perft test.integration ## Run all tests + +.PHONY: run.faucet +run.faucet: ## Run the GnoChess faucet. cd faucet; go run main.go \ -fund-limit 250000000ugnot \ - -send-amount 1000000000ugnot \ - -tokens juhb8a7p1D -tokens 6wrBVqzBgQ -tokens Ko3z72NaQm -tokens 6j7v0lDR39 -tokens xqh4stG702 \ - -tokens lWGjlfP5rs -tokens UG8f8igNO6 -tokens b3JUurpCFb -tokens 4azfjy6hE9 -tokens dzNR5KAz2r \ - -tokens lZOO7O5OeE -tokens epxa67WQ2c -tokens GnfMj2sDCO -tokens kDN7hiiSWE -tokens OtLfdJC279 \ - -tokens GNZi9TlXBu -tokens 6sVZv0ww7v -tokens SdmrRLKXcx -tokens 8GfDC6ODwr -tokens 783xSVRGbI \ - -tokens Ahphohei4b -tokens uPulohsh4f -tokens aigeVah1El -tokens wuchi4feeP -tokens Ae9weim0OK \ - -tokens ieb2Leik7e -tokens pohJ9oozoo -tokens xoKaesh3ae -tokens di6eeYooco -tokens bahti5ek0L \ - -tokens Uu5quoh6Oo -tokens Phaix9Ahcu -tokens maiGh8ziew -tokens ohPhoo9aev -tokens aeveV5ohgh \ - -tokens ceJ1reexoa -tokens rash0Ku5ha -tokens shaequoh7P -tokens NiLiesah3u -tokens Pion1Phie9 \ - -tokens ahkiev9Foo -tokens uaXiJ7eine -tokens thoTej9yo9 -tokens eiTee2Eizu -tokens ier6oaQu5p \ - -tokens fahoSoa5ee -tokens boet9fo2Ek -tokens ugh9Iedai7 -tokens no7ohsaiXo -tokens ahViquie5Z \ - -tokens Iquae8oozo -tokens Esh5on7eiT -tokens Moop1eekoo -tokens gae6uo5Sae -tokens fei9aufeeX \ - -tokens chee6aC9ph -tokens zongo0Coe3 -tokens Leing1pi0a -tokens ekai5Aih8N -tokens Kasu3es5ch \ - -tokens eeChe1OhKu -tokens Al9Oojoo3I -tokens Xohwate0AT -tokens eef1ieJu1m -tokens eeGh4rohfi \ - -tokens cah3Shohye -tokens eiZ7eish3t -tokens aiF9LieTie -tokens she6eeceeP -tokens teev5Moh6t \ - -tokens Zae2ailitu -tokens seech3Eice -tokens iju8Aegeeh -tokens quooth6iZa -tokens Fae3ohng1o \ - -tokens Caibal9ahx -tokens iaPhoow2ha -tokens Iethee8Wu0 -tokens ahsahgh3Do -tokens Aithai7ahz \ - -tokens wocie7pe8O -tokens PhaelahN0B -tokens boon4Yohth -tokens ohke9Pha0o -tokens UYieShez6a \ - -tokens aR8zaeWee0 -tokens ka0aeVai6z -tokens Oi6oThaez1 -tokens oodee5INga -tokens Aet6WeePu8 \ - -tokens Fieroo3Xai -tokens Is4neath2N -tokens EeliegeiT8 -tokens Ahg9aishi8 -tokens aj4mah9Daa \ - -tokens Sheish0foo -tokens ooseethoM8 -tokens Xaiphai8no -tokens ni9eeLei9f -tokens ieveiwai3E \ - -tokens mooQuag4ee -tokens ZaeRieph2j -tokens AeY8iPioh4 -tokens Huar8iemee -tokens shoo5Loh8z \ - -tokens ohz8Reetev -tokens Eotahh4aja -tokens Xae9ciew9B -tokens aeVe1Oethe -tokens eihah2Ahw7 \ - -tokens Chai8laile -tokens ku9iax9Cho -tokens Ahl4veihud -tokens FaShutaj2v -tokens nahS6iu0Yi \ - -tokens Ohzaj5wi2m -tokens EeL0Agee0e -tokens eePhie7tho -tokens Eisai2ew6E -tokens woiyoo6Xee \ - -mnemonic "piano aim fashion palace key scrap write garage avocado royal lounge lumber remove frozen sketch maze tree model half team cook burden pattern choice" \ - -num-accounts 10 - -3_run_web: ## Run the web server. + -send-amount 1000000000ugnot \ + -chain-id tendermint_test \ + -remote http://127.0.0.1:36657 \ + -tokens juhb8a7p1D -tokens 6wrBVqzBgQ -tokens Ko3z72NaQm -tokens 6j7v0lDR39 -tokens xqh4stG702 \ + -tokens lWGjlfP5rs -tokens UG8f8igNO6 -tokens b3JUurpCFb -tokens 4azfjy6hE9 -tokens dzNR5KAz2r \ + -tokens lZOO7O5OeE -tokens epxa67WQ2c -tokens GnfMj2sDCO -tokens kDN7hiiSWE -tokens OtLfdJC279 \ + -tokens GNZi9TlXBu -tokens 6sVZv0ww7v -tokens SdmrRLKXcx -tokens 8GfDC6ODwr -tokens 783xSVRGbI \ + -tokens Ahphohei4b -tokens uPulohsh4f -tokens aigeVah1El -tokens wuchi4feeP -tokens Ae9weim0OK \ + -tokens ieb2Leik7e -tokens pohJ9oozoo -tokens xoKaesh3ae -tokens di6eeYooco -tokens bahti5ek0L \ + -tokens Uu5quoh6Oo -tokens Phaix9Ahcu -tokens maiGh8ziew -tokens ohPhoo9aev -tokens aeveV5ohgh \ + -tokens ceJ1reexoa -tokens rash0Ku5ha -tokens shaequoh7P -tokens NiLiesah3u -tokens Pion1Phie9 \ + -tokens ahkiev9Foo -tokens uaXiJ7eine -tokens thoTej9yo9 -tokens eiTee2Eizu -tokens ier6oaQu5p \ + -tokens fahoSoa5ee -tokens boet9fo2Ek -tokens ugh9Iedai7 -tokens no7ohsaiXo -tokens ahViquie5Z \ + -tokens Iquae8oozo -tokens Esh5on7eiT -tokens Moop1eekoo -tokens gae6uo5Sae -tokens fei9aufeeX \ + -tokens chee6aC9ph -tokens zongo0Coe3 -tokens Leing1pi0a -tokens ekai5Aih8N -tokens Kasu3es5ch \ + -tokens eeChe1OhKu -tokens Al9Oojoo3I -tokens Xohwate0AT -tokens eef1ieJu1m -tokens eeGh4rohfi \ + -tokens cah3Shohye -tokens eiZ7eish3t -tokens aiF9LieTie -tokens she6eeceeP -tokens teev5Moh6t \ + -tokens Zae2ailitu -tokens seech3Eice -tokens iju8Aegeeh -tokens quooth6iZa -tokens Fae3ohng1o \ + -tokens Caibal9ahx -tokens iaPhoow2ha -tokens Iethee8Wu0 -tokens ahsahgh3Do -tokens Aithai7ahz \ + -tokens wocie7pe8O -tokens PhaelahN0B -tokens boon4Yohth -tokens ohke9Pha0o -tokens UYieShez6a \ + -tokens aR8zaeWee0 -tokens ka0aeVai6z -tokens Oi6oThaez1 -tokens oodee5INga -tokens Aet6WeePu8 \ + -tokens Fieroo3Xai -tokens Is4neath2N -tokens EeliegeiT8 -tokens Ahg9aishi8 -tokens aj4mah9Daa \ + -tokens Sheish0foo -tokens ooseethoM8 -tokens Xaiphai8no -tokens ni9eeLei9f -tokens ieveiwai3E \ + -tokens mooQuag4ee -tokens ZaeRieph2j -tokens AeY8iPioh4 -tokens Huar8iemee -tokens shoo5Loh8z \ + -tokens ohz8Reetev -tokens Eotahh4aja -tokens Xae9ciew9B -tokens aeVe1Oethe -tokens eihah2Ahw7 \ + -tokens Chai8laile -tokens ku9iax9Cho -tokens Ahl4veihud -tokens FaShutaj2v -tokens nahS6iu0Yi \ + -tokens Ohzaj5wi2m -tokens EeL0Agee0e -tokens eePhie7tho -tokens Eisai2ew6E -tokens woiyoo6Xee \ + -mnemonic "$(MNEMONIC_TEST1)" \ + -num-accounts 1 + +.PHONY: run.web +run.web: ## Run the web server. cd web; npm install ( \ - echo "VITE_GNO_WS_URL=ws://127.0.0.1:26657/websocket"; \ + echo "VITE_GNO_WS_URL=ws://127.0.0.1:36657/websocket"; \ echo "VITE_GNO_CHESS_REALM=gno.land/r/demo/chess"; \ echo "VITE_FAUCET_URL=http://127.0.0.1:8545"; \ - echo "VITE_GNO_JSONRPC_URL=http://127.0.0.1:26657"; \ + echo "VITE_GNO_JSONRPC_URL=http://127.0.0.1:36657"; \ ) > web/.env cp web/.env web/assets/js/.env cd web; npm run build cd web; npm run dev -4_deploy_realm: ## Deploy GnoChess realm on local node. - echo | $(GNOKEY) maketx addpkg \ - --insecure-password-stdin \ - --gas-wanted 20000000 \ - --gas-fee 1ugnot \ - --pkgpath gno.land/r/demo/chess \ - --pkgdir ./realm \ - --broadcast \ - DeployKey - -z_use_local_gno: ## Use the local '../gno' directory instead of the remote 'github.com/gnolang/gno' module. - @echo "Switching to local gno module..." - @go mod edit -replace github.com/gnolang/gno=../gno - -z_use_remote_gno: ## Use the remote 'github.com/gnolang/gno' module and remove any replacements. - @echo "Switching to remote gno module..." - @go mod edit -dropreplace github.com/gnolang/gno - -z_test_realm: ## Test the realm. - go run github.com/gnolang/gno/gnovm/cmd/gno test --verbose ./realm +.PHONY: run.gnodev +run.gnodev: ## Run gnodev with the gnochess packages and realm. + $(GNODEV) ./package/glicko2 ./package/zobrist ./package ./realm -z_test_integration: ## Test the realm. - go test -v -run='TestIntegration/.*' . +z_add_test1: ## Add the test1 key to gnokey. + printf '\n\n%s\n\n' "$(MNEMONIC_TEST1)" | $(GNOKEY) add --recover --insecure-password-stdin test1 || true + $(GNOKEY) list | grep test1 z_build_realm: ## Precompile and build the generated Go files. Assumes a working clone of gno in ../gno. mkdir -p ../gno/examples/gno.land/r/gnochess cp -rf realm/*.gno ../gno/examples/gno.land/r/gnochess - go run github.com/gnolang/gno/gnovm/cmd/gno precompile --verbose ../gno/examples/gno.land - go run github.com/gnolang/gno/gnovm/cmd/gno build --verbose ../gno/examples/gno.land/r/gnochess + $(GNOCMD) precompile --verbose ../gno/examples/gno.land + $(GNOCMD) build --verbose ../gno/examples/gno.land/r/gnochess z_poormans_dashboard: @( \ diff --git a/README.md b/README.md index bc041858..13bc52de 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,39 @@ This repository hosts both the source code for the [GnoChess realm and website](https://gnochess.com), as well as a dedicted tutorial section, originally planned to accompany a talk for Gophercon 2023. +## Getting Started + +Running GnoChess has a few requirements: + +- Go 1.21+ +- Node 16+ +- make +- git +- A POSIX environment (ie. have a UNIX shell, so Linux or macOS. + WSL probably works but nobody tested it.) + +After cloning the repository, run `go get` to install the dependencies, then you +can get started by running the following: + +```sh +make run.web & make run.faucet & make run.gnodev +``` + +You can also call the three commands separately to have their individual +outputs; here is an example with tmux: + +![637248](https://github.com/gnolang/gnochess/assets/4681308/03433d02-85e3-40a5-bf3b-ba46efc5c65c) + +With that done, you will be able to access a (hopefully) working local set-up of +GnoChess on . At the time of writing, this still requires +access through a token: you can pick one of the ones available in the +[Makefile](Makefile) at the `run.faucet` section. (Annoying -- it will improve, +we're working on it!) + +There's a rudimentary set up for working with docker also available on our +[docker-compose file](docker-compose.yml), though for the time being the local +set up using make is recommended! + ## Workshop tutorial > A Workshop on Gnochess has been held at Gophercon San Diego on 26/09/2023. diff --git a/docker-compose.yml b/docker-compose.yml index 9761ae2a..95f328f5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,32 +4,39 @@ volumes: gnonode: {} faucet: {} +networks: + gnochess: + enable_ipv6: false + services: gnoland: - image: ghcr.io/gnolang/gno/gnochess:latest + build: . + image: ghcr.io/gnolang/gnochess:latest environment: - LOG_LEVEL=4 - command: ["gnoland", "start", "-genesis-max-vm-cycles", "100000000"] - volumes: - - "gnonode:/opt/gno/src/testdir" - - "./util/devnet/config.toml:/opt/gno/src/gno.land/testdir/config/config.toml" - working_dir: /opt/gno/src/gno.land ports: - - 26657:26657 + - "26657:26657" restart: on-failure + working_dir: /opt/gno/src/gno.land + command: gnoland start + networks: + gnochess: logging: driver: "json-file" options: max-file: "10" max-size: "100m" - deployer: - build: ./util/devnet/deployer + gnoweb: + build: . + image: ghcr.io/gnolang/gnochess:latest + working_dir: /opt/gno/src/gno.land + command: gnoweb -bind 0.0.0.0:8888 -remote gnoland:26657 + ports: + - "8888:8888" restart: on-failure - depends_on: - - gnoland - volumes: - - "./realm:/realm" + networks: + gnochess: logging: driver: "json-file" options: @@ -38,9 +45,12 @@ services: web: build: ./web + image: ghcr.io/gnolang/gnochess/web:latest ports: - - 1313:1313 + - "1313:1313" restart: on-failure + networks: + gnochess: logging: driver: "json-file" options: @@ -56,6 +66,8 @@ services: redis: image: "redis:7.2" + networks: + gnochess: ports: - "6379:6379" @@ -80,6 +92,10 @@ services: volumes: - "faucet:/go" - "./faucet:/app" + ports: + - "5050:5050" + networks: + gnochess: signup-web: image: node @@ -92,9 +108,12 @@ services: environment: VITE_API_BASE_URL: "localhost:8080" VITE_NETLIFY_FUNCTIONS_URL: "http://localhost:9000" + networks: + gnochess: signup-functions: image: williamjackson/netlify-cli + stop_grace_period: 500ms # XXX: improve by making this a dockerfile which has dumb-init depends_on: - redis command: ["functions:serve", "-f", "./functions", "-p", "9000"] @@ -106,3 +125,5 @@ services: environment: NODE_ENV: "development" REDIS_URL: "redis://redis:6379" + networks: + gnochess: diff --git a/faucet/go.mod b/faucet/go.mod index eee30d51..9e74358c 100644 --- a/faucet/go.mod +++ b/faucet/go.mod @@ -3,12 +3,12 @@ module github.com/gnolang/gnochess-faucet go 1.20 require ( - github.com/gnolang/faucet v0.0.0-20230916181707-934303e1b40d + github.com/gnolang/faucet v0.0.0-20240112121623-353b2f2ae616 github.com/gnolang/gno v0.0.0-20230914214026-ef6a55bf9db2 github.com/peterbourgon/ff/v3 v3.4.0 github.com/redis/go-redis/v9 v9.2.0 go.uber.org/zap v1.26.0 - golang.org/x/sync v0.3.0 + golang.org/x/sync v0.6.0 ) require ( @@ -22,7 +22,7 @@ require ( github.com/dustin/go-humanize v1.0.0 // indirect github.com/gnolang/goleveldb v0.0.9 // indirect github.com/gnolang/overflow v0.0.0-20170615021017-4d914c927216 // indirect - github.com/go-chi/chi/v5 v5.0.10 // indirect + github.com/go-chi/chi/v5 v5.0.11 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b // indirect github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6 // indirect @@ -36,7 +36,7 @@ require ( github.com/linxGnu/grocksdb v1.8.4 // indirect github.com/pelletier/go-toml v1.9.5 // indirect github.com/pkg/errors v0.9.1 // indirect - github.com/rs/cors v1.10.0 // indirect + github.com/rs/cors v1.10.1 // indirect github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c // indirect go.etcd.io/bbolt v1.3.7 // indirect go.opencensus.io v0.22.5 // indirect diff --git a/faucet/go.sum b/faucet/go.sum index 641a4e78..f05d7dfa 100644 --- a/faucet/go.sum +++ b/faucet/go.sum @@ -25,6 +25,7 @@ github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XL github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cockroachdb/apd v1.1.0 h1:3LFP3629v+1aKXU5Q37mxmRxX/pIu1nijXydLShEq5I= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= @@ -49,16 +50,16 @@ github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4 h1:7HZCaLC5+BZpm github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/gnolang/faucet v0.0.0-20230916181707-934303e1b40d h1:BNpijDc+VMZrw9DYbtwC94TBKEyMW/Dn3fv/h0gsfPA= -github.com/gnolang/faucet v0.0.0-20230916181707-934303e1b40d/go.mod h1:LEZJ9cCyK7PCb63RB543pTU/lbchePJPmz74MymilO0= +github.com/gnolang/faucet v0.0.0-20240112121623-353b2f2ae616 h1:ktxBGpRZjl70Mw/874im7EJghXJxuA0JUFlBkUHEPkA= +github.com/gnolang/faucet v0.0.0-20240112121623-353b2f2ae616/go.mod h1:FHQwuzmzgUoYKbnmRS8c6dV1exF6ccz5318fMSM4yvM= github.com/gnolang/gno v0.0.0-20230914214026-ef6a55bf9db2 h1:/j3GhCiNnE04Yc+zF+ouY7sZuopGwYx6R9NPipSVVLE= github.com/gnolang/gno v0.0.0-20230914214026-ef6a55bf9db2/go.mod h1:dtwSoPiPCcGxACg4y2iJVWZ/vuU133n4kwF28mx6Krg= github.com/gnolang/goleveldb v0.0.9 h1:Q7rGko9oXMKtQA+Apeeed5a3sjba/mcDhzJGoTVLCKE= github.com/gnolang/goleveldb v0.0.9/go.mod h1:Dz6p9bmpy/FBESTgduiThZt5mToVDipcHGzj/zUOo8E= github.com/gnolang/overflow v0.0.0-20170615021017-4d914c927216 h1:GKvsK3oLWG9B1GL7WP/VqwM6C92j5tIvB844oggL9Lk= github.com/gnolang/overflow v0.0.0-20170615021017-4d914c927216/go.mod h1:xJhtEL7ahjM1WJipt89gel8tHzfIl/LyMY+lCYh38d8= -github.com/go-chi/chi/v5 v5.0.10 h1:rLz5avzKpjqxrYwXNfmjkrYYXOyLJd37pz53UFHC6vk= -github.com/go-chi/chi/v5 v5.0.10/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= +github.com/go-chi/chi/v5 v5.0.11 h1:BnpYbFZ3T3S1WMpD79r7R5ThWX40TaFB7L31Y8xqSwA= +github.com/go-chi/chi/v5 v5.0.11/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= @@ -123,8 +124,8 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/redis/go-redis/v9 v9.2.0 h1:zwMdX0A4eVzse46YN18QhuDiM4uf3JmkOB4VZrdt5uI= github.com/redis/go-redis/v9 v9.2.0/go.mod h1:hdY0cQFCN4fnSYT6TkisLufl/4W5UIXyv0b/CLO2V2M= -github.com/rs/cors v1.10.0 h1:62NOS1h+r8p1mW6FM0FSB0exioXLhd/sh15KpjWBZ+8= -github.com/rs/cors v1.10.0/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= +github.com/rs/cors v1.10.1 h1:L0uuZVXIKlI1SShY2nhFfo44TYvDPQ1w4oFkUJNfhyo= +github.com/rs/cors v1.10.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= @@ -187,8 +188,8 @@ golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= -golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= +golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= +golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -209,6 +210,7 @@ golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3 golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.6.0 h1:BOw41kyTf3PuCW1pVQf8+Cyg8pMlkYB1oo9iJ6D/lKM= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/go.mod b/go.mod index 1f13ae4e..454c4807 100644 --- a/go.mod +++ b/go.mod @@ -1,53 +1,70 @@ module github.com/gnolang/gnochess -go 1.20 +go 1.21 require ( - github.com/gnolang/gno v0.0.0-20230926053156-5c40bc5a7984 + github.com/gnolang/gno v0.0.0-20240208173614-9734695c3b17 + github.com/gnolang/gno/contribs/gnodev v0.0.0-20240208173614-9734695c3b17 github.com/jaekwon/testify v1.6.1 github.com/rogpeppe/go-internal v1.11.0 ) require ( - github.com/btcsuite/btcd v0.22.0-beta.0.20220111032746-97732e52810c // indirect - github.com/btcsuite/btcd/btcutil v1.0.0 // indirect + dario.cat/mergo v1.0.0 // indirect + github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect + github.com/btcsuite/btcd/btcutil v1.1.3 // indirect github.com/cespare/xxhash v1.1.0 // indirect - github.com/cespare/xxhash/v2 v2.1.1 // indirect - github.com/cockroachdb/apd v1.1.0 // indirect + github.com/cespare/xxhash/v2 v2.2.0 // indirect + github.com/cockroachdb/apd/v3 v3.2.1 // indirect + github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/dgraph-io/badger/v3 v3.2103.4 // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect + github.com/dgraph-io/badger/v3 v3.2103.5 // indirect github.com/dgraph-io/ristretto v0.1.1 // indirect github.com/dustin/go-humanize v1.0.0 // indirect + github.com/fsnotify/fsnotify v1.7.0 // indirect github.com/gnolang/goleveldb v0.0.9 // indirect github.com/gnolang/overflow v0.0.0-20170615021017-4d914c927216 // indirect github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b // indirect + github.com/golang/glog v1.1.0 // indirect github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6 // indirect github.com/golang/protobuf v1.5.3 // indirect github.com/golang/snappy v0.0.4 // indirect github.com/google/flatbuffers v1.12.1 // indirect - github.com/gorilla/websocket v1.5.0 // indirect + github.com/gorilla/mux v1.8.1 // indirect + github.com/gorilla/securecookie v1.1.1 // indirect + github.com/gorilla/sessions v1.2.1 // indirect + github.com/gorilla/websocket v1.5.1 // indirect + github.com/gotuna/gotuna v0.6.0 // indirect github.com/jmhodges/levigo v1.0.0 // indirect github.com/klauspost/compress v1.12.3 // indirect github.com/libp2p/go-buffer-pool v0.1.0 // indirect - github.com/linxGnu/grocksdb v1.8.4 // indirect + github.com/linxGnu/grocksdb v1.8.11 // indirect github.com/pelletier/go-toml v1.9.5 // indirect github.com/peterbourgon/ff/v3 v3.4.0 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/rs/cors v1.10.0 // indirect + github.com/rs/cors v1.10.1 // indirect github.com/stretchr/testify v1.8.4 // indirect github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c // indirect - go.etcd.io/bbolt v1.3.7 // indirect + github.com/zondax/hid v0.9.2 // indirect + github.com/zondax/ledger-go v0.14.3 // indirect + go.etcd.io/bbolt v1.3.8 // indirect go.opencensus.io v0.22.5 // indirect - go.uber.org/atomic v1.7.0 // indirect - go.uber.org/multierr v1.9.0 // indirect - golang.org/x/crypto v0.13.0 // indirect - golang.org/x/mod v0.12.0 // indirect - golang.org/x/net v0.15.0 // indirect - golang.org/x/sys v0.12.0 // indirect - golang.org/x/term v0.12.0 // indirect - golang.org/x/tools v0.6.0 // indirect + go.uber.org/atomic v1.10.0 // indirect + go.uber.org/multierr v1.10.0 // indirect + go.uber.org/zap v1.24.0 // indirect + go.uber.org/zap/exp v0.1.0 // indirect + golang.org/x/crypto v0.18.0 // indirect + golang.org/x/exp v0.0.0-20240112132812-db7319d0e0e3 // indirect + golang.org/x/mod v0.14.0 // indirect + golang.org/x/net v0.20.0 // indirect + golang.org/x/sys v0.16.0 // indirect + golang.org/x/term v0.16.0 // indirect + golang.org/x/text v0.14.0 // indirect + golang.org/x/tools v0.17.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20231009173412-8bfb1ae86b6c // indirect + google.golang.org/grpc v1.58.3 // indirect google.golang.org/protobuf v1.31.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index a03fe362..1ee71b27 100644 --- a/go.sum +++ b/go.sum @@ -1,39 +1,65 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= +dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= +github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= +github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ= -github.com/btcsuite/btcd v0.22.0-beta.0.20220111032746-97732e52810c h1:lnAMg3ra/Gw4AkRMxrxYs8nrprWsHowg8H9zaYsJOo4= github.com/btcsuite/btcd v0.22.0-beta.0.20220111032746-97732e52810c/go.mod h1:tjmYdS6MLJ5/s0Fj4DbLgSbDHbEqLJrtnHecBFkdz5M= -github.com/btcsuite/btcd/btcutil v1.0.0 h1:dB36qRTOucIh6NUe40UCieOS+axPhP6VNyRtYkTUKKk= +github.com/btcsuite/btcd v0.23.0 h1:V2/ZgjfDFIygAX3ZapeigkVBoVUtOJKSwrhZdlpSvaA= +github.com/btcsuite/btcd v0.23.0/go.mod h1:0QJIIN1wwIXF/3G/m87gIwGniDMDQqjVn4SZgnFpsYY= +github.com/btcsuite/btcd/btcec/v2 v2.1.0/go.mod h1:2VzYrv4Gm4apmbVVsSq5bqf1Ec8v56E48Vt0Y/umPgA= +github.com/btcsuite/btcd/btcec/v2 v2.1.3/go.mod h1:ctjw4H1kknNJmRN4iP1R7bTQ+v3GJkZBd6mui8ZsAZE= +github.com/btcsuite/btcd/btcec/v2 v2.3.2 h1:5n0X6hX0Zk+6omWcihdYvdAlGf2DfasC0GMf7DClJ3U= +github.com/btcsuite/btcd/btcec/v2 v2.3.2/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= github.com/btcsuite/btcd/btcutil v1.0.0/go.mod h1:Uoxwv0pqYWhD//tfTiipkxNfdhG9UrLwaeswfjfdF0A= +github.com/btcsuite/btcd/btcutil v1.1.0/go.mod h1:5OapHB7A2hBBWLm48mmw4MOHNJCcUBTwmWH/0Jn8VHE= +github.com/btcsuite/btcd/btcutil v1.1.3 h1:xfbtw8lwpp0G6NwSHb+UE67ryTFHJAiNuipusjXSohQ= +github.com/btcsuite/btcd/btcutil v1.1.3/go.mod h1:UR7dsSJzJUfMmFiiLlIrMq1lS9jh9EdCV7FStZSnpi0= +github.com/btcsuite/btcd/chaincfg/chainhash v1.0.0/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= +github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= +github.com/btcsuite/btcd/chaincfg/chainhash v1.0.2 h1:KdUfX2zKommPRa+PD0sWZUyXe9w277ABlgELO7H04IM= +github.com/btcsuite/btcd/chaincfg/chainhash v1.0.2/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA= github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= -github.com/btcsuite/btcutil v1.0.2 h1:9iZ1Terx9fMIOtq1VrwdqfsATL9MC2l8ZrUY6YZ2uts= github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg= github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd/go.mod h1:F+uVaaLLH7j4eDXPRvw78tMflu7Ie2bzYOH4Y8rRKBY= +github.com/btcsuite/goleveldb v1.0.0/go.mod h1:QiK9vBlgftBg6rWQIj6wFzbPfRjiykIEhBH4obrXJ/I= github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= +github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= -github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= +github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cockroachdb/apd v1.1.0 h1:3LFP3629v+1aKXU5Q37mxmRxX/pIu1nijXydLShEq5I= -github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= +github.com/cockroachdb/apd/v3 v3.2.1 h1:U+8j7t0axsIgvQUqthuNm82HIrYXodOV2iWLWtEaIwg= +github.com/cockroachdb/apd/v3 v3.2.1/go.mod h1:klXJcjp+FffLTHlhIG69tezTDvdP065naDsHzKhYSqc= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/cosmos/ledger-cosmos-go v0.13.3 h1:7ehuBGuyIytsXbd4MP43mLeoN2LTOEnk5nvue4rK+yM= +github.com/cosmos/ledger-cosmos-go v0.13.3/go.mod h1:HENcEP+VtahZFw38HZ3+LS3Iv5XV6svsnkk9vdJtLr8= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dgraph-io/badger/v3 v3.2103.4 h1:WE1B07YNTTJTtG9xjBcSW2wn0RJLyiV99h959RKZqM4= -github.com/dgraph-io/badger/v3 v3.2103.4/go.mod h1:4MPiseMeDQ3FNCYwRbbcBOGJLf5jsE0PPFzRiKjtcdw= +github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc= +github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= +github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1/go.mod h1:hyedUtir6IdtD/7lIxGeCxkaw7y45JueMRL4DIyJDKs= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= +github.com/decred/dcrd/lru v1.0.0/go.mod h1:mxKOwFd7lFjN2GZYsiz/ecgqR6kkYAl+0pz0tEMk218= +github.com/dgraph-io/badger/v3 v3.2103.5 h1:ylPa6qzbjYRQMU6jokoj4wzcaweHylt//CH0AKt0akg= +github.com/dgraph-io/badger/v3 v3.2103.5/go.mod h1:4MPiseMeDQ3FNCYwRbbcBOGJLf5jsE0PPFzRiKjtcdw= github.com/dgraph-io/ristretto v0.1.1 h1:6CWw5tJNgpegArSHpNHJKldNeq03FQCwYvfMVWajOK8= github.com/dgraph-io/ristretto v0.1.1/go.mod h1:S1GPSBCYCIhmVNfcth17y2zZtQT6wzkzgwUve0VDWWA= github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2 h1:tdlZCpZ/P9DhczCTSixgIKmwPv6+wP5DGjqLYw5SUiA= @@ -41,30 +67,41 @@ github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUn github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c h1:8ISkoahWXwZR41ois5lSJBSVw4D0OV19Ht/JSTzvSv0= +github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c/go.mod h1:Yg+htXGokKKdzcwhuNDwVvN+uBxDGXJ7G/VN1d8fa64= github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 h1:JWuenKqqX8nojtoVVWjGfOF9635RETekkoH6Cc9SX0A= +github.com/facebookgo/stack v0.0.0-20160209184415-751773369052/go.mod h1:UbMTZqLaRiH3MsBH8va0n7s1pQYcu3uTb8G4tygF4Zg= github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4 h1:7HZCaLC5+BZpmbhCOZJ293Lz68O7PYrF2EzeiFMwCLk= +github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4/go.mod h1:5tD+neXqOorC30/tWg0LCSkrqj/AR6gu8yY8/fpw1q0= github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= -github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= +github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/gnolang/gno v0.0.0-20230925211159-9c7c0a577eb6 h1:6r5rPQtx5yV3X3+zJzqVBdN3HAcUO9MwCI0TJ3lgCmU= -github.com/gnolang/gno v0.0.0-20230925211159-9c7c0a577eb6/go.mod h1:dtwSoPiPCcGxACg4y2iJVWZ/vuU133n4kwF28mx6Krg= -github.com/gnolang/gno v0.0.0-20230926003128-2a9e425470d1 h1:MqpejgKbMfC26A9w+JVCu81ilnlVdg8C6SXlIM6GiJE= -github.com/gnolang/gno v0.0.0-20230926003128-2a9e425470d1/go.mod h1:dtwSoPiPCcGxACg4y2iJVWZ/vuU133n4kwF28mx6Krg= -github.com/gnolang/gno v0.0.0-20230926053156-5c40bc5a7984 h1:VCnWFnSz5yL5vOBdLdJza/o4D95sO8RnFcb3qIZgWdY= -github.com/gnolang/gno v0.0.0-20230926053156-5c40bc5a7984/go.mod h1:dtwSoPiPCcGxACg4y2iJVWZ/vuU133n4kwF28mx6Krg= +github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= +github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= +github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= +github.com/gnolang/gno v0.0.0-20240208173614-9734695c3b17 h1:HzGOcZg/+KjZMTuvlApX84NfCUim4hSJcqB0elpckPc= +github.com/gnolang/gno v0.0.0-20240208173614-9734695c3b17/go.mod h1:pzlpRF80RfVsWpstEumplkhDnAhzkbgSpoVOio3jkJs= +github.com/gnolang/gno/contribs/gnodev v0.0.0-20240208173614-9734695c3b17 h1:CnudmmHlFJic9Mpbj0P5hBAFH+Pzv/NTU0BJzMw2VfA= +github.com/gnolang/gno/contribs/gnodev v0.0.0-20240208173614-9734695c3b17/go.mod h1:X/DDvLnu7m/bbvaccoTbpWNwGXjxWx1FtdWnO4cpv7E= github.com/gnolang/goleveldb v0.0.9 h1:Q7rGko9oXMKtQA+Apeeed5a3sjba/mcDhzJGoTVLCKE= github.com/gnolang/goleveldb v0.0.9/go.mod h1:Dz6p9bmpy/FBESTgduiThZt5mToVDipcHGzj/zUOo8E= github.com/gnolang/overflow v0.0.0-20170615021017-4d914c927216 h1:GKvsK3oLWG9B1GL7WP/VqwM6C92j5tIvB844oggL9Lk= github.com/gnolang/overflow v0.0.0-20170615021017-4d914c927216/go.mod h1:xJhtEL7ahjM1WJipt89gel8tHzfIl/LyMY+lCYh38d8= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/glog v1.1.0 h1:/d3pCKDPWNnvIWe0vVUpNP32qc8U3PDVxySP/y360qE= +github.com/golang/glog v1.1.0/go.mod h1:pfYeQZ3JWZoXTV5sFc986z3HTpwQs9At6P4ImfuP3NQ= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6 h1:ZgQEtGgCBiWRM39fZuwSd1LwSqqSW0hOdXCYYDX0R3I= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= @@ -74,18 +111,33 @@ github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEW github.com/google/flatbuffers v1.12.1 h1:MVlul7pQNoDzWRLTw5imwYsl+usrS1TXG2H4jg6ImGw= github.com/google/flatbuffers v1.12.1/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= -github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= -github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/gorilla/csrf v1.7.0/go.mod h1:+a/4tCmqhG6/w4oafeAZ9pEa3/NZOWYVbD9fV0FwIQA= +github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= +github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= +github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= +github.com/gorilla/securecookie v1.1.1 h1:miw7JPhV+b/lAHSXz4qd/nN9jRiAFV5FwjeKyCS8BvQ= +github.com/gorilla/securecookie v1.1.1/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+HVt/4epWDjd4= +github.com/gorilla/sessions v1.2.1 h1:DHd3rPN5lE3Ts3D8rKkQ8x/0kqfeNmBAaiSi+o7FsgI= +github.com/gorilla/sessions v1.2.1/go.mod h1:dk2InVEVJ0sfLlnXv9EAgkf6ecYs/i80K/zI+bUmuGM= +github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY= +github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY= +github.com/gotuna/gotuna v0.6.0 h1:N1lQKXEi/lwRp8u3sccTYLhzOffA4QasExz/1M5Riws= +github.com/gotuna/gotuna v0.6.0/go.mod h1:F/ecRt29ChB6Ycy1AFIBpBiMNK0j7Heq+gFbLWquhjc= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/jaekwon/testify v1.6.1 h1:4AtAJcR9GzXN5W4DdY7ie74iCPiJV1JJUJL90t2ZUyw= github.com/jaekwon/testify v1.6.1/go.mod h1:Oun0RXIHI7osufabQ60i4Lqkj0GXLbqI1I7kgzBNm1U= github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= +github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jmhodges/levigo v1.0.0 h1:q5EC36kV79HWeTBWsod3mG11EgStG3qArTKcvlksN1U= github.com/jmhodges/levigo v1.0.0/go.mod h1:Q6Qx+uH3RAqyK4rFQroq9RL7mdkABMcfhEI+nNuzMJQ= github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ= @@ -94,25 +146,35 @@ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+o github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4= github.com/klauspost/compress v1.12.3 h1:G5AfA94pHPysR56qqrkO2pxEexdDzrpFJ6yt/VqWxVU= github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= -github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/lib/pq v1.10.7 h1:p7ZhMD+KsSRozJr34udlUrhboJwWAgCg34+/ZZNvZZw= +github.com/lib/pq v1.10.7/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6cdF0Y8= github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= -github.com/linxGnu/grocksdb v1.8.4 h1:ZMsBpPpJNtRLHiKKp0mI7gW+NT4s7UgfD5xHxx1jVRo= -github.com/linxGnu/grocksdb v1.8.4/go.mod h1:xZCIb5Muw+nhbDK4Y5UJuOrin5MceOuiXkVUR7vp4WY= +github.com/linxGnu/grocksdb v1.8.11 h1:BGol9e5gB1BrsTvOxloC88pe70TCqgrfLNwkyWW0kD8= +github.com/linxGnu/grocksdb v1.8.11/go.mod h1:xZCIb5Muw+nhbDK4Y5UJuOrin5MceOuiXkVUR7vp4WY= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= +github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= +github.com/nxadm/tail v1.4.11 h1:8feyoE3OzPrcshW5/MJ4sGESc5cqmGkGCWlco4l0bqY= +github.com/nxadm/tail v1.4.11/go.mod h1:OTaG3NK980DZzxbRq6lEuzgU+mug70nY11sMd4JXXHc= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.14.0 h1:2mOpI4JVVPBN+WQRa0WKH2eXR+Ey+uK4n7Zj0aYpIQA= +github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= +github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1 h1:o0+MgICZLuZ7xjH7Vx6zS/zcu93/BEp1VwkIW1mEXCE= +github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8= github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= @@ -124,8 +186,8 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= -github.com/rs/cors v1.10.0 h1:62NOS1h+r8p1mW6FM0FSB0exioXLhd/sh15KpjWBZ+8= -github.com/rs/cors v1.10.0/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= +github.com/rs/cors v1.10.1 h1:L0uuZVXIKlI1SShY2nhFfo44TYvDPQ1w4oFkUJNfhyo= +github.com/rs/cors v1.10.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= @@ -137,42 +199,55 @@ github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb6 github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c h1:g+WoO5jjkqGAzHWCjJB1zZfXPIAaDpzXIEJ0eS6B5Ok= github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c/go.mod h1:ahpPrc7HpcfEWDQRZEmnXMzHY03mLDYMCxeDzy46i+8= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -go.etcd.io/bbolt v1.3.7 h1:j+zJOnnEjF/kyHlDDgGnVL/AIqIJPq8UoB2GSNfkUfQ= -go.etcd.io/bbolt v1.3.7/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw= +github.com/zondax/hid v0.9.2 h1:WCJFnEDMiqGF64nlZz28E9qLVZ0KSJ7xpc5DLEyma2U= +github.com/zondax/hid v0.9.2/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= +github.com/zondax/ledger-go v0.14.3 h1:wEpJt2CEcBJ428md/5MgSLsXLBos98sBOyxNmCjfUCw= +github.com/zondax/ledger-go v0.14.3/go.mod h1:IKKaoxupuB43g4NxeQmbLXv7T9AlQyie1UpHb342ycI= +go.etcd.io/bbolt v1.3.8 h1:xs88BrvEv273UsB79e0hcVrlUWmS0a8upikMFhSyAtA= +go.etcd.io/bbolt v1.3.8/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw= go.opencensus.io v0.22.5 h1:dntmOdLpSpHlVqbW5Eay97DelsZHe+55D+xC6i0dDS0= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= -go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw= -go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/multierr v1.9.0 h1:7fIwc/ZtS0q++VgcfqFDxSBZVv/Xo49/SYnDFupUwlI= -go.uber.org/multierr v1.9.0/go.mod h1:X2jQV1h+kxSjClGpnseKVIxpmcjrj7MNnI0bnlfKTVQ= +go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= +go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= +go.uber.org/goleak v1.1.11 h1:wy28qYRKZgnJTxGxvye5/wgWr1EKjmUDGYox5mGlRlI= +go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= +go.uber.org/multierr v1.10.0 h1:S0h4aNzvfcFsC3dRF1jLoaov7oRaKqRGC/pUEJ2yvPQ= +go.uber.org/multierr v1.10.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= +go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60= +go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg= +go.uber.org/zap/exp v0.1.0 h1:Ol9zQNvAEAgFHSBiR5LlwS9Xq8u5QF+7HBwNHUB8rcI= +go.uber.org/zap/exp v0.1.0/go.mod h1:z/0T3As39ttolxZGOsvk1OEvQfwwfTZpmV9YTp+VAkc= golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.13.0 h1:mvySKfSWJ+UKUii46M40LOvyWfN0s2U+46/jDd0e6Ck= -golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= +golang.org/x/crypto v0.18.0 h1:PGVlW0xEltQnzFZ55hkuX5+KLyrMYhHld1YHO4AKcdc= +golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20240112132812-db7319d0e0e3 h1:hNQpMuAJe5CtcUqCXaWga3FHu+kQvCqcsoVaQgSV60o= +golang.org/x/exp v0.0.0-20240112132812-db7319d0e0e3/go.mod h1:idGWGoKP1toJGkd5/ig9ZLuPcZBC3ewk7SzmH0uou08= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc= -golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= +golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -181,9 +256,11 @@ golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.15.0 h1:ugBLEUaxABaB5AJqW9enI0ACdci2RUd4eP51NTBvuJ8= -golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= +golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo= +golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -197,15 +274,23 @@ golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= -golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.12.0 h1:/ZfYdc3zq+q02Rv9vGqTeSItdzZTSNDmfTi0mBAuidU= -golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= +golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU= +golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/term v0.16.0 h1:m+B6fahuftsE9qjo0VWp2FW0mB3MTJvR0BaMQrq0pmE= +golang.org/x/term v0.16.0/go.mod h1:yn7UURbUtPyrVJPGPq404EukNFxcm/foM+bV/bfcDsY= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= @@ -213,8 +298,8 @@ golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3 golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.6.0 h1:BOw41kyTf3PuCW1pVQf8+Cyg8pMlkYB1oo9iJ6D/lKM= -golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= +golang.org/x/tools v0.17.0 h1:FvmRgNOcs3kOa+T20R1uhfP9F6HgG2mfxDv1vrx1Htc= +golang.org/x/tools v0.17.0/go.mod h1:xsh6VxdV005rRVaS6SSAf9oiAqljS7UZUacMZ8Bnsps= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -224,8 +309,18 @@ google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9Ywl google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231009173412-8bfb1ae86b6c h1:jHkCUWkseRf+W+edG5hMzr/Uh1xkDREY4caybAq4dpY= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231009173412-8bfb1ae86b6c/go.mod h1:4cYg8o5yUbm77w8ZX00LhMVNl/YVBFJRYWDc0uYWMs0= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.58.3 h1:BjnpXut1btbtgN/6sp+brB2Kbm2LjNXnidYujAVbSoQ= +google.golang.org/grpc v1.58.3/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= @@ -233,12 +328,16 @@ google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqw gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/integration_test.go b/integration_test.go deleted file mode 100644 index f8f118a1..00000000 --- a/integration_test.go +++ /dev/null @@ -1,99 +0,0 @@ -package main - -import ( - "bufio" - "fmt" - "os" - "os/exec" - "path/filepath" - "testing" - "time" - - integration "github.com/gnolang/gno/gno.land/pkg/integration" - "github.com/jaekwon/testify/require" - "github.com/rogpeppe/go-internal/testscript" -) - -var balances = []string{ - "g1plqds6kxnfaqcpky0gtt6fpntfhjgcfx8r73a0=100000000000000000ugnot", - "g1sgy2zhqg2wecuz3qt8th63d539afagjnhs4zj3=100000000000000000ugnot", - "g1unk9a8yt595p4yxpfpejewvf9lx6yrvd2ylgtm=100000000000000000ugnot", - "g17x4qwuhmc6fyp6ut2qtscc9265xe5jnj83s8c6=100000000000000000ugnot", - "g1agq8t3289xxmm63z55axykmmve2pz87yqgyn5n=100000000000000000ugnot", - "g153xesqpfvr5y35l0aykew3796kz452zttp0xt2=100000000000000000ugnot", - "g18epncd7avkhmdlf930e4t2p7c7j9qdv3yda93f=100000000000000000ugnot", - "g1elguymy8sjjy246u09qddtx587934k6uzf8mc4=100000000000000000ugnot", - "g1sl70rzvu49mp0lstxaptmvle8h2a8rx8pu56uk=100000000000000000ugnot", - "g18dgugclk93v65qtxxus82eg30af59fgk246nqy=100000000000000000ugnot", - // test2 and test3, should be added from github.com/gnolang/gno/gno.land/pkg/integration - "g1m5exxkaqrsxd8ne93psljuakxzhkzcm42yg7ye=100000000000000000ugnot", - "g13hlh3a3kygwq9g3vgjzz5zu4fy7gpkk523ex6l=100000000000000000ugnot", -} - -func generateGenesisFile(genesispath, target string) error { - genesis, err := os.ReadFile(genesispath) - if err != nil { - return fmt.Errorf("Error reading genesis file: %w", err) - } - - outputFile, err := os.Create(target) - if err != nil { - return fmt.Errorf("Error creating output file: %w", err) - } - defer outputFile.Close() - - writer := bufio.NewWriter(outputFile) - writer.Write(genesis) - writer.WriteRune('\n') - writer.WriteRune('\n') - for _, line := range balances { - writer.WriteString(line) - writer.WriteRune('\n') - } - writer.Flush() - - return nil -} - -func TestIntegration(t *testing.T) { - ts := integration.SetupGnolandTestScript(t, "testdata") - - goModPath, err := exec.Command("go", "env", "GOMOD").CombinedOutput() - require.NoError(t, err) - - oldsetup := ts.Setup - idx := 0 - ts.Setup = func(e *testscript.Env) error { - oldsetup(e) - e.Setenv("ROOTDIR", filepath.Dir(string(goModPath))) - e.Setenv("NL", "\n") - - e.Setenv("GNOHOME", fmt.Sprintf("%s/%d", e.Getenv("GNOHOME"), idx)) - idx++ - - rootdir := e.Getenv("GNOROOT") - tmpdir := e.Getenv("TMPDIR") - - inputGenesis := filepath.Join(rootdir, "gno.land/genesis/genesis_balances.txt") - outputGenesis := filepath.Join(tmpdir, "genesis_balances.txt") - - if err := generateGenesisFile(inputGenesis, outputGenesis); err != nil { - return fmt.Errorf("unable to generate genesis file: %w", err) - } - return nil - } - - ts.Cmds["sleep"] = func(ts *testscript.TestScript, neg bool, args []string) { - d := time.Second - if len(args) > 0 { - var err error - if d, err = time.ParseDuration(args[0]); err != nil { - ts.Fatalf("uanble to parse duration %q: %s", args[1], err) - } - } - - time.Sleep(d) - } - - testscript.Run(t, ts) -} diff --git a/realm/rules.gno b/package/engine.gno similarity index 96% rename from realm/rules.gno rename to package/engine.gno index 30b5f5f5..c931d6e3 100644 --- a/realm/rules.gno +++ b/package/engine.gno @@ -1,9 +1,12 @@ -// This file is focused on elemental types and functions for handling -// chess games. Thus, the move legality rules are implemented here. +// Package chess implements a simple chess engine, designed to implement all +// of the official FIDE rules with the intention of validating moves for a +// "chess server" realm (gno.land/r/demo/chess). // -// To verify the following section, see the FIDE "Laws of Chess": +// To implement the rules, the FIDE "Laws of Chess" are used as a reference: // https://www.fide.com/FIDE/handbook/LawsOfChess.pdf - +// +// This package was designed with a focus on clarity and on using this code as +// a didactic tool. Any contributions to the code should respect this. package chess import ( @@ -11,6 +14,8 @@ import ( "sort" "strconv" "strings" + + "gno.land/p/demo/chess/zobrist" ) // PositionFlags. The lower 4 bits indicate an en passant column; the upper @@ -51,6 +56,8 @@ func (p PositionFlags) CastlingRights() string { // Position contains the information about a chessboard, and surrounding // context: the previous moves, the castling rights and "en passant" column. +// +// NOTE: the position of a piece is encoded in a [Square]. type Position struct { B Board Moves []Move @@ -70,7 +77,7 @@ func NewPosition() Position { return Position{ B: NewBoard(), Moves: make([]Move, 0, 80), // typical chess game is ~40 moves, 80 half-moves - Hashes: []uint64{hashInitialPosition}, + Hashes: []uint64{zobrist.InitialPosition}, } } @@ -206,6 +213,7 @@ func (p Position) ValidateMove(m Move) (newP Position, valid bool) { // validateMove allows for m to be a "king-capture" move, which is illegal in // chess, but it is useful for InCheck. +// This is commonly known in chess programming as a "pseudo-legal" move. func (oldp Position) validateMove(m Move) (_ Position, ok bool) { p := oldp.clone() @@ -447,7 +455,7 @@ func (oldp Position) validateMove(m Move) (_ Position, ok bool) { p.Hashes, // color is inverted, because we consider the present move as already // done (hence, it is the other player to move). - zobrist(p.B, bool(!color), byte(p.Flags)>>4, ep), + zobrist.Hash(zobrist.Board(p.B), bool(!color), byte(p.Flags)>>4, ep), ) // is our king in check, as a result of the current move? @@ -958,6 +966,13 @@ func (c Color) Piece() Piece { // Piece represents a piece on the board. type Piece byte +// PieceFromChar returns the piece corresponding to the given character. +// White pieces are uppercase, and black pieces are lowercase. +// If a piece is invalid, PieceInvalid is returned. +func PieceFromChar(b byte) Piece { + return p[b] +} + // piece character to internal piece var p = [256]Piece{ 'P': PiecePawn, diff --git a/realm/rules_test.gno b/package/engine_test.gno similarity index 100% rename from realm/rules_test.gno rename to package/engine_test.gno diff --git a/realm/glicko2.gno b/package/glicko2/glicko2.gno similarity index 89% rename from realm/glicko2.gno rename to package/glicko2/glicko2.gno index c565b536..46fc6d7b 100644 --- a/realm/glicko2.gno +++ b/package/glicko2/glicko2.gno @@ -1,17 +1,15 @@ -package chess +package glicko2 import ( "bytes" "math" "std" + "strconv" ) // http://www.glicko.net/glicko/glicko2.pdf -// realm global variable containing player ratings. -var playerRatings [CategoryMax][]*PlayerRating - const ( // Step 1. // Determine a rating and RD for each player at the onset of the rating period. The @@ -52,16 +50,6 @@ func NewPlayerRating(addr std.Address) *PlayerRating { } } -func (p PlayerRating) MarshalJSON() ([]byte, error) { - var buf bytes.Buffer - buf.WriteByte('{') - buf.WriteString(`"rating":` + strconv.FormatFloat(p.Rating, 'f', -1, 64) + `,`) - buf.WriteString(`"deviation":` + strconv.FormatFloat(p.RatingDeviation, 'f', -1, 64) + `,`) - buf.WriteString(`"volatility":` + strconv.FormatFloat(p.RatingVolatility, 'f', -1, 64)) - buf.WriteByte('}') - return buf.Bytes(), nil -} - // RatingScore is the outcome of a game between two players. type RatingScore struct { White, Black std.Address @@ -80,7 +68,7 @@ func getRatingScore(scores []RatingScore, player, opponent std.Address) float64 return -1 } -func updateRatings(source []*PlayerRating, scores []RatingScore) { +func UpdateRatings(source []*PlayerRating, scores []RatingScore) { // step 2: assign working wr/wrd/wrv for i, player := range source { player.wr = (player.Rating - GlickoInitialRating) / glickoScaleFactor diff --git a/realm/glicko2_test.gno b/package/glicko2/glicko2_test.gno similarity index 77% rename from realm/glicko2_test.gno rename to package/glicko2/glicko2_test.gno index 2ca2c06e..cf592771 100644 --- a/realm/glicko2_test.gno +++ b/package/glicko2/glicko2_test.gno @@ -1,4 +1,4 @@ -package chess +package glicko2 import ( "testing" @@ -20,6 +20,10 @@ func TestExampleCalculations(t *testing.T) { {White: "1", Black: "3", Score: 0}, {White: "1", Black: "4", Score: 0}, } - updateRatings(ratings, scores) - t.Logf("%+v\n", ratings[0]) + UpdateRatings(ratings, scores) + r := ratings[0] + t.Logf("%.4f (± %.4f, volatility: %.4f); working values: %.2f / %.2f / %.2f\n", + r.Rating, r.RatingDeviation, r.RatingVolatility, + r.wr, r.wrd, r.wrv, + ) } diff --git a/package/glicko2/gno.mod b/package/glicko2/gno.mod new file mode 100644 index 00000000..f89cecf7 --- /dev/null +++ b/package/glicko2/gno.mod @@ -0,0 +1 @@ +module gno.land/p/demo/chess/glicko2 diff --git a/package/gno.mod b/package/gno.mod new file mode 100644 index 00000000..7b25435c --- /dev/null +++ b/package/gno.mod @@ -0,0 +1,7 @@ +module gno.land/p/demo/chess + +require ( + gno.land/p/demo/chess/zobrist v0.0.0-latest +) + +replace gno.land/p/demo/chess/zobrist => ./zobrist diff --git a/package/zobrist/gno.mod b/package/zobrist/gno.mod new file mode 100644 index 00000000..aa67db18 --- /dev/null +++ b/package/zobrist/gno.mod @@ -0,0 +1 @@ +module gno.land/p/demo/chess/zobrist diff --git a/util/rands.go b/package/zobrist/rands.go similarity index 100% rename from util/rands.go rename to package/zobrist/rands.go diff --git a/realm/hash.gno b/package/zobrist/zobrist.gno similarity index 93% rename from realm/hash.gno rename to package/zobrist/zobrist.gno index 17e47d8d..393d9d30 100644 --- a/realm/hash.gno +++ b/package/zobrist/zobrist.gno @@ -1,25 +1,44 @@ -// this file contains an implementation of Zobrist Hashing +// Package zobrist contains an implementation of the Zobrist Hashing algorithm. // https://www.chessprogramming.org/Zobrist_Hashing +// +// The hash is performed using a series of random numbers generated through +// rands.go, in this source directory. +package zobrist -package chess +// Board is a representation of a chess board. +// Details on how to transform a chess algebraic position into an index +// can be found at [Square]. +type Board [64]Piece -/* to generate hashInitialPosition -func init() { - println( - "initial position hash", - zobrist( - NewBoard(), - false, - 0, - 255, - ), - ) -} -*/ +// Piece represents a piece on the board. +type Piece byte + +// Possible values of Piece. Within the context of Board, Piece is assumed to +// be white, unless p&PieceBlack != 0. Note PieceBlack is not a valid piece; it +// must be bitwise OR'd to a non-empty piece. +const ( + PieceEmpty Piece = iota + + PiecePawn + PieceRook + PieceKnight + PieceBishop + PieceQueen + PieceKing + + PieceBlack Piece = 8 // bit-flag +) -const hashInitialPosition uint64 = 1957848132405881468 +// InitialPosition is the zobrist hash (as implemented by this package) +// for the initial chess position. +const InitialPosition uint64 = 1957848132405881468 -func zobrist(b Board, isBlack bool, castling, epFile byte) uint64 { +// Hash generates a Zobrist hash with the given parameter. +// +// castling can assume a value between [0,16), +// epFile should be set to a value between [0,8) -- if there is no en passant +// file, pass 255 (as a convention). +func Hash(b Board, isBlack bool, castling, epFile byte) uint64 { var hash uint64 if isBlack { hash ^= hashBlack @@ -28,7 +47,7 @@ func zobrist(b Board, isBlack bool, castling, epFile byte) uint64 { if p == PieceEmpty { continue } - if p.Color() == White { + if p&PieceBlack == 0 { // values 0-5 p-- } else { @@ -44,7 +63,6 @@ func zobrist(b Board, isBlack bool, castling, epFile byte) uint64 { return hash } -// randomly generated using utils/rand.go var ( hashBlack uint64 = 0x331cf7440c179431 hashCastling = [...]uint64{ diff --git a/package/zobrist/zobrist_test.gno b/package/zobrist/zobrist_test.gno new file mode 100644 index 00000000..4a5b97fe --- /dev/null +++ b/package/zobrist/zobrist_test.gno @@ -0,0 +1,55 @@ +package zobrist + +import ( + "testing" +) + +// piece character to internal piece +var p = [256]Piece{ + 'P': PiecePawn, + 'R': PieceRook, + 'N': PieceKnight, + 'B': PieceBishop, + 'Q': PieceQueen, + 'K': PieceKing, + + 'p': PieceBlack | PiecePawn, + 'r': PieceBlack | PieceRook, + 'n': PieceBlack | PieceKnight, + 'b': PieceBlack | PieceBishop, + 'q': PieceBlack | PieceQueen, + 'k': PieceBlack | PieceKing, +} + +// NewBoard returns a Board normally set up at the initial position for standard +// chess. +func NewBoard() Board { + return Board{ + // row 1 + p['R'], p['N'], p['B'], p['Q'], + p['K'], p['B'], p['N'], p['R'], + // row 2 + p['P'], p['P'], p['P'], p['P'], + p['P'], p['P'], p['P'], p['P'], + + // rows 3, 4, 5, 6 + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + + // row 7 + p['p'], p['p'], p['p'], p['p'], + p['p'], p['p'], p['p'], p['p'], + // row 8 + p['r'], p['n'], p['b'], p['q'], + p['k'], p['b'], p['n'], p['r'], + } +} + +func TestInitialPosition(t *testing.T) { + h := Hash(NewBoard(),false, 0, 255) + if h != InitialPosition { + t.Fatalf("InitialPosition is invalid: set to %d, should be %d", InitialPosition, h) + } +} diff --git a/realm/chess.gno b/realm/chess.gno index e36bdd9b..01d39d7c 100644 --- a/realm/chess.gno +++ b/realm/chess.gno @@ -9,6 +9,8 @@ import ( "time" "gno.land/p/demo/avl" + "gno.land/p/demo/chess" + "gno.land/p/demo/ufmt" ) // realm state @@ -25,11 +27,11 @@ var ( type Game struct { ID string `json:"id"` - White std.Address `json:"white"` - Black std.Address `json:"black"` - Position Position `json:"position"` - State GameState `json:"state"` - Winner Winner `json:"winner"` + White std.Address `json:"white"` + Black std.Address `json:"black"` + Position chess.Position `json:"position"` + State GameState `json:"state"` + Winner Winner `json:"winner"` Creator std.Address `json:"creator"` CreatedAt time.Time `json:"created_at"` @@ -45,78 +47,6 @@ func (g Game) json() string { return string(s) } -func (g Game) MarshalJSON() (_ []byte, err error) { - var b bytes.Buffer - b.WriteByte('{') - - nilAddr := func(na *std.Address) string { - if na == nil { - return `null` - } - return `"` + na.String() + `"` - } - mjson := func(s string, val interface{ MarshalJSON() ([]byte, error) }, comma bool) { - if err != nil { - return - } - var res []byte - res, err = val.MarshalJSON() - if err != nil { - return - } - b.WriteString(`"` + s + `":`) - b.Write(res) - if comma { - b.WriteByte(',') - } - } - - b.WriteString(`"id":"` + g.ID + `",`) - b.WriteString(`"white":"` + g.White.String() + `",`) - b.WriteString(`"black":"` + g.Black.String() + `",`) - - mjson("position", g.Position, true) - mjson("state", g.State, true) - mjson("winner", g.Winner, true) - if err != nil { - return - } - - b.WriteString(`"creator":"` + g.Creator.String() + `",`) - b.WriteString(`"created_at":"` + g.CreatedAt.Format(time.RFC3339) + `",`) - b.WriteString(`"draw_offerer":` + nilAddr(g.DrawOfferer) + ",") - b.WriteString(`"concluder":` + nilAddr(g.Concluder) + ",") - - mjson("time", g.Time, false) - if err != nil { - return - } - - b.WriteByte('}') - return b.Bytes(), nil -} - -func (p Position) MarshalJSON() ([]byte, error) { - var b bytes.Buffer - b.WriteByte('{') - - bfen := p.EncodeFEN() - b.WriteString(`"fen":"` + bfen + `",`) - - b.WriteString(`"moves":[`) - - for idx, m := range p.Moves { - b.WriteString(`"` + m.String() + `"`) - if idx != len(p.Moves)-1 { - b.WriteByte(',') - } - } - - b.WriteByte(']') - b.WriteByte('}') - return b.Bytes(), nil -} - // Winner represents the "direct" outcome of a game // (white, black or draw?) type Winner byte @@ -135,13 +65,6 @@ var winnerString = [...]string{ WinnerDraw: "draw", } -func (w Winner) MarshalJSON() ([]byte, error) { - if n := int(w); n < len(winnerString) { - return []byte(`"` + winnerString[n] + `"`), nil - } - return nil, errors.New("invalid winner value") -} - // GameState represents the current game state. type GameState byte @@ -187,13 +110,6 @@ var gameStatesSnake = [...]string{ GameStateDrawnByAgreement: "drawn_by_agreement", } -func (g GameState) MarshalJSON() ([]byte, error) { - if int(g) >= len(gameStatesSnake) { - return nil, errors.New("invalid game state") - } - return []byte(`"` + gameStatesSnake[g] + `"`), nil -} - // IsFinished returns whether the game is in a finished state. func (g GameState) IsFinished() bool { return g != GameStateOpen @@ -212,7 +128,7 @@ func (g GameState) IsFinished() bool { // parallel games OR by introducing a "request" system, so that a game is not // immediately considered "open" when calling NewGame. func xNewGame(opponentRaw string, seconds, increment int) string { - std.AssertOriginCall() + assertOriginCall() if seconds >= 0 && increment < 0 { panic("negative increment invalid") @@ -266,7 +182,7 @@ func newGame(caller, opponent std.Address, seconds, increment int) *Game { ID: id, White: caller, Black: opponent, - Position: NewPosition(), + Position: chess.NewPosition(), State: GameStateOpen, Creator: caller, CreatedAt: time.Now(), @@ -350,8 +266,8 @@ func getGame(id string, wantOpen bool) *Game { // If the piece is a pawn which is moving to the last row, a promotion piece // must be specified. // Castling is specified by indicating the king's movement. -func MakeMove(gameID, from, to string, promote Piece) string { - std.AssertOriginCall() +func MakeMove(gameID, from, to string, promote chess.Piece) string { + assertOriginCall() g := getGame(gameID, true) @@ -387,14 +303,14 @@ func MakeMove(gameID, from, to string, promote Piece) string { } // validate move - m := Move{ - From: SquareFromString(from), - To: SquareFromString(to), + m := chess.Move{ + From: chess.SquareFromString(from), + To: chess.SquareFromString(to), } - if m.From == SquareInvalid || m.To == SquareInvalid { + if m.From == chess.SquareInvalid || m.To == chess.SquareInvalid { panic("invalid from/to square") } - if promote > 0 && promote <= PieceKing { + if promote > 0 && promote <= chess.PieceKing { m.Promotion = promote } newp, ok := g.Position.ValidateMove(m) @@ -406,7 +322,7 @@ func MakeMove(gameID, from, to string, promote Piece) string { g.Position = newp o := newp.IsFinished() - if o == NotFinished { + if o == chess.NotFinished { // opponent of draw offerer has made a move. take as implicit rejection of draw. if g.DrawOfferer != nil && *g.DrawOfferer != caller { g.DrawOfferer = nil @@ -416,20 +332,20 @@ func MakeMove(gameID, from, to string, promote Piece) string { } switch { - case o == Checkmate && isBlack: + case o == chess.Checkmate && isBlack: g.State = GameStateCheckmated g.Winner = WinnerBlack - case o == Checkmate && !isBlack: + case o == chess.Checkmate && !isBlack: g.State = GameStateCheckmated g.Winner = WinnerWhite - case o == Stalemate: + case o == chess.Stalemate: g.State = GameStateStalemate g.Winner = WinnerDraw - case o == Drawn75Move: + case o == chess.Drawn75Move: g.State = GameStateDrawn75Move g.Winner = WinnerDraw - case o == Drawn5Fold: + case o == chess.Drawn5Fold: g.State = GameStateDrawn5Fold g.Winner = WinnerDraw } @@ -488,7 +404,7 @@ func ClaimTimeout(gameID string) string { } func Abort(gameID string) string { - std.AssertOriginCall() + assertOriginCall() g := getGame(gameID, true) err := abort(g) @@ -516,7 +432,7 @@ func abort(g *Game) error { } func Resign(gameID string) string { - std.AssertOriginCall() + assertOriginCall() g := getGame(gameID, true) err := resign(g) @@ -550,7 +466,7 @@ func resign(g *Game) error { // DrawOffer creates a draw offer in the current game, if one doesn't already // exist. func DrawOffer(gameID string) string { - std.AssertOriginCall() + assertOriginCall() g := getGame(gameID, true) caller := std.GetOrigCaller() @@ -568,7 +484,7 @@ func DrawOffer(gameID string) string { // DrawRefuse refuse a draw offer in the given game. func DrawRefuse(gameID string) string { - std.AssertOriginCall() + assertOriginCall() g := getGame(gameID, true) caller := std.GetOrigCaller() @@ -592,7 +508,7 @@ func DrawRefuse(gameID string) string { // - Insufficient material (§9.4) // Note: stalemate happens as a consequence of a Move, and thus is handled in that function. func Draw(gameID string) string { - std.AssertOriginCall() + assertOriginCall() g := getGame(gameID, true) @@ -614,11 +530,11 @@ func Draw(gameID string) string { o := g.Position.IsFinished() switch { - case o&Can50Move != 0: + case o&chess.Can50Move != 0: g.State = GameStateDrawn50Move - case o&Can3Fold != 0: + case o&chess.Can3Fold != 0: g.State = GameStateDrawn3Fold - case o&CanInsufficient != 0: + case o&chess.CanInsufficient != 0: g.State = GameStateDrawnInsufficient default: panic("this game can't be automatically drawn") @@ -631,3 +547,17 @@ func Draw(gameID string) string { return g.json() } + +func checkErr(err error) { + if err != nil { + panic(err.Error()) + } +} + +// Replacement for OriginCall using std.PrevRealm(). +// See: https://github.com/gnolang/gno/pull/1048 +func assertOriginCall() { + if !std.PrevRealm().IsUser() { + panic("invalid non-origin call") + } +} diff --git a/realm/chess_test.gno b/realm/chess_test.gno index a0543ef8..e0f91296 100644 --- a/realm/chess_test.gno +++ b/realm/chess_test.gno @@ -11,6 +11,8 @@ import ( "internal/os_test" "gno.land/p/demo/avl" + "gno.land/p/demo/chess" + "gno.land/p/demo/chess/glicko2" ) func cleanup() { @@ -21,7 +23,7 @@ func cleanup() { leaderboard = [CategoryMax]leaderboardType{} lobby = [tcLobbyMax][]lobbyPlayer{} lobbyPlayer2Game = avl.Tree{} - playerRatings = [CategoryMax][]*PlayerRating{} + playerRatings = [CategoryMax][]*glicko2.PlayerRating{} } func TestNewGame(t *testing.T) { @@ -290,7 +292,7 @@ func (tc *testCommandNewGame) Run(t *testing.T, bufs map[string]string) { type testCommandMove struct { addr std.Address from, to string - promotion Piece + promotion chess.Piece } func (tc *testCommandMove) Run(t *testing.T, bufs map[string]string) { @@ -418,10 +420,10 @@ func parseCommandTest(t *testing.T, command string) (funcs []testCommandRunner, panic("invalid lan move " + command[2]) } from, to := command[2][:2], command[2][2:4] - var promotion Piece + var promotion chess.Piece if len(command[2]) == 5 { - promotion = p[command[2][4]] - if promotion == PieceEmpty { + promotion = chess.PieceFromChar(command[2][4]) + if promotion == chess.PieceEmpty { panic("invalid piece for promotion: " + string(command[2][4])) } } @@ -598,6 +600,7 @@ func runCommandTest(t *testing.T, command string) { func catchPanic(tc testCommandRunner, t *testing.T, bufs map[string]string) { defer func() { + // XXX: should prefer testing.Recover, but see: https://github.com/gnolang/gno/issues/1650 e := recover() if e == nil { bufs["panic"] = "" diff --git a/realm/discovery.gno b/realm/discovery.gno index f98e7490..f9178dd0 100644 --- a/realm/discovery.gno +++ b/realm/discovery.gno @@ -11,6 +11,7 @@ import ( "strings" "gno.land/p/demo/avl" + "gno.land/p/demo/chess/glicko2" "gno.land/r/demo/users" ) @@ -70,8 +71,9 @@ func (tc *TimeControl) Category() Category { // realm state var ( - playerStore avl.Tree // std.Address -> *Player - leaderboard [CategoryMax]leaderboardType + playerStore avl.Tree // std.Address -> *Player + leaderboard [CategoryMax]leaderboardType + playerRatings [CategoryMax][]*glicko2.PlayerRating ) func GetPlayer(player string) string { @@ -93,7 +95,7 @@ type Player struct { type CategoryInfo struct { Wins, Losses, Draws int - *PlayerRating + *glicko2.PlayerRating } // Score for determining leaderboards. @@ -111,43 +113,6 @@ func (p Player) LeaderboardPosition(cat Category) int { return pos } -func (p Player) MarshalJSON() ([]byte, error) { - u := users.GetUserByAddress(p.Address) - - var buf bytes.Buffer - buf.WriteByte('{') - - buf.WriteString(`"address":"` + p.Address.String() + `",`) - if u == nil { - buf.WriteString(`"username":"",`) - } else { - buf.WriteString(`"username":"` + u.Name() + `",`) - } - - for idx, cat := range categoryList { - stat := p.CategoryInfo[cat] - buf.WriteString(`"` + cat.String() + `":{`) - buf.WriteString(`"wins":` + strconv.Itoa(stat.Wins) + ",") - buf.WriteString(`"losses":` + strconv.Itoa(stat.Losses) + ",") - buf.WriteString(`"draws":` + strconv.Itoa(stat.Draws) + ",") - buf.WriteString(`"rating":`) - if res, err := stat.PlayerRating.MarshalJSON(); err != nil { - return nil, err - } else { - buf.Write(res) - } - buf.WriteByte(',') - buf.WriteString(`"position":` + strconv.Itoa(p.LeaderboardPosition(cat))) - buf.WriteByte('}') - if idx != len(categoryList)-1 { - buf.WriteByte(',') - } - } - - buf.WriteByte('}') - return buf.Bytes(), nil -} - func (g *Game) saveResult() { w, b := getPlayer(g.White), getPlayer(g.Black) @@ -174,7 +139,7 @@ func (g *Game) saveResult() { // Call glicko 2 rating calculator. owr, obr := w.CategoryInfo[cat].Rating, b.CategoryInfo[cat].Rating - updateRatings(playerRatings[cat], []RatingScore{{ + glicko2.UpdateRatings(playerRatings[cat], []glicko2.RatingScore{{ White: g.White, Black: g.Black, Score: result, @@ -195,12 +160,12 @@ func getPlayer(addr std.Address) *Player { p := new(Player) p.Address = addr for _, cat := range categoryList { - pr := NewPlayerRating(addr) + pr := glicko2.NewPlayerRating(addr) p.CategoryInfo[cat] = CategoryInfo{ PlayerRating: pr, } // https://github.com/gnolang/gno/pull/1170 - prs := append([]*PlayerRating{}, playerRatings[cat]...) + prs := append([]*glicko2.PlayerRating{}, playerRatings[cat]...) playerRatings[cat] = append(prs, pr) } playerStore.Set(addr.String(), p) diff --git a/realm/gno.mod b/realm/gno.mod index 237435ec..003c9642 100644 --- a/realm/gno.mod +++ b/realm/gno.mod @@ -2,5 +2,8 @@ module gno.land/r/demo/chess require ( gno.land/p/demo/avl v0.0.0-latest + gno.land/p/demo/chess v0.0.0-latest + gno.land/p/demo/chess/glicko2 v0.0.0-latest + gno.land/p/demo/ufmt v0.0.0-latest gno.land/r/demo/users v0.0.0-latest ) diff --git a/realm/json.gno b/realm/json.gno new file mode 100644 index 00000000..7daf3eda --- /dev/null +++ b/realm/json.gno @@ -0,0 +1,204 @@ +package chess + +import ( + "bytes" + "errors" + "math" + "std" + "strconv" + "time" + + "gno.land/p/demo/chess" + "gno.land/p/demo/chess/glicko2" + "gno.land/r/demo/users" +) + +// This file contains a bunch of JSON marshalers. +// These should disappear eventually! +// https://github.com/gnolang/gno/issues/1655 + +func (g Game) MarshalJSON() (_ []byte, err error) { + var b bytes.Buffer + b.WriteByte('{') + + nilAddr := func(na *std.Address) string { + if na == nil { + return `null` + } + return `"` + na.String() + `"` + } + mjson := func(s string, val interface{ MarshalJSON() ([]byte, error) }, comma bool) { + if err != nil { + return + } + var res []byte + res, err = val.MarshalJSON() + if err != nil { + return + } + b.WriteString(`"` + s + `":`) + b.Write(res) + if comma { + b.WriteByte(',') + } + } + + b.WriteString(`"id":"` + g.ID + `",`) + b.WriteString(`"white":"` + g.White.String() + `",`) + b.WriteString(`"black":"` + g.Black.String() + `",`) + + mjson("position", jsonPosition{g.Position}, true) + mjson("state", g.State, true) + mjson("winner", g.Winner, true) + if err != nil { + return + } + + b.WriteString(`"creator":"` + g.Creator.String() + `",`) + b.WriteString(`"created_at":"` + g.CreatedAt.Format(time.RFC3339) + `",`) + b.WriteString(`"draw_offerer":` + nilAddr(g.DrawOfferer) + ",") + b.WriteString(`"concluder":` + nilAddr(g.Concluder) + ",") + + mjson("time", g.Time, false) + if err != nil { + return + } + + b.WriteByte('}') + return b.Bytes(), nil +} + +type jsonPosition struct { + chess.Position +} + +func (p jsonPosition) MarshalJSON() ([]byte, error) { + var b bytes.Buffer + b.WriteByte('{') + + bfen := p.EncodeFEN() + b.WriteString(`"fen":"` + bfen + `",`) + + b.WriteString(`"moves":[`) + + for idx, m := range p.Moves { + b.WriteString(`"` + m.String() + `"`) + if idx != len(p.Moves)-1 { + b.WriteByte(',') + } + } + + b.WriteByte(']') + b.WriteByte('}') + return b.Bytes(), nil +} + +func (w Winner) MarshalJSON() ([]byte, error) { + if n := int(w); n < len(winnerString) { + return []byte(`"` + winnerString[n] + `"`), nil + } + return nil, errors.New("invalid winner value") +} + +func (g GameState) MarshalJSON() ([]byte, error) { + if int(g) >= len(gameStatesSnake) { + return nil, errors.New("invalid game state") + } + return []byte(`"` + gameStatesSnake[g] + `"`), nil +} + +func (tc *TimeControl) MarshalJSON() ([]byte, error) { + if tc == nil { + return []byte("null"), nil + } + var buf bytes.Buffer + + buf.WriteByte('{') + buf.WriteString(`"seconds":` + strconv.Itoa(tc.Seconds) + `,`) + buf.WriteString(`"increment":` + strconv.Itoa(tc.Increment) + `,`) + buf.WriteString(`"started_at":"` + tc.StartedAt.Format(time.RFC3339) + `",`) + + buf.WriteString(`"move_timestamps":[`) + for idx, mt := range tc.MoveTimestamps { + buf.WriteString(`"` + mt.Format(time.RFC3339) + `"`) + if idx != len(tc.MoveTimestamps)-1 { + buf.WriteByte(',') + } + } + buf.WriteString("],") + + buf.WriteString(`"white_time":` + strconv.FormatInt(tc.WhiteTime.Milliseconds(), 10) + ",") + buf.WriteString(`"black_time":` + strconv.FormatInt(tc.BlackTime.Milliseconds(), 10)) + buf.WriteByte('}') + + return buf.Bytes(), nil +} + +func (p Player) MarshalJSON() ([]byte, error) { + u := users.GetUserByAddress(p.Address) + + var buf bytes.Buffer + buf.WriteByte('{') + + buf.WriteString(`"address":"` + p.Address.String() + `",`) + if u == nil { + buf.WriteString(`"username":"",`) + } else { + buf.WriteString(`"username":"` + u.Name() + `",`) + } + + for idx, cat := range categoryList { + stat := p.CategoryInfo[cat] + buf.WriteString(`"` + cat.String() + `":{`) + buf.WriteString(`"wins":` + strconv.Itoa(stat.Wins) + ",") + buf.WriteString(`"losses":` + strconv.Itoa(stat.Losses) + ",") + buf.WriteString(`"draws":` + strconv.Itoa(stat.Draws) + ",") + buf.WriteString(`"rating":`) + if res, err := (jsonPlayerRating{stat.PlayerRating}).MarshalJSON(); err != nil { + return nil, err + } else { + buf.Write(res) + } + buf.WriteByte(',') + buf.WriteString(`"position":` + strconv.Itoa(p.LeaderboardPosition(cat))) + buf.WriteByte('}') + if idx != len(categoryList)-1 { + buf.WriteByte(',') + } + } + + buf.WriteByte('}') + return buf.Bytes(), nil +} + +type jsonPlayerRating struct{ *glicko2.PlayerRating } + +func (p jsonPlayerRating) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + buf.WriteByte('{') + buf.WriteString(`"rating":` + formatFloat(p.Rating, 5) + `,`) + buf.WriteString(`"deviation":` + formatFloat(p.RatingDeviation, 5) + `,`) + buf.WriteString(`"volatility":` + formatFloat(p.RatingVolatility, 5)) + buf.WriteByte('}') + return buf.Bytes(), nil +} + +// XXX: dumb formatFloat implementation while we don't have strconv.FormatFloat +// https://github.com/gnolang/gno/pull/1464 +func formatFloat(f float64, decimals int) string { + if decimals > 10 { + decimals = 10 + } + neg := "" + if f < 0 { + f *= -1 + neg = "-" + } + const zeroes = "0000000000" // 10 zeroes + whole := math.Floor(f) + fractional := f - whole + leading := strconv.Itoa(int(whole)) + trailing := strconv.Itoa(int(fractional * 1e10)) + trailing = zeroes[:10-len(trailing)] + trailing + return neg + leading + "." + trailing +} diff --git a/realm/lobby.gno b/realm/lobby.gno index ed0ec639..9603a43c 100644 --- a/realm/lobby.gno +++ b/realm/lobby.gno @@ -64,21 +64,8 @@ var ( lobbyPlayer2Game avl.Tree // player addr -> *Game. set after a user is matched; reset when joining again. ) -// XXX: REMOVE BEFORE PRODUCTION -func LobbyData() string { - var buf bytes.Buffer - for idx, sublob := range lobby { - buf.WriteString("Sublobby " + strconv.Itoa(idx)) - for _, player := range sublob { - buf.WriteString("- " + player.player.Address.String()) - } - buf.WriteByte('\n') - } - return buf.String() -} - func LobbyJoin(seconds, increment int) { - std.AssertOriginCall() + assertOriginCall() var tc tcLobby switch { diff --git a/realm/lobby_test.gno b/realm/lobby_test.gno index dba1f223..2df41a5e 100644 --- a/realm/lobby_test.gno +++ b/realm/lobby_test.gno @@ -8,6 +8,8 @@ import ( "time" "internal/os_test" + + "gno.land/p/demo/chess/glicko2" ) func TestLobbyJoin(t *testing.T) { @@ -147,7 +149,7 @@ func TestLobbyGameFound(t *testing.T) { player: &Player{ Address: p.id, CategoryInfo: [CategoryMax]CategoryInfo{ - Blitz: {PlayerRating: &PlayerRating{Rating: p.rating}}, + Blitz: {PlayerRating: &glicko2.PlayerRating{Rating: p.rating}}, }, }, }) diff --git a/GOPHERCON_COMPETITION.md b/realm/raffle/GOPHERCON_COMPETITION.md similarity index 100% rename from GOPHERCON_COMPETITION.md rename to realm/raffle/GOPHERCON_COMPETITION.md diff --git a/realm/time.gno b/realm/time.gno index 302a5d92..637e5b4c 100644 --- a/realm/time.gno +++ b/realm/time.gno @@ -31,33 +31,6 @@ func NewTimeControl(seconds, incr int) *TimeControl { } } -func (tc *TimeControl) MarshalJSON() ([]byte, error) { - if tc == nil { - return []byte("null"), nil - } - var buf bytes.Buffer - - buf.WriteByte('{') - buf.WriteString(`"seconds":` + strconv.Itoa(tc.Seconds) + `,`) - buf.WriteString(`"increment":` + strconv.Itoa(tc.Increment) + `,`) - buf.WriteString(`"started_at":"` + tc.StartedAt.Format(time.RFC3339) + `",`) - - buf.WriteString(`"move_timestamps":[`) - for idx, mt := range tc.MoveTimestamps { - buf.WriteString(`"` + mt.Format(time.RFC3339) + `"`) - if idx != len(tc.MoveTimestamps)-1 { - buf.WriteByte(',') - } - } - buf.WriteString("],") - - buf.WriteString(`"white_time":` + strconv.FormatInt(tc.WhiteTime.Milliseconds(), 10) + ",") - buf.WriteString(`"black_time":` + strconv.FormatInt(tc.BlackTime.Milliseconds(), 10)) - buf.WriteByte('}') - - return buf.Bytes(), nil -} - // AddMove records that at the current time, a new move was added. func (tc *TimeControl) AddMove() (valid bool) { nd, v := tc.timedOut() diff --git a/realm/util.gno b/realm/util.gno deleted file mode 100644 index d9dc9192..00000000 --- a/realm/util.gno +++ /dev/null @@ -1,7 +0,0 @@ -package chess - -func checkErr(err error) { - if err != nil { - panic(err.Error()) - } -} diff --git a/testdata/addpkg_gnochess.txtar b/testdata/addpkg_gnochess.txtar deleted file mode 100644 index 35652d18..00000000 --- a/testdata/addpkg_gnochess.txtar +++ /dev/null @@ -1,5 +0,0 @@ -gnoland start -genesis-balances-file=${TMPDIR}/genesis_balances.txt -genesis-max-vm-cycles 100000000 - -sleep 500ms - -gnokey maketx addpkg -pkgdir ${ROOTDIR}/realm -pkgpath gno.land/r/demo/chess2 -gas-wanted 20000000 -gas-fee 1ugnot -chainid=tendermint_test -broadcast test1 diff --git a/tutorial/01_getting_started/gno.mod b/tutorial/01_getting_started/gno.mod index b1d10c52..cee66b96 100644 --- a/tutorial/01_getting_started/gno.mod +++ b/tutorial/01_getting_started/gno.mod @@ -1 +1 @@ -module gno.land/r/demo/001_getting_started +module gno.land/r/demo/x01_getting_started diff --git a/util/devnet/README.md b/util/devnet/README.md deleted file mode 100644 index 6e2a0872..00000000 --- a/util/devnet/README.md +++ /dev/null @@ -1,23 +0,0 @@ -# devnet dockerfiles - -Quickly set up a Gnochess devnet & hack interactively! - -Instructions: - -1. Install [`docker`](https://docs.docker.com/engine/install/) and [`docker compose`](https://docs.docker.com/compose/install/) -2. `cd` into this directory from your terminal -3. `docker compose` (or `docker compose -d`, if you want this to run in the - background) -4. Gnoweb should now be accessible from http://localhost:8888 -5. Set up the [test1 key](https://docs.onbloc.xyz/tutorials/start-writing-a-realm#deploying-locally) if you haven't already. -6. Use it to call the realm (visit `localhost:8888/r/demo/chess_XXXX`, XXXX is a - random number, you can check out what was generated for you by calling `docker compose logs deployer | grep 'publishing as'`). - If you visit the help page, gnoweb will generate some commands for you to - call the realm. - -Need more help? Check out a [small video tutorial](https://www.youtube.com/watch?v=-1huuUG2yRc). - -If you're doing local development in the `realm` subdirectory, changes will -synchronise automatically and the realm will be auto-published, however it will -be at a new address. This is published in the `deployer` logs (see above -command). diff --git a/util/devnet/deployer/Dockerfile b/util/devnet/deployer/Dockerfile deleted file mode 100644 index 2f0997e7..00000000 --- a/util/devnet/deployer/Dockerfile +++ /dev/null @@ -1,9 +0,0 @@ -FROM ghcr.io/gnolang/gno/gnochess:latest - -RUN apt-get update && \ - apt-get install -y entr dumb-init - -WORKDIR / -CMD [ "dumb-init", "./deployer.sh" ] - -ADD ./deployer.sh /deployer.sh diff --git a/util/devnet/deployer/deployer.sh b/util/devnet/deployer/deployer.sh deleted file mode 100755 index 209dedaf..00000000 --- a/util/devnet/deployer/deployer.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash -# Auto-deploys realm on any change. - -t1mnemonic="source bonus chronic canvas draft south burst lottery vacant surface solve popular case indicate oppose farm nothing bullet exhibit title speed wink action roast" -export SHELL="/bin/bash" - -if [ ! -f ".deployer.touch" ]; then - printf '\n\n%s\n\n' "$t1mnemonic" | gnokey add --recover --insecure-password-stdin test1 - touch .deployer.touch -fi - -cd realm/ - -sleep 7.5 # get gno node set up - -ls *.gno | entr -ns ' -path=gno.land/r/demo/chess_$RANDOM -echo "publishing as $path" -echo | gnokey maketx addpkg \ - --gas-wanted 50000000 \ - --gas-fee 1ugnot \ - --pkgpath $path \ - --pkgdir . \ - --insecure-password-stdin \ - --remote gnoland:26657 \ - --broadcast test1' diff --git a/util/devnet/docker-compose.yml b/util/devnet/docker-compose.yml deleted file mode 100644 index 95ba4e17..00000000 --- a/util/devnet/docker-compose.yml +++ /dev/null @@ -1,65 +0,0 @@ -version: "3.7" - -services: - web: - build: ../../web - networks: - - gnonode - ports: - - 1313:1313 - restart: on-failure - logging: - driver: "json-file" - options: - max-file: "10" - max-size: "100m" - deployer: - build: ./deployer - networks: - - gnonode - volumes: - - "../../realm:/realm" - restart: on-failure - logging: - driver: "json-file" - options: - max-file: "10" - max-size: "100m" - gnoweb: - image: ghcr.io/gnolang/gno/gnochess:latest - command: ["gnoweb", "-remote", "gnoland:26657", "-bind", "0.0.0.0:8888"] - working_dir: /opt/gno/src/gno.land - networks: - - gnonode - ports: - - 8888:8888 - restart: on-failure - logging: - driver: "json-file" - options: - max-file: "10" - max-size: "100m" - gnoland: - image: ghcr.io/gnolang/gno/gnochess:latest - environment: - - LOG_LEVEL=4 - command: ["gnoland", "start", "-genesis-max-vm-cycles", "100000000"] - volumes: - - "gnonode:/opt/gno/src/testdir" - - "./config.toml:/opt/gno/src/gno.land/testdir/config/config.toml" - working_dir: /opt/gno/src/gno.land - networks: - - gnonode - ports: - - 26657:26657 - restart: on-failure - logging: - driver: "json-file" - options: - max-file: "10" - max-size: "100m" - -networks: - gnonode: {} -volumes: - gnonode: {} diff --git a/util/gnoimport.go b/util/gnoimport.go index 6ab8198c..84321ffb 100644 --- a/util/gnoimport.go +++ b/util/gnoimport.go @@ -5,6 +5,7 @@ package main import ( + _ "github.com/gnolang/gno/contribs/gnodev" _ "github.com/gnolang/gno/gno.land/cmd/gnokey" _ "github.com/gnolang/gno/gnovm/cmd/gno" ) diff --git a/util/integration/integration_test.go b/util/integration/integration_test.go new file mode 100644 index 00000000..48907fba --- /dev/null +++ b/util/integration/integration_test.go @@ -0,0 +1,12 @@ +package integ + +import ( + "testing" + + integration "github.com/gnolang/gno/gno.land/pkg/integration" +) + +func TestIntegration(t *testing.T) { + t.Skip("Integration tests are currently disabled: https://github.com/gnolang/gnochess/issues/209") + integration.RunGnolandTestscripts(t, "testdata") +} diff --git a/util/integration/testdata/addpkg_gnochess.txtar b/util/integration/testdata/addpkg_gnochess.txtar new file mode 100644 index 00000000..41396ddb --- /dev/null +++ b/util/integration/testdata/addpkg_gnochess.txtar @@ -0,0 +1,5 @@ +gnoland start + +exec ls + +gnokey maketx addpkg -pkgdir $WORK/registry -pkgpath gno.land/r/registry -gas-fee 1000000ugnot -gas-wanted 2000000 -broadcast -chainid=tendermint_test test1 diff --git a/testdata/gnochess-scholars-mate.txtar b/util/integration/testdata/gnochess-scholars-mate.txtar similarity index 100% rename from testdata/gnochess-scholars-mate.txtar rename to util/integration/testdata/gnochess-scholars-mate.txtar diff --git a/util/devnet/config.toml b/util/node-config.toml similarity index 97% rename from util/devnet/config.toml rename to util/node-config.toml index 171b111d..c49ac4f4 100644 --- a/util/devnet/config.toml +++ b/util/node-config.toml @@ -1,3 +1,4 @@ +# This config is used in the Dockerfile to set up the default configuration. # This is a TOML config file. # For more information, see https://github.com/toml-lang/toml @@ -123,7 +124,7 @@ max_body_bytes = 1000000 max_header_bytes = 1048576 # The path to a file containing certificate that is used to create the HTTPS server. -# Migth be either absolute path or path related to tendermint's config directory. +# Might be either absolute path or path related to tendermint's config directory. # If the certificate is signed by a certificate authority, # the certFile should be the concatenation of the server's certificate, any intermediates, # and the CA's certificate. @@ -131,7 +132,7 @@ max_header_bytes = 1048576 tls_cert_file = "" # The path to a file containing matching private key that is used to create the HTTPS server. -# Migth be either absolute path or path related to tendermint's config directory. +# Might be either absolute path or path related to tendermint's config directory. # NOTE: both tls_cert_file and tls_key_file must be present for Tendermint to create HTTPS server. Otherwise, HTTP server is run. tls_key_file = "" @@ -139,7 +140,7 @@ tls_key_file = "" [p2p] # Address to listen for incoming connections -laddr = "tcp://0.0.0.0:36656" +laddr = "tcp://0.0.0.0:26656" # Address to advertise to peers for them to dial # If empty, will use the same port as the laddr,