Running holochain apps on a remote server: sample code

I recently added infrastructure code to Syn to start multiple instances of the app on a remote server. Sharing here as some of this is likely useful for other apps as well.

The above script:

  1. starts however many servers you specify via hc sandbox ...
  2. start hc nodes on ports 8000, 8001, 8002…
  3. and since hc binds to localhost only, we expose these servers via socat on 9000, 9001, 9002…

Bonus: We add a systemd syn.service startup file, so that we can run the script in the background, restart on crash, etc:

4 Likes