Skip to content

Latest commit

 

History

History
 
 

pokt-network

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Pocket Network

Pocket Network (POKT) tackles the RPC Trilemma by enabling an open protocol that empowers developers with Reliable, Performant, and Cost-Effective RPC access to the open internet.

Overview

The Pocket Network (POKT) is a decentralized, permissionless blockchain network that provides relay infrastructure for other blockchains at a lower cost. It uses a unique token economic model where Applications and Service Nodes stake POKT tokens to access or provide work to the network. The network utilizes proof-of-relay and proof-of-stake mechanisms to incentivize participation and validate transactions, with rewards distributed through the inflation of POKT tokens. The network's design aims to eliminate recurring payments to traditional infrastructure providers and reduce coordination costs.

Pre-requisites

  • POKT account: An address on the POKT Network with sufficient $POKT to stake a Servicer node, which is 15000 $POKT. Please ensure that your wallet has additional funds to cover transaction fees; we recommend having at least 15100 $POKT to be safe.
    • You can learn about how to create an address on the POKT Network here.
    • Information on where to obtain $POKT can be found here.
  • Other blockchains' RPC endpoints: As Applications on the POKT Network send relays to other blockchain nodes through Servicers and are rewarded for this, your Servicer node needs to connect to the other blockchains on which you want to stake your Servicer.
    • You can find a list of supported blockchains here.
    • You can obtain information on which blockchains yield more rewards here.
  • [OPTIONAL] Domain name: As Applications connect to Servicers on the POKT network, Servicers should be reachable via HTTPS. You have the option to use a URL generated by the Akash provider, or you can bring your own.
    • Please be aware that if you decide to bring your own domain name, an SSL certificate will also need to be created. According to Akash Network documentation, the easiest way to do this is to use CloudFlare. Please refer to this guide.
    • If you decide to use a URL generated by the Akash provider, please be aware that you would need to restake a Pocket Servicer every time you delete and recreate your Akash deployment, as the URL would change.

Deploy the node

Specify the parameters for Akash deployment

Fill in the variables in the SDL file:

Variable Description
SSH_PASS Password to connect to the node via SSH (root user).
VERSION Specify a version of Pocket Network node to deploy.
CHAIN Set POKT chain, mainnet or testnet.
KEYFILE_BASE64 Encrypted contents of the keyfile.json file using BASE64.
KEY_PASS Password to keyfile.json.
ADDRESS Account address.
CHAINS_LINK Link to download chains.json file, or use CHAINS_BASE64 to transfer the contents of the chains.json file in encrypted form.
SEEDS Set seeds address .

Resources

  • If you want use ephemeral storage (WARNING! Data will be lost when the container is restarted!):
profiles:
  compute:
    app:
      resources:
        cpu:
          units: 4.0
        memory:
          size: 24Gi
        storage:
          size: 500Gi
  • If you want use persistent storage:
  1. Uncomment in app section:
params:
  storage:
    data:
      mount: /root/
  1. Uncomment in profiles section:
profiles:
  compute:
    app:
      resources:
        cpu:
          units: 4.0
        memory:
          size: 16Gi
        storage:
          size: 10Gi
          - name: data
            size: 500Gi
            attributes:
              persistent: true
              class: beta3

HTTP/SSL

HTTP/SSL Option 1: Use a URL generated by the Akash provider

The certificate for this domain is provisioned automatically by Akash network provider. The hostname can be found in the console; see the screenshot for an example:

image

Beware this URL is unique for each deployment. If you recreate a deployment, you'd need to re-stake your node with a new URL to continue getting the rewards.

HTTP/SSL Option 2: Bring your own domain name

  1. Make sure you have commented out the accept list in Akash SDL yaml and specified your domain.
    expose:
      - port: 8081
        to:
          - global: true
        as: 80
        # # If you wish to bring your own domain, uncomment the following line and replace the domain name with your own.
        # accept:
        #   - poktonakt.spankpool.com
  1. Get familiar with Akash network documentation page on how to use CloudFlare.

The process should be as follows:

  1. Make sure your domain name is set up with CloudFlare

  2. Go to DNSRecords and add a new CNAME record. Name should match the domain name you specified in Akash SDL. Target must be the endpoint of your deployment (see screenshot above). image

  3. Beware the this "Target" endpoint is unique for each deployment. If you recreate a deployment, you'd need to update that record.

Verify your node is configured to issue relays

Run the node with --simulate-relay argument (currently included in the gist script)

A relay simulation can be ran against the node with --simulate-relay argument turned on:

curl -X POST --data '{"relay_network_id":"0021","payload":{"data":"{\"jsonrpc\":\"2.0\",\"method\":\"eth_blockNumber\",\"params\":[],\"id\":0}","method":"POST","path":"","headers":{}}}'  ${SERVICE_URL}/v1/client/sim

A successful response example:

❯ curl -X POST --data '{"relay_network_id":"0021","payload":{"data":"{\"jsonrpc\":\"2.0\",\"method\":\"eth_blockNumber\",\"params\":[],\"id\":0}","method":"POST","path":"","headers":{}}}' http://1g8r43a9659shclf8ev8c770lc.ingress.europlots.com/v1/client/sim
"{\"jsonrpc\":\"2.0\",\"id\":0,\"result\":\"0x10f6d80\"}"%

Stake your node

After you made sure the node can issue relays, you can stake it on the POKT network.

You can stake a node with a pocket nodes stake custodial commdand:

/ # pocket nodes stake custodial --help
Stake the node into the network, making it available for service.
Will prompt the user for the <fromAddr> account passphrase. If the node is already staked, this transaction acts as an *update* transaction.
A node can updated relayChainIDs, serviceURI, and raise the stake amount with this transaction.
If the node is currently staked at X and you submit an update with new stake Y. Only Y-X will be subtracted from an account
If no changes are desired for the parameter, just enter the current param value just as before

Usage:
  pocket nodes stake custodial <fromAddr> <amount> <RelayChainIDs> <serviceURI> <networkID> <fee> <isBefore8.0> [flags]

Flags:
  -h, --help         help for custodial
      --pwd string   passphrase used by the cmd, non empty usage bypass interactive prompt

Global Flags:
      --datadir string            data directory (default is $HOME/.pocket/
      --node string               takes a remote endpoint in the form <protocol>://<host>:<port>
      --persistent_peers string   a comma separated list of PeerURLs: '<ID>@<IP>:<PORT>,<ID2>@<IP2>:<PORT>...<IDn>@<IPn>:<PORT>'
      --remoteCLIURL string       takes a remote endpoint in the form of <protocol>://<host> (uses RPC Port)
      --seeds string              a comma separated list of PeerURLs: '<ID>@<IP>:<PORT>,<ID2>@<IP2>:<PORT>...<IDn>@<IPn>:<PORT>'

For example:

pocket nodes stake custodial "4207d9f5f9eacd29f20691793ed6a68676072169" "15050000000" 0021 "http://1g8r43a9659shclf8ev8c770lc.ingress.europlots.com:443" mainnet 10000 false --remoteCLIURL=$POCKET_ENDPOINT