Skip to content

Instantly share code, notes, and snippets.

View vishalxl's full-sized avatar
💭
I may be slow to respond.

Vishal vishalxl

💭
I may be slow to respond.
View GitHub Profile
@cmdruid
cmdruid / cloudflare-worker.js
Last active September 5, 2024 13:59
Import a (modified) NostrEmitter into a Cloudlfare Worker
/* Cloudflare Worker Script */
import NostrEmitter from './emitter.js'
const delay = (ms = 1000) => new Promise((r, _) => setTimeout(r, ms))
export default {
async fetch(request) {
let cache
const emitter = new NostrEmitter()
@melvincarvalho
melvincarvalho / nostr-tx-broadcast.js
Created April 27, 2023 08:16
nostr-tx-broadcast.js
const WebSocket = require('ws');
const bitcoin = require('bitcoinjs-lib');
const fetch = require('node-fetch');
const base64 = require('base64-js');
const relays = [
'wss://nostr.wine',
'wss://nos.lol',
'wss://nostr.fmt.wiz.biz',
'wss://nostr.zebedee.cloud',

Delete All Nostr Notes

This sends a delete request to all relays that have your data. This is a best effort and will likely not work well enough to actually delete everything, or possibly anything. A lot of relays do not respect delete requests.

  1. First download a list of relays:
curl -o relays.json https://api.nostr.watch/v1/online