Use pubsub to distribute a changing file
Opened this issue · 1 comments
benhylau commented
The file we want to distribute is the changing live.m3u8
because IPNS isn't reliable, and ipfs pubsub pub <topic> <data>
seems to work well.
First we need to enable --enable-pubsub-experiment
in the /etc/systemd/system/ipfs.service
for all the ipfs nodes. Then on server:
ipfs add live/current.m3u8 | awk '{print $2","}' | ipfs pubsub pub m3u8
On mirrors, run:
ipfs pubsub sub m3u8 > m3u8-sub.log
and in a crontab:
ipfs cat `awk -F, '{ print $(NF-1) }' m3u8-sub.log` > live.m3u8
We decided not to use this for Our Networks since:
- Anyone can pub, we don't have time to implement access control before the conference
- pubsub lacks an interface easy for video player to consume (e.g.
http://<gateway>:8080/pubsub/<topic>
) - We know
wget
is reliable and functionally this is just another way for us to do that without the benefits of IPNS
darkdrgn2k commented
Might be interesting to look at https://cluster.ipfs.io/