0

How to write Dockerfile to spin up substrate node template, unit tests and/or integration tests, e2e tests, etc? Someone please suggest some resources.

1 Answer 1

1

https://github.com/hack-ink/slothunter/blob/main/test/guide.md

Here is my test setup:

FROM archlinux:latest

COPY\
  data/polkadot\
  data/rococo.json.fork-off\
  ./

RUN chmod u+x polkadot

ENTRYPOINT ./polkadot --unsafe-rpc-external --rpc-cors all --rpc-methods unsafe --tmp --chain rococo.json.fork-off --alice
services:
  db:
    image: postgres:12
    restart: always
    volumes:
      - ./data/db/postgres:/db/postgres
    environment:
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: postgres
      POSTGRES_DB: squid-archive

  node:
    build: .
    ports:
      - "9944:9944"
    volumes:
      - ./data/db/node:/db/node

  ingest:
    depends_on:
      - db
      - node
    restart: on-failure
    image: subsquid/substrate-ingest:firesquid
    extra_hosts:
    - "host.docker.internal:host-gateway"
    command:
      [
        "-e",
        "ws://host.docker.internal:9944",
        "--out",
        "postgres://postgres:postgres@db:5432/squid-archive"
      ]

  gateway:
    depends_on:
      - db
    image: subsquid/substrate-gateway:firesquid
    environment:
      RUST_LOG: "substrate_gateway=info,actix_server=info"
    command:
      [
        "--database-url",
        "postgres://postgres:postgres@db:5432/squid-archive",
        "--database-max-connections",
        "3"
      ]
    ports:
      - "8000:8000"

  explorer:
    image: subsquid/substrate-explorer:firesquid
    environment:
      DB_TYPE: postgres
      DB_HOST: db
      DB_PORT: "5432"
      DB_NAME: "squid-archive"
      DB_USER: "postgres"
      DB_PASS: "postgres"
    ports:
      - "3000:3000"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.