Compare commits

...

4 Commits

Author SHA1 Message Date
martbost 86007f0784 Footer network links carry a referral username (Marty 2026-11-15): the signed-in member's own (/api/me), else the referral the visitor came in on (?ref= on the page, remembered for the visit, then the iap.sponsor join cookie; usernames only, never a member number or wallet). Tracked links get it as s1 (LinkSpin sends it on as ?ref=), plain links as ?ref=, none for Earners Corner. Same approach as VBB 6798503. common.js + netline.js ?v=20261115nr. NOT deployed (another lane owns the LinkSpin deploy).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 07:59:33 -06:00
martbost 6607e39e30 Partner tracked links generalized (2026-11-15): POST /api/partner/<site>/links for site dh (DownlineHydra programs) or vab (ViralAdBlitz text ads, the ad id as s1/placement). PARTNER_LINKS maps each site to its network template + link name; keys dh:<id> / vab:<id> keep the two apart; items take program or id. Catalog viraladblitz template gains clickid/placement/s1 params. qa/partner-vablinks.test.mjs 13/13 (signature, unknown site refused, source, edit keeps the code, dh vs vab apart, stats per site); run.sh netsrc runs netsrc 17/17 + partner-dhlinks 13/13 + partner-vablinks 13/13. LOCAL ONLY.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 06:20:23 -06:00
martbost e23d9ecbdb ViralAdBlitz as a network site (2026-11-15): network sign-in by wallet to ViralAdBlitz (networksso wallets.viraladblitz = VAB_URL, default https://viraladblitz.com; NAMES viraladblitz), fixed network link nwvab -> https://viraladblitz.com/{s2}?ref={s1} on the admin account, catalog network template viraladblitz + NET_SRC vab/viraladblitz (merged by hand beside d6e8de3's dh entry), netsites CODES viraladblitz: nwvab. qa: netsrc 17/17 (seven network links), partner-dhlinks 13/13. LOCAL ONLY.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 06:06:31 -06:00
martbost d6e8de3e6a Partner endpoint for DownlineHydra tracked program links (Marty 2026-11-15): POST /api/partner/dh/links, net.v1-signed with NETWORK_SSO_SECRET. op ensure makes or updates one link per program on the member's own account (by email, else network username), tagged with a new 'DownlineHydra' network source and the program id as sub-id (?s1=&placement=), clean link host from domains.hosts(); op stats answers clicks per program. rotator.ensurePartner / partnerStats; catalog template downlinehydra; NET_SRC dh. qa/partner-dhlinks.test.mjs 13/13, partner-spins 13/13, netsrc 16/16. LOCAL ONLY, not pushed or deployed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 05:26:46 -06:00
37 changed files with 350 additions and 48 deletions
+1 -1
View File
@@ -110,7 +110,7 @@ function head(o) {
+ '</head><body><div class="wrap bl">';
}
function tail() {
return '</div><script src="/assets/common.js?v=20261114ns"></script><script src="/assets/blog-page.js?v=20260914a"></script></body></html>';
return '</div><script src="/assets/common.js?v=20261115nr"></script><script src="/assets/blog-page.js?v=20260914a"></script></body></html>';
}
const authorBox = () => '<div class="author"><img src="/logo-icon.png" alt="LinkSpin"><div><b>' + AUTHOR + '</b><span>Founder of LinkSpin and the Crypto Team Build Network. Twenty-plus years of internet marketing, and a habit of writing down what actually worked.</span></div></div>';
const cardHtml = p => '<a class="post-card" href="/blog/' + esc(p.slug) + '">' + (p.cover ? '<img src="' + esc(p.cover) + '" alt="" loading="lazy" style="width:100%;border-radius:10px;margin:0 0 12px">' : '') + '<h2>' + esc(p.title) + '</h2><p>' + esc(p.excerpt) + '</p><p class="meta">' + fmtDate(p.publishedAt || p.created) + ' · ' + readMinutes(p.body) + ' min read' + (p.tags.length ? ' · ' + p.tags.map(esc).join(', ') : '') + '</p></a>';
+60
View File
@@ -59,6 +59,36 @@
"verified": true,
"source": "network"
},
{
"key": "downlinehydra",
"name": "DownlineHydra",
"site": "downlinehydra.com",
"costModel": "",
"params": [
{
"key": "clickid",
"token": "{clickid}",
"label": "Click id",
"role": "externalId"
},
{
"key": "placement",
"token": "{program}",
"label": "Program",
"role": "param"
},
{
"key": "s1",
"token": "{program}",
"label": "Program (sub-id)",
"role": "param"
}
],
"postbackUrl": "",
"notes": "DownlineHydra downline builder. Your saved referral links for outside programs (wild heads and my heads) go out as LinkSpin links: every click carries the program id as placement and s1, so Reports split them by program.",
"verified": true,
"source": "network"
},
{
"key": "instantadpay",
"name": "InstantAdPay",
@@ -81,6 +111,36 @@
"verified": true,
"source": "network"
},
{
"key": "viraladblitz",
"name": "ViralAdBlitz",
"site": "viraladblitz.com",
"costModel": "",
"params": [
{
"key": "clickid",
"token": "{clickid}",
"label": "Click id",
"role": "externalId"
},
{
"key": "placement",
"token": "{ad}",
"label": "Text ad",
"role": "param"
},
{
"key": "s1",
"token": "{ad}",
"label": "Text ad (sub-id)",
"role": "param"
}
],
"postbackUrl": "",
"notes": "Crypto Team Build Network text-ad site. Clicks that arrive from ViralAdBlitz (its footer, its promo kit) carry ?src=viraladblitz and are counted under this source automatically. Your own ViralAdBlitz text ad goes out as a LinkSpin link on your account: every click carries the ad id as placement and s1.",
"verified": true,
"source": "network"
},
{
"key": "stackpol",
"name": "Stack POL",
+1 -1
View File
@@ -146,7 +146,7 @@ async function renderPage() {
const w = winners();
if (w.length) h += '<h2 style="font-size:24px;margin:0 0 10px">Past winners</h2>' + w.slice(0, 12).map(x => '<div class="win"><b>' + (x.kind === 'week' ? 'Week of ' : 'Month of ') + fmtD(x.start) + '</b>: ' + (x.top[0] ? esc(x.top[0].name) + ' (' + x.top[0].sales + ' sold, $' + x.top[0].usd + ')' : 'no sales') + (x.granted && x.granted.length ? ' · awarded: ' + x.granted.map(g => esc(g.name) + ' +' + g.credits.toLocaleString()).join(', ') : (x.prize ? ' · prize ' + esc(x.prize) : '')) + '</div>').join('');
h += '<p class="muted small" style="margin-top:30px">Sales are $ of packages bought by members you directly sponsor. Weekly and monthly prizes are advertising credits or packages, never cash. No income is guaranteed.</p>';
h += '</div><script src="/assets/common.js?v=20261114ns"></script><script src="/assets/blog-page.js?v=20260914a"></script></body></html>';
h += '</div><script src="/assets/common.js?v=20261115nr"></script><script src="/assets/blog-page.js?v=20260914a"></script></body></html>';
return h;
}
function setLaunchPanel(fn) { if (R) R.launchPanel = fn; }
+1
View File
@@ -11,6 +11,7 @@ const SITES = [
{ id: 'linkspin', code: 'nwls', name: 'LinkSpin', url: 'https://linkspin.app/{s2}?ref={s1}' },
{ id: 'dlb', code: 'nwdlb', name: 'Downline Banners', url: 'https://downlinebanners.com/{s2}?ref={s1}' },
{ id: 'vbb', code: 'nwvbb', name: 'Viral Banner Blitz', url: 'https://viralbannerblitz.com/{s2}?ref={s1}' },
{ id: 'viraladblitz', code: 'nwvab', name: 'ViralAdBlitz', url: 'https://viraladblitz.com/{s2}?ref={s1}' },
{ id: 'stackpol', code: 'nwsp', name: 'Stack POL', url: 'https://stackpol.com/{s2}?ref={s1}' },
{ id: 'earnerscorner', code: 'nwec', name: 'Earners Corner', url: 'https://earnerscorner.com/{s2}' }
];
+1 -1
View File
@@ -36,7 +36,7 @@ function list() { if (Date.now() - cache.at > TTL) refresh(); return cache.list;
// entry also gets go = the LinkSpin network link for that site with ?src=<this site>, so a click shows in LinkSpin Reports under the
// site that sent it (LinkSpin netlinks.js: fixed codes on the admin account). This site = NETWORK_SITE_ID, else the request host.
// No go for this site itself, or when this site cannot be told (a test host): the page then uses the plain url.
const CODES = { iap: 'nwiap', linkspin: 'nwls', dlb: 'nwdlb', vbb: 'nwvbb', stackpol: 'nwsp', earnerscorner: 'nwec' };
const CODES = { iap: 'nwiap', linkspin: 'nwls', dlb: 'nwdlb', vbb: 'nwvbb', viraladblitz: 'nwvab', stackpol: 'nwsp', earnerscorner: 'nwec' };
const linksBase = () => String(process.env.NETWORK_LINKS_BASE || 'https://linkspin.app').trim().replace(/\/+$/, '');
const hostOf = u => { try { return new URL(u).hostname.toLowerCase().replace(/^www\./, ''); } catch (e) { return ''; } };
function selfId(req, l) {
+1 -1
View File
@@ -39,7 +39,7 @@ const BACK_AGE = 1200; // seconds: the provider remembers an unf
const TRIED_AGE = 1800; // seconds: one silent check per browser per 30 minutes
const OFF_AGE = 12 * 3600; // seconds: no silent check after a sign-out on this site
const HINT_AGE = 300; // seconds: the email prefill when the member is not here yet
const NAMES = { iap: 'InstantAdPay', linkspin: 'LinkSpin', bannerline: 'Downline Banners', vbb: 'Viral Banner Blitz' }; // vbb = Viral Banner Blitz, a wallet site like Downline Banners (2026-11-14)
const NAMES = { iap: 'InstantAdPay', linkspin: 'LinkSpin', bannerline: 'Downline Banners', vbb: 'Viral Banner Blitz', viraladblitz: 'ViralAdBlitz' }; // vbb = Viral Banner Blitz, a wallet site like Downline Banners (2026-11-14); viraladblitz = ViralAdBlitz, a wallet site like VBB (2026-11-15)
const WALLET_RE = /^0x[0-9a-f]{40}$/;
let C = null; // { self, peer, peerBase(), isProd, dataDir, db, member(req), accept(email, req, v), signIn(email, req, v), landing(to), signinPath(to), defaultPath,
+1 -1
View File
@@ -548,7 +548,7 @@
</div>
</div>
<script src="/assets/common.js?v=20261114ns"></script>
<script src="/assets/common.js?v=20261115nr"></script>
<script src="/assets/admin-kb.js?v=20261020kb"></script>
<script src="/assets/admin.js?v=20261112txt"></script><script src="/assets/admin-sponsorcheck.js?v=20261107tg"></script><script src="/assets/admin-refill.js?v=20261024rf"></script><script src="/assets/admin-kits.js?v=20261024kit"></script><script src="/assets/admin-launchweek.js?v=20261105lw"></script>
</body>
+24 -4
View File
@@ -70,19 +70,39 @@ window.IAP = (function () {
if (!netList) netList = fetch('/api/network-sites').then(r => r.json()).then(l => (Array.isArray(l) && l.length ? l : NET_FALLBACK)).catch(() => NET_FALLBACK);
return netList;
}
// the footer links carry a referral username (Marty 2026-11-15): the signed-in member's own, else the referral this visitor came in on
// (?ref= on this page, remembered for the visit, then the iap.sponsor join cookie; usernames only, never a member number or wallet).
// Tracked links get it as s1 (LinkSpin sends it on as ?ref=), plain links as ?ref=. Earners Corner takes none.
const okRef = v => /^[A-Za-z0-9_.-]{1,40}$/.test(v) && !/^\d+$/.test(v) && !/^0x[0-9a-f]{40}$/i.test(v) && v !== 'company' && v !== 'top';
const arrivedRef = () => {
try { const q = String(new URLSearchParams(location.search).get('ref') || '').trim().toLowerCase(); if (okRef(q)) { try { sessionStorage.setItem('ls.netref', q); } catch (e) {} return q; } } catch (e) {}
try { const v = sessionStorage.getItem('ls.netref') || ''; if (okRef(v)) return v; } catch (e) {}
const m = document.cookie.match(/(?:^|;\s*)iap\.sponsor=([^;]*)/); try { const v = m ? decodeURIComponent(m[1]) : ''; return okRef(v) ? v : ''; } catch (e) { return ''; }
};
let netRef = null;
function networkRef() {
if (!netRef) netRef = fetch('/api/me', { credentials: 'same-origin' }).then(r => r.json()).then(m => (m && m.signedIn && m.username && okRef(m.username) ? m.username : arrivedRef())).catch(() => arrivedRef());
return netRef;
}
function withRef(s, ref) {
const href = s.go || s.url; if (!ref || s.id === 'earnerscorner') return href;
try { const u = new URL(href); u.searchParams.set(s.go ? 's1' : 'ref', ref); return u.toString(); } catch (e) { return href; }
}
function renderNetworkLine(host) {
if (!host || host.querySelector('.netline')) return;
const d = document.createElement('div'); d.className = 'netline';
d.style.cssText = 'margin-top:10px;display:flex;gap:6px 14px;justify-content:center;flex-wrap:wrap;align-items:baseline;font-size:12.5px';
host.appendChild(d);
const esc = s => String(s).replace(/[&<>"]/g, ch => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;' })[ch]);
const paint = list => {
let list = NET_FALLBACK, ref = arrivedRef();
const paint = () => {
d.innerHTML = '<b>Part of the network</b><span>One account across the network:</span>' + list.map(s => (s.id === 'linkspin' || /linkspin\.app/.test(s.url))
? '<span aria-current="page" style="font-weight:700;color:var(--ink)">' + esc(s.name) + ' (you are here)</span>'
: '<a href="' + esc(s.go || s.url) + '" target="_blank" rel="noopener nofollow">' + esc(s.name) + '</a>').join('');
: '<a href="' + esc(withRef(s, ref)) + '" target="_blank" rel="noopener nofollow">' + esc(s.name) + '</a>').join('');
};
paint(NET_FALLBACK);
networkSites().then(paint);
paint();
networkSites().then(l => { list = l; paint(); });
networkRef().then(r => { if (r !== ref) { ref = r; paint(); } });
}
// pages with their own footer (the members area) get the network line too
function decorateFooters() { document.querySelectorAll('footer.bo-pagefoot').forEach(f => { const w = document.createElement('div'); w.style.width = '100%'; f.appendChild(w); renderNetworkLine(w); }); }
+19 -4
View File
@@ -4,6 +4,19 @@
var me = (document.currentScript && document.currentScript.getAttribute('data-site')) || 'linkspin';
var FALLBACK = [['iap', 'InstantAdPay', 'https://instantadpay.com'], ['linkspin', 'LinkSpin', 'https://linkspin.app'], ['dlb', 'Downline Banners', 'https://downlinebanners.com'],
['vbb', 'Viral Banner Blitz', 'https://viralbannerblitz.com'], ['stackpol', 'Stack POL', 'https://stackpol.com'], ['earnerscorner', 'Earners Corner', 'https://earnerscorner.com']].map(function (a) { return { id: a[0], name: a[1], url: a[2] }; });
// the links carry a referral username (Marty 2026-11-15): the signed-in member's own, else the referral this visitor came in on
// (?ref= here, remembered for the visit, then the iap.sponsor cookie; usernames only). Tracked links get it as s1 (LinkSpin sends it
// on as ?ref=), plain links as ?ref=; Earners Corner none.
function okRef(v) { return /^[A-Za-z0-9_.-]{1,40}$/.test(v) && !/^\d+$/.test(v) && !/^0x[0-9a-f]{40}$/i.test(v) && v !== 'company' && v !== 'top'; }
function arrivedRef() {
try { var q = String(new URLSearchParams(location.search).get('ref') || '').trim().toLowerCase(); if (okRef(q)) { try { sessionStorage.setItem('ls.netref', q); } catch (e) {} return q; } } catch (e) {}
try { var v = sessionStorage.getItem('ls.netref') || ''; if (okRef(v)) return v; } catch (e) {}
var m = document.cookie.match(/(?:^|;\s*)iap\.sponsor=([^;]*)/); try { var c = m ? decodeURIComponent(m[1]) : ''; return okRef(c) ? c : ''; } catch (e) { return ''; }
}
function withRef(s, ref) {
var href = s.go || s.url; if (!ref || s.id === 'earnerscorner') return href;
try { var u = new URL(href); u.searchParams.set(s.go ? 's1' : 'ref', ref); return u.toString(); } catch (e) { return href; }
}
function esc(s) { return String(s).replace(/[&<>"]/g, function (c) { return { '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;' }[c]; }); }
function run() {
var f = document.querySelector('footer'); if (!f || f.querySelector('.netline')) return;
@@ -11,13 +24,15 @@
var box = document.createElement('div'); box.className = 'netline';
box.style.cssText = 'flex-basis:100%;width:100%;margin-top:10px;display:flex;gap:6px 14px;flex-wrap:wrap;align-items:baseline;font-size:12.5px';
host.appendChild(box);
var paint = function (list) {
var list = FALLBACK, ref = arrivedRef();
var paint = function () {
box.innerHTML = '<span style="flex-basis:100%">TrustClickz · 615 Green Valley Drive, Moody, AL 35004</span><b>Part of the network</b><span>One account across the network:</span>' + list.map(function (s) {
return s.id === me ? '<span aria-current="page" style="font-weight:700">' + esc(s.name) + ' (you are here)</span>' : '<a href="' + esc(s.go || s.url) + '" target="_blank" rel="noopener nofollow">' + esc(s.name) + '</a>';
return s.id === me ? '<span aria-current="page" style="font-weight:700">' + esc(s.name) + ' (you are here)</span>' : '<a href="' + esc(withRef(s, ref)) + '" target="_blank" rel="noopener nofollow">' + esc(s.name) + '</a>';
}).join('');
};
paint(FALLBACK);
fetch('/api/network-sites').then(function (r) { return r.json(); }).then(function (l) { if (Array.isArray(l) && l.length) paint(l); }).catch(function () {});
paint();
fetch('/api/network-sites').then(function (r) { return r.json(); }).then(function (l) { if (Array.isArray(l) && l.length) { list = l; paint(); } }).catch(function () {});
fetch('/api/me', { credentials: 'same-origin' }).then(function (r) { return r.json(); }).then(function (m) { if (m && m.signedIn && m.username && okRef(m.username)) { ref = m.username; paint(); } }).catch(function () {});
}
if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', run); else run();
})();
+1 -1
View File
@@ -149,6 +149,6 @@
</div>
</footer>
<script src="/assets/contract.js?v=20261023ov"></script>
<script src="/assets/netline.js?v=20261114ns" data-site="linkspin"></script>
<script src="/assets/netline.js?v=20261115nr" data-site="linkspin"></script>
</body>
</html>
+1 -1
View File
@@ -284,6 +284,6 @@
</div>
</footer>
<script src="/assets/conversion-guide.js?v=20261024ct"></script>
<script src="/assets/netline.js?v=20261114ns" data-site="linkspin"></script>
<script src="/assets/netline.js?v=20261115nr" data-site="linkspin"></script>
</body>
</html>
+1 -1
View File
@@ -81,7 +81,7 @@
</div>
</div>
</div>
<script src="/assets/common.js?v=20261114ns"></script>
<script src="/assets/common.js?v=20261115nr"></script>
<script src="/assets/wallet.js?v=20261021a"></script>
<script src="/assets/cr-shell.js?v=20261114tu"></script>
<script src="/assets/credits-screen.js?v=20261107tg"></script>
+1 -1
View File
@@ -47,6 +47,6 @@
<span class="mono" style="font-size:11px">a Crypto Team Build Network property</span>
</div>
</footer>
<script src="/assets/netline.js?v=20261114ns" data-site="linkspin"></script>
<script src="/assets/netline.js?v=20261115nr" data-site="linkspin"></script>
</body>
</html>
+2 -2
View File
@@ -69,7 +69,7 @@
<div class="small">Advertising services with a performance referral program. Not an investment product; no income guarantees.</div>
</footer>
</div>
<script src="/assets/common.js?v=20261114ns"></script>
<script src="/assets/netline.js?v=20261114ns" data-site="linkspin"></script>
<script src="/assets/common.js?v=20261115nr"></script>
<script src="/assets/netline.js?v=20261115nr" data-site="linkspin"></script>
</body>
</html>
+1 -1
View File
@@ -225,6 +225,6 @@
</footer>
<script src="/assets/home.js?v=20261113me"></script>
<script src="/assets/netline.js?v=20261114ns" data-site="linkspin"></script>
<script src="/assets/netline.js?v=20261115nr" data-site="linkspin"></script>
</body>
</html>
+2 -2
View File
@@ -106,8 +106,8 @@ body.squeeze .card{position:sticky;top:16px}
<span class="mono" style="font-size:11px">a Crypto Team Build Network property</span>
</div>
</footer>
<script src="/assets/common.js?v=20261114ns"></script>
<script src="/assets/common.js?v=20261115nr"></script>
<script src="/assets/join.js?v=20261111b4h"></script>
<script src="/assets/netline.js?v=20261114ns" data-site="linkspin"></script>
<script src="/assets/netline.js?v=20261115nr" data-site="linkspin"></script>
</body>
</html>
+1 -1
View File
@@ -102,7 +102,7 @@
<div class="small">Advertising services with a performance referral program. Not an investment product; no income guarantees.</div>
</footer>
</div>
<script src="/assets/common.js?v=20261114ns"></script>
<script src="/assets/common.js?v=20261115nr"></script>
<script src="/assets/launch.js?v=20261105po"></script>
</body>
</html>
+2 -2
View File
@@ -65,8 +65,8 @@
<span class="mono" style="font-size:11px">a Crypto Team Build Network property</span>
</div>
</footer>
<script src="/assets/common.js?v=20261114ns"></script>
<script src="/assets/common.js?v=20261115nr"></script>
<script src="/assets/ledger.js?v=20261007a"></script>
<script src="/assets/netline.js?v=20261114ns" data-site="linkspin"></script>
<script src="/assets/netline.js?v=20261115nr" data-site="linkspin"></script>
</body>
</html>
+1 -1
View File
@@ -1015,7 +1015,7 @@
</div>
</div>
</div>
<script src="/assets/common.js?v=20261114ns"></script>
<script src="/assets/common.js?v=20261115nr"></script>
<script src="/assets/cr-shell.js?v=20261114tu"></script>
<script src="/assets/tools.js?v=20261011a"></script>
<script src="/assets/wallet.js?v=20261021a"></script>
+2 -2
View File
@@ -131,8 +131,8 @@
<div class="small">Advertising services with a performance referral program. Not an investment product; no income guarantees. Crypto transactions are irreversible. Never spend what you cannot afford to lose.</div>
</footer>
</div>
<script src="/assets/common.js?v=20261114ns"></script>
<script src="/assets/common.js?v=20261115nr"></script>
<script src="/assets/partners.js?v=20261010a"></script>
<script src="/assets/netline.js?v=20261114ns" data-site="linkspin"></script>
<script src="/assets/netline.js?v=20261115nr" data-site="linkspin"></script>
</body>
</html>
+1 -1
View File
@@ -193,7 +193,7 @@
<div class="small">Advertising services with a performance referral program. Not an investment product; no income guarantees. Crypto transactions are irreversible. Never spend what you cannot afford.</div>
</footer>
</div>
<script src="/assets/common.js?v=20261114ns"></script>
<script src="/assets/common.js?v=20261115nr"></script>
<script src="/assets/plays.js?v=20260910b"></script>
</body>
</html>
+1 -1
View File
@@ -56,6 +56,6 @@
<span class="mono" style="font-size:11px">a Crypto Team Build Network property</span>
</div>
</footer>
<script src="/assets/netline.js?v=20261114ns" data-site="linkspin"></script>
<script src="/assets/netline.js?v=20261115nr" data-site="linkspin"></script>
</body>
</html>
+1 -1
View File
@@ -289,6 +289,6 @@
</footer>
<script src="/assets/publishers.js?v=20261010a"></script>
<script src="/assets/netline.js?v=20261114ns" data-site="linkspin"></script>
<script src="/assets/netline.js?v=20261115nr" data-site="linkspin"></script>
</body>
</html>
+1 -1
View File
@@ -281,6 +281,6 @@
</div>
</footer>
<script src="/assets/refuel-guide.js?v=20261024rg"></script>
<script src="/assets/netline.js?v=20261114ns" data-site="linkspin"></script>
<script src="/assets/netline.js?v=20261115nr" data-site="linkspin"></script>
</body>
</html>
+2 -2
View File
@@ -67,8 +67,8 @@
<span class="mono" style="font-size:11px">a Crypto Team Build Network property</span>
</div>
</footer>
<script src="/assets/common.js?v=20261114ns"></script>
<script src="/assets/common.js?v=20261115nr"></script>
<script src="/assets/support.js?v=20261016a"></script>
<script src="/assets/netline.js?v=20261114ns" data-site="linkspin"></script>
<script src="/assets/netline.js?v=20261115nr" data-site="linkspin"></script>
</body>
</html>
+1 -1
View File
@@ -62,6 +62,6 @@
<span class="mono" style="font-size:11px">a Crypto Team Build Network property</span>
</div>
</footer>
<script src="/assets/netline.js?v=20261114ns" data-site="linkspin"></script>
<script src="/assets/netline.js?v=20261115nr" data-site="linkspin"></script>
</body>
</html>
+1 -1
View File
@@ -35,7 +35,7 @@
<p><a href="/ledger">← Back to the live ledger</a> · <a href="/contract">Read the contract review</a></p>
</div>
</section>
<script src="/assets/common.js?v=20261114ns"></script>
<script src="/assets/common.js?v=20261115nr"></script>
<script src="/assets/tx.js?v=20260906m"></script>
</body>
</html>
+1 -1
View File
@@ -49,7 +49,7 @@
</div>
</div>
</section>
<script src="/assets/common.js?v=20261114ns"></script>
<script src="/assets/common.js?v=20261115nr"></script>
<script src="/assets/wall.js?v=20261030pp"></script>
<script src="/assets/wall-founder.js?v=20261105fd"></script>
</body>
+1 -1
View File
@@ -120,7 +120,7 @@
<div class="small">Advertising services with a performance referral program. Not an investment product; no income guarantees. Crypto transactions are irreversible. Never share your recovery phrase.</div>
</footer>
</div>
<script src="/assets/common.js?v=20261114ns"></script>
<script src="/assets/common.js?v=20261115nr"></script>
<script src="/assets/wallets.js?v=20261026a"></script>
</body>
</html>
+6 -4
View File
@@ -1,5 +1,5 @@
// Network sites as traffic sources (2026-11-14). Boots server.js on its own port with a throwaway seeded data dir (JSON store, no DB)
// and checks: the admin account gets one fixed network link per site (nwiap, nwls, nwdlb, nwvbb, nwsp, nwec) and one source per
// and checks: the admin account gets one fixed network link per site (nwiap, nwls, nwdlb, nwvbb, nwvab, nwsp, nwec) and one source per
// network site; /r/<code>?src=&s1=&s2= lands on the right page with ?ref=<member>; the click counts under the sending site's source;
// a member's own link with ?src=<site> gets that site's source made on first use; an unknown src changes nothing; a reboot makes
// nothing twice.
@@ -28,9 +28,9 @@ const srcOf = (owner, tpl) => read('sources.json').items.find(x => x.owner === o
try {
await boot();
const rots = read('rotator.json').rotations.filter(r => r.owner === ADMIN);
ok(['nwiap', 'nwls', 'nwdlb', 'nwvbb', 'nwsp', 'nwec'].every(c => rots.some(r => r.code === c)) && rots.length === 6, 'the admin account has the six network links', rots.map(r => r.code));
ok(['nwiap', 'nwls', 'nwdlb', 'nwvbb', 'nwvab', 'nwsp', 'nwec'].every(c => rots.some(r => r.code === c)) && rots.length === 7, 'the admin account has the seven network links', rots.map(r => r.code));
const mineSrc = read('sources.json').items.filter(x => x.owner === ADMIN);
ok(['instantadpay', 'linkspin', 'downlinebanners', 'viralbannerblitz', 'stackpol', 'earnerscorner'].every(t => mineSrc.some(x => x.template === t)) && mineSrc.length === 6, 'and one source per network site', mineSrc.map(x => x.template));
ok(['instantadpay', 'linkspin', 'downlinebanners', 'viralbannerblitz', 'viraladblitz', 'stackpol', 'earnerscorner'].every(t => mineSrc.some(x => x.template === t)) && mineSrc.length === 7, 'and one source per network site', mineSrc.map(x => x.template));
let r = await go('/r/nwdlb?src=iap&s1=bob&s2=how');
ok(r.status === 302 && /^https:\/\/downlinebanners\.com\/how\?ref=bob$/.test(r.loc), 'nwdlb: lands on /how with ?ref=bob', r);
@@ -38,6 +38,8 @@ try {
ok(r.status === 302 && /^https:\/\/instantadpay\.com\/\?ref=amy&lsclk=[a-f0-9]{10}$/.test(r.loc), 'nwiap: home page with ?ref=amy and the click id (InstantAdPay reports joins against it)', r);
r = await go('/r/nwec?src=dlb');
ok(r.status === 302 && /^https:\/\/earnerscorner\.com\/(\?|$)/.test(r.loc), 'nwec: the forum home', r);
r = await go('/r/nwvab?src=vab&s1=bob&s2=boost');
ok(r.status === 302 && /^https:\/\/viraladblitz\.com\/boost\?ref=bob$/.test(r.loc), 'nwvab: ViralAdBlitz page with the member ref', r);
r = await go('/r/nwvbb?src=linkspin', 'https://linkspin.app/contract');
ok(r.status === 302 && /^https:\/\/viralbannerblitz\.com\/\?ref=(&|$)/.test(r.loc), 'nwvbb with no member: an empty ref', r);
await sleep(300);
@@ -58,7 +60,7 @@ try {
ok(read('sources.json').items.filter(x => x.owner === MEM).length === 2, 'an unknown src makes no source');
await stop(); await boot();
ok(read('rotator.json').rotations.filter(x => x.owner === ADMIN).length === 6 && read('sources.json').items.filter(x => x.owner === ADMIN).length === 6, 'a reboot makes nothing twice');
ok(read('rotator.json').rotations.filter(x => x.owner === ADMIN).length === 7 && read('sources.json').items.filter(x => x.owner === ADMIN).length === 7, 'a reboot makes nothing twice');
} catch (e) { fail++; console.error(e); }
finally { await stop(); try { fs.rmSync(DATA, { recursive: true, force: true }); } catch (e) {} }
console.log('\n' + pass + ' passed, ' + fail + ' failed'); process.exit(fail ? 1 : 0);
+64
View File
@@ -0,0 +1,64 @@
// DownlineHydra tracked program links (/api/partner/dh/links, Marty 2026-11-15).
// Boots server.js on its own port with a throwaway seeded data dir (JSON store, no DB, no mail key, no chain keys) and checks:
// the NETWORK_SSO_SECRET signature, account by email then by network username, one link per program on the member's own account
// with the "DownlineHydra" source, the program id as sub-id, the destination following a changed referral URL (same code), the
// clean link host, https-only destinations, the redirect keeping the referral ID intact, and clicks per program in the stats.
// node qa/partner-dhlinks.test.mjs (from the site dir; PORT default 8973)
import fs from 'node:fs';
import os from 'node:os';
import path from 'node:path';
import crypto from 'node:crypto';
import { spawn } from 'node:child_process';
const PORT = Number(process.env.PORT || 8973); const BASE = 'http://127.0.0.1:' + PORT; const SEC = crypto.randomBytes(32).toString('hex');
let pass = 0, fail = 0; const ok = (c, what, x) => { if (c) { pass++; console.log(' ok ' + what); } else { fail++; console.log(' FAIL ' + what + (x !== undefined ? ' -> ' + JSON.stringify(x).slice(0, 400) : '')); } };
const DATA = fs.mkdtempSync(path.join(os.tmpdir(), 'dh-qa-'));
const now = Date.now();
const acct = (email, username, memberId) => ({ email, username, code: username.slice(0, 7), memberId, created: now - 86400000, sponsorRef: '' });
const accounts = { v: 2, byEmail: { 'one@dh.test': acct('one@dh.test', 'dhone', 920001), 'two@dh.test': acct('two@dh.test', 'dhtwo', 920002) }, byAddress: {}, byCode: {}, joins: 2, positions: {} };
for (const a of Object.values(accounts.byEmail)) accounts.byCode[a.code] = a.email;
fs.writeFileSync(path.join(DATA, 'accounts.json'), JSON.stringify(accounts));
fs.writeFileSync(path.join(DATA, 'site.json'), JSON.stringify({ linkDomains: 'spin-links.test.org' }));
const env = Object.assign({}, process.env, { PORT: String(PORT), DATA_DIR: DATA, NETWORK_SSO_SECRET: SEC, ADMIN_PASSWORD: 'x'.repeat(16), ADMIN_EMAIL: 'admin@dh.test' });
for (const k of ['NODE_ENV', 'DATABASE_URL', 'ENGINE_KEY', 'LS_SYNC_SECRET', 'OUTBOUND', 'LS_TESTERS', 'CURTAIN', 'HUB_ENABLED', 'HUB_URL']) delete env[k];
const site = path.resolve(path.dirname(new URL(import.meta.url).pathname.replace(/^\/([A-Za-z]:)/, '$1')), '..');
const srv = spawn(process.execPath, ['server.js'], { cwd: site, env, stdio: ['ignore', 'ignore', 'ignore'] });
const sleep = ms => new Promise(r => setTimeout(r, ms));
async function call(body, o = {}) {
const raw = JSON.stringify(body); const ts = String(o.ts || Date.now()); const sig = crypto.createHmac('sha256', o.sec || SEC).update('net.v1.' + ts + '\n' + raw).digest('hex');
const r = await fetch(BASE + '/api/partner/dh/links', { method: 'POST', body: raw, headers: { 'Content-Type': 'application/json', 'X-Net-Ts': ts, 'X-Net-Sig': sig } });
return Object.assign({ _status: r.status }, await r.json().catch(() => ({})));
}
try {
for (let i = 0; i < 60; i++) { try { if ((await fetch(BASE + '/api/config')).ok) break; } catch (e) {} await sleep(500); }
const L1 = [{ program: 'ctb19', name: 'Ads Earn Network', url: 'https://www.adsearnnetwork.com/?one19' }, { program: 'mh3', name: 'My Mailer', url: 'https://mymailer.example.org/r/one' }];
let r = await call({ email: 'one@dh.test', op: 'ensure', links: L1 }, { sec: 'y'.repeat(64) }); ok(r._status === 401, 'a wrong signature is refused');
r = await call({ email: 'one@dh.test', op: 'ensure', links: L1 }, { ts: Date.now() - 600000 }); ok(r._status === 401, 'an old timestamp is refused');
r = await call({ email: 'nobody@dh.test', op: 'ensure', links: L1 }); ok(r._status === 200 && r.account === false, 'no LinkSpin account: account false, nothing made', r);
r = await call({ email: 'one@dh.test', op: 'ensure', links: L1 });
const c19 = r.links && r.links.ctb19 && r.links.ctb19.code;
ok(r.account && r.host === 'spin-links.test.org' && /^[a-z0-9]{6}$/.test(c19 || '') && r.links.ctb19.created && r.links.mh3.created, 'ensure: one new link per program on the member\'s account, clean host', r);
ok(r.links.ctb19.link === 'https://spin-links.test.org/r/' + c19 + '?s1=ctb19&placement=ctb19', 'the link carries the program id as sub-id (s1) and placement', r.links.ctb19.link);
const src = JSON.parse(fs.readFileSync(path.join(DATA, 'sources.json'), 'utf8')); const mine = (src.items || src.sources || []).filter(x => x.owner === 'one@dh.test');
ok(mine.length === 1 && mine[0].template === 'downlinehydra' && mine[0].name === 'DownlineHydra' && r.sourceId === mine[0].id, 'the account has one "DownlineHydra" source (network template)', mine);
const rot = JSON.parse(fs.readFileSync(path.join(DATA, 'rotator.json'), 'utf8')).rotations.filter(x => x.owner === 'one@dh.test');
ok(rot.length === 2 && rot.every(x => x.sourceId === mine[0].id && /^dh:/.test(x.partner)) && rot.find(x => x.partner === 'dh:ctb19').destinations[0].url === 'https://www.adsearnnetwork.com/?one19', 'the links are tagged with that source and point at the referral URL', rot);
r = await call({ email: 'one@dh.test', op: 'ensure', links: [{ program: 'ctb19', name: 'Ads Earn Network', url: 'https://www.adsearnnetwork.com/?one19new' }] });
const rot2 = JSON.parse(fs.readFileSync(path.join(DATA, 'rotator.json'), 'utf8')).rotations.filter(x => x.owner === 'one@dh.test');
ok(r.links.ctb19.code === c19 && !r.links.ctb19.created && rot2.length === 2 && rot2.find(x => x.partner === 'dh:ctb19').destinations[0].url.endsWith('?one19new'), 'a changed referral URL updates the same link (same code, no new link)', r);
r = await call({ email: 'one@dh.test', op: 'ensure', links: [{ program: 'bad', url: 'http://plain.example.org/' }, { program: 'bad id!', url: 'https://x.example.org/' }] });
ok(r.errors && r.errors.bad && r.errors['bad id!'] && !Object.keys(r.links).length, 'http destinations and bad program ids are refused', r);
r = await call({ username: 'dhtwo', op: 'ensure', links: [{ program: 'ctb19', url: 'https://www.adsearnnetwork.com/?two19' }] });
ok(r.account && r.username === 'dhtwo' && r.links.ctb19 && r.links.ctb19.code !== c19, 'found by network username when the email is not given; a separate link on that account', r);
// a click through the link keeps the referral ID and counts for the program
const hit = await fetch('https://spin-links.test.org/r/'.replace('https://spin-links.test.org', BASE) + c19 + '?s1=ctb19&placement=ctb19', { redirect: 'manual', headers: { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 Chrome/130.0 Safari/537.36' } });
const loc = hit.headers.get('location') || '';
ok(hit.status >= 300 && hit.status < 400 && loc.startsWith('https://www.adsearnnetwork.com/?one19new'), 'the redirect lands on the program with the member\'s referral ID intact', [hit.status, loc]);
await sleep(300);
r = await call({ email: 'one@dh.test', op: 'stats' });
ok(r.account && r.stats.ctb19 && r.stats.ctb19.hits === 1 && r.stats.ctb19.hits30 === 1 && r.stats.ctb19.unique30 === 1 && r.stats.mh3.hits === 0 && r.stats.ctb19.link.includes(c19), 'stats: clicks per program for this account only', r.stats);
const rep = JSON.parse(fs.readFileSync(path.join(DATA, 'rotator.json'), 'utf8')).hits.find(h => h.r === rot.find(x => x.partner === 'dh:ctb19').id);
ok(rep && rep.sr === mine[0].id && rep.q && rep.q.s1 === 'ctb19' && rep.q.placement === 'ctb19', 'the click is recorded under the DownlineHydra source with the program sub-id (Reports split it by program)', rep);
} catch (e) { fail++; console.error(e); }
finally { srv.kill(); await sleep(300); try { fs.rmSync(DATA, { recursive: true, force: true }); } catch (e) {} }
console.log('\n' + pass + ' passed, ' + fail + ' failed'); process.exit(fail ? 1 : 0);
+63
View File
@@ -0,0 +1,63 @@
// ViralAdBlitz tracked text-ad links (/api/partner/vab/links, 2026-11-15; the same endpoint as DownlineHydra's, site vab).
// Boots server.js on its own port with a throwaway seeded data dir (JSON store, no DB, no mail key, no chain keys) and checks:
// the signature, one link per text ad on the member's own account with the "ViralAdBlitz" source and the ad id as sub-id, an edited
// ad link updating the same code, a DownlineHydra link with the same id kept apart, stats per site, unknown partner sites refused.
// node qa/partner-vablinks.test.mjs (from the site dir; PORT default 8974)
import fs from 'node:fs';
import os from 'node:os';
import path from 'node:path';
import crypto from 'node:crypto';
import { spawn } from 'node:child_process';
const PORT = Number(process.env.PORT || 8974); const BASE = 'http://127.0.0.1:' + PORT; const SEC = crypto.randomBytes(32).toString('hex');
let pass = 0, fail = 0; const ok = (c, what, x) => { if (c) { pass++; console.log(' ok ' + what); } else { fail++; console.log(' FAIL ' + what + (x !== undefined ? ' -> ' + JSON.stringify(x).slice(0, 400) : '')); } };
const DATA = fs.mkdtempSync(path.join(os.tmpdir(), 'vab-qa-'));
const now = Date.now();
const acct = (email, username, memberId) => ({ email, username, code: username.slice(0, 7), memberId, created: now - 86400000, sponsorRef: '' });
const accounts = { v: 2, byEmail: { 'one@dh.test': acct('one@dh.test', 'dhone', 920001), 'two@dh.test': acct('two@dh.test', 'dhtwo', 920002) }, byAddress: {}, byCode: {}, joins: 2, positions: {} };
for (const a of Object.values(accounts.byEmail)) accounts.byCode[a.code] = a.email;
fs.writeFileSync(path.join(DATA, 'accounts.json'), JSON.stringify(accounts));
fs.writeFileSync(path.join(DATA, 'site.json'), JSON.stringify({ linkDomains: 'spin-links.test.org' }));
const env = Object.assign({}, process.env, { PORT: String(PORT), DATA_DIR: DATA, NETWORK_SSO_SECRET: SEC, ADMIN_PASSWORD: 'x'.repeat(16), ADMIN_EMAIL: 'admin@dh.test' });
for (const k of ['NODE_ENV', 'DATABASE_URL', 'ENGINE_KEY', 'LS_SYNC_SECRET', 'OUTBOUND', 'LS_TESTERS', 'CURTAIN', 'HUB_ENABLED', 'HUB_URL']) delete env[k];
const site = path.resolve(path.dirname(new URL(import.meta.url).pathname.replace(/^\/([A-Za-z]:)/, '$1')), '..');
const srv = spawn(process.execPath, ['server.js'], { cwd: site, env, stdio: ['ignore', 'ignore', 'ignore'] });
const sleep = ms => new Promise(r => setTimeout(r, ms));
async function call(body, o = {}, site = 'vab') {
const raw = JSON.stringify(body); const ts = String(o.ts || Date.now()); const sig = crypto.createHmac('sha256', o.sec || SEC).update('net.v1.' + ts + '\n' + raw).digest('hex');
const r = await fetch(BASE + '/api/partner/' + site + '/links', { method: 'POST', body: raw, headers: { 'Content-Type': 'application/json', 'X-Net-Ts': ts, 'X-Net-Sig': sig } });
return Object.assign({ _status: r.status }, await r.json().catch(() => ({})));
}
try {
for (let i = 0; i < 60; i++) { try { if ((await fetch(BASE + '/api/config')).ok) break; } catch (e) {} await sleep(500); }
const AD = [{ id: '42', name: 'Grow your list', url: 'https://mylist.example.org/?ref=one' }];
let r = await call({ email: 'one@dh.test', op: 'ensure', links: AD }, { sec: 'y'.repeat(64) }); ok(r._status === 401, 'a wrong signature is refused');
r = await call({ email: 'one@dh.test', op: 'ensure', links: AD }, {}, 'zz'); ok(r._status === 404 || (r._status >= 400 && !r.links), 'an unknown partner site is not served', r);
r = await call({ email: 'nobody@dh.test', op: 'ensure', links: AD }); ok(r._status === 200 && r.account === false, 'no LinkSpin account: account false', r);
r = await call({ email: 'one@dh.test', op: 'ensure', links: AD });
const c42 = r.links && r.links['42'] && r.links['42'].code;
ok(r.account && r.host === 'spin-links.test.org' && /^[a-z0-9]{6}$/.test(c42 || '') && r.links['42'].created, 'ensure: a new link for the ad (id field), clean host', r);
ok(r.links['42'].link === 'https://spin-links.test.org/r/' + c42 + '?s1=42&placement=42', 'the link carries the ad id as s1 and placement', r.links['42'].link);
const src = JSON.parse(fs.readFileSync(path.join(DATA, 'sources.json'), 'utf8')); const mine = (src.items || src.sources || []).filter(x => x.owner === 'one@dh.test');
ok(mine.length === 1 && mine[0].template === 'viraladblitz' && mine[0].name === 'ViralAdBlitz' && r.sourceId === mine[0].id, 'the account has one "ViralAdBlitz" source (network template)', mine);
let rot = JSON.parse(fs.readFileSync(path.join(DATA, 'rotator.json'), 'utf8')).rotations.filter(x => x.owner === 'one@dh.test');
ok(rot.length === 1 && rot[0].partner === 'vab:42' && rot[0].name === 'ViralAdBlitz: Grow your list' && rot[0].sourceId === mine[0].id && rot[0].destinations[0].url === AD[0].url, 'the link is tagged vab:42 with that source and points at the ad link', rot);
r = await call({ email: 'one@dh.test', op: 'ensure', links: [{ id: '42', name: 'Grow your list', url: 'https://mylist.example.org/?ref=one&v=2' }] });
rot = JSON.parse(fs.readFileSync(path.join(DATA, 'rotator.json'), 'utf8')).rotations.filter(x => x.owner === 'one@dh.test');
ok(r.links['42'].code === c42 && !r.links['42'].created && rot.length === 1 && rot[0].destinations[0].url.endsWith('&v=2'), 'an edited ad link updates the same LinkSpin link', r);
r = await call({ email: 'one@dh.test', op: 'ensure', links: [{ program: '42', url: 'https://other.example.org/' }] }, {}, 'dh');
rot = JSON.parse(fs.readFileSync(path.join(DATA, 'rotator.json'), 'utf8')).rotations.filter(x => x.owner === 'one@dh.test');
ok(r.links['42'] && r.links['42'].code !== c42 && rot.length === 2 && rot.some(x => x.partner === 'dh:42'), 'a DownlineHydra program with the same id is a separate link', rot.map(x => x.partner));
const hit = await fetch(BASE + '/r/' + c42 + '?s1=42&placement=42', { redirect: 'manual', headers: { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 Chrome/130.0 Safari/537.36' } });
const loc = hit.headers.get('location') || '';
ok(hit.status >= 300 && hit.status < 400 && loc.startsWith('https://mylist.example.org/?ref=one&v=2'), 'the redirect lands on the ad link', [hit.status, loc]);
await sleep(300);
r = await call({ email: 'one@dh.test', op: 'stats' });
ok(r.account && r.stats['42'] && r.stats['42'].hits === 1 && r.stats['42'].unique30 === 1 && Object.keys(r.stats).length === 1, 'vab stats: the ad click, only the vab links', r.stats);
r = await call({ email: 'one@dh.test', op: 'stats' }, {}, 'dh');
ok(r.account && r.stats['42'] && r.stats['42'].hits === 0, 'dh stats do not see the vab click', r.stats);
const rep = JSON.parse(fs.readFileSync(path.join(DATA, 'rotator.json'), 'utf8')).hits.find(h => h.r === rot.find(x => x.partner === 'vab:42').id);
ok(rep && rep.sr === mine[0].id && rep.q && rep.q.s1 === '42', 'the click is recorded under the ViralAdBlitz source with the ad sub-id', rep);
} catch (e) { fail++; console.error(e); }
finally { srv.kill(); await sleep(300); try { fs.rmSync(DATA, { recursive: true, force: true }); } catch (e) {} }
console.log('\n' + pass + ' passed, ' + fail + ' failed'); process.exit(fail ? 1 : 0);
+3 -1
View File
@@ -9,7 +9,7 @@
# bash qa/run.sh sponsorfollow # sponsor follow rule + network tank unit tests + carry hold guard + carry activation regression
# bash qa/run.sh tankhold # holding tank: network alignment first, plain-activation hold (never a purchase), 24-hour rotation, payouts on at assignment (unit with a mocked clock + fake engine, then a local copy with a mock InstantAdPay)
# bash qa/run.sh netconv # conversion linkage: InstantAdPay's joins, wallets, purchases counted once, own account left out, window, aged hits, two copies racing, one Reports list, the landing tag on network links
# bash qa/run.sh netsrc # network sites as traffic sources: the six fixed network links, ?src= picks the sending site's source, member links get it on first use
# bash qa/run.sh netsrc # network sites as traffic sources: the seven fixed network links, ?src= picks the sending site's source, member links get it on first use; partner tracked links (DownlineHydra programs, ViralAdBlitz text ads)
# bash qa/run.sh lsid # page-builder lead -> rotator conversion + postback, audience pixel events and cookieless hits
# bash qa/run.sh convpixel # conversion pixel: ad click ids, landing tag + goal pixel (url/stored/cookie/soft), dedupe, window, owner check, cost per goal, IAP partner calls, browser + framed
# bash qa/run.sh nas # Network Ad Space billing: stop snapshot, active-only reconcile, restart without phantom delivery, the 1/N network + partner-zone rate (stubbed NAS, throwaway data)
@@ -100,6 +100,8 @@ elif [ "$MODE" = "netconv" ]; then
node qa/netconv.test.mjs || status=1
elif [ "$MODE" = "netsrc" ]; then
node qa/netsrc.test.mjs || status=1
node qa/partner-dhlinks.test.mjs || status=1
node qa/partner-vablinks.test.mjs || status=1
elif [ "$MODE" = "lsid" ]; then
node qa/lsid-pixel.test.mjs || status=1
elif [ "$MODE" = "kb" ]; then
+1 -1
View File
@@ -66,7 +66,7 @@ function renderPage() {
h += '<h2 style="font-size:24px;margin:10px 0 16px">Release notes</h2>';
h += v.notes.length ? v.notes.map(n => '<article class="note" id="' + esc(n.id) + '"><h2>' + esc(n.title) + n.tags.map(tagChip).join('') + '</h2><p class="when">' + fmt(n.date) + '</p>' + bodyHtml(n.body) + '</article>').join('') : '<p class="muted">No notes yet.</p>';
h += '<p class="muted small" style="margin-top:30px">Suggestions and bug reports: the chat bubble on any page, or the LinkSpin Telegram group.</p>';
h += '</div><script src="/assets/common.js?v=20261114ns"></script><script src="/assets/blog-page.js?v=20260914a"></script></body></html>';
h += '</div><script src="/assets/common.js?v=20261115nr"></script><script src="/assets/blog-page.js?v=20260914a"></script></body></html>';
return h;
}
module.exports = { init, notes, roadmap, saveNote, saveRoadmap, remove, publicView, renderPage, bodyHtml, TAGS, STATUSES };
+31 -1
View File
@@ -152,6 +152,36 @@ function ensureFixed(owner, code, name, url) {
const r = { id: (J.db.rotations.reduce((m, x) => Math.max(m, x.id), 0) + 1), owner: norm(owner), name: String(name).slice(0, 80), code: c, fallback: '', destinations: [{ id: 1, url: u, label: '', weight: 1, active: true, added: Date.now() }], created: Date.now(), paused: false, nextDest: 2 };
J.db.rotations.push(r); J.save(); return { ok: true, rotation: r, created: true };
}
// DownlineHydra tracked program links (Marty 2026-11-15, /api/partner/dh/links): one link per (account, partner key), e.g.
// key 'dh:ctb19' = the member's Ads Earn Network referral link. Made on the first ask, its one destination follows the member's
// latest referral URL, its traffic source is the account's "DownlineHydra" source. Never past the 100-link account cap.
function ensurePartner(owner, key, name, url, sourceId) {
const k = String(key || ''); if (!/^[a-z]{2,8}:[a-z0-9_-]{1,40}$/i.test(k)) return { error: 'key' };
const u = cleanUrl(url); if (!u || !/^https:\/\//i.test(u)) return { error: 'Destination must be a full https:// address.' };
let r = J.db.rotations.find(x => x.owner === norm(owner) && x.partner === k); let created = false;
if (!r) {
if (J.db.rotations.filter(x => x.owner === norm(owner)).length >= 100) return { error: 'This LinkSpin account already has 100 links.' };
let code = newCode(); while (J.db.rotations.some(x => x.code === code)) code = newCode();
r = { id: (J.db.rotations.reduce((m, x) => Math.max(m, x.id), 0) + 1), owner: norm(owner), name: String(name || k).slice(0, 80), code, fallback: '', destinations: [{ id: 1, url: u, label: '', weight: 1, active: true, added: Date.now() }], created: Date.now(), paused: false, nextDest: 2, partner: k };
J.db.rotations.push(r); created = true;
} else {
const d = r.destinations[0];
if (!d) r.destinations.push({ id: r.nextDest++, url: u, label: '', weight: 1, active: true, added: Date.now() });
else if (d.url !== u) { d.url = u; d.active = true; delete d.autoPaused; }
if (name) r.name = String(name).slice(0, 80);
}
if (sourceId && !r.sourceId) r.sourceId = String(sourceId);
J.save(); return { ok: true, created, code: r.code, id: r.id };
}
// clicks on an account's partner links whose key starts with `prefix` ('dh:'): { key: { code, hits, hits30, unique30 } } (non-bot)
function partnerStats(owner, prefix) {
const mine = J.db.rotations.filter(r => r.owner === norm(owner) && r.partner && r.partner.startsWith(prefix)); const ix = new Map(mine.map(r => [r.id, r.partner]));
const since = Date.now() - 30 * DAY; const out = {};
for (const r of mine) out[r.partner] = { code: r.code, hits: 0, hits30: 0, u: new Set() };
for (const h of J.db.hits) { const k = ix.get(h.r); if (!k || h.bot) continue; const o = out[k]; o.hits++; if (h.ts >= since) { o.hits30++; o.u.add(h.v); } }
for (const k in out) { out[k].unique30 = out[k].u.size; delete out[k].u; }
return out;
}
async function remove(owner, id) { const n = J.db.rotations.length; J.db.rotations = J.db.rotations.filter(r => !(r.id === Number(id) && r.owner === norm(owner))); J.save(); return n !== J.db.rotations.length ? { ok: true } : { error: 'No such rotation.' }; }
// opts.max: the admin import path only (BTC4Hits rotators, 2026-11-11) may go past the 25 a member can add, up to IMPORT_MAX
const DEST_MAX = 25, IMPORT_MAX = 2000;
@@ -366,4 +396,4 @@ function adminAll() {
hits: o.hits, hits7: o.hits7, bots: o.bots, conversions: cv[r.id] || 0 }; });
}
module.exports = { init, convRows, adminAll, hitById, list, get, create, update, remove, addDest, updateDest, resolve, stats, totals, convert, summary, createDemo, claim, sweepDemos, servedToday, window24,
pub, rawRotations, save, findMine, setExternalConvert, PRESETS, cleanHours, cleanTz, cellAt, zoneFor, isOn, COUNTRY_TZ, sourceCounts, detachSource, ensureFixed };
pub, rawRotations, save, findMine, setExternalConvert, PRESETS, cleanHours, cleanTz, cellAt, zoneFor, isOn, COUNTRY_TZ, sourceCounts, detachSource, ensureFixed, ensurePartner, partnerStats };
+46 -2
View File
@@ -645,7 +645,8 @@ async function boot() {
// let in (LS_TESTERS) gets the normal email-code sign-in with the email filled in; nothing is created by the network sign-in.
networksso.init({ self: 'linkspin', peer: 'iap', peerBase: IAP_BASE, isProd: IS_PROD, dataDir: DATA_DIR, db, defaultPath: '/ads',
wallets: { bannerline: () => String(process.env.BL_URL || 'https://downlinebanners.com').replace(/\/+$/, ''), // Downline Banners by wallet (2026-11-13)
vbb: () => String(process.env.VBB_URL || 'https://viralbannerblitz.com').replace(/\/+$/, '') }, // Viral Banner Blitz by wallet (2026-11-14)
vbb: () => String(process.env.VBB_URL || 'https://viralbannerblitz.com').replace(/\/+$/, ''), // Viral Banner Blitz by wallet (2026-11-14)
viraladblitz: () => String(process.env.VAB_URL || 'https://viraladblitz.com').replace(/\/+$/, '') }, // ViralAdBlitz by wallet (2026-11-15; VAB_URL = staging host until the domain switch)
wallet: async s => { const a = await accounts.byEmail(s.email); const addr = String(s.address || (a && a.address) || '').toLowerCase(); return addr ? { address: addr, name: '' } : null; },
member: async req => { // a wallet sign-in carries the address, not the email: find the account that owns the wallet (2026-11-13)
const s = await auth.fromRequest(req); if (!s) return null;
@@ -1427,6 +1428,8 @@ function curtained(req, res, u) {
return true;
}
// partner sites allowed on /api/partner/<site>/links (2026-11-15): network catalog template + the name the member sees on the link
const PARTNER_LINKS = { dh: { template: 'downlinehydra', name: 'DownlineHydra' }, vab: { template: 'viraladblitz', name: 'ViralAdBlitz' } };
const server = http.createServer(async (req, res) => {
{ const t0 = Date.now(); res.on('finish', () => { const ms = Date.now() - t0; if (ms > 3000) console.warn('slow request', req.method, String(req.url || '').split('?')[0].slice(0, 80), ms + 'ms', res.statusCode); }); } // visibility for member-felt delays (2026-10-12)
try {
@@ -3129,6 +3132,47 @@ const server = http.createServer(async (req, res) => {
}
return json(res, 200, out, { 'Cache-Control': 'no-store' });
}
// -- Partner tracked links (Marty 2026-11-15): /api/partner/<site>/links, site = dh (DownlineHydra program links) or vab (ViralAdBlitz
// text ads, the ad id as sub-id). PARTNER_LINKS names each site's network template and link name. Below, "program" = the
// partner's item id (a DownlineHydra program, a ViralAdBlitz ad).
// DownlineHydra tracked program links (Marty 2026-11-15). Same net.v1 signature as the Banner Spins call above. A DownlineHydra
// member saved a referral link for an outside program (a wild head or a my head); their downline sees a LinkSpin link for it
// on this member's own account, tagged with the account's "DownlineHydra" source and the program id as a sub-id
// (?s1=<program>&placement=<program>, so Reports split clicks by program). Only clean link domains (domains.hosts()).
// { email, username?, op: 'ensure', links: [{ program, name, url }] } -> { account, username, host, links: { program: { code, link } }, errors }
// { email, username?, op: 'stats' } -> { account, host, stats: { program: { code, link, hits, hits30, unique30 } } }
// Nothing else about the account is read or changed.
const plm = req.method === 'POST' ? /^\/api\/partner\/([a-z]{2,8})\/links$/.exec(p) : null;
if (plm && PARTNER_LINKS[plm[1]]) {
const PL = PARTNER_LINKS[plm[1]]; const pfx = plm[1] + ':';
let raw = ''; try { raw = await new Promise((ok, no) => { let d = ''; req.on('data', c => { d += c; if (d.length > 65536) { req.destroy(); no(new Error('too big')); } }); req.on('end', () => ok(d)); req.on('error', no); }); } catch (e) { return json(res, 400, { error: 'bad body' }); }
const sec = String(process.env.NETWORK_SSO_SECRET || '').trim(); const ts = String(req.headers['x-net-ts'] || ''); const sig = String(req.headers['x-net-sig'] || '');
if (sec.length < 32 || !/^\d{13}$/.test(ts) || Math.abs(Date.now() - Number(ts)) > 300000) return json(res, 401, { error: 'unauthorized' });
const want = crypto.createHmac('sha256', sec).update('net.v1.' + ts + '\n' + raw).digest('hex');
if (sig.length !== want.length || !crypto.timingSafeEqual(Buffer.from(sig), Buffer.from(want))) return json(res, 401, { error: 'unauthorized' });
let b; try { b = JSON.parse(raw || '{}'); } catch (e) { return json(res, 400, { error: 'bad json' }); }
const email = String(b.email || '').trim().toLowerCase();
let a = /^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/.test(email) ? await accounts.byEmail(email).catch(() => null) : null;
if ((!a || !a.email) && b.username && /^[A-Za-z0-9_.-]{2,40}$/.test(String(b.username))) a = await accounts.byUsername(String(b.username)).catch(() => null);
if (!a || !a.email) return json(res, 200, { account: false });
const hs = domains.hosts(); if (!hs.length) return json(res, 503, { error: 'No clean link domain right now.' });
const host = hs[0].host; const PID = /^[a-z0-9_-]{1,40}$/i;
const linkOf = (code, pid) => 'https://' + host + '/r/' + code + '?s1=' + encodeURIComponent(pid) + '&placement=' + encodeURIComponent(pid);
if (b.op === 'stats') {
const st = rotator.partnerStats(a.email, pfx); const out = {};
for (const [k, v] of Object.entries(st)) { const pid = k.slice(pfx.length); out[pid] = { code: v.code, link: linkOf(v.code, pid), hits: v.hits, hits30: v.hits30, unique30: v.unique30 }; }
return json(res, 200, { account: true, username: a.username || null, host, stats: out }, { 'Cache-Control': 'no-store' });
}
if (b.op !== 'ensure' || !Array.isArray(b.links) || !b.links.length || b.links.length > 60) return json(res, 400, { error: 'op' });
const src = sources.networkSource(a.email, PL.template);
const links = {}, errors = {};
for (const x of b.links) {
const pid = String((x && (x.program || x.id)) || ''); if (!PID.test(pid)) { errors[pid.slice(0, 40) || '?'] = 'program'; continue; }
const r = rotator.ensurePartner(a.email, pfx + pid, PL.name + ': ' + String(x.name || pid).slice(0, 60), String(x.url || ''), src ? src.id : null);
if (r.error) errors[pid] = r.error; else links[pid] = { code: r.code, link: linkOf(r.code, pid), created: r.created };
}
return json(res, 200, { account: true, username: a.username || null, host, sourceId: src ? src.id : null, links, errors }, { 'Cache-Control': 'no-store' });
}
if (p === '/api/partner/clicks' && req.method === 'POST') {
const sg = await readPartnerSigned(req, 2e6); if (!sg.body) return json(res, sg.status, { error: sg.error });
const owners = convtrack.importOwners(sg.body.owners); // InstantAdPay members' own soft keys first, so their own clicks import as tests
@@ -4454,7 +4498,7 @@ const server = http.createServer(async (req, res) => {
+ '<style>.bp{max-width:560px;text-align:center;padding:40px 16px 60px}.bp img{width:100%;max-width:520px;border-radius:18px;border:1px solid var(--line);box-shadow:0 20px 60px rgba(0,0,0,.45)}.bp h1{font-size:clamp(24px,5vw,34px);margin:22px 0 8px}.bp p{color:var(--muted);max-width:44ch;margin:0 auto 20px}</style></head>'
+ '<body><div class="wrap bp"><img src="' + img + '" alt="' + esc(label) + ' badge for @' + esc(un) + '"><h1>@' + esc(un) + ' unlocked <em>' + label + '</em></h1><p>' + esc(sub.charAt(0).toUpperCase() + sub.slice(1)) + '. On LinkSpin every ad package that sells pays the sponsor in the same transaction, straight to their wallet, on-chain.</p>'
+ '<a class="btn" href="/join/' + esc(un) + '">Join @' + esc(un) + '\u2019s line free</a><p class="small" style="margin-top:26px">Advertising with a performance referral program. Not an investment; no income is guaranteed.</p></div>'
+ '<script src="/assets/common.js?v=20261114ns"></script><script src="/assets/blog-page.js?v=20260912a"></script></body></html>';
+ '<script src="/assets/common.js?v=20261115nr"></script><script src="/assets/blog-page.js?v=20260912a"></script></body></html>';
res.writeHead(200, baseHeaders({ 'Content-Type': 'text/html; charset=utf-8', 'Cache-Control': 'public, max-age=300' }));
return res.end(html);
}
+2 -1
View File
@@ -142,7 +142,8 @@ function meta(owner) { const m = {}; for (const s of mine(owner)) m[s.id] = { na
// carrying ?src=<site id> (iap, linkspin, dlb, vbb, stackpol, earnerscorner, or the catalog key) counts under the link owner's
// source for that site, made from the network catalog template the first time it is needed. Only network templates qualify.
const NET_SRC = { iap: 'instantadpay', instantadpay: 'instantadpay', linkspin: 'linkspin', dlb: 'downlinebanners', downlinebanners: 'downlinebanners',
vbb: 'viralbannerblitz', viralbannerblitz: 'viralbannerblitz', stackpol: 'stackpol', earnerscorner: 'earnerscorner' };
vbb: 'viralbannerblitz', viralbannerblitz: 'viralbannerblitz', stackpol: 'stackpol', earnerscorner: 'earnerscorner',
dh: 'downlinehydra', downlinehydra: 'downlinehydra', vab: 'viraladblitz', viraladblitz: 'viraladblitz' };
function networkTemplate(src) { const k = NET_SRC[String(src || '').trim().toLowerCase()]; const t = k ? template(k) : null; return t && t.source === 'network' ? t : null; }
function networkSource(owner, src) {
const t = networkTemplate(src); if (!t || !owner) return null;