2.1 Deploy the Full Stack
WARNING: Operations at this step may reset your previous Phala blockchain data and you will need to re-deploy the docker containers. For more detail, refer to our Dockerfile Github repo. You can find the latest Phala Network docker images from the official repo.
PLEASE follow the order of deploying the three docker containers below.
Deploying Phala full-node
A Phala full-node helps maintain the backbone of the network. We suggest you to run a Phala full-node on a device with 50+ GB storage.
What is a full-node
Open the Terminal, and use the commands as follow. Your node name will be set by the second line.
sudo docker pull phalanetwork/phala-poc3-node(to pull a docker file)
sudo docker run -ti --rm --name phala-node -d -e NODE_NAME="YOUR_NODE_NAME" -p 9933:9933 -p 9944:9944 -p 30333:30333 -v $HOME/phala-node-data:/root/data phalanetwork/phala-poc3-node(to run the docker file; please repalce
YOUR_NODE_NAMEwith your own name, only alhpabets, digits and whitespace are supported)
The docker container will start after these two commands. To stop or restart it, please refer to this tutorial.
You can stop the full node by
sudo docker kill phala-node. Please avoid irregular turning down of the container （e.g., turn off or reboot your computer without stopping it). It may cause damage to the blockchain database, which can only be solved by re-sync of the entire blockchain.
If you are planning to run multiple full-nodes on one device (which is not suggested), please set different database path for each node by changing
$HOME/phala-node-datato some other directory.
sudo docker pull phalanetwork/phala-poc3-pruntime
- Run the docker container according to the type of your driver
If there is no output, please refer to the FAQ.
$HOME/phala-pruntime-datais the default path to the data of pRuntime. It's set in the
phala-pruntime-datafolder by default, which can be changed to another folder that the system admin has full access to. To run multiple pRuntime containers on one device (which is unnecessary and not suggested), please set different path for each container.
If the data was deleted, please re-register the miner from the beginning.
If the pRuntime docker fails to run, please recheck its installation according to the suggestions below:
- Please ensure there's no typo in your commands;
- Please ensure your drivers are installed correctly and successfully;
- Type in the command below to check whether your port is accessible:
- Type in the command below to check whether the docker container is running:
docker attach --sig-proxy=false --detach-keys=ctrl-c phala-pruntime
- Check whether your mainboard is able to mine PHA
Please replace the
YOUR-CONTROLLER-MNEMONIC in the second command with the mnemonic of your controller. If you didn't fill in mnemonic at this step, you would receive "NotController" error when submitting transactions related to
It costs a tiny amount of tPHA as well. Before deploying pHost, please make sure there are a certain amount of tPHA in your Stash account and controller account. Click here to learn how to obtain tPHA.
sudo docker pull phalanetwork/phala-poc3-phost
sudo docker run -d -ti --rm --name phala-phost -e PRUNTIME_ENDPOINT="http://IP-ADDRESS:8000" -e PHALA_NODE_WS_ENDPOINT="ws://IP-ADDRESS:9944" -e MNEMONIC="YOUR-CONTROLLER-MNEMONIC" -e EXTRA_OPTS="-r" phalanetwork/phala-poc3-phost
The docker contanier will start to run after the input of these two commands. To stop or restart it, please refer to the tutorial.
If you reboot the pRuntime container, you will have to reboot the pHost as well.
http://IP-ADDRESS:8000is the address listened by pRuntime. And
ws://IP-ADDRESS:9944is the WebSocker address of Phala full-node. They have to replace
IP-ADDRESSby the IP address of your host machine instead of the localhost (e.g.
127.0.0.1) You can find your IP address with