Skip to content

Init community scripts#1

Open
louis14448 wants to merge 51 commits into
gnoverse:mainfrom
louis14448:init-community-scripts
Open

Init community scripts#1
louis14448 wants to merge 51 commits into
gnoverse:mainfrom
louis14448:init-community-scripts

Conversation

@louis14448
Copy link
Copy Markdown

@louis14448 louis14448 commented May 18, 2026

Sets up the initial community test framework and adds the first contributor
test suite (samourai-crew).

Framework (Makefile, _template/, .github/):

  • Root Makefile orchestrator that auto-discovers contributor subdirectories
  • Contributor template (_template/Makefile) with the 4 required rules
  • GitHub Actions CI with multi-network matrix (test-13, test12), triggered on push/PR to main
  • Funder script runs inside a gnokey Docker container — no local gnokey required on the runner

Contributor contract (Makefile interface):
Every contributor subdirectory exposes 4 rules:
list-funding-one-shot, list-funding-repeatable,
tests-one-shot, tests-repeatable

Each contributor declares their testnet account addresses in list-funding-*.
The funder script (test1) tops up those accounts before each run.
Mnemonics are baked into each contributor's Dockerfile (testnet keys, no real value).

samourai-crew test suite:

  • 8 GnoVM audit scripts (regression tests for specific gnovm bugfixes)
  • 3 E2E transaction tests (nonce replay, counter realm, mempool stress)
  • 3 Sybil stress tests (multi-validator convergence verification)
  • Self-contained Docker image based on ghcr.io/gnolang/gno/gnokey:master

After merge — configure these repository variables (Settings → Secrets and variables → Actions → Variables):

Variable Description Default
REMOTES_TEST13 Comma-separated RPC list for test-13 https://rpc.test-13-aeddi-1.gnoland.network,https://rpc.test-13-gfanton-1.gnoland.network,https://rpc.test-13-moul-1.gnoland.network
CHAINID_TEST13 Chain ID for test-13 test-13
REMOTES_TEST12 Comma-separated RPC list for test12 https://rpc.testnet12.samourai.live,http://sentry1.test12.gno.berty.io:27657,https://rpc.test12.moul.p2p.team
CHAINID_TEST12 Chain ID for test12 test12

Also: test1 on test-13 needs to be funded for the funder script to work.

Test plan

  • make tests-one-shot REMOTES=<rpc_list> CHAINID=<id> runs successfully
  • make tests-repeatable REMOTES=<rpc_list> CHAINID=<id> runs successfully
  • CI workflow triggers on push to main
  • make help lists available targets from any directory

louis14448 added 30 commits May 18, 2026 14:17
Adds project.md with the contributor contract (4 Makefile rules, Docker
constraint, funder flow). Expands README to document repo purpose, structure,
the Makefile interface, and how to run tests against a remote RPC.
Replaces the local-node docker-compose setup with a self-contained
Dockerfile (ghcr.io/gnolang/gno/gnokey base). Tests now run against
any remote RPC via REMOTE/CHAINID env vars.

- Adds Dockerfile (runner only, no gnoland node)
- Rewrites Makefile with the 4 required rules + REMOTE/CHAINID vars
- Rewrites run_tests.sh: mode-aware (one-shot/repeatable), uses REMOTE
- Updates common.sh: RPC resolved from REMOTE, supports FUNDER_MNEMONIC
- Removes docker-compose.yml
Script that funds a list of addresses from the test1 faucet account.
Reads addresses as positional arguments, configurable via REMOTE,
CHAINID, FUNDER_MNEMONIC, and AMOUNT env vars.
Iterates over all contributor subdirs, calls list-funding-* to collect
addresses, passes them to the FUNDER script, then runs tests-*.
Configurable via REMOTE, CHAINID, and FUNDER.
Runs one-shot and repeatable tests against test-13 on push/PR to main.
Uses a matrix of networks for future extensibility. FUNDER_MNEMONIC
is read from repository variables (vars.FUNDER_MNEMONIC), falling back
to the public test1 mnemonic if not configured.
Each test run now generates a fresh keypair via `gnokey generate`,
funds it from test1 (FUNDER_MNEMONIC), and uses it to sign all test
transactions. No per-contributor secret is needed.

- run_tests.sh: generates runner account, funds it, exports KEY/KEY_ADDR
- common.sh: KEY_ADDR is now overridable, removed hardcoded key import
- samourai-crew/Makefile: list-funding-* return empty (funding internal)
- root Makefile: exports FUNDER_MNEMONIC to sub-makes
- ci.yml: only FUNDER_MNEMONIC env var needed, comment updated
…Makefile

Each contributor now owns a fixed testnet keypair. The address and the
funding amount needed are declared in their Makefile's list-funding-*
rules. The funder script (test1) sends the exact amount before each run.
The mnemonic is baked into the Dockerfile — it is a testnet-only key
with no real value.

- samourai-crew: new keypair (g1hvl0529gtj4fgtsuaurg4hcruuya2l9nuh04uj)
- list-funding-*: now outputs "address amount" pairs
- run_tests.sh: removed account generation and self-funding logic
- funders/test-13.sh: accepts address/amount pairs
- root Makefile: passes address+amount args to the funder script
Each test container now generates a fresh throwaway wallet at startup,
funds it from test1 (FUNDER_MNEMONIC), and discards it after the run.
The Makefile is the single interface — contributors declare the amount
needed (list-funding-*) and the image to run (tests-*). No pre-existing
wallet or per-contributor secret required.

- _template/Makefile: copy-paste template for new contributors
- samourai-crew/Makefile: IMAGE from dirname, FUND_AMOUNT vars
- samourai-crew/Dockerfile: removed hardcoded key, added FUND_AMOUNT env
- samourai-crew/run_tests.sh: generates throwaway wallet, self-funds
- root Makefile: simplified, funding handled inside containers
- ci.yml: only FUNDER_MNEMONIC needed, no funding step in CI
test-13 has restricted token transfers. test12 has a genesis test1
balance of ~9.2e18 ugnot — sufficient for unlimited test runs.
- Remove funders/ (unused in current flow)
- Align FUND_AMOUNT fallback to 50M ugnot
- Clean up common.sh fallbacks (KEY_ADDR empty, KEY=runner)
- Add comment in _template/Makefile on REMOTE override
- Update README structure
Three stress scripts targeting N validators simultaneously via REMOTES:
- sybil_chaos: full parallel bombardment
- sybil_precision: sequential per wallet with delay, parallel across wallets
- sybil_salted_chaos: ultra-parallel fire-and-forget with memo salt

Each script generates N throwaway wallets (one per RPC), deploys its own
counter realm, funds the wallets from the runner, then bombards in parallel.
Final state is verified for convergence across all nodes.

- Dockerfile: add bash + jq, copy stress/ and realms/
- realms/counter/counter.gno: shared counter realm source
- run_tests.sh: export REMOTES/FUND_AMOUNT_PER_WALLET, add stress to one-shot
- Makefile: add REMOTES, FUND_AMOUNT_PER_WALLET, raise FUND_AMOUNT_ONE_SHOT
On networks with restricted transfers (test-13, test12), accounts must
sign the CLA (gno.land/r/sys/cla) before they can initiate transfers.
run_tests.sh now fetches the CLA hash and signs it with the runner key
right after funding. Stress scripts reverted to use runner (not funder)
to fund their wallets, preserving the intended architecture.
Goes back to the spec's funder model: test1 funds all accounts before
the tests run, each contributor declares their fixed accounts in
list-funding-* (address + amount pairs).

- Restore funders/test-13.sh
- Root Makefile: add FUNDER= param, call list-funding-* then funder then tests
- samourai-crew/Makefile: list-funding-* returns fixed addresses (TODO placeholders)
- samourai-crew/Dockerfile: bake runner + stress wallet mnemonics (TODO placeholders)
- run_tests.sh: import fixed keys from mnemonics, no more throwaway generation
- stress scripts: use pre-imported stress_1/2/3 keys, no more dynamic wallet creation
- Fill in the 3 samourai-crew test account addresses and mnemonics
- funders/test-13.sh: skip funding if wallet already has sufficient balance
louis14448 added 21 commits May 19, 2026 16:16
- Makefile: funder runs via Docker (no local gnokey needed on CI runner)
  FUNDER_MNEMONIC passed via -e (inherits from env, handles spaces)
- run_tests.sh: import all keys before CLA signing loop
- ci.yml: fix comment (no throwaway wallet), add REMOTES for multi-validator
- Dockerfile: remove unused FUND_AMOUNT env vars
- samourai-crew/Makefile: remove stale TODO comment
maketx call doesn't persist realm state correctly in this context.
maketx run with a dynamically generated increment.gno that imports
the freshly deployed counter realm is the correct approach.
The counter=0 bug was due to query parsing (now fixed with tail -1).
The sybil tests verify that all validators agree on the same state,
not that every transaction committed. Under parallel load, some txs
fail due to nonce conflicts — this is expected behavior.
PASS if all nodes show the same value AND at least one tx committed.
Comment thread samourai-crew/Makefile
Comment on lines +9 to +17
# 3 wallets — wallet 1 is both the runner (audit/e2e) and stress_1 (first RPC)
ADDR_1 := g1hzlg063fqrq4gltql992ssjc0xzau89t5jp63w
ADDR_2 := g174tsxfpf8zj8h3tyrz4ld690xvhcjnquls6ffc
ADDR_3 := g19xnaenyhe88emmge4726ta43lp3n237vvuzc2n

# wallet 1 gets more funds: covers audit/e2e + stress role
FUND_AMOUNT_WALLET_1 := 50000000ugnot
FUND_AMOUNT_PER_WALLET := 15000000ugnot
FUND_AMOUNT_REPEATABLE := 10000000ugnot
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know what the logic of your scripts is, but it seems strange to me that all of this is hardcoded in your Makefile.
Also the fact that your addresses are duplicated between your Dockerfile, your Makefile, and probably other parts of the code creates multiple sources of truth and leads to errors in the end. It would be better if a single global file contained this kind of information and was imported by the different scripts that need it.

Comment thread samourai-crew/Makefile
.PHONY: list-funding-one-shot list-funding-repeatable tests-one-shot tests-repeatable build help

comma := ,
REMOTES ?=
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why REMOTES when we have REMOTE?
It seems confusing to me. The README only explains that it is a comma-separated list but does not explain why we would pass multiple remotes.
Also, the comment for tests-repeatable seems wrong, it mentions REMOTES but does not seem to use it. By the way, why would one-shot use it but not repeatable?

Comment thread Makefile

# Contributor subdirectories are detected automatically.
CONTRIB_DIRS := $(filter-out _%, $(patsubst %/Makefile,%,$(wildcard */Makefile)))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move them to a tests subdir please, it will be cleaner and less error prone.

Comment thread Makefile
REMOTE ?= $(if $(REMOTES),$(firstword $(subst $(comma), ,$(REMOTES))),https://rpc.test-13-aeddi-1.gnoland.network)
CHAINID ?= test-13
FUNDER_SCRIPT ?= ./funders/gnoland.sh
FUNDER_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
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you remove this please?
This should not be here, the root Makefile should be completely agnostic of this kind of thing.
Some funder scripts may use multiple addresses, others may use a faucet, etc.

Comment thread Makefile
CHAINID ?= test-13
FUNDER_SCRIPT ?= ./funders/gnoland.sh
FUNDER_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
GNOKEY_IMAGE ?= ghcr.io/gnolang/gno/gnokey:master
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same thing for this gnokey image: if my funder script doesn’t need gnokey to work, it shouldn’t be in the root Makefile. Can you remove it please?

Comment thread Makefile
Comment on lines +16 to +27
# Run the funder script inside a gnokey Docker container.
# No local gnokey installation required — compatible with GitHub Actions.
define run-funder
docker run --rm \
-e REMOTE=$(REMOTE) \
-e CHAINID=$(CHAINID) \
-e FUNDER_MNEMONIC \
-v "$(CURDIR)/funders:/funders:ro" \
--entrypoint /bin/sh \
$(GNOKEY_IMAGE) \
/funders/$(notdir $(FUNDER_SCRIPT)) $(1)
endef
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this entirely please.
This Makefile should just take a funder script path as parameter, and call it with CHAIN_ID + REMOTE and the account / amount. No matters if it use a mnemonic, gnokey or anything else.

Comment thread funders/gnoland.sh
Comment on lines +1 to +8
#!/bin/sh
# Funds a list of address/amount pairs from the test1 faucet on test-13.
# Usage: test-13.sh <addr1> <amount1> [<addr2> <amount2> ...]
#
# Required env:
# REMOTE — RPC endpoint (default: https://rpc.test-13-aeddi-1.gnoland.network)
# CHAINID — chain ID (default: test-13)
# FUNDER_MNEMONIC — test1 mnemonic (default: public test1 mnemonic)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment is outdated

Comment thread funders/gnoland.sh
Comment on lines +13 to +15
PASSWORD="test1234"
GNOKEY_HOME="${GNOKEY_HOME:-/tmp/gnokey-funder}"
FUNDER_KEY="funder"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this should be removed and hardcoded below. There is no point to change them.

Comment thread funders/gnoland.sh
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be cleaner to have a gnokey-send.sh script or similar which take as params: REMOTE, CHAIN_ID, SENDER_MNEMONIC (and it just fails if one of this param is not passed, this script is generic, don't set any default values).

Then have a thin test-13.sh wrapper which just call gnokey-send.sh with the right REMOTE, CHAIN_ID, SENDER_MNEMONIC (test1) + pass through the dest address and amount to send.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And later on, just add a thin test-14.sh wrapper, etc. without duplicating code.

Comment thread .github/workflows/ci.yml
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you make all this generic please by removing:

  • the run_test13 and run_test12 inputs (keep the test_type choice as is)
  • the push and pull_request triggers

And by adding:

  • the text input fields: chain_id, remote, and funder_script
  • a workflow_call trigger with the same 4 inputs as the workflow_dispatch one

Then create a test-13.yml with the triggers push on main, pull_request on main, and a workflow_dispatch with only one input test_type. This test-13 workflow calls the generic workflow with the right test-13 chain_id, remote, and funder_script.

This way, we can launch a workflow_dispatch on test-13 with a single click or run a custom one if we want to. And we might later add a cron job in test-13.yml that won’t be the same as for the other chains.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants