Network hub shadow mode (Marty 2026-11-13): hubreport.js reports every on-chain member to the hub as a contract bind by wallet (one way; unknown wallets kept and re-asked every 6 h), visible in /api/admin/status; off unless HUB_ENABLED
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -13,6 +13,7 @@ const board = require('./board');
|
||||
const safety = require('./safety');
|
||||
const keeper = require('./keeper');
|
||||
const { iface } = require('./abi');
|
||||
const hubreport = require('./hubreport'); // network hub, shadow mode: members reported by wallet (2026-11-13), off unless HUB_ENABLED
|
||||
const networksso = require('./networksso'); // network sign-in: arrive signed in from InstantAdPay or LinkSpin (2026-11-13), see networksso.js
|
||||
const SEL = { buy: iface.getFunction('buy').selector, buyFor: iface.getFunction('buyFor').selector }; // the browser builds calldata from these (ABI stays in abi.js)
|
||||
|
||||
@@ -20,6 +21,7 @@ const C = cfgMod.get();
|
||||
fs.mkdirSync(path.join(C.dataDir, 'art'), { recursive: true });
|
||||
store.load();
|
||||
chain.init();
|
||||
hubreport.init({ dataDir: C.dataDir, members: () => chain.allMembers() });
|
||||
keeper.init();
|
||||
|
||||
const PUB = path.join(__dirname, 'public');
|
||||
@@ -340,7 +342,7 @@ const server = http.createServer(async (req, res) => {
|
||||
// -- admin (ADMIN_TOKEN header): keeper preview + index status. No key material is ever returned.
|
||||
if (p === '/api/admin/status' && req.method === 'GET') {
|
||||
const tok = process.env.ADMIN_TOKEN; if (!tok || req.headers['x-admin-token'] !== tok) return json(res, 401, { error: 'no' });
|
||||
return json(res, 200, { index: chain.status(), totals: chain.totals(), keeper: keeper.statusInfo() });
|
||||
return json(res, 200, { index: chain.status(), totals: chain.totals(), keeper: keeper.statusInfo(), hub: hubreport.view() });
|
||||
}
|
||||
|
||||
if (p.startsWith('/api/')) return json(res, 404, { error: 'Not found' });
|
||||
|
||||
Reference in New Issue
Block a user