NG
Phala

Phala

Setup Guide

Guide was not fully tested.

1. BIOS Settings

First of all, we recommend to update your BIOS to the latest version.

  • Enter BIOS. The method varies for different motherboards, and Google is always at your service about this.
  • Disable Secure Boot. Go to Security -> Secure Boot, set it to Disabled.
  • Enable SGX Extension. Go to Security -> SGX (This name may vary according to the different manufacturers), set it to Enabled.
  • If you can only find SGX: Software Controlled option, you will have to run sgx-software-enable in Ubuntu. You can download and execute it with the following commands:
wget https://github.com/Phala-Network/sgx-tools/releases/download/0.1/sgx_enable
chmod +x sgx_enable
sudo ./sgx_enable
  • Use UEFI Boot. Go to Boot -> Boot Mode, and make sure it was set to UEFI.
  • Save and reboot.
  • You also need to make sure that Ubuntu is installed in UEFI mode. SGX is not guaranteed to work properly on the OS installed in legacy mode. In such case you may want to reinstall the system.

2. Install

mkdir phala
cd phala
wget https://codeload.github.com/Phala-Network/solo-mining-scripts/zip/main
unzip main
cd solo-mining-scripts-main
sudo chmod +x *.sh
sudo ./install.sh en

Check the SGX capability:

sudo phala sgx-test

Please pay attention to the following checks:

  • SGX system software → Able to launch enclaves → Production Mode
  • Flexible launch control → Able to launch production mode enclave

The report below would be a positive result:
Phala-0

3. Accounts

3.1. Create Stash Account

  • Prerequisite: Install polkadot{.js} extension to your browser
    • Go to https://poc3.phala.network/polkadotjs
    • Click Allow in polkadot{.js} extension
    • Phala-1Go to Accounts, click Add Account
      Phala-2Save mnemonic seed in a safe place, mark ‘I have saved my mnemonic seed safely’:
      Phala-3Click next:
      Phala-4
    • Fill required values – it’s recommended that name contains ‘Stash’
    • Click Next
    • Click Save

3.2. Create Controller Account

Repeat all actions from the previous step to create Controller account:
Phala-5

3.3. Obtaining tPHA

Please be aware that you will need to burn ERC20 PHA to obtain tPHA on testnet Vendetta. So you need to buy/swap these tokens before we can go further. You need only 0.1 PHA.

  • Go to https://poc3-swap.phala.network
    Phala-6
  • Click Connect Wallet and it will be connected to your MetaMask Wallet
    Phala-7
  • Click ‘Click To Burn’. The Metamask window will be opened
    Phala-8
  • Click Confirm in your metamask
  • Wait a little bit
    Phala-9
  • Select Claim Tokens
    Phala-10
  • Paste your Phala Stash Account address into PHA Recipient Address and click ‘Click To Claim’
    Phala-11
  • Sign transaction in MetaMask
  • Wait for operation success
    Phala-12
  • Return to https://poc3.phala.network/#/accounts to check your test tokens
    Phala-13
  • Send tPHA to Controller account
  • Click send near Stash account
    Phala-14
  • Fill the values accordingly to screenshot below and click Make Transfer
    Phala-15
  • Click Sign and Submit and wait while operation is ended
    Phala-16

3.4. Set relationship between accounts

  • Go to Developer → Extrinsics
    Phala-17
  • Click as shown below
    Phala-18
  • Select phala module and click as shown below
    Phala-19
  • Select setStash(controller)
    Phala-20
  • Select Controller account
    Phala-21
  • Click Submit Transaction, approve it and wait for it finished.

3.5. Set Payout preferences

Go to Developer → Extrinsics. Configure as shown and Submit transaction:
Phala-22

4. Preparing to mining

Start Phala:

sudo phala install init

Fill in reauired fields – take controller mnemonic from step 5:

sudo phala start node

Phala-23

Wait for node sync. It could takes several hours. Next steps:

sudo phala start pruntime
sudo phala start phost

Check status:

sudo phala status

All three containers should be running. Now we should check worker state, so go to the explorer (Developer/Chain state):
Phala-24

Select phalaModule/workerState/Stash account:Phala-25Click green plus and you can see your miner status. Screen like below means that everything is ok.
Phala-26

5. Start mining

Go to the explorer, Developer/Extrinsics. Configure like shown below:
Phala-27

Submit transaction:
Phala-28

5.1 Verify mining

Some time later repeat step above, now you should see the following:
Phala-29

Stuck? Ask!

By continuing to use our website, you consent to our use of cookies in accordance with our cookie policy