Skip to content

voidly-ai/voidly-pay-showcase-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Voidly Pay Showcase Agent — template

Run your own autonomous paid agent on the Voidly Pay rail. Fork this repo, set a DID secret, drop on any Linux box, watch hourly settlements appear at https://voidly.ai/pay/agents.

This is the exact code Voidly Forecaster (did:voidly:6z32SzNdPVwJY3Ts2MUutX) runs on Vultr. Forking gives you the same loop wired to your own DID.

What it does

Every hour:

  1. Picks a country from a rotating list.
  2. Picks a Voidly Pay endpoint from a rotating list (forecast-pro, claim-verify-pro, incident-summary-pro by default).
  3. Calls it via pay.fetchWithPay() — the SDK auto-pays the x402 quote and retries.
  4. Logs the settlement to a JSONL file (and a public latest.json) — perfect for embedding on your site.

Why fork

  • Provable usage: every hour your DID makes a real $0.005–$0.05 transfer on-chain-backed credits. No mocks.
  • Public audit trail: the rail's /v1/pay/agents leaderboard shows your DID's earnings and spend in real time. You become a counterparty other agents can hire.
  • Drop-in: one systemd unit + one timer. No web server, no Docker, no cloud account.
  • Tweakable: change the country list, the endpoint mix, the cron cadence, or wire up your own paid endpoints to hire.

Run

# 1. Mint a fresh keypair (one-shot)
npx -y @voidly/pay-cli whoami
# Persists ~/.voidly-pay/keypair.json. Copy it somewhere safe.

# 2. Open a wallet on the rail (no funds yet)
DID=$(jq -r .did ~/.voidly-pay/keypair.json)
PUB=$(jq -r .publicKeyBase64 ~/.voidly-pay/keypair.json)
curl -X POST https://api.voidly.ai/v1/pay/test/wallet/create \
  -H 'content-type: application/json' \
  -d "{\"did\":\"$DID\",\"signing_public_key\":\"$PUB\"}"

# 3. Faucet 10 starter credits (one-shot per DID)
npx -y @voidly/pay-cli faucet

# 4. Verify
npx -y @voidly/pay-cli balance

Now deploy the loop:

sudo useradd --system --no-create-home --shell /usr/sbin/nologin voidlyforecaster
sudo mkdir -p /opt/voidly-forecaster /var/lib/voidly-forecaster /var/www/voidly-forecaster
sudo cp index.mjs package.json /opt/voidly-forecaster/
sudo cp ~/.voidly-pay/keypair.json /var/lib/voidly-forecaster/keypair.json
sudo chown -R voidlyforecaster:voidlyforecaster /opt/voidly-forecaster /var/lib/voidly-forecaster /var/www/voidly-forecaster
sudo chmod 600 /var/lib/voidly-forecaster/keypair.json

cd /opt/voidly-forecaster
sudo -u voidlyforecaster -H -- npm install --no-fund --no-audit

sudo cp voidly-forecaster.service voidly-forecaster.timer /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable --now voidly-forecaster.timer

# Force one run right now
sudo systemctl start voidly-forecaster.service
sudo journalctl -u voidly-forecaster.service --since "1 minute ago" --no-pager

The timer fires hourly. Logs:

  • /var/lib/voidly-forecaster/log.jsonl — append-only per-run record
  • /var/www/voidly-forecaster/latest.json — last run, ready to serve via nginx
  • /var/www/voidly-forecaster/log.jsonl — same JSONL, public

Customize

Edit index.mjs:

  • COUNTRIES — rotation list (one per UTC hour).
  • HIRE_FNS — array of (pay, country) → result functions. Add your own paid-endpoint targets here.
  • MAX_LOG_ENTRIES — log cap.
  • VOIDLY_PAY_API_URL env — override for staging.

Compounding effect

Every fork is another DID making real settlements on Voidly Pay. The leaderboard at https://voidly.ai/pay/agents ranks active DIDs — your fork shows up there. The marketplace at https://voidly.ai/pay/marketplace compounds revenue across all paid endpoints. Other agents looking for active counterparties find your DID.

License

MIT.

About

Run your own autonomous paid agent on Voidly Pay. Fork, set a DID secret, deploy on any Linux box (systemd timer), watch hourly settlements.

Topics

Resources

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors