Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
21db2f0
docs: add project spec and expand README
louis14448 May 18, 2026
c2fee83
feat(samourai-crew): add Dockerfile, refactor for remote RPC testing
louis14448 May 18, 2026
b32da00
feat: add funders/test-13.sh
louis14448 May 18, 2026
7fee421
feat: add root Makefile orchestrator
louis14448 May 18, 2026
58c05d1
ci: add GitHub Actions workflow for community tests
louis14448 May 18, 2026
1d7d01e
refactor: use throwaway account per test run, funded by test1
louis14448 May 18, 2026
bd5959b
refactor: dedicated test account per contributor, amount declared in …
louis14448 May 18, 2026
7ce0f6e
refactor: throwaway wallet per run, contributor template Makefile
louis14448 May 18, 2026
984286d
fix(samourai-crew): correct gnokey list address parsing
louis14448 May 18, 2026
99f100a
fix: reduce fund amount to 50M ugnot, exclude _template from contribu…
louis14448 May 18, 2026
f5129a8
chore: switch default network to test12
louis14448 May 18, 2026
c3d6033
chore: revert default network to test-13
louis14448 May 18, 2026
ce3c54f
chore: fix test-13 RPC URL
louis14448 May 18, 2026
177d543
docs: expand README with contributor guide
louis14448 May 18, 2026
25da0e7
fix: review corrections
louis14448 May 18, 2026
52dbe67
docs: document multi-wallet pattern in contributor guide
louis14448 May 19, 2026
30481ce
feat(samourai-crew): add sybil stress tests with N-wallet support
louis14448 May 19, 2026
27bd1f5
fix: derive REMOTE from first entry of REMOTES when set
louis14448 May 19, 2026
c3d4559
fix(stress): add gnomod.toml generation before addpkg
louis14448 May 19, 2026
daf3534
fix(stress): add gno version to gnomod.toml, update counter realm
louis14448 May 19, 2026
0c9594f
fix: fund stress wallets from test1, fix runtime_pkg detection
louis14448 May 19, 2026
5bf2c0b
fix: runner signs CLA before funding stress wallets
louis14448 May 19, 2026
d24fe2b
feat: add help target to all Makefiles
louis14448 May 19, 2026
f695f0e
docs: update README with REMOTES, help target, stress tests
louis14448 May 19, 2026
b0d30b7
refactor: switch to funder model with fixed accounts
louis14448 May 19, 2026
249933c
refactor(samourai-crew): 3 wallets, runner = stress_1
louis14448 May 19, 2026
a85c420
feat(samourai-crew): set wallet addresses and mnemonics
louis14448 May 19, 2026
be2c85f
fix(stress): use runner key for first RPC slot, stress_1 was duplicate
louis14448 May 19, 2026
1749467
fix: sign CLA automatically, increase gas for stress addpkg
louis14448 May 19, 2026
7cf502f
docs: update README and template for funder model with fixed accounts
louis14448 May 19, 2026
d5a4123
fix: parse CLA hash with hex pattern instead of quoted string
louis14448 May 19, 2026
adf0d7f
debug: show CLA query and signing output to diagnose failure
louis14448 May 19, 2026
cb18e14
fix: increase CLA signing gas from 2M to 5M
louis14448 May 19, 2026
aa6e6f3
fix: increase CLA signing gas to 10M
louis14448 May 19, 2026
b9fdf90
fix: sign CLA for all imported keys, not just runner
louis14448 May 19, 2026
a16790f
fix(stress): add timestamp suffix to counter realm path
louis14448 May 19, 2026
834888d
fix(funders): top up to needed amount instead of sending full amount
louis14448 May 19, 2026
f40b3b5
fix: review corrections (funder Docker, CLA order, ci.yml, cleanup)
louis14448 May 19, 2026
0466224
docs: fix FUNDER_SCRIPT variable name in README
louis14448 May 19, 2026
ea5daa0
clean_repos
louis14448 May 19, 2026
cc3adb1
ci: trigger on init-community-scripts branch
louis14448 May 20, 2026
df322d2
ci: add workflow_dispatch with network/test_type selector, multi-chai…
louis14448 May 20, 2026
cf68698
fix(ci): move matrix filter to step level (matrix not available in jo…
louis14448 May 20, 2026
ee86dfb
ci: replace network choice with boolean toggles per network
louis14448 May 20, 2026
889cf17
fix(ci): remove FUNDER_MNEMONIC env var, mnemonic is hardcoded in fun…
louis14448 May 20, 2026
00fdb67
refactor: rename funders/test-13.sh to funders/gnoland.sh
louis14448 May 20, 2026
1c05fc2
fix(stress): replace maketx run with maketx call to persist realm state
louis14448 May 20, 2026
06e0baa
fix(stress): fix counter query parsing (tail -1 to get last number, n…
louis14448 May 20, 2026
842dbaa
debug(stress): show first tx output to diagnose counter=0
louis14448 May 20, 2026
b2fb04d
fix(stress): revert to maketx run with dynamic increment.gno
louis14448 May 20, 2026
1d8dd60
fix(stress): check convergence not exact count
louis14448 May 20, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 91 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: Community Tests

on:
push:
branches: [main, init-community-scripts]
pull_request:
branches: [main]
workflow_dispatch:
inputs:
run_test13:
description: 'Run on test-13'
type: boolean
default: true
run_test12:
description: 'Run on test12'
type: boolean
default: true
test_type:
description: 'Test type'
type: choice
default: both
options: [one-shot, repeatable, both]

# Optional repository variables (Settings → Secrets and variables → Actions → Variables):
# vars.REMOTES_TEST13 — comma-separated RPC list for test-13
# vars.CHAINID_TEST13 — chain ID for test-13 (default: test-13)
# vars.REMOTES_TEST12 — comma-separated RPC list for test12
# vars.CHAINID_TEST12 — chain ID for test12 (default: test12)
#
# The test1 funder mnemonic is public and hardcoded in funders/ — no secret needed.
# The funder script runs inside a gnokey Docker container — no local
# gnokey installation required on the runner.

jobs:
tests-one-shot:
name: One-shot — ${{ matrix.network.name }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
network:
- name: test-13
remotes: ${{ vars.REMOTES_TEST13 || '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: ${{ vars.CHAINID_TEST13 || 'test-13' }}
- name: test12
remotes: ${{ vars.REMOTES_TEST12 || 'https://rpc.test12.testnets.gno.land' }}
chainid: ${{ vars.CHAINID_TEST12 || 'test12' }}

steps:
- uses: actions/checkout@v4

- name: Run one-shot tests
if: >
github.event_name != 'workflow_dispatch' ||
(inputs.test_type == 'one-shot' || inputs.test_type == 'both') && (
(matrix.network.name == 'test-13' && inputs.run_test13 == true) ||
(matrix.network.name == 'test12' && inputs.run_test12 == true)
)
run: |
make tests-one-shot \
REMOTES="${{ matrix.network.remotes }}" \
CHAINID=${{ matrix.network.chainid }}

tests-repeatable:
name: Repeatable — ${{ matrix.network.name }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
network:
- name: test-13
remotes: ${{ vars.REMOTES_TEST13 || 'https://rpc.test-13-aeddi-1.gnoland.network' }}
chainid: ${{ vars.CHAINID_TEST13 || 'test-13' }}
- name: test12
remotes: ${{ vars.REMOTES_TEST12 || 'https://rpc.test12.testnets.gno.land' }}
chainid: ${{ vars.CHAINID_TEST12 || 'test12' }}

steps:
- uses: actions/checkout@v4

- name: Run repeatable tests
if: >
github.event_name != 'workflow_dispatch' ||
(inputs.test_type == 'repeatable' || inputs.test_type == 'both') && (
(matrix.network.name == 'test-13' && inputs.run_test13 == true) ||
(matrix.network.name == 'test12' && inputs.run_test12 == true)
)
run: |
make tests-repeatable \
REMOTES="${{ matrix.network.remotes }}" \
CHAINID=${{ matrix.network.chainid }}
61 changes: 61 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
.PHONY: tests-one-shot tests-repeatable help

comma := ,
REMOTES ?=
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
GNOKEY_IMAGE ?= ghcr.io/gnolang/gno/gnokey:master

export FUNDER_MNEMONIC

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

# 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

## tests-one-shot : fund accounts then run one-shot tests (REMOTES, CHAINID)
tests-one-shot:
@for dir in $(CONTRIB_DIRS); do \
echo ""; \
echo "==> $$dir — funding (one-shot)"; \
ARGS=$$($(MAKE) -C $$dir list-funding-one-shot --no-print-directory \
REMOTE=$(REMOTE) REMOTES=$(REMOTES) CHAINID=$(CHAINID)); \
if [ -n "$$ARGS" ]; then \
$(call run-funder,$$ARGS) || exit 1; \
fi; \
echo "==> $$dir — tests (one-shot)"; \
$(MAKE) -C $$dir tests-one-shot --no-print-directory \
REMOTE=$(REMOTE) REMOTES=$(REMOTES) CHAINID=$(CHAINID) || exit 1; \
done

## tests-repeatable : fund accounts then run repeatable tests (REMOTES, CHAINID)
tests-repeatable:
@for dir in $(CONTRIB_DIRS); do \
echo ""; \
echo "==> $$dir — funding (repeatable)"; \
ARGS=$$($(MAKE) -C $$dir list-funding-repeatable --no-print-directory \
REMOTE=$(REMOTE) CHAINID=$(CHAINID)); \
if [ -n "$$ARGS" ]; then \
$(call run-funder,$$ARGS) || exit 1; \
fi; \
echo "==> $$dir — tests (repeatable)"; \
$(MAKE) -C $$dir tests-repeatable --no-print-directory \
REMOTE=$(REMOTE) CHAINID=$(CHAINID) || exit 1; \
done

## help : show available targets
help:
@grep -E '^## ' Makefile | sed 's/## / /'
141 changes: 140 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,141 @@
# community-scripts
A collection of various community scripts and tests that will eventually become mainstream

A collection of community-contributed test suites for [gnoland](https://gno.land) chains.

## Purpose

This repository lets contributors package their own tests and run them against any gnoland network via its RPC endpoint — no local node required. The goal is to provide a shared, extensible testing framework that can be wired into CI and executed against public testnets (e.g. `test-13`) or any custom deployment.

## Structure

```text
community-scripts/
├── Makefile # root orchestrator
├── funders/
│ └── gnoland.sh # funds test accounts from test1 (works on any gnoland network)
├── _template/
│ └── Makefile # copy-paste template for new contributors
└── <contributor>/
├── Makefile # exposes the 4 required rules (see below)
└── Dockerfile # self-contained test runner (any language)
```

## Makefile interface

Every contributor subdirectory must expose these four rules:

| Rule | Description |
| ------------------------- | ------------------------------------------------------------------- |
| `list-funding-one-shot` | Prints `address amount` pairs to fund before one-shot tests |
| `list-funding-repeatable` | Prints `address amount` pairs to fund before repeatable tests |
| `tests-one-shot` | Runs tests that deploy on-chain state (realm deploys...) |
| `tests-repeatable` | Runs tests that can be re-executed safely |

All rules accept `REMOTES` (comma-separated RPC list) and `CHAINID` variables.
`REMOTE` is automatically derived from the first entry in `REMOTES`.

Before each run, the root Makefile calls `list-funding-*`, passes the returned
addresses to the funder script (test1), then runs the tests.

Run `make help` from any directory to list available targets.

## Running tests

Against test-13 (default):

```sh
make tests-one-shot
make tests-repeatable
```

Against a single custom RPC:

```sh
make tests-one-shot REMOTES=https://rpc.test12.testnets.gno.land CHAINID=test12
```

Against multiple validator nodes (stress tests will hit each one):

```sh
make tests-one-shot \
REMOTES=https://rpc1.gnoland.network,https://rpc2.gnoland.network,https://rpc3.gnoland.network \
CHAINID=test-13
```

With a custom funder script:

```sh
make tests-one-shot FUNDER_SCRIPT=./funders/gnoland.sh REMOTES=... CHAINID=test-13
```

Directly from a contributor subdirectory:

```sh
cd samourai-crew
make help
make tests-one-shot REMOTES=https://rpc.test12.testnets.gno.land CHAINID=test12
```

## Adding your own tests

### 1. Create your directory

```sh
cp -r _template my-name
```

### 2. Generate a testnet keypair

Generate a dedicated testnet account for your tests (no real value):

```sh
gnokey generate # save the mnemonic
gnokey add my-test-account -recover
```

### 3. Edit the Makefile

Declare your test account address and funding amounts:

```makefile
ADDR_1 := g1your_address_here

FUND_AMOUNT_ONE_SHOT := 30000000ugnot # ~30 transactions at 1M ugnot each
FUND_AMOUNT_REPEATABLE := 10000000ugnot

list-funding-one-shot:
@echo "$(ADDR_1) $(FUND_AMOUNT_ONE_SHOT)"

list-funding-repeatable:
@echo "$(ADDR_1) $(FUND_AMOUNT_REPEATABLE)"
```

**Multiple wallets:** declare all addresses in `list-funding-*` as space-separated
`address amount` pairs. The funder will fund each one before the tests run.

### 4. Write your Dockerfile

Your `Dockerfile` must:

- Accept `one-shot` or `repeatable` as a command argument
- Contain your test account mnemonic (testnet key, no real value)
- Read `REMOTE`, `REMOTES`, and `CHAINID` from env
- Sign the network CLA if required (see `samourai-crew/run_tests.sh` for an example)

The image can use **any language** (shell, Go, Python, etc.). See `samourai-crew/` for a shell-based example.

### 5. What your container receives at runtime

| Variable | Description |
| --------- | --------------------------------------------------- |
| `REMOTE` | Primary RPC endpoint (first entry of `REMOTES`) |
| `REMOTES` | Comma-separated list of RPC endpoints |
| `CHAINID` | Chain ID |

The funding has already been done by the time your container starts.

## Current contributors

| Directory | Description |
| --------------- | ------------------------------------------------------------------ |
| `samourai-crew` | GnoVM audit scripts, E2E transaction tests, and sybil stress tests |
47 changes: 47 additions & 0 deletions _template/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
.PHONY: list-funding-one-shot list-funding-repeatable tests-one-shot tests-repeatable build help

# Override REMOTES and CHAINID to target a live network:
# make tests-one-shot REMOTES=https://rpc.test-13-aeddi-1.gnoland.network CHAINID=test-13
comma := ,
REMOTES ?=
REMOTE ?= $(if $(REMOTES),$(firstword $(subst $(comma), ,$(REMOTES))),http://127.0.0.1:26657)
CHAINID ?= test
IMAGE := $(shell basename $(CURDIR))

# TODO: replace with your testnet account address(es)
ADDR_1 := TODO_REPLACE_ADDR_1

# Funding amounts — adjust to match your tests' gas needs (~1M ugnot per tx)
FUND_AMOUNT_ONE_SHOT := 30000000ugnot
FUND_AMOUNT_REPEATABLE := 10000000ugnot

## list-funding-one-shot : print address/amount pairs to fund before one-shot tests
list-funding-one-shot:
@echo "$(ADDR_1) $(FUND_AMOUNT_ONE_SHOT)"

## list-funding-repeatable : print address/amount pairs to fund before repeatable tests
list-funding-repeatable:
@echo "$(ADDR_1) $(FUND_AMOUNT_REPEATABLE)"

## build : build the Docker test image
build:
docker build -t $(IMAGE) .

## tests-one-shot : run one-shot tests (REMOTES, CHAINID)
tests-one-shot: build
docker run --rm \
-e REMOTE=$(REMOTE) \
-e REMOTES=$(REMOTES) \
-e CHAINID=$(CHAINID) \
$(IMAGE) one-shot

## tests-repeatable : run repeatable tests (REMOTES, CHAINID)
tests-repeatable: build
docker run --rm \
-e REMOTE=$(REMOTE) \
-e CHAINID=$(CHAINID) \
$(IMAGE) repeatable

## help : show available targets
help:
@grep -E '^## ' Makefile | sed 's/## / /'
Loading