free amp template

PAC Global Masternode Setup Guide


Getting started

Setting up a masternode requires a basic understanding of Linux and blockchain technology, as well as an ability to follow instructions closely. It also requires regular maintenance and careful security. There are some decisions to be made along the way, and optional extra steps to take for increased security.

Commercial masternode hosting services are available if you prefer to delegate day-to-day operation of your masternode to a professional operator. When using these hosting services, you retain full control of the 500,000 PAC collateral and pay an agreed percentage of your reward to the operator. It is also possible to delegate your voting keys to a representative.


Before you begin

This guide assumes you are setting up a single mainnet masternode for the first time. You will need:

> 500,000 PAC
> A wallet to store your PAC.
> A Linux server, preferably a Virtual Private Server (VPS).
> PAC Global 0.14.0 and later implement DIP003, which introduces several changes to how a PAC Global masternode is set up and operated.

This documentation describes the commands as if they were entered in the PAC Global Core GUI by opening the console from Tools > Debug console, but the same result can be achieved on a masternode by entering the same commands and adding the prefix ~/.PACGlobal/pacglobal-cli to each command.

Setting up your VPS

A VPS, more commonly known as a cloud server, is fully functional installation of an operating system (usually Linux) operating within a virtual machine.

The virtual machine allows the VPS provider to run multiple systems on one physical server, making it more efficient and much cheaper than having a single operating system running on the “bare metal” of each server. A VPS is ideal for hosting a PAC Global masternode because they typically offer guaranteed up-time, redundancy in the case of hardware failure and a static IP address that is required to ensure you remain in the masternode payment queue. While running a masternode from home on a desktop computer is technically possible, it will most likely not work reliably because most ISPs allocate dynamic IP addresses to home users.

We will use Vultr hosting as an example of a VPS, although DigitalOcean, Amazon EC2, Google Cloud, Choopa and OVH are also popular choices.

First create an account and add credit. Then go to the Servers menu item on the left and click + to add a new server. Select a location for your new server on the following screen:
Select Ubuntu 18.04 x64 as the server type. We use this LTS release of Ubuntu instead of the latest version because LTS releases are supported with security updates for 5 years, instead of the usual 9 months.
Select a server size offering at least 1GB of memory

> Enter a hostname and label for your server.
> Vultr will now install your server. This process may take a few minutes.
> Click Manage when installation is complete and take note of the IP address, username and password.

Connecting to your VPS

We will begin by connecting to your newly provisioned server. On Windo ws, we will first download an app called PuTTY to connect to the server. Go to the PuTTY download page and select the appropriate MSI installer for your system. On Mac or Linux you can ssh directly from
the terminal - simply type ssh root@<server_ip> and enter your password when prompted.
Double-click the downloaded file to install PuTTY, then run the app from your Start menu. Enter the IP address of the server in the Host Name field and click Open. You may see a certificate warning, since this is the first time you are connecting to this server. You can safely click Yes to trust this server in the future.
You are now connected to your server and should see a terminal window. Begin by logging in to your server with the user root and password supplied by your hosting provider.

Tip: Right Click in the console to paste copied text

Turning off staking

To make sure the collateral you are about to make does not get locked for staking you will need to temporarily turn of staking.
Navigate to your PAC Global folder:

Windows: 

Press the Windows Key + R together. Search for %appdata% and press Enter. Make sure you are in the Roaming folder, and locate the PACGlobal folder.

MacOS

Go to Finder, hit the following keys COMMAND + Shift + G (⌘ + SHIFT + G) and as path please enter ~Library/Application Support/PACGlobal and hit the ENTER key.

In the PACGlobal folder you will find a file called pacglobal.conf open that file and add staking=0

Now restart your wallet.

Sending the collateral

A PAC Global address with a single unspent transaction output (UTXO) of exactly 500,000 PAC is required to operate a masternode. Once it has been sent, various keys regarding the transaction must be extracted for later entry in a configuration file and registration transaction as proof to write the configuration to the blockchain so the masternode can be included in the deterministic list.

​A masternode can be registered from the official PAC Global Core wallet.

Open PAC Global Core wallet and wait for it to synchronize with the network. It should look like this when ready:
Click Tools > Debug console to open the console. Type the following command into the console

to generate a new PAC Global address for the collateral: getnewaddress

Take note of the collateral address, since we will need it later. The next step is to secure your wallet (if you have not already done so). First, encrypt the wallet by selecting Settings > Encrypt wallet. You should use a strong, new password that you have never used somewhere else. Take note of your password and store it somewhere safe or you will be permanently locked out of your wallet and lose access to your funds. Next, back up your wallet file b y selecting File > Backup Wallet. Save the file to a secure location physically separate to your computer, since this will be the only way you can access our funds if anything happens to your computer.

Now send exactly 500,000 PAC in a single transaction to the new address you generated in the previous step. This may be sent from another wallet, or from funds already held in your current wallet. You will need 15 confirmations before you can register the masternode, but you can continue with the next step at this point already: generating your masternode operator key.

Generate a BLS key pair

A public/private BLS key pair is required to operate a masternode - for each masternode one needs one key pair. The private key is specified on the masternode itself, and allows it to be included in the deterministic masternode list once a provider registration transaction with the corresponding public key has been created.

If you are using a hosting service, they may provide you with their public key, and you can skip this step. If you are hosting your own masternode or have agreed to provide your host with the BLS private key, generate a BLS public/private keypair in PAG Global Core by clicking Tools > Debug console and entering the following command: bls generate

These keys are NOT stored by the wallet and must be kept secure.

Install PAC Global core on a VPS

PAC Global Core is the software behind both the PAC Global Core GUI wallet and PAC Global masternodes. If not displaying a GUI, it runs as a daemon on your VPS (pacglobald), controlled by a simple command interface (pacglobal-cli).

Open PuTTY or a console again and connect using the username and password from your VPS provider.

To install PAC Global using the install script, enter the following commands after logging in:
wget https://raw.githubusercontent.com/PACGlobalOfficial/PAC/master/pacglobal-mn.sh && chmod +x pacglobal-mn.sh && ./pacglobal-mn.sh

This will setup the basic firewall settings, create a swapfile, download and install the latest version on Pac Global Core for your system, automatically configure the masternode and create a systemctl service.

You will be prompted to enter your masternodeblsprivkey. You have this saved from the previous step, this is your private bls key.

We now need to wait for 15 confirmations of the collateral transaction to complete, and wait for the blockchain to finish synchronizing on the masternode. You can use the following commands to monitor progress: 
~/PACGlobal/pacglobal-cli mnsync status

 When synchronisation is complete, you should see the following response:
{
"AssetID": 999,
"AssetName": "MASTERNODE_SYNC_FINISHED",
"AssetStartTime": 1558596597,
"Attempt": 0,
"IsBlockchainSynced": true,
"IsSynced": true,
"IsFailed": false
}


Continue with the next step to construct the ProTx transaction required to enable your masternode.

Register your masternode

DIP003 introduced several changes to how a masternode is set up and operated.

If you used an address in PAC Global Core wallet for your collateral transaction, you now need to find the txid of the transaction. Click Tools > Debug console and enter the following command:
masternode outputs


This should return a string of characters similar to the following: 
{“16347a28f4e5edf39f4dceac60e2327931a25fdee1fb4b94b63eeacf0d5879e3" : "1",}

The first long string is your collateralHash, while the last number is the collateralIndex.

A pair of BLS keys for the operator were already generated above, and the private key was entered on the masternode. The public key is used in this transaction as the operatorPubKey.

First, we need to get a new, unused address from the wallet to serve as the owner key address (ownerKeyAddr). This is not the same as the collateral address holding 500,000 PAC. Type the following command into the console to generate a new PAC Global address: getnewaddress

This address can also be used as the voting key address (votingKeyAddr). Alternatively, you can specify an address provided to you by your chosen voting delegate, or simply generate a new voting key address. Type the following command into the console to generate a new PACGlobal address:
getnewaddress

Then either generate or choose an existing address to receive the owner’s masternode payouts (payoutAddress). It is also possible to use an address external to the wallet. Type the following command into the console to generate a new PAC Global address:
getnewaddress


You can also optionally generate and fund another address as the transaction fee source (feeSourceAddress). If you selected an external payout address, you must specify a fee source address. Either the payout address or fee source address must have enough balance to pay the transaction fee, or the final register_submit transaction will fail.

The private keys to the owner and fee source addresses must exist in the wallet submitting the transaction to the network. If your wallet is protected by a password, it must now be unlocked to perform the following commands. Unlock your wallet for 5 minutes: 
walletpassphrase yourSecretPassword 300

Preparing a ProRegTX transaction

We will now prepare an unsigned ProRegTx special transaction using the protx register_prepare command. This command has the following syntax:
protx register_prepare collateralHash collateralIndex ipAndPort ownerKeyAddr operatorPubKey votingKeyAddr operatorReward payoutAddress (feeSourceAddress)

Open a text editor such as notepad to prepare this command. Replace each argument to the command as follows:

collateralHash: The txid of the 500,000 PAC collateral funding transaction (long output from masternode outputs)
> collateralIndex: The output index of the 500,000 PAC funding transaction (short output from masternode outputs)
> ipAndPort: Masternode IP address and port, in the format x.x.x.x:yyyy
> ownerKeyAddr: The new PAC Global address generated above for the owner/voting address
> operatorPubKey: The BLS public key generated above (or provided by your hosting service)
> votingKeyAddr: The new PAC Global address generated above, or the address of a delegate, used for proposal voting
> operatorReward: The percentage of the block reward allocated to the operator as payment. If you are setting your own masternode on your own VPS, the value should be 0.
> payoutAddress: A new or existing PAC Global address to receive the owner’s masternode rewards
> feeSourceAddress: An (optional) address used to fund ProTx fee. payoutAddress will be used if not specified.

Note 1: You will need to have enough funds in payoutaddress to cover transaction fee. So add 100-200 PAC there.
Note 2: For the above command to work there has to be exactly one space between each entry.
Note 3: Ownerkeyaddr and votingkeyaddr need to be the same
Note 4: That the operator is responsible for specifying their own reward address in a separate update_service transaction if you specify a non-zero operatorReward. The owner of the masternode collateral does not specify the operator’s payout address.

Paste your prepared command in the debug console this will give 3 outputs: TX, CollateralAddress and SignMessage

Next we will use the collateralAddress and signMessage fields to sign the transaction, and the output of the tx field to submit the transaction.

Signing the ProRegTX transaction

We will now sign the content of the signMessage field using the private key for the collateral address as specified in collateralAddress.

Note that no internet connection is required for this step, meaning that the wallet can remain disconnected from the internet in cold storage to sign the message. In this example we will again use PAC Global Core. The command takes the following syntax: 

signmessage collateralAddress signMessage

This command will generate a sig hash.

Submitting the signed message

We will now submit the ProRegTx special transaction to the blockchain to register the masternode. This command must be sent from a PAC Global Core wallet holding a balance on either the feeSourceAddress or payoutAddress, since a standard transaction fee is involved.

The command takes the following syntax: 
protx register_submit tx sig

Where:
tx: The serialized transaction previously returned in the tx output field from the protx register_prepare command.
sig: The message signed with the collateral key from the signmessage command. (output from the signmessage command)

Your masternode is now registered and will appear on the Deterministic Masternode List after the transaction is committed to a block. You can view this list on the Masternodes -> DIP3 Masternodes tab of the PAC Global Core wallet, or in the console using the command protx list valid, where the txid of the final protx register_submit transaction identifies your masternode.

At this point you can go back to your terminal window and monitor your masternode using ~/PACGlobal/pacglobal-cli masternode status

​At this point you can safely log out of your server by typing exit. Congratulations! Your masternode is now running.

Masternode monitoring

The status of the masternodes in the desktop wallet masternode section is reliable. Currently there is no other method of monitoring masternodes.

For feedback please email Helpdesk@paccoin.net

Thanks to:
Fozzyblob

Cookiess
Dijida
Dash documentation