- Event Kind: 20000 (custom geohash events)
- Required Tags:
gtag with geohash valuentag with nickname (optional)
- Content: Any message content
-
Make sure the server is running (from your project root):
npm start
-
In a new terminal, run the test publisher (from the same project root):
node test-publisher.js
-
Open your browser to the address printed by the server (or your deployment URL) and watch the map light up.
-
Install nostril:
go install github.com/fiatjaf/nostril@latest
-
Generate a test private key:
nostril --gen-key
-
Publish a test geohash event:
nostril \ --kind 20000 \ --tag g:dr5regy7 \ --tag n:TestUser \ --content "Test geohash event from NYC" \ --sec YOUR_PRIVATE_KEY_HERE \ --relay wss://relay.damus.ioGeohash examples:
dr5regy7= New York City areagcpvj0du= London areaxn774c06= Tokyo arear3gx2f77= Sydney area
const { generatePrivateKey, getPublicKey, finishEvent, relayInit } = require('nostr-tools');
const ngeohash = require('ngeohash');
const sk = generatePrivateKey();
const pk = getPublicKey(sk);
// Create geohash event
const event = finishEvent({
kind: 20000,
created_at: Math.floor(Date.now() / 1000),
tags: [
['g', ngeohash.encode(40.7128, -74.0060, 8)], // NYC coordinates
['n', 'MyTestUser']
],
content: 'Hello from the heatmap!'
}, sk);
// Publish to relay
const relay = relayInit('wss://relay.damus.io');
relay.connect().then(() => {
relay.publish(event);
});- No events showing up: Check the browser console and server logs for errors
- Events not validating: Ensure your events have proper signatures and structure
- Relay connection issues: Try different relays from the list in server.js
After publishing test events, you should see:
- Points appear on the heatmap at the geohash locations
- Server logs showing received events
- Data visible in the web interface