Mining PKT is as easy as 1, 2, 3

Mining PKT is as easy as 1, 2, 3

This guide written by Chandra Station will walk through how to deploy a PKT announcement miner on the Akash Network. There are three steps to a successful deployment:

  1. Creating a PKT wallet.
  2. Create a configuration file, using Akash’s stack definition language (SDL).
  3. Deploy the PKT miner on Akash.

Step 1: Create Your PKT Wallet

There are PKT wallets for Windows, Mac, and command line. Visit PKT.cash and PKT.world (Windows only) to try out the wallets that support mining. This guide will assume you are setting up a wallet via Command Line. If using the PKT World or GUI wallet, don’t worry, all you need is a wallet address.

For Windows:

  • Download the most recent zip archive suffixed with -windows.zip available from pktd releases page: (e.g. pktd-v1.3.1-windows.zip)
  • Go to the Downloads directory
  • Unarchive the content of the file
  • Open the command prompt
  • Type cd Downloads to change directory to the downloads folder

For MacOS:

  • Download one of the most recent packages available for Linux or MacOS from pktd releases page: (e.g. pktd-v1.3.1-macos.pkg)
  • Install pktwallet and other utilities by clicking on the package icon in the Finder.

For Linux:

  • Download one of the following packages:
    • pktd-v1.3.1-linux.deb (Debian or Ubuntu),
    • pktd-v1.3.1-linux.rpm (Fedora or RedHat)
    • pktd AUR package (Arch linux or Manjaro)
  • Install pktwallet and other utilities by clicking on the appropriate package icon or running an installation command

Creating a wallet

To create a new PKT wallet, use the pktwallet — create command:

For Mac: pktwallet --create

For Windows: ./bin/pktwallet.exe --create

You will be prompted to follow a few steps, make sure you write your seed words on paper so that you can recover your funds even if your computer is damaged.

Run PKT wallet

After creating your wallet, you can launch pktwallet with:

For Mac:
pktwallet

For Windows:
./bin/pktwallet

Watch the output from the logs and when you see a log line like this:

1608294386 [INF] headerlogger.go:64 Processed 1 block in the last 24.82s (height 702781, 2020-12-18 13:26:01 +0100 CET)

Compare the height number in the log line (e.g. 702781) to the number in the pkt block explorer to see when your wallet is up to date.

You may leave pktwallet running in the background or start it only when needed.

Creating a new PKT address

While pktwallet is running in the background, open a new terminal window, change directory again if needed, and run the following command:

For Mac:
pktctl --wallet getnewaddress

For Windows:
./bin/pktctl.exe --wallet getnewaddress

You should see a series of numbers and letters beginning with pkt1, this is your address which you can use for receiving coins.

NOTE: Every time you use getnewaddress, the address you receive must be remembered by pktwallet forever so only use it when you actually need an address.

You now have a PKT wallet address and we can move on to step two.

Step 2: Create Your Configuration File

When deploying on Akash, miners define the deployment services, data centers, requirements, and pricing parameters, in a “manifest” - a configuration file that may end in .yml or .yaml. This configuration file follows the YAML standard and is very similar to Docker Compose files. The file is written in a human-friendly language called Stack Definition Language (SDL). This SDL file is a form to request resources and declare deployment attributes.

Choosing the Ideal Configuration for your miner

When choosing a configuration for PKT mining in the cloud, a higher amount of vCPU cores will yield more PKT, but this performance comes at a higher cost paid in Akash Token (AKT). Akash’s CTO, Adam Bozanovich, looked at the results of the performance testing with various CPU configurations to find the ideal configuration that produces the most PKT for the least AKT spent.

The ideal configuration for PKT miners is 10 vCPU, 1 GB RAM, 1 GB storage.

Configurations with less than 10 vCPU do not yield as much PKT and consume excess RAM and storage. Configurations with 1 vCPU still produce PKT, but the single core miner produced a better price to performance ratio.

Visit the Akash Community to find more guides, ask for help, and connect with other PKT miners. You can also join the Akash Discord server to chat with us live.

Below is an example configuration file written in the Akash stack definition language (SDL). The file has four sections: version, services, profiles, deployment. Just change the wallet address in the services section and you are good to go, or modify it to your taste.

Download the file or copy the contents below and save it to a new file named deploy.yml.

Don’t forget to add your PKT wallet address after the WALLET_ADDR=

version: "2.0"
services:
  miner:
    image: chandrastation/pkt_on_akash:v1.0.0
    env:
      - WALLET_ADDR=
      - POOL1=http://pool.srizbi.com 
      - POOL2=http://pool.pktpool.io
      - POOL3=http://pool.pkt.world
      - POOL4=http://pool.pkteer.com
      - POOL5=http://pool.pktco.in
    expose:
      - port: 3000
        as: 80
        to:
          - global: true

profiles:
  compute:
    miner:
      resources:
        cpu:
          units: 10
        memory:
          size: 1Gi
        storage:
          size: 1Gi
  placement:
    miner:
      attributes:
        host: akash
      signedBy:
        anyOf:
          - "akash1365yvmc4s7awdyj3n2sav7xfx76adc6dnmlx63"
      pricing:
        miner:
          denom: uakt
          amount: 1000

deployment:
  miner:
    miner:
      profile: miner
      count: 1

We recommend that you do not change the Akash address under signedBy if you are a first time user. Learn more about Audited Attributes in the documentation.

Step 3: Deploy Your Miner to Akash

If you are new to Akash Network, you will need to install Akash and set up your wallet and get some AKT, so head over to the Quick Start Guide to get started. It takes just a few minutes to install Akash, and just seconds to create a wallet and add a certificate to the Akash blockchain enabling you to deploy to Akash.

We recommend using the amazing new Akashlytics Deploy Tool for an easy to use Windows or Mac OS tool to deploy. But we know you are a rockstar, and you’ll probably want to use the CLI - so keep reading.

Before you can create a deployment, a certificate must first be created. Your certificate needs to be created only once per account and can be used across all deployments. To do this, run:

akash tx cert create client --chain-id $AKASH_CHAIN_ID --keyring-backend os --from $AKASH_KEY_NAME --node $AKASH_NODE --fees 5000uakt

If you see an error adding your certificate to the blockchain, try again! Now to deploy on Akash, run:

akash tx deployment create deploy.yml --from <your_wallet_name> --node https://rpc.akash.forbole.com:443 --chain-id akashnet-2 --fees 5000uakt -y

After that command a string of JSON will appear in your terminal/command prompt.

{“height”:“1696542”,“txhash”:“AF360662F5EF02E22C2FC7CDD1975164FC04651C8B911144FB9B15F06AEFE90C”,“codespace”:"",“code”:0,“data”:“0A130A116372656174652D6465706C6F796D656E74”,“raw_log”:"[{“events”:[{“type”:“akash.v1”,“attributes”:[{“key”:“module”,“value”:“deployment”},{“key”:“action”,“value”:“deployment-created”},{“key”:“version”,“value”:“629fe5d9f40da5a3882b3e9d0ec3ad50d31bc6491f84807987196eed2f87a549”},{“key”:“owner”,“value”:“akash10a670qvazh3qa6xdvclc4jtrdjrnwm392x66we”},{“key”:“dseq”,“value”:“1696540”},{“key”:“module”,“value”:“market”},{“key”:“action”,“value”:“order-created”},{“key”:“owner”,“value”:“akash10a670qvazh3qa6xdvclc4jtrdjrnwm392x66we”},{“key”:“dseq”,“value”:“1696540”},{“key”:“gseq”,“value”:“1”},{“key”:“oseq”,“value”:“1”}]},{“type”:“message”,“attributes”:[{“key”:“action”,“value”:“create-deployment”},
{“key”:“sender”,“value”:“akash10a670qvazh3qa6xdvclc4jtrdjrnwm392x66we”},
{“key”:“sender”,“value”:“akash10a670qvazh3qa6xdvclc4jtrdjrnwm392x66we”}]},{“type”:“transfer”,“attributes”:[{“key”:“recipient”,“value”:“akash17xpfvakm2amg962yls6f84z3kell8c5lazw8j8”},{“key”:“sender”,“value”:“akash10a670qvazh3qa6xdvclc4jtrdjrnwm392x66we”},
{“key”:“amount”,“value”:“5000uakt”},{“key”:“recipient”,“value”:“akash14pphss726thpwws3yc458hggufynm9x77l4l2u”},{“key”:“sender”,“value”:“akash10a670qvazh3qa6xdvclc4jtrdjrnwm392x66we”},{“key”:“amount”,“value”:“5000000uakt”}]}]}]",“logs”:[{“msg_index”:0,“log”:"",“events”:[{“type”:“akash.v1”,“attributes”:[{“key”:“module”,“value”:“deployment”},{“key”:“action”,“value”:“deployment-created”},{“key”:“version”,“value”:“629fe5d9f40da5a3882b3e9d0ec3ad50d31bc6491f84807987196eed2f87a549”},{“key”:“owner”,“value”:“akash10a670qvazh3qa6xdvclc4jtrdjrnwm392x66we”},{“key”:“dseq”,“value”:“1696540”},{“key”:“module”,“value”:“market”},{“key”:“action”,“value”:“order-created”},{“key”:“owner”,“value”:“akash10a670qvazh3qa6xdvclc4jtrdjrnwm392x66we”},{“key”:“dseq”,“value”:“1696540”},{“key”:“gseq”,“value”:“1”},{“key”:“oseq”,“value”:“1”}]},{“type”:“message”,“attributes”:[{“key”:“action”,“value”:“create-deployment”},{“key”:“sender”,“value”:“akash10a670qvazh3qa6xdvclc4jtrdjrnwm392x66we”},{“key”:“sender”,“value”:“akash10a670qvazh3qa6xdvclc4jtrdjrnwm392x66we”}]},{“type”:“transfer”,“attributes”:[{“key”:“recipient”,“value”:“akash17xpfvakm2amg962yls6f84z3kell8c5lazw8j8”},{“key”:“sender”,“value”:“akash10a670qvazh3qa6xdvclc4jtrdjrnwm392x66we”},{“key”:“amount”,“value”:“5000uakt”},{“key”:“recipient”,“value”:“akash14pphss726thpwws3yc458hggufynm9x77l4l2u”},{“key”:“sender”,“value”:“akash10a670qvazh3qa6xdvclc4jtrdjrnwm392x66we”},{“key”:“amount”,“value”:“5000000uakt”}]}]}],“info”:"",“gas_wanted”:“200000”,“gas_used”:“94750”,“tx”:null,“timestamp”:""}`

Find and take note of your DSEQ value in bold above. This is your deployment sequence number and identifies your miner on the network, and it will be used in the commands that follow.

`{“key”:“dseq”,“value”:“1696540”}

Note, if you just followed the Quick Start Guide, you might run into an error such as “deployment exists” What happened is this DSEQ number was stored as an environmental variable in your shell terminal. You should clear it from memory by running this command:

unset AKASH_DSEQ

Next, run

akash query deployment get --owner <your_akash_wallet_address> --node=tcp://135.181.60.250:26657 --dseq <your_dseq>

Create a market order.

akash query market order get --node=https://rpc.akash.forbole.com:443 --owner <your_akash_wallet> --dseq <your_dseq> --oseq 1 --gseq 1

Acquire a list of bids.

akash query market bid list --owner=<your_wallet_address> --node=https://rpc.akash.forbole.com:443 --dseq <your_dseq>

Select a bid from a provider.

akash tx market lease create --chain-id akashnet-2 --node=tcp://135.181.60.250:26657 --owner <your_wallet_address> --dseq <your_dseq> --gseq 1 --oseq 1 --provider <select_a_provider_from_the_list> --from <your_wallet_name> --fees 5000uakt

Confirm your lease is open.

akash query market lease list --owner <your_wallet_address> --node=tcp://135.181.60.250:26657 --dseq <your_dseq>

Send the manifest.

akash provider send-manifest deploy.yml --node=tcp://135.181.60.250:26657 --dseq <your_dseq> --provider <the_provider_you_selected> --home ~/.akash --from <your_wallet_address>

Ensure the miner is running by looking at your logs.

akash provider lease-logs --node=tcp://135.181.60.250:26657 --dseq <your_dseq> --gseq 1 --oseq 1 --provider <the_provider_you_selected> --from <your_wallet_address>

Another great way to see how much PKT you are mining is by visiting the block explorer and inputting your PKT wallet address.

How to Get Help

Ask us right here on the Akash Community! You can also join the Akash Discord server to chat with us live and ask for support in the #deployments channel.

12 Likes

Thanks a lot for this guide & docker image Chandra Station!
just deployed my miner and it’s already generating some PKT

4 Likes

Heck yeah! Mining PKT successfully!

3 Likes

Dedicated hardware aka running software on “bare metal” does provide the best performance. This might actually help explain why Akash’s providers are more performant than than AWS.

The Akash providers used for PKT mining run kubernetes containers on bare metal. So we use Containers not VMs and not virtualization. The miner shares the same system resources as the host OS, but it is managed by Kubernetes instead of by the application. As long as you request whole numbers of CPU cores (e.g. 1, 2, 4, 8, 10) you can have a “dedicated” CPU assigned to your container.

Most modern scalable web apps run microservices in containers now, and there has been a move away from VMs and AWS style Cloud. Large enterprise companies are now building “private clouds” on bare metal to get better performance.

We did performance testing with 10 CPU, 4, 2, 1 CPU count. We found a similar yield on a miner with 10 CPU versus a group of 10 miners with 1 CPU. Initially we thought there was a price advantage to running 10 miners each with 1 CPU, but after further testing we have updated our results. You can see the performance and profit analysis here.

You can learn more here: Feature Highlight: CPU Manager | Kubernetes

1 Like

Even easier than the command line, you can deploy using the Akashlytics Deploy Tool.

  1. Download this tool https://www.akashlytics.com/deploy

  2. Create an AKT wallet in it, send over funds, and create a certificate. (In the tool)

  3. Copy the contents from the file in step 2 here https://akash.network/blog/how-to-mine-pkt-faster-on-the-world-s-first-decentralized-cloud

  4. Create a new deployment, start off with a blank template and paste the contents you just copied.

  5. Find the line where you should swap some text to your PKT wallet address.

  6. Deploy, choose a provider, and you’re done. You should be seeing some action in the wallet if done correctly.

Thank you @stelballe for the suggestion!

2 Likes

Do you guys know logs meaning?

akash provider lease-logs --node $AKASH_NODE --dseq $AKASH_DSEQ --gseq 1 --oseq 1 --provider $AKASH_PROVIDER --from $AKASH_KEY_NAME
[miner-67885d9dc-wzk9r] 1628853105 INFO poolclient.rs:92 Discovered block [fee0f2c5ff9cbcd85f42a8991712be42b44fe026c9276680fa913567442257d6 @ 1055093]
[miner-67885d9dc-wzk9r] 1628853105 WARN annmine.rs:565 [799181] Error uploading ann batch to http://ann207.pktpool.io/submit: [799181] handler [http://ann207.pktpool.io/submit] replied with no result [{"error":["[ann207] Block number out of range: 1055090, tip is at 1055093"],"warn":[],"result":null}]
[miner-67885d9dc-wzk9r] 1628853105 WARN annmine.rs:565 [799221] Error uploading ann batch to http://ann205.pktpool.io/submit: [799221] handler [http://ann205.pktpool.io/submit] replied with no result [{"error":["[ann205] Block number out of range: 1055090, tip is at 1055093"],"warn":[],"result":null}]
[miner-67885d9dc-wzk9r] 1628853105 WARN annmine.rs:565 [799205] Error uploading ann batch to http://ann2.pktpool.io/submit: [799205] handler [http://ann2.pktpool.io/submit] replied with no result [{"error":["[ann2] Block number out of range: 1055090, tip is at 1055093"],"warn":[],"result":null}]
[miner-67885d9dc-wzk9r] 1628853105 WARN annmine.rs:565 [799224] Error uploading ann batch to http://ann209.pktpool.io/submit: [799224] handler [http://ann209.pktpool.io/submit] replied with no result [{"error":["[ann209] Block number out of range: 1055090, tip is at 1055093"],"warn":[],"result":null}]
[miner-67885d9dc-wzk9r] 1628853105 WARN annmine.rs:565 [799218] Error uploading ann batch to http://ann204.pktpool.io/submit: [799218] handler [http://ann204.pktpool.io/submit] replied with no result [{"error":["[ann43] Block number out of range: 1055090, tip is at 1055093"],"warn":[],"result":null}]
[miner-67885d9dc-wzk9r] 1628853106 WARN annmine.rs:565 [799229] Error uploading ann batch to http://ann22.pktpool.io/submit: [799229] handler [http://ann22.pktpool.io/submit] replied with no result [{"error":["[ann61] Block number out of range: 1055090, tip is at 1055093"],"warn":[],"result":null}]
[miner-67885d9dc-wzk9r] 1628853106 WARN annmine.rs:565 [799225] Error uploading ann batch to http://ann208.pktpool.io/submit: [799225] handler [http://ann208.pktpool.io/submit] replied with no result [{"error":["[ann38] Block number out of range: 1055090, tip is at 1055093"],"warn":[],"result":null}]
[miner-67885d9dc-wzk9r] 1628853106 WARN annmine.rs:565 [799232] Error uploading ann batch to http://ann27.pktpool.io/submit: [799232] handler [http://ann27.pktpool.io/submit] replied with no result [{"error":["[server_57] Block number out of range: 1055090, tip is at 1055093"],"warn":[],"result":null}]
[miner-67885d9dc-wzk9r] 1628853106 WARN annmine.rs:565 [799230] Error uploading ann batch to http://ann13.pktpool.io/submit: [799230] handler [http://ann13.pktpool.io/submit] replied with no result [{"error":["[ann13] Block number out of range: 1055090, tip is at 1055093"],"warn":[],"result":null}]
[miner-67885d9dc-wzk9r] 1628853106 WARN annmine.rs:565 [799233] Error uploading ann batch to http://ann3.pktpool.io/submit: [799233] handler [http://ann3.pktpool.io/submit] replied with no result [{"error":["[ann3] Block number out of range: 1055090, tip is at 1055093"],"warn":[],"result":null}]
[miner-67885d9dc-wzk9r] 1628853106 WARN annmine.rs:565 [799235] Error uploading ann batch to http://ann14.pktpool.io/submit: [799235] handler [http://ann14.pktpool.io/submit] replied with no result [{"error":["[ann14] Block number out of range: 1055090, tip is at 1055093"],"warn":[],"result":null}]
[miner-67885d9dc-wzk9r] 1628853106 WARN annmine.rs:565 [799236] Error uploading ann batch to http://ann23.pktpool.io/submit: [799236] handler [http://ann23.pktpool.io/submit] replied with no result [{"error":["[ann23] Block number out of range: 1055090, tip is at 1055093"],"warn":[],"result":null}]
[miner-67885d9dc-wzk9r] 1628853106 WARN annmine.rs:565 [799237] Error uploading ann batch to http://ann18.pktpool.io/submit: [799237] handler [http://ann18.pktpool.io/submit] replied with no result [{"error":["[ann65] Block number out of range: 1055090, tip is at 1055093"],"warn":[],"result":null}]
[miner-67885d9dc-wzk9r] 1628853106 WARN annmine.rs:565 [799240] Error uploading ann batch to http://ann19.pktpool.io/submit: [799240] handler [http://ann19.pktpool.io/submit] replied with no result [{"error":["[ann64] Block number out of range: 1055090, tip is at 1055093"],"warn":[],"result":null}]
[miner-67885d9dc-wzk9r] 1628853106 WARN annmine.rs:565 [799241] Error uploading ann batch to http://ann7.pktpool.io/submit: [799241] handler [http://ann7.pktpool.io/submit] replied with no result [{"error":["[ann7] Block number out of range: 1055090, tip is at 1055093"],"warn":[],"result":null}]
[miner-67885d9dc-wzk9r] 1628853106 WARN annmine.rs:565 [799239] Error uploading ann batch to http://ann203.pktpool.io/submit: [799239] handler [http://ann203.pktpool.io/submit] replied with no result [{"error":["[ann44] Block number out of range: 1055090, tip is at 1055093"],"warn":[],"result":null}]
[miner-67885d9dc-wzk9r] 1628853106 WARN annmine.rs:565 [799238] Error uploading ann batch to http://ann8.pktpool.io/submit: [799238] handler [http://ann8.pktpool.io/submit] replied with no result [{"error":["[ann8] Block number out of range: 1055090, tip is at 1055093"],"warn":[],"result":null}]
[miner-67885d9dc-wzk9r] 1628853106 WARN annmine.rs:565 [799242] Error uploading ann batch to http://ann5.pktpool.io/submit: [799242] handler [http://ann5.pktpool.io/submit] replied with no result [{"error":["[ann5] Block number out of range: 1055090, tip is at 1055093"],"warn":[],"result":null}]
1 Like

Looks like pktpool.io is not accepting the announcements from your miner. You might want to remove that pool from your deployment configuration. I’ll ask a PKT expert to respond here.

Here is a guide by @figurestudios as well:

Deploying a PKT miner (easily)

SFirst time deployer here. I followed the pkt guide and used the quick deploy on akashlytics. I copied the updated .yml file and did two deployments with separate providers but am still getting a lease not found on provider message. It says its active in the status bar but no PKT generated yet. Any insight?

Double check that your Lease is active, feel free to share the deployment ID here.

Double check that your PKT wallet is inputted into the yml file without the < > before and after.

Hey all, been playing around with the PKT mining for a couple of days. Now I am running a 2 core, a 4core and 8 core deployments.

Early testing is showing the 4 core as most profitable. Will update tomorrow with a full 24 hours of results, but early results have the 4 core (1g memory, 1g storage) producing PKT at a cost of $0.012927 each (with AKT at $2.70). Have not tried the 10 core setup yet.

Will provide detailed update after a full 24 hours.

3 Likes

Hey all,After reading the article, I did the deployment again

It looks complicated, and it takes time to learn

1 Like

Nice tutorial, can anyone tell me how mang aKT do I need to deploy the PKT miner.

1 Like

Is that possible to run Idena node and client on Akash?

1 Like

Thanks a lot for this guide!!

Thanks a lot for this guide & docker image Chandra Station!