Pocketnet Core: Node Setup Notes

for Ubuntu 20.04 LTS

Declan Paine
6 min readMar 18, 2021

Build your own social media’ they said. They built Parler. Apple censored ParlerAWS shut down Parler’s servers… The centralization of hosting services caught Parler off-guard. Pocketnet’s decentralized architecture shields it from this vulnerability, and allows you to be part of the solution to censorship, while generating some coin in the meantime!

from the Pocketnet Whitepaper

Here are some tips for getting your Pocketnet node started:

Dependencies:

You can find a list of dependencies in Pocketcoin’s Unix Notes. This command from these notes should install most of the necessary dependencies for Pocketnet:

run this command to install most dependencies

The only dependency that gave me issues was BerkeleyDB. Pocketnet’s Github Repo includes a script, /contrib/install_db4.sh, that will install the proper version of BerkeleyDB.

Installing Pocketnet Core:

If you’ve already cloned the Pocketnet Git Repo, you can install Pocketnet by navigating to the Pocketnet repo and running the following commands:

use these commands to build Pocketnet Core from the repo

Otherwise, you can download the .deb file for their latest version from their version release page and use sudo apt install to install Pocketnet.

Configuring Pocketnet Core:

RPC Auth:

You will have to create a new set of RPC credentials for Pocketnet if you don’t have one already. Luckily, Pocketnet includes a Python script for this. If you’ve installed the dependencies successfully, you already have Python as well.

You can now add this set of credentials to your pocketcoin.conf file in the .pocketcoin/ directory. You’ll also need to specify the port used for RPCs. Edit your pocketcoin.conf file to include the following lines:

RPC settings that should be included in .pocketcoin/pocketcoin.conf

Enable your Firewall & Allow Pocketnet Traffic:

For added security, you should enable Ubuntu’s Universal Fire Wall.

Then, add rules to allow TCP and UDP traffic on port 37070. This is the port you’ll use for connections to other Pocketnet nodes.

Port-Forwarding:

Port-forwarding must be setup on port 37070 to allow incoming connections. Basically, you need to (1) assign a static IP address to the machine you’re running Pocketnet on and (2) add a rule to setup port-forwarding on port 37070. These guides are for Bitcoin, but Pocketnet is designed with similar architecture. Just make sure to use port 37070, NOT 8333.

The pocketcoin.conf File:

I’ve already referenced the pocketcoin.conf file a few times. This file controls the basic settings of your Pocketnet Node and is analogous to the bitcoin.conf file in the Bitcoin Core distribution. You can find an example pocketcoin.conf file that contains many notes on the config options allowed by Pocketnet Core. There may be additional config settings in here you’ll need to get your node functioning properly.

Downloading the Blockchain via Torrent:

When you start up your node for the first time, you won’t have and blockchain data on your machine yet. If you just start pocketcoind, it may take weeks to catch up to the blockchain…

It’s much quicker to download the latest blockchain checkpoint via torrent. As of 2021–03–27, this is the torrent URL for the latest checkpoint:

magnet:?xt=urn:btih:f21283c5071ce10c2f7f513eb02d2bcf72f62a5d&dn=pocketnet.checkpoint.1077334&tr=udp%3a%2f%2ftracker.torrent.eu.org%3a451%2fannounce&tr=udp%3a%2f%2ftracker.coppersurfer.tk%3a6969%2fannounce&tr=udp%3a%2f%2ftracker.leechers-paradise.org%3a6969%2fannounce&tr=udp%3a%2f%2ftracker.bitcoin.sprovoost.nl%3a6969&tr=udp%3a%2f%2ftracker.openbittorrent.com%3a80%2fannounce&tr=udp%3a%2f%2fexplodie.org%3a6969%2fannounce&tr=udp%3a%2f%2ftracker.opentrackr.org%3a1337%2fannounce

Check this README from the PocketNet Team for the most recent checkpoint torrent URL.

To download this on Ubuntu, I recommend using transmission-cli, a nice command line interface for all types of transfer protocols. Use these commands to install transmission-cli.

Now you can navigate to your Downloads folder and download the latest checkpoint via torrent.

It may take a while to connect to peers if it’s been a while since the last checkpoint. Just let it keep looking for a while. Once connected to peers, you’ll begin to download the blockchain checkpoint.

After completing the download, it will say that you’ve started seeding. This means that your computer is now looking for others who want the blockchain, and will send the blockchain to anybody looking for it. It’s common courtesy to seed the torrent for about as long as it took you to download, but it’s up to you!

Hit control C to stop the output once you’re done seeding. Use ps -ef | grep transmission to check that transmission-cli has stopped running. If it hasn’t, kill it as outlined for pocketcoind in the next section.

As outlined in this post from the PocketNet Team, you’ll need to remove everything from your .pocketcoin/ directory besides your pocketcoin.conf file and your wallet(s), then copy the checkpoint in.

Occasionally there are issues in the blockchain that cause a fork, where some nodes will go off and create their own different version of the blockchain. When this happens, the PocketNet team will release a new version of pocketcoind and node operators will install this new version and reset to the latest checkpoint using the same process I just described.

Starting & Stopping Pocketnet Core:

You should now see a hidden .pocketcoin/ directory which contains a pocketcoin.conf file. You can use pocketcoin-cli help to see a list of available commands from the Pocketcoin command line interface.

If everything is installed correctly, you should be able to start the pocketcoin daemon by executing:

Adding the -debug flag will create a log file at .pocketcoin/debug.log. Check your logs and make sure there aren’t any obvious errors. If there are issues, look for the process using a regular expression to find pocketcoind and kill it.

Debugging:

As stated before, the -debug flag is helpful for debugging. Many of the errors I found in my debug.log had solutions for analogs to Bitcoin Core. Use this nice command to trail your log file as you run pocketcoind:

Here are several pocketcoin-cli commands that are helpful.

Check the current block height in the block explorer.

Once you have pocketcoind running without errors, make sure that your copy of the blockchain is caught up using pocketcoin-cli getblockchaininfo (see notes above). Check that your connection count is 8 or greater with pocketcoin-cli getconnectioncount. Once you’ve confirmed this, you can be confident that your node is running properly.

Staking:

In order to start staking (and earning) PKOIN, you’ll need to setup a wallet and add PKOIN to it. Once you have 50+ PKOIN in the wallet on your node, you will automatically start staking PKOIN!

Use pocketcoin-cli listaddressgroupings to check if you already have a wallet created. If you do, you should see an address listed. To be honest, I’m not sure if a wallet will be set up for you or not, you’ll have to check.

If you don’t have one created, you can create one with the following command: pocketcoin-cli getnewaddress <label> <address-type>. Label is just a nickname you come up with, I used “node”. You’ll have to select an address as well. I’d suggest p2sh-segwit for the address type to keep your transaction fees low.

Once you run this, check pocketcoin-cli listaddressgroupings again to find your new address!

Once you have an address you can send PKOIN there. Check out the Sending PKOIN section of my PocketNet User Tips to learn more about sending PKOIN. As soon as you have >50 PKOIN in any wallet in your node, you’ll start staking and earning PKOIN!

The more PKOIN you have in your node wallet, the more frequently you’ll receive payouts! If you have the PocketNet desktop client, you can find a Staking Calculator on the right-hand side of the home page.

Use pocketcoin-cli getwalletinfo to get the total amount of PKOIN on your node. Enter this into the yellow field to get an estimate of how much PKOIN you’ll mine over the long-run.

The frequency of PKOIN payouts can be pretty random. When I started staking a received my first payout within a couple days. At times, my node can go a full week without receiving a payout. Then suddenly I’ll receive payouts 3 days in a row. Just keep staking!

Last updated 2021–03–27. For corrections, comments, suggestions please find me on Pocketnet @declanpaine OR email me declanpaine at protonmail dot com.

--

--

Declan Paine

American. Big Data Engineer. Data Privacy Advocate. Musician. Libertarian. Patriot. Anti-War.