This is a proof of concept for a simple Node.js server that splits, stamps and distributes chunks to multiple Bee nodes.
Run npm install
.
Run npm run build
.
https://hub.docker.com/r/blossomlabs/chunkstorm/
Create a .env
file in the project root directory based on .env.example
.
BATCH_ID
: The Ethereum batch ID for stamping chunks (hexadecimal string)- Format:
0x
followed by 64 hexadecimal characters
- Format:
-
Option 1: Private Key
PRIVATE_KEY
: Your Ethereum private key for signing stamps
-
Option 2: Keystore File
KEYSTORE_PATH
: Path to your Ethereum keystore fileKEYSTORE_PASSWORD
: Password to decrypt the keystore file
-
BEE_ENDPOINT
: URL of the Bee node API- Default:
http://localhost:1633
- Default:
-
PORT
: Port number for the Chunkstorm server- Default:
3050
- Default:
-
STAMPERSTORE_PATH
: Directory path to store stamper binary files- Default:
.
(current directory)
- Default:
Start the server with node dist
.
Run the benchmark with node dist/perf.js
.
The benchmark uploads 45 randomly generated 128KB files to the server. It should finish in less than 12 seconds.
The current stamper in Bee-JS finished in 40301ms.
This was brought down to 21467ms by switching to an optimized stamper.
Another 2.5X speedup could be achieved by a faster secp256k1 signature implementation.