Quick Onboarding Guide
1. Preparing the Application Stakes
Application stakes provides Gateway Operators access to the POKT Network for sending traffic.
2. Create Encryption Password
Create an encryption password for your app stake keys. This password will be used to encrypt/decrypt your app-stake private keys stored in a Postgres database. It can be any combination of plaintext, symbols, letters, etc.
3. Configure Global Configuration Variables
Fill out the .env
variables for the gateway server. This can be done by injecting environment variables directly or using a .env
file.
Env Variables Description
POKT_RPC_FULL_HOST
Used for dispatching sessions
https://pokt-testnet-rpc.nodies.org
(a complimentary testnet dispatcher URL provided by Nodies)
HTTP_SERVER_PORT
Gateway server port
8080
POKT_RPC_TIMEOUT
Max response time for a POKT node to respond
10s
ALTRUIST_REQUEST_TIMEOUT
Max response time for an altruist backup to respond
10s
ENVIRONMENT_STAGE
Log verbosity
development
, production
SESSION_CACHE_TTL
Duration for sessions to stay in cache
75m
POKT_APPLICATIONS_ENCRYPTION_KEY
User-generated encryption key
a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6
DB_CONNECTION_URL
PostgreSQL Database connection URL
postgres://user:password@localhost:5432/postgres
Here is an .env.sample that you can use a reference
4. Run Migration Script
Run the migration script to seed your PostgreSQL database.
5. Insert App Stake Private Keys
Copy and paste the following SQL query to insert app stake private keys into the database:
Note: Replace {private_key} and {encryption_key} in the SQL query with your actual private key and encryption key.
6. Compile and Run Gateway Server
Copy and paste the following code to compile and run the gateway server. Hit the endpoint http://localhost/relay/{chain_id} with a JSON-RPC payload.
If using testnet, send a request to chain 0007
, http://localhost/relay/0007. This testnet chain id represents Ethereum Node Operators and Nodies is currently supporting the chain id for reliable testing.
Alternatively, you can leverage our published docker images
7. Setup Chain Configuration and Altruist
Upon startup of the gateway server, nodes within a session take time to be marked as healthy (~10 seconds), therefore the requests will be routed to the altruist (failover) node. It is suggested each chain that you support has a configured altruist. You can learn more about supplying altruist configurations through this Altruist Chain Configuration guide.
Remember to keep sensitive information secure and follow best practices for handling private keys and passwords.
Last updated