This is a local development setup with all of the pocket tools in development mode to allow for feature development, debugging and higher flexibility when dealing with the stack.
For quick usage, to use a 5 node setup of pocket network run:
$ bin/pkt-stack pokt-net prod-local up
To run the portal-api alongside the wallet/explorer against the 5 node setup, run:
$ bin/pkt-stack pokt-fdt prod-local up
- Docker Compose
- Git
- Make (please upgrade your pre-installed Make version to
GNU Make 3.81
)
In order to run this tool, you first need to clone the following repositories:
By default, the repositories are expected to be in the same directory as the E2E stack. If they're not, you can configure their location in a .env
file as detailed below.
bin/pkt-stack STACK_NAME ENV ACTION
Available stacks:
- pokt-net: Pocket Network stack as a localnet
- pokt-fdt: Pocket Foundation stack: portal-ui (missing), portal-api, wallet (missing), explorer (missing)
- pokt-aps: Pocket App Solutions stack: pocket-js
- pokt-all: Aggregates all previous stacks into one inter-connected stack
Available envs:
- prod: Production dockerhub imges
- dev: Local development mode, includes hot-reloading features, and a local net
Available actions:
- up: Spins up the stack
- down: Spins down the stack
- config: Prints out the resulting docker compose config file
Make sure you follow the proper instructions to replicate the production database locally (check the portal-api README.md)
Once you have properly setup the portal-api
database with production data, add a new entry in the "Applications" collection in the gateways database with the values located in: pocket-e2e-stack/assets/mongo-db-app.json
Then, make sure you add the blockchains you are concerned with to the Blockchains
collection and you have added them to the chains.json in config/chains.json
in this project.
Run cp .env.template .env
and update the file locally, if necessary.
GATEWAY_REPO_PATH=../portal-api
POCKETJS_REPO_PATH=../pocket-js
POCKET_CORE_REPO_PATH=../pocket-core
(These are the default locations assuming you have cloned all the repos to one folder, but update the .env
if you have cloned to the repos to another location.)
You can specify which environment you would like to run:
- dev: a local live development version with hot reloading
- prod: pulls the official production image
$ bin/pkt-stack pokt-fdt ENV up
Similarly, bring it down using:
$ bin/pkt-stack pokt-fdt ENV down
1. Launch the stack in production mode by using the dockerhub official pocket core production image (currently at RC-0.9.2)
- dev: a local live development version with hot reloading
- prod: pulls the official production image
$ bin/pkt-stack pokt-net ENV up
Similarly, bring it down using:
$ bin/pkt-stack pokt-net ENV down
Incoming
$ bin/pkt-stack pokt-aps ENV up
Similarly, bring it down using:
$ bin/pkt-stack pokt-aps ENV down
Since we do not want to clutter the SDK with docker specific files, this repo is where you'd find the development docker image for pocketjs, still there are a few things you have to introduce to pocketjs to make it smoothly work:
- update tsconfig.json to exclude
dist
directory- create a
.dockerignore
file in pocketjs directory and ignore./node_modules
and./dist
directories
pocket app solutions stack (_pocket-js) + pocket foundation stack (gateway + dependencies) + pocket network stack (a localnet pocket-core fullnode)_
You can specify which environment you would like to run:
- dev: pocket-core, portal-api and pocket-js are launched in local development and hot reloading mode allowing you to change code on the fly
- prod: pulls official production images
$ bin/pkt-stack pokt-all ENV up
Similarly, bring it down using:
$ bin/pkt-stack pokt-all ENV down
Some configurations such as pokt-net dev-tm
enable debugging using Delve and support hot reloading.
You can run a debugging stack with this command: ./bin/pokt-net-dev-tm.sh
.
dlv connect localhost:1234
Create a new configuration like the following:
incoming
incoming