electrum: wire wss://silentmode.st/electrum as first-choice (port 443 reachable)
Bns-indexer on VPS was only exposed on port 50011 via nginx, which corporate
firewalls, mobile carriers, and many VPNs block. Added an nginx location on
443 that proxies to the same 127.0.0.1:50010, giving us a browser-friendly
WSS endpoint on the standard HTTPS port.
* lib/electrum.js CHIPNET_ELECTRUM: wss://silentmode.st/electrum listed
first (used by registrar.connect() + everything that depends on it).
* lib/resolver-web.js CHIPNET_ELECTRUM: same, kept in lockstep per the
"change both together" comment.
* bns-register.js bundle rebuilt to bake the new list.
* portal.html imports the bundle with ?v= so Chrome's in-memory ES-module
map doesn't serve a stale copy across tabs.
Portal now connects successfully; next remaining issue is that
bns-indexer only supports (server.version, get_history, transaction.get) —
`blockchain.scripthash.listunspent` for wallet address queries is not
implemented, so the "list your names" step fails there. Follow-up: add a
GET /api/holdings/<address> to public-gateway.mjs backed by the existing
BCHN electrum access, so the portal can pull holdings over plain HTTP.
This commit is contained in:
parent
3462c00188
commit
8532711563
2 changed files with 32 additions and 13 deletions
File diff suppressed because one or more lines are too long
|
|
@ -2408,6 +2408,8 @@ function normalizeURL(url) {
|
|||
}
|
||||
}
|
||||
function isHex32(input) {
|
||||
if (input.length !== 64)
|
||||
return false;
|
||||
for (let i22 = 0; i22 < 64; i22++) {
|
||||
let cc = input.charCodeAt(i22);
|
||||
if (isNaN(cc) || cc < 48 || cc > 102 || cc > 57 && cc < 97) {
|
||||
|
|
@ -3143,10 +3145,12 @@ var init_pool = __esm({
|
|||
this.closed = true;
|
||||
}
|
||||
this.relay.openSubs.delete(this.id);
|
||||
this.relay.ongoingOperations--;
|
||||
if (this.relay.ongoingOperations === 0) {
|
||||
this.relay.idleSince = Date.now();
|
||||
this.relay.scheduleIdleClose();
|
||||
if (!this.id.startsWith("<forced-ping>")) {
|
||||
this.relay.ongoingOperations--;
|
||||
if (this.relay.ongoingOperations === 0) {
|
||||
this.relay.idleSince = Date.now();
|
||||
this.relay.scheduleIdleClose();
|
||||
}
|
||||
}
|
||||
this.onclose?.(reason);
|
||||
}
|
||||
|
|
@ -3441,7 +3445,7 @@ var init_pool = __esm({
|
|||
});
|
||||
} catch (err) {
|
||||
this.onRelayConnectionFailure?.(url);
|
||||
return String("connection failure: " + String(err));
|
||||
return Promise.reject("connection failure: " + String(err));
|
||||
}
|
||||
return r.publish(event).catch(async (err) => {
|
||||
if (err instanceof Error && err.message.startsWith("auth-required: ") && params?.onauth) {
|
||||
|
|
@ -4496,6 +4500,8 @@ var init_base = __esm({
|
|||
|
||||
// node_modules/nostr-tools/lib/esm/nip59.js
|
||||
function isHex322(input) {
|
||||
if (input.length !== 64)
|
||||
return false;
|
||||
for (let i22 = 0; i22 < 64; i22++) {
|
||||
let cc = input.charCodeAt(i22);
|
||||
if (isNaN(cc) || cc < 48 || cc > 102 || cc > 57 && cc < 97) {
|
||||
|
|
@ -4690,8 +4696,21 @@ function wrapEvent(event, senderPrivateKey, recipientPublicKey) {
|
|||
return createWrap(seal, recipientPublicKey);
|
||||
}
|
||||
function unwrapEvent(wrap, recipientPrivateKey) {
|
||||
const unwrappedSeal = nip44Decrypt(wrap, recipientPrivateKey);
|
||||
return nip44Decrypt(unwrappedSeal, recipientPrivateKey);
|
||||
if (wrap.kind !== GiftWrap) {
|
||||
throw new Error(`unexpected wrap kind ${wrap.kind}, expected ${GiftWrap}`);
|
||||
}
|
||||
const seal = nip44Decrypt(wrap, recipientPrivateKey);
|
||||
if (seal.kind !== Seal) {
|
||||
throw new Error(`unexpected seal kind ${seal.kind}, expected ${Seal}`);
|
||||
}
|
||||
if (!verifyEvent2(seal)) {
|
||||
throw new Error("seal signature is invalid");
|
||||
}
|
||||
const rumor = nip44Decrypt(seal, recipientPrivateKey);
|
||||
if (rumor.pubkey !== seal.pubkey) {
|
||||
throw new Error(`rumor pubkey ${rumor.pubkey} does not match seal pubkey ${seal.pubkey}`);
|
||||
}
|
||||
return rumor;
|
||||
}
|
||||
var utf8Decoder2, utf8Encoder3, minPlaintextSize, maxPlaintextSize, extendedPrefixThreshold, verifiedSymbol2, isRecord2, JS2, i2, generateSecretKey2, getPublicKey2, finalizeEvent2, verifyEvent2, Seal, GiftWrap, TWO_DAYS, now, randomNow, nip44ConversationKey, nip44Encrypt, nip44Decrypt;
|
||||
var init_nip59 = __esm({
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue