Skip to content

Instantly share code, notes, and snippets.

{
const sleepZeroMsgChannel = () => {
return new Promise((resolve) => {
const ch = new MessageChannel();
ch.port1.addEventListener('message', () => resolve());
ch.port2.postMessage(0);
ch.port1.start();
});
};
@syusui-s
syusui-s / batchedQuery.ts
Last active November 23, 2023 09:11
xk6-nostr バッチ化・集約化されたクエリの負荷テスト用
/*
Copyright 2023 Moyatani Shusui
original code is made by akiomik
https://github.com/akiomik/xk6-nostr
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0

Damus relay behavior investigation

2023-09-06

relay.damus.io (strfry v1.9.4 30b8c38) returns events in incorrect order.

I would say the relay should be updated with the latest version.

And, no new version of strfry has been released for a long time, even though there have been many commits since the last release.

/**
* To the extent possible under law, the person who associated CC0
* with this work has waived all copyright and related or
* neighboring rights to this work.
*
* https://creativecommons.org/publicdomain/zero/1.0/
*/
import fs from 'fs/promises';
import path from 'path';
import util from 'util';
class NostrEvent extends Event {
constructor(event) {
super('event');
this.event = event;
}
}
const createBatchSubscription = () => {
let timer = null;
let filters = [];

Keybase proof

I hereby claim:

  • I am syusui-s on github.
  • I am syusui_s (https://keybase.io/syusui_s) on keybase.
  • I have a public key whose fingerprint is 0AC8 2BCD E410 214C 2116 2FB5 9E40 A52F 2CB9 BE6A

To claim this, I am signing this object:

node_modules/
package-lock.json
/**
* This file is licensed under MIT license, not AGPL.
*
* Copyright (c) 2023 Syusui Moyatani
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
// This code is Public domain (Creative Commons Zero CC0-1.0)
// https://creativecommons.org/publicdomain/zero/1.0/deed.ja
// from nostr-tools (Public domains)
export type NostrEvent = {
id?: string;
kind: number;
tags: string[][];
pubkey: string;
content: string;