FAQâs Guide to mining on Phala Testnet - #Expectchaos
Dear Phamily,
Having read the announcement that Para-1 testnet was live I jumped at the chance to mine on the Khala Testnet. This post is here to clarify the mining process for the community by highlighting the issues I came across, and in the second part will constitute a list of issues and fixes the Phala community has come across. These have been pulled from multiple social media channels and Phala forums. We hope this becomes an active database of issues and fixes sourced from every corner of the Phala community!
The explanation of the issues is organized in a way that makes your current mining errors more easily searchable. You can simply search for the specific issue and go straight to the section which discusses it. The Error Type and Answered Using parts will be clearly labelled as seen here. The first part of the guide can be followed side-by-side with the Para-1 Testnet mining guide or be pulled up when you encounter a problem and do a quick search.
Inevitably there will be some errors and problems you will come across which wonât be covered here. If this is the case, please leave a comment and we will look to answer and include your new issue. We understand setting up the mining process can be challenging to newcomers given Phalaâs TEE hardware configuration requests. However, by sharing and guiding each other through the processes and with mainnet almost here, there has never been a better time to jump into the mining process.
Para-1 Testnet Goal
The main aim for the current testnet is to test the new economic model and TEE mining function compatibility before mainnet launch later this year. Whatâs New?
-
New Token Economics model weighs incentives on hardware confidence scores
-
PHA StakePool enabled TEE mining
-
A funky console and data display for miners
Important statements about mining setup:
- That is currently NO REWARD in tokens for staking or mining on Testnet Phala.
- The block explorer has been updated to para1
- Watch out with memory modules from Corsair, even though they are listed in compatibility charts they are not compatible anymore.
- Currently you cannot mine with AMD hardware, despite some having their own version of SGX.
1. Hardware & Software configuration
Firstly, you will need to get into the configuration of the computer hardware to check and then activate the SGX function of your miner. The BIOS setup plays an important role in the confidence score Phala blockchain grants you when syncing â the higher the confidence, the more mining responsibilities & rewards your miner gets. Finally, make sure you have the correct Ubuntu software and get the Polkadot. js browser extension.
The Ideal Khala requirements are above, but you are advised to have upto 500GB of space. Now this can be on the same disk of course, but you could also set up a soft/symbolic link to a folder on a different drive. If you are worried about having enough space, you could set up this soft link to funnel mining data to your HDD drive, while running on SSD.
This could make sense with the size differences between SSD and HDD drives. To do it this way, after syncing with the testnet, check where the phala folders are placed and fill up with data. They can then be moved to a separate (mounted) drive, and replaced in the /var folder with a soft link of the same name.
Source: https://tecnstuff.net/how-to-create-symbolic-links-in-linux-using-the-ln-command/
2. Issues with processor requirements & SGX capability (for TEE computations)
The wiki guide section about the hardware requirements shows in a step-by-step guide what processes are needed to check and enable SGX (Software Guard Extension) capacity on your computer. This is clear and seems straight forward, but there are some deep pitfalls to be sure to avoid.
Firstly, if you havenât checked if your processor has this feature click here to go directly to Intelâs site and see whether this can be done â just scroll down the page a lot
To find your processor details in Ubuntu - go to âSettingsâ â > âDetailsâ
Now, in the knowledge that your processor can have SGX enabled you need to restart the computer in BIOS setup (F10) to âŚ
Disable Secure Boot. Go to Security â Secure Boot, set it to Disabled.
Use UEFI Boot. Go to Boot (options) â Boot Mode (network boot), set to UEFI.
Enable SGX Extensions. Go to Security â SGX (The exact name may vary by manufacturer), set it to Enabled. Things should look similar to thisâŚ
One major mistake I made was not swapping the Operating System hierarchy (with dual Windows and Ubuntu boot). This sent me into a Windows boot loop and a LOT annoyance. This may seem obvious to many, but it caught me out.
This was the painful Grub loop I found myself in after not putting Ubuntu top of that OS bootâŚ
Driver Installation: â Should you go about installing drivers from within Ubuntu please
click here for more.
3. BIOS configurations and miner âconfidence scoreâ
The story with the BIOS settings doesnât end here. Because it helps establish your minerâs âconfidence scoreâ. This score measures many factors, amongst which - how secure the SGX Enclave execution environment is. The higher the security level the higher the confidence score which makes you more likely to be chosen to process the more sensitive data on the blockchain.
Letâs look at what the documentation says⌠from hereâŚ1.3 Check the SGX Capability and Confidence Level | Phala Network Wiki
Error Issue:
GROUP_OUT_OF_DATE
CONFIGURATION_NEEDED
CONFIGURATION_AND_SW_HARDENING_NEEDED
Answered Using:
From source: https://wiki.phala.network/en-us/docs/khala-mining/1-3-confidential-level-evaluation/
Quoting heavily from the Phala Wiki we see that it is advised that you contact the vendor directly to inquire, and obtain, the BIOS upgrade for your BIOS version. To check those details type one of the two commands that workedâŚ
sudo phala sgx-test -
sudo dmidecode | less â This you will get the full list of specs
sudo dmidecode -s bios-version â This will get the version only.
With the first prompt I got this;
Once you have this information, contact the vendor for an update with your version type. Although you can carry on the mining process before they respond, they should do so quickly.
For issues regarding:
"configuration_and_sw_hardening_needed"
"configuration_needed"
â These can be fixed with BIOS configuration, (See the FAQ page above) - eg. - Disable HT, disable low power mode, disable internal graphicsâŚ
When/if you reconfigure type BIOS such as above, it can reset the BIOS settings when you boot back to default - So it is important to go back to (part 1) and make sure the settings are SGX ready to mine Phala.
FYI - Confidence and overall numbers for processors in google sheets:
IMPORTANT BIOS MANUAL SETUP
There is an Unofficial BIOS re-configuration guide on the wiki, however this guide, if followed incorrectly, could lead you to âbrick your computerâ. Please take this seriously, as you will see the guide also warns you. But that said, this is a sophisticated guide to understanding the context and procedure when updating your motherboards, contacting vendors and updating those BIOS options.
Source: https://forum.phala.network/t/topic/2565 from active community member
Take a moment to explore some of the options here:
Here we have a video from a respected community member looking at the BIOS issues. Please do note this is sensitive territory for your computer and that you should proceed with extreme caution here.
4. Phala Syncing Errors
For this section please in Ubuntu terminal have Sudo phala help open to help guide you through the process with the list of available commands. (This was very helpful to me as a noob)
Error type: phala-node error / Docker error
Cannot start service phala-node: error while creating mount source path â/var/phala-node-daaâ: mkdir /var/phala-node-data:file exists
Docker: Error response from daemon: error while creating mount source path â/var/khala-dev-nodeâ: mkdir /var/khla-dev-node: file exists.
I found that in /var both the khala-dev-node & the phala-node-data were broken. (Red with black backgrounds)
Answered using:
Sudo phala stop
Sudo phala update clean
Sudo phala start
Error type: The Compose file â./docker-compose.ymlâ
Error The Compose file â./docker-compose.ymlâ is invalid because:
services.phala_pruntime.devices contains an invalid type, it should be an array
This error popâs up when trying to run âsudo phala updateâ
Here you need clean data and update scripts -
Answered using:
sudo phala update script
sudo phala install dcap
sudo phala install isgx
Error type: Worker-public-key 0xnull
This error comes up repeatedly in the chats, and I also had the issue. That being the worker-public-key would never show up once I had my Gas account linked - but mistakenly put the DIP number of that gas account as the pool address. I would only see 0xnull such as below.
This PID number was fed into the system as a pool account addressâŚ
Use the command to see:
sudo phala status
This mistake caused the whole process to stagnate and never really enabled the blockchain to sync. So this caused me to have recurring syncing issues - looking something like thisâŚ
Answer Using:
What is needed is to set up another wallet to be your main account. This will stake and be added to the pool, while your more vulnerable account is the Gas (because you added the mnemonic to the Phala Blockchain) should be credited with a low PHA balance - i.e 10 PHA for gas is enough. - So in short, make sure you have 2 accounts:
1- Gas Account - credited with 10 PHA - (insecure because you gave your mnemonic)
2- Main Account - where your PHA is staked and where your mnemonic is still private.
If, after this you are still seeing 0xnull - it should disappear quite soon as the pherry automatically catches up with the blockchain data to input your pool address to the status.
Error following sudo phala score-test
This minor error will indicate not knowing the number of machine core, and will turn up like this:
------The parameter of the number of machine cores is missing------
Answered Using:
Here you need to write how many cores you intend to use from your machine. You get that request when installing the testnet, but to find out the number of processors again;
#nproc
Whereas in more detail, lscpu gathers CPU architecture information from /proc/cpuinfonâŚ
#lscpu
But if you already know or remember from installation how many cores you have you can directly input that usingâŚ
Answered Using:
sudo phala config setâŚ
sudo phala config show - you can see what you installed.
5 .Polkadot Js, Wallet and Workers!
There is sufficient material here to follow and setup wallets in both.
Polkadot browser extensions and using the Phala console.
Follow the wiki to set up your wallets, and use the Telegram Faucet to credit your accounts with Testnet Phala. Write your telegram username with the command in the chat /drip (your public address) and you should soon be credited with 9000 tPha.
You can create a new wallet or follow the imagesâŚ
It is also worth exploring the new Phala console, from which you can stake, add workers and connect to the Phala blockchain. There is also a testnet explorer which you can follow the ongoings of the blockchain in.
Once credited with /drip from the telegram faucet, you can follow the Phala testnet explorer to find and check if the transaction went through. It should look something like this:
In the end after following the guides available, using the console to manage your mining serves as a fantastic way of getting comfortable with your wallet and wallet options. Also you have access to the just released Phala DAO through this console. It would look similar to:
List of Community Mining Questions
For this section please have a look at Sudo phala help - keep it handy during this process as it helps demark what commands are possible.
Question: Will I earn from mining (working) in para-1 testnet?
Answer: Unfortunately not on the testnet, but after the mainnet launch, yes!
Question: Can I stake Phala?
Answer: We are still working on stake PHA, but on Testnet you can stake tPHA.
Question: How easy is it to set up mining with Phala?
Answer: There is a procedure and the start requires checking & setting up your internal hardware, but there is a fantastic guide that Phala has created to guide you.
Question: Does mining only works on ubuntu? is it also works on other distro like manjaro?
Answer: Sorry, our solo mining scripts is ONLY support Ubuntu 18.04&20.04(LTS).
Question: I am installing a new miner here. However I get an error when trying to install the SQX driverwere
Answer: Switch from hardware software controlled to âEnableâ? (config in BIOS)
Question: How do I get some test tokens to participate?
Answer: Use the Telegram Phala Faucet group and make sure your name is visible â How to Settings â Edit- Username write the command in the chat /drip (your public address) and give it a minute.
Question: Why are parachains not syncing ?
Answer: Use command :phalanetwork/khala-dev-node
not phalanetwork/khala-node /
could be Sudo Phala Config needs changing.
Question: How are you able to assign a controller to stash account in the Khala testnet? It doesnât have the phala option here.
Answer: We donât have a âstash accountâ nor a âcontroller accountâ. Make sure you have read Wiki(wiki.phala.network) before you operate your miner.
Question: Trying to add a worker to the pool for the para-1 testnet. The extrinsic never completes and no worker is added.
Answer: Check the log.
Question: âIâve setup the three dockers, sync the blocks and 2 dockers (phala-node
and phala-pruntime) are running succesfully my problem is with the phala-phost docker when I start it, after few minutes (long :p) Iâve got this message : block with justification at: 1942900 bridge() exited with result: Err(SubxtRpcError(TypeSizeUnavailable(âCallHashâ)))â
Answer: The pherry depends on the node, you should reinstall sgx driver;
sudo phala install dcap
sudo phala install isgx
Question: Has anyone tested prb using the image phalanetwork/prb
? I canât add any worker nor pool. Furthermore the fetch status seems wrongâŚ
Answer: First check that your local node is synched with the blockchain, To do that use phalanetwork/khala-dev-node
for this testâŚ
Check the environment variable in docker-compose file, should look like:
PHALA_PARENT_CHAIN_ENDPOINT=ws://node:9945
PHALA_CHAIN_ENDPOINT=ws://node:9944
For more details about the khala docker please check this Github link