What is Nostr?
david / David
npub1u5n…ldq3
2025-02-09 17:23:50
in reply to nevent1q…uf46

david on Nostr: Here’s the script I’m running now which took about 45 min: ``` #! /bin/bash sudo ...

Here’s the script I’m running now which took about 45 min:

```
#! /bin/bash

sudo /home/ubuntu/strfry/strfry export --since 0 >> /home/ubuntu/neo4jExport.json
sudo mv /home/ubuntu/neo4jExport.json /var/lib/neo4j/import/neo4jExport.json

cypher-shell -u XXXX -p XXXX -a bolt://localhost:7687 -f /home/ubuntu/apocCypherCommand

sudo rm /var/lib/neo4j/import/neo4jExport.json
```

And here’s apocCypherCommand:
```
CALL apoc.periodic.iterate(
"CALL apoc.load.json('file:///neo4jExport.json') YIELD value AS event",
"
MERGE (u:ApocNostrUser {pubkey:event.pubkey})
ON CREATE SET u.proceses=['initialization'], u.foo='bar'
MERGE (e:ApocNostrEvent {event_id:event.id})
ON CREATE SET e.kind=event.kind, e.created_at=event.created_at, e.author=event.pubkey, e.processes=['initialiation'], e.foo='bar'
WITH u, e
MATCH (e2:ApocNostrEvent) WHERE e2.author=e.author AND e2.kind=1 MERGE (u)-[r:AUTHOR {foo:'bar'}]->(e2)
",
{ batchSize:1000, parallel:true}
)
;
```

Some of the things like the edges I’m adding now just to see if I have the syntax right.

I’ll probably replace strfry export with strfry scan so I can use filters
Author Public Key
npub1u5njm6g5h5cpw4wy8xugu62e5s7f6fnysv0sj0z3a8rengt2zqhsxrldq3