Commit Graph

39 Commits

Author SHA1 Message Date
0187114918 fixed websocket client bugs 2025-08-17 09:48:01 +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
0f652a9043 all docker bits build now 2025-08-16 05:51:59 +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
2025-08-15 22:27:16 +01:00
acd2c41447 chore: go fmt 2025-08-15 15:56:10 -04: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
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.
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
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
b761a04422 fix a lot of tests
also a couple disable because they are weird
2025-08-07 22:39:18 +01:00
a4dd177eb5 roll back lerproxy 2025-08-07 21:04:44 +01:00
8898b20d4b Update walletcli usage message and bump version to v0.5.1
- cmd/walletcli/main.go
  - Fixed usage message to correctly escape double quotes around the NWC connection URL.

- pkg/version/version
  - Updated version from v0.5.0 to v0.5.1.
2025-08-07 09:39:26 +01:00
9c8ff2976d backporting relay client and pool from latest go-nostr 2025-08-06 22:18:26 +01:00
a7dd958585 Renamed NWC client methods and added RPCRaw wrappers
*   Renamed `NWCClient` to `nwc.NewNWCClient(opts)` in `cmd/nwcclient/main.go`
*   Added `RPCRaw` wrappers for NWC client methods in `pkg/protocol/nwc/methods.go`

**Updated walletcli main function**

*   Updated the main function in `cmd/walletcli/main.go` to use new NWC client and RPCRaw wrappers

**Added new methods for walletcli**

*   Added new methods for handling NWC client RPC calls, such as:
    *   `handleGetWalletServiceInfo`
    *   `handleMakeHoldInvoice`
    *   `handleSettleHoldInvoice`
    *   `handleCancelHoldInvoice`

**Code formatting and style changes**

*   Formatted code according to Go standard
*   Used consistent naming conventions and coding styles

**Other updates**

*   Updated dependencies and imported packages accordingly
2025-08-06 10:03:16 +01:00
b74f4757e7 refactor: Simplify NWC protocol structures and update method handling
- cmd/lerproxy/app/bufpool.go
  - Removed bufferPool-related code and `Pool` struct

- cmd/nwcclient/main.go
  - Renamed `Method` to `Capability` for clarity in method handling

- pkg/utils/values/values.go
  - Added utility functions to return pointers for various types

- pkg/utils/pointers/pointers.go
  - Revised documentation to reference `utils/values` package for pointer utilities

- pkg/protocol/nwc/types.go
  - Replaced redundant types and structures with simplified versions
  - Introduced dedicated structs for `MakeInvoice`, `PayInvoice`, and related results
  - Refactored `Transaction` and its fields for consistent type usage

- pkg/protocol/nwc/uri.go
  - Added `ParseConnectionURI` function for URI parsing and validation

- pkg/protocol/nwc/client.go
  - Refactored `Client` struct to improve key management and relay handling
  - Introduced `Request` struct for generic method invocation payloads
2025-08-05 20:18:32 +01:00
b9a713d81d simple performance benchmark tool 2025-08-05 10:54:53 -04:00
1ffb7afb01 implement first draft of nwc client and cli 2025-08-04 14:54:15 +01:00
c62d685fa4 implement cluster replication
todo: need to add chain of senders in a header to a header to prevent unnecessary sends
2025-07-31 15:55:07 +01:00
c68654dccc Fix documentation and code formatting issues
- cmd/lerproxy/README.md
  - Fixed grammar and punctuation in note about certificate selection
  - Improved clarity in instructions for appending intermediate certificates
  - Corrected wording in explanation of CLI tool issues with certificates

- cmd/lerproxy/app/reverse.go
  - Split long line for X-Forwarded-Host header comment to improve readability

- pkg/app/relay/server-publish.go
  - Reformatted comment block for function description to fit within line length limits
  - Added comments explaining why certain events aren't deleted from the database
  - don't delete any kind of directory events

- pkg/protocol/socketapi/handleReq.go
  - Split long lines for better readability in error message and log statements
  - Improved formatting of the notice envelope message

- pkg/app/config/config.go
  - Added new configuration fields for relay cluster replication authentication

- pkg/app/relay/publish/publisher.go
  - Removed redundant package imports and logging statements
2025-07-30 15:45:47 +01:00
72c6d16739 refactor lerproxy to be better laid out 2025-07-29 19:59:39 +01:00
366d35ec28 Refactor packages into main and remove redundant package declarations
- cmd/lerproxy/reverse/proxy.go
  - Changed package from 'reverse' to 'main'
  - Added standardized Forwarded header according to RFC 7239
  - Set X-Forwarded-* headers for backward compatibility
  - Updated URL path joining logic
- cmd/lerproxy/hsts/proxy.go
  - Changed package from 'hsts' to 'main'
  - Updated HSTS header setting
- cmd/lerproxy/timeout/conn.go
  - Changed package from 'timeout' to 'main'
- cmd/lerproxy/util/u.go
  - Changed package from 'util' to 'main'
- cmd/lerproxy/buf/bufpool.go
  - Changed package from 'buf' to 'main'
- cmd/lerproxy/main.go
  - Removed redundant package declarations and imports
  - Renamed struct and function names to follow camelCase convention
  - Updated server setup logic
- cmd/lerproxy/tcpkeepalive/listener.go
  - Changed package from 'tcpkeepalive' to 'main'
2025-07-29 19:00:41 +01:00
c36cec44c4 upgrade vainstr to actually using fast cgo, improve result format 2025-07-29 17:20:27 +01:00
f5c3da9bc3 Add systemd service file for lerproxy
- cmd/lerproxy/lerproxy.service
  - Created new file with systemd unit configuration to run lerproxy as a service
  - Defined [Unit], [Service], and [Install] sections with appropriate settings and dependencies
2025-07-25 17:46:47 +01:00
0e83a56025 completed first level of owners followed pubkeys 2025-07-19 19:37:30 +01:00
fc68bcf3cb moved everything into pkg/ 2025-07-17 13:18:55 +01:00
3aa56ebe66 Remove unused protocol packages and interfaces and clean up code 2025-07-16 07:46:19 +01:00
bc947f188c restructured repository layout to group together related types of things into folders 2025-07-13 23:09:19 +01:00
9b868cea17 migrate to mostly working old realy codebase, preparing to integrate new database and event codec 2025-07-12 22:14:40 +01:00