Media Server for 0chain, serves media files via partial content where allowed
mediaserve.php?a=xx&b=nn&network=beta
a = authticket b = minblocksize network = network(.yaml) config file to be used ( ~/.zcn folder )
Adjust file paths accordingly file paths must be accessible/writeable by web user
- zbox CLI binary and network config(s) already present and functional in ~.zcn folder, again with user permissions
- Default to networks:- beta.yaml, dev.yaml, test.yaml
- Split out files:-
- config.php - Editable config file
- functions.php - Re-usable functions
- cron.php - Removes old file chunks
- cron.php (to delete older file chunks) can be called from main script by setting CRONDEMAND in config.php
- Wallet auto-created if doesn't exist
git clone https://github.com/sculptex/php0chainmediaserver.git
cd php0chainmediaserver
nano config.sh
Note: these scripts use default admin account, this is for simplicity of demonstration and not recommended for production
bash init-hestia.sh
reboot
cd php0chainmediaserver
bash initweb-hestia.sh
bash initzcn.sh