Skip to content

How to setup local dev nodes for apps development?

fewensa edited this page Dec 14, 2021 · 6 revisions

Create docker-compose.yml and run docker-compose up -d

services:

  crab:
    container_name: crab
    image: quay.io/darwinia-network/darwinia:v0.11.7
    ports:
      - 9930:9933
      - 9940:9944
    command:
      - --chain
      - crab-dev
      - --unsafe-ws-external
      - --alice
      - --rpc-methods
      - Unsafe
      - --rpc-external
      - --rpc-cors
      - all
      - --tmp

If you are directly using docker, can start with

docker run -it --name crab \
  -p 9930:9933 -p 9940:9944 \
  quay.io/darwinia-network/darwinia:v0.11.7 \
  --chain crab-dev \
  --alice \
  --unsafe-ws-external \
  --rpc-methods Unsafe \
  --rpc-external \
  --rpc-cors all \
  --tmp

After these being executed, 9930 9940 will be bound in local machine and 9933 9944 in the mapping container will be retained.

Use docker run -dit if you want to start the docker command in the background, and if you are using docker-compose given above, it is already started in the background. If you do not want to start in the background, execute docker-compose up, then it is not started in the background, the container will stop after Ctrl+C (edited).