Skip to content

Commit ff631b6

Browse files
authored
Merge branch 'main' into refactor/admit-user-stored-func
2 parents dfe65cc + 12688ec commit ff631b6

34 files changed

Lines changed: 5150 additions & 12540 deletions

.github/workflows/checks.yml

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -129,25 +129,6 @@ jobs:
129129
with:
130130
name: integration-coverage-lcov
131131
path: .coverage/integration/lcov.info
132-
sonarcloud:
133-
name: Sonarcloud
134-
needs: [test-units-and-cover, test-integrations-and-cover]
135-
if: ${{ github.event_name != 'pull_request' || !github.event.pull_request.head.repo.fork }}
136-
runs-on: ubuntu-latest
137-
steps:
138-
- name: Checkout
139-
uses: actions/checkout@v3
140-
with:
141-
fetch-depth: 0
142-
- uses: actions/download-artifact@v4
143-
name: Download unit & integration coverage reports
144-
with:
145-
path: .coverage
146-
- name: SonarCloud Scan
147-
uses: sonarsource/sonarcloud-github-action@master
148-
env:
149-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
150-
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
151132
post-tests:
152133
name: Post Tests
153134
needs: [test-units-and-cover, test-integrations-and-cover]

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v18.8.0
1+
v24.14.1

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:18-alpine3.16 AS build
1+
FROM node:24-alpine AS build
22

33
WORKDIR /build
44

@@ -10,7 +10,7 @@ COPY . .
1010

1111
RUN npm run build
1212

13-
FROM node:18-alpine3.16
13+
FROM node:24-alpine
1414

1515
LABEL org.opencontainers.image.title="Nostream"
1616
LABEL org.opencontainers.image.source=https://github.com/cameri/nostream

Dockerfile.railwayapp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
## Author Saransh Sharma @cynsar foundation
2-
FROM node:18-alpine3.16 as build
2+
FROM node:24-alpine as build
33

44
ARG PORT
55
ARG PGHOST
@@ -29,7 +29,7 @@ COPY . .
2929

3030
RUN npm run build
3131

32-
FROM node:18-alpine3.16
32+
FROM node:24-alpine
3333

3434
ARG PORT
3535
ARG PGHOST

Dockerfile.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:18-alpine3.16
1+
FROM node:24-alpine
22

33
WORKDIR /code
44

README.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ NIPs with a relay-specific implementation are listed here.
6767
### Standalone setup
6868
- PostgreSQL 14.0
6969
- Redis
70-
- Node v18
70+
- Node v24
7171
- Typescript
7272

7373
### Docker setups
@@ -230,6 +230,29 @@ Print the Tor hostname:
230230
./scripts/print_tor_hostname
231231
```
232232
233+
### Importing events from JSON Lines
234+
235+
You can import NIP-01 events from a `.jsonl` file directly into the relay database.
236+
237+
Basic import:
238+
```
239+
npm run import -- ./events.jsonl
240+
```
241+
242+
Set a custom batch size (default: `1000`):
243+
```
244+
npm run import -- ./events.jsonl --batch-size 500
245+
```
246+
247+
The importer:
248+
249+
- Processes the file line-by-line to keep memory usage bounded.
250+
- Validates NIP-01 schema, event id hash, and Schnorr signature before insertion.
251+
- Inserts in database transactions per batch.
252+
- Skips duplicates without failing the whole import.
253+
- Prints progress in the format:
254+
`[Processed: 50,000 | Inserted: 45,000 | Skipped: 5,000 | Errors: 0]`
255+
233256
### Running as a Service
234257
235258
By default this server will run continuously until you stop it with Ctrl+C or until the system restarts.

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ services:
114114
retries: 5
115115

116116
nostream-migrate:
117-
image: node:18-alpine3.16
117+
image: node:24-alpine
118118
container_name: nostream-migrate
119119
environment:
120120
DB_HOST: nostream-db

0 commit comments

Comments
 (0)