✂️ Implement message chunking mechanism for NIP-44 size limit compliance
This ensures all messages can be properly encrypted and transmitted regardless of size. Fixes issue #2
This commit is contained in:
parent
a4134fa416
commit
89d9dc3cbe
4 changed files with 246 additions and 65 deletions
24
consts.ts
24
consts.ts
|
@ -18,3 +18,27 @@ export const MIN_POW = 8;
|
|||
* - Difficulty 21: ~5-6 seconds
|
||||
*/
|
||||
export const POW_TO_MINE = 10;
|
||||
|
||||
/**
|
||||
* Maximum size of a note chunk in bytes.
|
||||
*
|
||||
* This value determines the maximum size of a note that can be encrypted and
|
||||
* sent in a single chunk.
|
||||
*/
|
||||
export const MAX_CHUNK_SIZE = 32768;
|
||||
|
||||
/**
|
||||
* Interval for cleaning up expired note chunks in milliseconds.
|
||||
*
|
||||
* This value determines how often the relay will check for and remove expired
|
||||
* note chunks from the database.
|
||||
*/
|
||||
export const CHUNK_CLEANUP_INTERVAL = 1000 * 60 * 60;
|
||||
|
||||
/**
|
||||
* Maximum age of a note chunk in milliseconds.
|
||||
*
|
||||
* This value determines the maximum duration a note chunk can remain in the
|
||||
* database before it is considered expired and eligible for cleanup.
|
||||
*/
|
||||
export const CHUNK_MAX_AGE = 1000 * 60 * 60 * 24;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue