Experience and tricks with a dedicated Phala server

For some infrastructures it is not recommended to use the public ip directly but it is necessary to create a virtual switch with a local subnet.

Using public ip you may have one of these problems:

  • pRuntime not initialized. Requesting init…

Example configuration systemd and netplan (e.g.Ubuntu 18.04)
Newer instances of installimage create netplan-based network configurations on Ubuntu 18.04. The /etc/systemd/network/ directory will be empty. To set up the VLAN, you need to change the netplan file:

#/etc/netplan/01-netcfg.yaml

Hetzner Online GmbH installimage

network:
version: 2
renderer: networkd
ethernets:
enp0s31f6:
addresses:
…
vlans:
enp0s31f6.4000:
id: 4000
link: enp0s31f6
mtu: 1400
addresses:

  • 192.168.200.2/24
    After that you have to execute the following commands and the network should be available:

sudo /lib/netplan/generate
sudo systemctl restart systemd-networkd

check the network interface with ipconfig

Now prune e pull

Use the local ip address for pruntime and phost and you are done!

SOME ADVICES:

If you are not familiar with docker you can run docker containers in screen sessions without the -d option.

screen -S phost this command create a session with name phost

ctrl-a + ctrl-d command for detach session

screen -r phost command for attach the session

to monitor the nodes you can make a script sh with this command that checks the ports and enable a notification on telegram in case of down

#!/bin/sh
while :
do
nc -vz -w 2 111.111.111.111 30333 && echo $?
result=$?
if [ “$result2” != 0 ]; then
echo alarm nodo spento && curl -s -X POST https://api.telegram.org/bot1231231231231231230/sendMessage -d text=“WARNING PORT 30333 DOWN” -d chat_id=you-chat-id
else
echo “node ok”
fi
done

1 Like