Getting Started¶
1. Start the stack¶
cd src/storage
deploy/scripts/up.sh
This starts relays, a signer, an origin, aggregators, a bridge, Dragonfly with a seed and a peer, Hyperdrive, and a registry.
2. Publish a file¶
head -c 50000000 /dev/urandom > big.bin
deploy/scripts/storage.sh file publish big.bin --propagate
The answer contains author and cid. With --propagate, the bridge of each region fetches the file into Dragonfly.
Paths are relative to the current directory, which is mounted into the tool.
3. Download it through peers¶
deploy/scripts/storage.sh file get <author> <cid> copy.bin
cmp big.bin copy.bin
4. Publish an asset¶
echo '{"name": "demo-model", "version": "1.0", "asset_path": "big.bin"}' > asset.json
deploy/scripts/storage.sh asset publish asset.json
deploy/scripts/storage.sh asset find --name demo-model
5. Start the media server¶
deploy/scripts/blossom.sh
docker run --rm --network storage_default -u "$(id -u):$(id -g)" -v "$PWD:/work" -w /work storage-go:dev \
blossomctl upload -server http://blossom:8080 -file big.bin -relay ws://relay-0:8080
The client creates its key blossom.key on first use.
6. Stop¶
bash -c '. deploy/scripts/lib.sh; load_env; compose --profile blossom stop; compose --profile blossom rm -f'
deploy/scripts/down.sh
The first command stops the whole stack including the media server, and the second removes its network. Data is kept.