Skip to main content
storage-daemon downloads and shares TON Storage bags. storage-daemon-cli is the console client used to control it.

Prerequisites

  • Linux, macOS, or Windows host with at least a dual-core 1 GHz CPU, 2 GB RAM, 2 GB SSD (plus space for bags), and stable 10 Mb/s bandwidth with a public/static IP
  • Global network config file, for example global.config.json from the TON configs

Install storage-daemon

  • Download prebuilt storage-daemon and storage-daemon-cli binaries from TON auto builds (built from the testnet branch).
  • Or build from source in the ton-blockchain/ton repository (target: storage-daemon and storage-daemon-cli).

Start the daemon

Run the daemon with explicit ports and a data directory:
storage-daemon -v 3 -C global.config.json -I <IP>:3333 -p 5555 -D storage-db
  • -v — log verbosity (3 = INFO)
  • -C — path to the global network config
  • -I — ADNL listen IP and port (<IP> is the public or reachable address of the host)
  • -p — TCP port for the console interface
  • -D — path to the daemon database; CLI keys are generated inside the cli-keys/ subdirectory on first start
Open the console port in the firewall only when needed. Keep the daemon bound to localhost when storage-daemon-cli runs on the same host.

Connect with storage-daemon-cli

Point the CLI at the console port and keypair generated by the daemon:
storage-daemon-cli -I 127.0.0.1:5555 -k storage-db/cli-keys/client -p storage-db/cli-keys/server.pub
  • -I — daemon host and console port
  • -k — client private key path
  • -p — server public key path (CLI option, not a port)
storage-daemon-cli can also run non-interactively:
storage-daemon-cli ... -c "add-by-meta bag-meta.bag" -c "list --hashes"

Add bags for download

Download by bag ID hash or by meta file:
add-by-hash <BAG_ID> -d <DOWNLOAD_DIR>
add-by-meta <META_FILE> -d <DOWNLOAD_DIR>
  • <BAG_ID> — 64-character hex bag ID
  • <DOWNLOAD_DIR> — target directory for downloaded files
  • <META_FILE> — path to the bag meta file
  • If -d is omitted, files are saved to the daemon’s default storage directory.
list shows added bags; list --hashes prints full IDs. Use either the numeric ordinal from list (valid only for the current session) or the full ID in other commands.

Inspect and control transfers

  • get <BAG_ID> — show description, size, speed, and file list
  • get-peers <BAG_ID> — list connected peers
  • download-pause <BAG_ID> / download-resume <BAG_ID> — control downloads
  • upload-pause <BAG_ID> / upload-resume <BAG_ID> — control uploads
  • remove <BAG_ID> — remove the bag
  • remove --remove-files <BAG_ID> — remove the bag and files (files are always removed if stored in the daemon’s internal directory)
remove --remove-files deletes local files. Run it only when the files are backed up or no longer needed.

Partial downloads and priorities

Download only selected files by setting priorities:
add-by-hash <BAG_ID> -d <DOWNLOAD_DIR> --partial file1 file2
add-by-meta <META_FILE> -d <DOWNLOAD_DIR> --partial file1 file2
Each file has a priority 0–255; 0 disables download. --partial sets listed files to 1 and all others to 0. Update priorities after adding the bag:
  • priority-all <BAG_ID> <priority> — set the same priority for every file
  • priority-idx <BAG_ID> <index> <priority> — set by file index from get
  • priority-name <BAG_ID> <name> <priority> — set by file name
Priorities can be set before the full file list loads.
  • <priority> — integer priority from 0 (do not download) to 255 (highest)
  • <index> — file index from the get output
  • <name> — file name from the get output

Create and share a bag

Create a bag from a file or directory and start seeding:
create <PATH> -d "Description of the bag"
  • <PATH> — file or directory to include in the bag
Options:
  • --no-upload — create the bag without uploading; enable later with upload-resume
  • --copy — copy files into the daemon’s internal directory before seeding
After creation the CLI prints the bag ID. Share the meta file if others need a .torrent-like descriptor:
get-meta <BAG_ID> <META_FILE>
  • <META_FILE> — path to save the generated meta file