Install dependencies with:
bun installAnd then:
cd shared/models && mkdir dist && bun run --filter @shared/models buildInitialize the project:
tlp initChoose ./timeleap as the location of nodes and select both broker and worker.
Now you’ll have secrets generated in:
./timeleap/secrets/worker_secrets.yaml
./timeleap/secrets/broker_secrets.yaml
and a base config at:
./timeleap/config.yaml
Each app has its own .env file:
apps/client/.envapps/plugin/.env
Create apps/client/.env:
cp apps/client/.env.example apps/client/.envFill BROKER_PUBLIC_KEY from ./timeleap/secrets/broker_secrets.yaml
And BROKER_URI from ./timeleap/config.yaml:
BROKER_PUBLIC_KEY=91sP4tqxy7rA6hN8mVbLDp2XwEoFUQnJ5kC3iYgTHZMz
BROKER_URI=ws://broker:9123/1.0.0Create apps/plugin/.env:
cp apps/plugin/.env.example apps/plugin/.envFill in values using:
WORKER_PUBLIC_KEY→ fromworker_secrets.yamlBROKER_PUBLIC_KEY→ frombroker_secrets.yamlPLUGIN_PRIVATE_KEY→ generated by the plugin utility (see below)PLUGIN_PUBLIC_KEY→ generated by the plugin utility (see below)APP_ID→ optional (can be null)
Example:
WORKER_PUBLIC_KEY=EN1N19wf6uoGWtNydVDF6L9MpgT7yQGyvyj2tSCgJdp1
PLUGIN_PRIVATE_KEY=8vAco6ppdLSVLdMgeqLptSXtaeM6Kbqtqu3X7ePsGSAi
BROKER_PUBLIC_KEY=37iPtisyYXSQoCTUtsFWX4mwAMtKmFYStcX9QZxzVDnA
PLUGIN_PUBLIC_KEY=91sP4tqxy7rA6hN8mVbLDp2XwEoFUQnJ5kC3iYgTHZMz
APP_ID=1337The apps/plugin package provides a utility for generating a key.
From the root of the repository, run:
bun run --filter @apps/plugin generate:keyYou’ll get two keys:
sk→ your plugin private key (PLUGIN_PRIVATE_KEY)- the other → public key (used in
PLUGIN_PUBLIC_KEYor for sharing)
Save these keys securely.
Raplce this with plugins: [] inside the config.yaml:
plugins:
- type: websocket
name: swiss.timeleap.watermarker
endpoint: ws://swiss.timeleap.watermarker
publicKey: ${PLUGIN_PUBLIC_KEY}
functions:
- name: addWatermarkToImage
fee:
amount: 1
currency: USDEither add Broker and Plugin's public key manually in config.yaml or make .env in root directory containing:
WORKER_PUBLIC_KEY=
PLUGIN_PRIVATE_KEY=
BROKER_URI=
BROKER_PUBLIC_KEY=Once your environment files are ready:
tlp compose up --build