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.
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.
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.
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
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:
→ 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.
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)
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 -
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…
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------
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;
Whereas in more detail, lscpu gathers CPU architecture information from /proc/cpuinfon…
But if you already know or remember from installation how many cores you have you can directly input that using…
sudo phala config set… sudo phala config show - you can see what you installed.
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:
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-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:
For more details about the khala docker please check this Github link