Run on the Zen testnet
Run your own indexd on Sia's Zen testnet with free test coins, connect Sluby to it, and play a video, without a sia.storage account.
Zen is Sia's testnet: the same software as mainnet, with coins that have no value and a free faucet. This page runs your own indexer (indexd) on Zen next to Sluby, so you can try the whole platform without a sia.storage account. It was last run end to end on November 30, 2026 with indexd 0.6.5 and @siafoundation/sia-storage 0.1.5.
For real use, connect to mainnet with sia.storage instead. Zen's hosts are run by volunteers for testing and can lose data or go offline.
What is different on Zen
Zen has a small host pool: 14 hosts were online on November 30, 2026, and only 11 of them had free space (zen.siascan.com). Three defaults assume a mainnet sized pool:
- Shards per slab. Sluby stores each slab as data plus parity shards, every shard on a different host. The default of 10 + 20 needs 30 hosts.
- The redundancy check. Both indexd and the Sia SDK refuse a shard ratio unless it gives at least a 99.99% chance of recovering a slab, assuming each host stays available with probability 0.75, and redundancy between 1.5x and 4x. With fewer than 12 hosts no ratio passes: the smallest that do are 3 + 9 (12 hosts) and 4 + 10 (14 hosts). This page builds indexd and the SDK with the availability raised to 0.90, which lets 2 data + 4 parity shards through: 3x redundancy, on 6 hosts. Fewer shards than hosts leaves room for the Zen hosts that refuse data: in the test run one host answered "not enough storage" while it reported free space, and others dropped uploads with "stream idle". The SDK moves a shard to another host when that happens, as long as one is left.
- Account readiness. indexd reports an app's account as ready once it has funded 30 host accounts. On Zen it never gets there, so the connect script reports the account as not ready, and the Studio's overview says "This server cannot reach the Sia indexer" and leaves Connect Sia not done. Uploads and playback work regardless.
Requirements
- Everything listed in the quickstart, except the sia.storage account.
- Git, to fetch the indexd and Sia SDK source.
- About an hour, most of it waiting: for indexd to sync, and for Zen blocks (about 10 minutes apart) to confirm the faucet payment and the first contracts.
Set up
Run every command in the folder where you cloned Sluby. Steps that differ from the quickstart are spelled out here; the rest link back to it.
Get the code and create .env
git clone https://github.com/justmert/Sluby.git
cd Sluby
cp .env.example .envAdd a password for the indexer's database to .env:
INDEXD_POSTGRES_PASSWORD=<any long random string>Build indexd and the Sia SDK for Zen
Build indexd 0.6.5 with the host availability raised to 0.90. The build uses indexd's own Dockerfile:
git clone --depth 1 --branch v0.6.5 https://github.com/SiaFoundation/indexd ../indexd
perl -pi -e 's/const recoveryProbability = 0\.75/const recoveryProbability = 0.90/' ../indexd/slabs/slabs.go
docker build -t indexd-zen:0.6.5 ../indexdBuild the Sia SDK's native module with the same change, from the source of the SDK version the backend installs. On an ARM64 machine (such as an Apple silicon Mac):
git clone --depth 1 --branch sia_storage_napi/v0.11.1 https://github.com/SiaFoundation/sia-sdk-rs ../sia-sdk-rs
perl -pi -e 's/const RECOVERY_PROBABILITY: f64 = 0\.75;/const RECOVERY_PROBABILITY: f64 = 0.90;/' ../sia-sdk-rs/sia_storage/src/lib.rs
docker run --rm -v "$PWD/../sia-sdk-rs:/src" -w /src rust:1-trixie cargo build --release -p sia_storage_napi
mkdir -p backend/vendor/sia-storage-linux-arm64-gnu
cp ../sia-sdk-rs/target/release/libsia_storage_napi.so backend/vendor/sia-storage-linux-arm64-gnu/sia-storage.nodeOn an x86-64 machine, add --platform linux/amd64 after docker run --rm and use the directory sia-storage-linux-x64-gnu in the last two lines. backend/vendor/README.md has the details.
Point the stack at both builds in .env, with the directory you used:
INDEXD_IMAGE=indexd-zen:0.6.5
SIA_STORAGE_NATIVE=sia-storage-linux-arm64-gnu/sia-storage.nodeConfigure indexd
cp zen/indexd.example.yml zen/indexd.yml
docker compose -f docker-compose.yml -f docker-compose.sia.yml run --rm --no-deps indexd seedThe second command prints a new wallet for the indexer:
Recovery Phrase: <12 words>
Address <76 hex characters>Keep both. In zen/indexd.yml, fill in the three values in angle brackets: the 12 words as recoveryPhrase, an admin password of your choice under adminAPI, and the INDEXD_POSTGRES_PASSWORD value from .env under database. zen/indexd.yml is gitignored.
Let your browser reach indexd
The Sluby backend reaches indexd as http://indexd:9982, and indexd checks that name on every signed request, so your browser has to use the same address when you approve the connection. Add this line to /etc/hosts on the machine you run the browser on (on Windows, C:\Windows\System32\drivers\etc\hosts):
127.0.0.1 indexdStart indexd and wait for it to sync
docker compose -f docker-compose.yml -f docker-compose.sia.yml up -d indexdindexd starts from a recent checkpoint (instant sync) and then downloads the blocks since. Check progress with the admin password from zen/indexd.yml:
curl -s -u :<admin password> http://localhost:9980/api/stateIt is done when the response has "synced":true. That took a few minutes in the test run. If syncHeight stops rising for several minutes, connect indexd to Zen's bootstrap peers by hand; sync continued right after:
for peer in 141.94.161.198:9881 15.204.141.235:9881 51.79.16.87:9881 162.19.232.38:9881; do
curl -s -u :<admin password> -X POST http://localhost:9980/api/syncer/connect -d "\"$peer\""
doneThe admin UI is at http://localhost:9980, with the same password.
Fund the wallet from the faucet
Open the Zen faucet, enter the address the seed command printed, and request 20,000 zSC. The page states a limit of 50,000 a day, but in the test run a later request was refused with "amount exceeds max amount per day" after 20,000; ask for less or try again the next day if that happens. The coins arrive with the next Zen block, about 10 minutes. Check with:
curl -s -u :<admin password> http://localhost:9980/api/walletconfirmed is in hastings: 10,000 zSC is 10000 followed by 24 zeros. indexd then splits the coins into smaller outputs for contracts, which waits for one more block. What a contract locks up depends on the host's prices: in the test run it ranged from 40 to 7,400 zSC, and the first six contracts took about 14,400 zSC together.
Turn on contracts for Zen
indexd forms no contracts until you turn them on. Turn them on with a one week period (1,008 blocks), which more Zen hosts accept than the six week default, and raise the price limits, which are set for mainnet:
curl -s -u :<admin password> -X PUT http://localhost:9980/api/settings/contracts \
-d '{"enabled":true,"period":1008,"renewWindow":288,"wantedContracts":14}'
curl -s -u :<admin password> -X PUT http://localhost:9980/api/settings/hosts \
-d '{"maxEgressPrice":"300000000000000000","maxIngressPrice":"300000000000000000","maxStoragePrice":"69444444444400","minCollateral":"0","minProtocolVersion":"v5.1.0"}'The same settings are on the admin UI's Configuration page. Contracts form once the wallet has spendable coins. Count them with:
curl -s -u :<admin password> http://localhost:9980/api/contractsUploads with 2 + 4 shards need contracts with at least 6 hosts that accept data; more gives the SDK hosts to fall back on. The test run had 11 contracts.
Create an app password
Approving Sluby's connection asks for an app password, which indexd calls an app connect key:
curl -s -u :<admin password> -X POST http://localhost:9980/api/apps/connect/keys \
-d '{"description":"sluby","quota":"default"}'The key field of the response is the app password. You can also create one on the admin UI's Keys page with Create key.
Point Sluby at indexd
In .env, set the indexer, the network, the shard counts and indexd's admin API:
SIA_INDEXER_URL=http://indexd:9982
SIA_NETWORK=zen
SIA_DATA_SHARDS=2
SIA_PARITY_SHARDS=4
SIA_ADMIN_URL=http://indexd:9980
SIA_ADMIN_PASSWORD=<admin password>With the admin API set, a video's storage breakdown in the Studio also shows contract IDs and the indexer's wallet. See the configuration reference.
Build Sluby and connect it to indexd
docker compose -f docker-compose.yml -f docker-compose.sia.yml build
docker compose -f docker-compose.yml -f docker-compose.sia.yml run --rm --no-deps backend node scripts/connect-indexer.mjsThe script prints a URL like http://indexd:9982/auth/connect/<request id>. Open it in your browser, enter the app password under App password and click Accept. The page says "Connection approved".
The script then waits up to two minutes for the account to report ready, prints the three lines for .env, and says The account is not ready yet. On Zen that is expected (see What is different on Zen). Replace the SIA_INDEXER_URL, SIA_APP_ID and SIA_APP_KEY lines in .env with the printed ones.
Start Sluby
docker compose -f docker-compose.yml -f docker-compose.sia.yml up -dAlways pass both files, so the backend and indexd share a network. From here on, follow the quickstart from Find the setup code: create the first admin, upload a video, wait until it is ready and play it.
Storing on Sia takes longer on Zen than on mainnet, because hosts that refuse shards cost the SDK a few seconds each before it moves on. In the test run, storing a 6 second clip failed twice on refusing hosts and the server retried it by itself; the third attempt stored it in about two minutes, eleven minutes after it started. If all attempts fail, the video shows "Storing the video on Sia failed": check the contract count, and click Retry processing on the video once more hosts are contracted. The backend's log shows each host's answer when LOG_LEVEL=debug is set in .env.
Stop and remove
docker compose -f docker-compose.yml -f docker-compose.sia.yml downdown -v also deletes the volumes: the indexer's chain data and database, and Sluby's own. The wallet can be restored from the recovery phrase.
Related
- Connect Sia storage, for sia.storage and other indexers
- How Sluby stores videos on Sia
- Configuration reference