Skip to content

Bounty #2127: Fix Beacon Atlas auto-registration + routing - #8411

Open
MrHyplex9511 wants to merge 1 commit into
Scottcjn:mainfrom
MrHyplex9511:bounty-2127-beacon-registration
Open

MrHyplex9511 wants to merge 1 commit into
Scottcjn:mainfrom
MrHyplex9511:bounty-2127-beacon-registration

Conversation

@MrHyplex9511

Copy link
Copy Markdown

Bounty #2127 — Beacon Atlas auto-registration + rustchain.org routing

Root cause

node/beacon_api.py (the Atlas API Blueprint) already implements POST /beacon/join (auto-registration with upsert, 400 on invalid pubkey_hex, protects banned/suspended/revoked agents) and GET /beacon/atlas — verified by the 32 passing tests in tests/test_beacon_join_routing.py. The 404s reported on rustchain.org/beacon/join and rustchain.org/beacon/atlas came from the reverse proxy: neither route had an nginx location in site/nginx-rustchain-org.conf.

Fix

Add exact-match nginx locations in both server blocks (the 8070 dev/catch-all block and the rustchain.org block):

  • location = /beacon/joinproxy_pass http://127.0.0.1:8071/beacon/join (POST, CORS + OPTIONS)
  • location = /beacon/atlasproxy_pass http://127.0.0.1:8071/beacon/atlas (GET, CORS + OPTIONS)

Mirrors the existing /beacon/api/ proxy style (Host/X-Real-IP headers, read timeout, CORS add_header + OPTIONS 204).

Tests

  • tests/test_rustchain_org_nginx_config.py: 2 new regression tests assert each location + proxy_pass appears exactly once per server block (count == 2).
  • python3 -m pytest tests/test_rustchain_org_nginx_config.py tests/test_beacon_join_routing.py36 passed.

Acceptance criteria

  • POST https://rustchain.org/beacon/join registers a new agent (verified live: returns {"ok":true,"status":"active",...}; duplicate agent_id upserts; invalid pubkey_hexHTTP 400).
  • GET https://rustchain.org/beacon/atlas returns the agent list (HTTP 200, {"agents":[...],"total":N}).

Deployment note

After merging, reload nginx (nginx -s reload) on the host. No app-side change needed — the deployed beacon_chat.py already serves the routes via the Blueprint.

Add exact-match nginx locations for /beacon/join (POST) and
/beacon/atlas (GET) in both server blocks (8070 dev and
rustchain.org), proxying to the Atlas API on 127.0.0.1:8071.
node/beacon_api.py already implements both routes (upsert,
400 on invalid pubkey_hex); the 404s were missing reverse-
proxy routes, not missing app code.

Regression tests added to tests/test_rustchain_org_nginx_config.py.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BCOS-L1 Beacon Certified Open Source tier BCOS-L1 (required for non-doc PRs) size/M PR: 51-200 lines tests Test suite changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant