Running Directly in Linux

Running prb directly in a Linux shell is not recommended since using Docker is more convenient in both development and production.

Requirements

  • git
  • Redis 5 or newer
  • Node.js 14 (Latest LTS)
  • pnpm

Set up dependencies and generate Protobuf interfaces

1git submodule init
2git submodule update
3pnpm install
4pnpm proto:build # use `pnpm proto:darwin:build` in macOS
5pnpm proto:build_prpc # use `pnpm proto:darwin:build_prpc` in macOS

Start Services

To start any of the services, run pnpm start_module, all parameters are read from the environment variables of current shell.

 1PHALA_MODULE=fetch # module to start
 2NODE_ENV=development
 3PHALA_DB_HOST=io # hostname/ip to io service
 4PHALA_DB_PORT_BASE=9000
 5PHALA_LOGGER_LEVEL=debug
 6PHALA_PARENT_CHAIN_ENDPOINT=ws://127.0.0.0:9945 # parent chain substrate websocket endpoint
 7PHALA_CHAIN_ENDPOINT=ws://127.0.0.0:9945 # parachain substrate websocket endpoint
 8PHALA_REDIS_ENDPOINT=redis://127.0.0.1:6379 # redis endpoint for mq and rpc
 9
10# for `io`
11PHALA_DB_PREFIX=/var/data # path to data directory
12PHALA_DB_TYPE=rocksdb # rocksdb or leveldb