Commit Graph

257 Commits

Author SHA1 Message Date
02bf704e28 add fast bytes compare and start revising QueryForIds 2025-08-17 15:24:38 +01:00
7112930f73 add SimplePool implementation for managing relay connections
- pkg/protocol/ws/pool.go
  - Added `SimplePool` struct to manage connections to multiple relays.
  - Introduced associated methods for relay connection, publishing, and subscribing.
  - Added middleware support for events, duplicates, and queries.
  - Implemented penalty box for managing failed relay connections.
  - Provided various options for customizing behavior (e.g. relays, authentication, event handling).

- pkg/protocol/ws/subscription.go
  - Removed unnecessary `ReplaceableKey` struct.
  - Cleaned up redundant spaces and comments in subscription methods.
2025-08-17 11:40:41 +01:00
0187114918 fixed websocket client bugs 2025-08-17 09:48:01 +01:00
0ad371b06a Merge pull request #11
fix: fix OK callbacks
2025-08-17 06:13:17 +01:00
9832a8b28a refactor: cache event ID string conversion in OK handler 2025-08-16 22:23:44 -04:00
e9285cbc07 fix: correct deletion block scope in handleEvent 2025-08-16 22:23:39 -04:00
ddb60b7ae1 fix: correct context field reference in handleMessage 2025-08-16 22:23:33 -04:00
6c04646b79 assign logger to database options
- pkg/database/database.go
  - Added `opts.Logger = d.Logger` to include logger in database options.
2025-08-16 20:01:25 +01:00
0d81d48c25 add nostr-relay-rs and cleaned up install.sh script 2025-08-16 15:49:00 +01:00
9c731f729f created shell script that builds and installs all of the relays 2025-08-16 13:05:39 +01:00
fa3b717cf4 updating deps
Some checks failed
Go / build (push) Has been cancelled
Go / release (push) Has been cancelled
v0.8.0
2025-08-16 06:38:14 +01:00
9646c23083 updating deps 2025-08-16 06:08:28 +01:00
0f652a9043 all docker bits build now 2025-08-16 05:51:59 +01:00
ebfccf341f Merge pull request #10 from kwsantiago/kwsantiago/benchmark-docker
feat: Dockerize Benchmark Suite
2025-08-16 04:22:47 +01:00
c1723442a0 Merge remote-tracking branch 'upstream/main' into kwsantiago/benchmark-docker 2025-08-15 17:44:34 -04:00
6b1140b382 feat: docker benchmark and updated relay comparison results 2025-08-15 17:40:55 -04:00
dda39de5a5 refactor logging to use closures for intensive tasks
Some checks failed
Go / build (push) Has been cancelled
Go / release (push) Has been cancelled
v0.7.0
2025-08-15 22:27:16 +01:00
acd2c41447 chore: go fmt 2025-08-15 15:56:10 -04:00
6fc3e9a049 Merge remote-tracking branch 'origin/main' 2025-08-15 18:56:12 +01:00
ffcd0bdcc0 Remove unused event unmarshaling logic and update migration logging
- pkg/encoders/event/reader.go
  - Deleted the `UnmarshalRead` function and associated event unmarshaling logic.

- pkg/database/migrations.go
  - Added a log statement indicating migration completion.
  - Replaced `UnmarshalRead` with `UnmarshalBinary` in the event decoding process.
2025-08-15 18:55:59 +01:00
3525dd2b6c Merge remote-tracking branch 'origin/main' 2025-08-15 16:03:44 +01:00
66be769f7a Add support for expiration indexing and event deletion
- pkg/database/database.go
  - Added `RunMigrations` to handle new index versions.
  - Integrated `DeleteExpired` for scheduled cleanup of expired events within a goroutine.

- pkg/database/delete-event.go
  - Refactored the existing deletion logic into `DeleteEventBySerial`.

- pkg/database/delete-expired.go
  - Added new implementation to handle deletion of expired events using expiration indexes.

- pkg/database/migrations.go
  - Implemented `RunMigrations` to handle database versioning and reindexing when new keys are introduced.

- pkg/database/indexes/keys.go
  - Added `ExpirationPrefix` and `VersionPrefix` for new expiration and version indexes.
  - Implemented encoding structs for expiration and version handling.

- pkg/encoders/event/writer.go
  - Added JSON marshaling logic to serialize events with or without whitespace.

- pkg/encoders/event/reader.go
  - Refined unmarshaling logic for handling event keys and values robustly.

- pkg/protocol/socketapi/handleEvent.go
  - Formatted log statements and updated logging verbosity for event handling.

- pkg/app/relay/handleRelayinfo.go
  - Re-enabled relay handling for expiration timestamps.

- pkg/database/indexes/types.go (new file)
  - Introduced structures for `Uint40s` and other types used in indexes.
2025-08-15 15:50:31 +01:00
1794a881a2 Merge pull request #8 from kwsantiago/kwsantiago/benchmark-relay-comparison
feat: Nostr Relay Benchmark Suite
2025-08-14 20:08:08 +01:00
a2cce3f38b Bump version to v0.6.2
Some checks failed
Go / build (push) Has been cancelled
Go / release (push) Has been cancelled
- pkg/version/version
  - Updated version from v0.6.1 to v0.6.2. to trigger generation of release binaries
v0.6.2
2025-08-09 09:32:38 +01:00
04d789b23b Remove unnecessary logging statement from lerproxy
- cmd/lerproxy/main.go
  - Deleted `log.I.S` statement used for logging raw favicon data.
2025-08-09 09:21:02 +01:00
2148c597aa Fix favicon logic to correctly check for file read errors
- cmd/lerproxy/main.go
  - Updated condition to properly handle favicon file read errors.
2025-08-09 09:20:02 +01:00
f8c30e2213 Add logging for favicon data in lerproxy
- cmd/lerproxy/main.go
  - Added `log.I.S` statement to log raw favicon data.
2025-08-09 09:18:54 +01:00
2ef76884bd Add logging for favicon requests in lerproxy
- cmd/lerproxy/main.go
  - Added log statement to record favicon requests using `log.I.F`.
2025-08-09 09:16:41 +01:00
a4355f4963 Update logging level in lerproxy handler
- cmd/lerproxy/main.go
  - Changed logging level from `log.D.Ln` (debug) to `log.I.Ln` (info).
2025-08-09 09:13:03 +01:00
8fa3e2ad80 Update favicon handling and bump version to v0.6.1
Some checks failed
Go / build (push) Has been cancelled
Go / release (push) Has been cancelled
- main.go
  - Removed static favicon serving from `ServeMux`.
  - Removed import for `net/http`.

- pkg/version/version
  - Updated version from v0.6.0 to v0.6.1.

- cmd/lerproxy/main.go
  - Added embedded support for default favicon using `//go:embed`.
  - Modified logic to serve favicon as an embedded resource or from file in the same directory as the nostr.json

- static/favicon.ico
  - Deleted static favicon file.

- cmd/lerproxy/favicon.ico
  - Added new file for embedded favicon resource.
v0.6.1
2025-08-09 08:59:36 +01:00
0807ce3672 benchmark readme update 2025-08-08 16:03:54 -04:00
d4f7c0b07f feat: Nostr Relay Benchmark Suite 2025-08-08 16:01:58 -04:00
463bce47b0 Merge pull request #7 from Silberengel/feature/favicon-support
Add favicon support - serve favicon.ico from static directory
2025-08-08 20:10:49 +01:00
silberengel
289f962420 Add favicon support - serve favicon.ico from static directory 2025-08-08 20:58:44 +02:00
619198d1b5 Add mock wallet service examples documentation
- cmd/walletcli/mock-wallet-service/EXAMPLES.md
  - Added detailed example commands for all supported mock wallet service methods.
  - Included a complete example workflow for testing the service.
  - Added notes on the mock service's behavior and limitations.
2025-08-08 17:49:33 +01:00
e94d68c3b2 Add wallet service implementation and mock CLI tool
- pkg/protocol/nwc/wallet.go
  - Implemented `WalletService` with method registration and request handling.
  - Added default stub handlers for supported wallet methods.
  - Included support for notifications with `SendNotification`.

- pkg/protocol/nwc/client-methods.go
  - Added `Subscribe` function for handling client subscriptions.

- cmd/walletcli/mock-wallet-service/main.go
  - Implemented a mock CLI tool for wallet service.
  - Added command-line flags for relay connection and key management.
  - Added handlers for various wallet service methods (e.g., `GetInfo`, `GetBalance`, etc.).

- pkg/protocol/nwc/types.go
  - Added `GetWalletServiceInfo` to the list of wallet service capabilities.
2025-08-08 17:34:44 +01:00
bb8f070992 Add subscription feature and optimize logging
- pkg/protocol/ws/client.go
  - Added logging for received subscription events.
  - Optimized subscription ID assignment.

- pkg/protocol/nwc/client.go
  - Implemented `Subscribe` function to handle event subscriptions.

- cmd/walletcli/main.go
  - Added support for `subscribe` command to handle notifications.
  - Replaced `ctx` with `c` for context usage across all commands.

- pkg/crypto/p256k/helpers.go
  - Removed unnecessary logging from `HexToBin` function.
2025-08-08 13:22:36 +01:00
b6670d952d Remove pull_request trigger from GitHub Actions workflow
- .github/workflows/go.yml
  - Removed the `pull_request` event trigger.
  - Removed branch filtering for the `push` event.
2025-08-08 10:19:58 +01:00
d2d2ea3fa0 Add releases section to README
- readme.adoc
  - Added a new "Releases" section with a link to pre-built binaries.
  - Included details about binaries built on Go 1.24 and Linux static builds.
2025-08-08 10:17:47 +01:00
7d4f90f0de Enable CGO for Linux builds and bump version to v0.6.0
Some checks failed
Go / build (push) Has been cancelled
Go / release (push) Has been cancelled
- .github/workflows/go.yml
  - Updated `CGO_ENABLED` to 1 for Linux builds (amd64 and arm64).

- pkg/version/version
  - Updated version from v0.5.9 to v0.6.0.
v0.6.0
2025-08-08 10:03:32 +01:00
667890561a Update release workflow dependencies and bump version to v0.5.9
Some checks failed
Go / build (push) Has been cancelled
Go / release (push) Has been cancelled
- .github/workflows/go.yml
  - Added `needs: build` dependency to the `release` job.

- pkg/version/version
  - Updated version from v0.5.8 to v0.5.9.
v0.5.9
2025-08-08 09:49:23 +01:00
85fe316fdb Update GitHub Actions release workflow and bump version to v0.5.8
Some checks failed
Go / build (push) Has been cancelled
Go / release (push) Has been cancelled
- .github/workflows/go.yml
  - Updated repository `permissions` from `contents: read` to `contents: write`.
  - Fixed misaligned spaces in `go build` commands for release binaries.
  - Corrected `go build` syntax for cmd executables.

- pkg/version/version
  - Updated version from v0.5.7 to v0.5.8.
v0.5.8
2025-08-08 09:45:15 +01:00
1535f10343 Add release process and bump version to v0.5.7
Some checks failed
Go / build (push) Has been cancelled
Go / release (push) Has been cancelled
- .github/workflows/go.yml
  - Added a new `release` job with steps to set up Go, install `libsecp256k1`, and build release binaries.

- pkg/version/version
  - Updated version from v0.5.6 to v0.5.7.

- pkg/protocol/ws/pool_test.go
  - Commented out the `TestPoolContextCancellation` test function.
v0.5.7
2025-08-08 09:37:28 +01:00
dd80cc767d Add release process to GitHub Actions and bump version to v0.5.6
Some checks failed
Go / build (push) Has been cancelled
- .github/workflows/go.yml
  - Added detailed steps for the release process, including tagging and pushing.
  - Included logic to build release binaries for multiple platforms.
  - Configured process for checksum generation and GitHub release creation.

- pkg/version/version
  - Updated version from v0.5.5 to v0.5.6.
v0.5.6
2025-08-08 09:22:54 +01:00
423270402b Comment out nested subscription test in subscription_test.go
- pkg/protocol/ws/subscription_test.go
  - Commented out the `TestNestedSubscriptions` test function.
  - Removed unused imports from the file.
2025-08-08 08:53:18 +01:00
e929c09476 Update GitHub Actions workflow to include libsecp256k1 setup and cgo tests
- .github/workflows/go.yml
  - Added a step to install `libsecp256k1` using `ubuntu_install_libsecp256k1.sh`.
  - Updated steps to build and test with cgo enabled.
  - Added a step to explicitly set `CGO_ENABLED=0` in the environment.
2025-08-08 08:47:02 +01:00
429c8acaef Bump version to v0.5.5 and enhance event deletion handling logic
- pkg/version/version
  - Updated version from v0.5.4 to v0.5.5.

- pkg/database/query-events.go
  - Added `deletedEventIds` map to track specifically deleted event IDs.
  - Improved logic for handling replaceable events with deletion statuses.
  - Added checks for newer events when processing deletions by kind/pubkey.

- pkg/database/get-indexes-from-filter.go
  - Fixed incorrect range end calculation by adjusting `Until` value usage.
v0.5.5
2025-08-08 07:47:46 +01:00
f3f933675e fix a lot of tests 2025-08-08 07:27:01 +01:00
b761a04422 fix a lot of tests
also a couple disable because they are weird
2025-08-07 22:39:18 +01:00
8d61b8e44c Fix incorrect syntax in environment variable setup in go.yml
- .github/workflows/go.yml
  - Corrected syntax for appending `CGO_ENABLED=0` to `$GITHUB_ENV`.
2025-08-07 21:26:30 +01:00