Made for matrix-org/synapse#13575
Dumps state events into your local Synapse current_state_events
database table.
Usage:
- Download some state events:
GET https://matrix-client.matrix.org/_matrix/client/r0/rooms/!OGEhHVWSdvArJzumhm:matrix.org/state
- Update the
stateEvents
JSON file path in the script. node dump.js
Dumps state events into your local Synapse events
and current_state_events
database table. Will also insert filler events in between your actual events so that Postgres doesn't have such an ideal environment to query in.
Usage:
- Download some state events:
GET https://matrix-client.matrix.org/_matrix/client/r0/rooms/!OGEhHVWSdvArJzumhm:matrix.org/state
- Update the
stateEvents
JSON file path in the script. - Adjust the
DUPLICATION_FACTOR
variable to your liking. This is the amount of filler events that will be inserted between each actual state event.- You can clean up these filler events later with:
psql synapse
->DELETE FROM events where room_id = '!fake-room:fake-homeserver';
andDELETE FROM current_state_events where room_id = '!fake-room:fake-homeserver';
- You can clean up these filler events later with:
node dump-with-extra-filler.js