Skip to content
Wouter den Bakker edited this page Nov 28, 2019 · 6 revisions

Setup:

Setup node and database using docker-compose:

  • (processor) See the processor for instructions.
  • (non-processor)
    • Download and install docker (Windows, Mac, Linux, you can ignore the popup asking you to create an account).
    • Download the docker-compose.yml file.
    • In case you want to target specific versions, rather then latest, modify the context for all services.
    • Fill in the variables in the docker-compose file using the values that the processor has for you as well as choosing a database password. (Alternately you can provide them when starting the docker using -e VARNAME=VALUE flags.) You can also modify any other settings.
    • If you are testing a node on the same computer as the processor make sure to change the the port the node and server listen on to not conflict with the processor.
      • If using Windows or Mac you can use host.docker.internal as processor host to connect to your local machine if you have no external ip.
    • Run docker-compose build.

Setup node using docker:

  • Download and install docker (Windows, Mac, Linux, you can ignore the popup asking you to create an account).
  • (non-processor) Start a postgres server and setup the database using the setup script. It is recommended to run this on the same system as the node to reduce latency, as all reads/writes need to be done in sequence.
  • Download the Node.Dockerfile file.
  • In case you want to target a specific version, rather then latest, modify the git clone command to point to a specific version.
  • Fill in the variables in the docker file using the values that the processor has for you (or you have yourself) as well as choosing a database password. (Alternately you can provide them when starting the docker using -e VARNAME=VALUE flags.)
    • If using Windows or Mac you can use host.docker.internal as processor/database host to connect to your local machine if you have no external ip.
  • Run docker build -f Node.Dockerfile -t vnode . where the node was downloaded.

Setup node standalone:

  • (non-processor) Make sure to read the security concerns.
  • (non-processor) Start a postgres server and setup the database using the setup script. It is recommended to run this on the same system as the node to reduce latency, as all reads/writes need to be done in sequence.
  • Clone this repository.
  • Download and install node.js and yarn.
  • Run yarn install and yarn build in the folder you cloned this repository to.
  • Create a config file for the node. (Alternately use environment variables.)

Starting:

Start node and database using docker-compose:

  • The first time use docker-compose up -d (From the folder the docker file is in.)
  • Subsequent times use docker-compose start (From the folder the docker file is in.)
  • Log can be viewed using docker-compose logs (From the folder the docker file is in.)

Start node using docker:

  • The first time use docker run --name vnode -d vnode.
  • Subsequent times use docker start vnode.
  • Log can be viewed using docker logs vnode.

Start node standalone:

  • Run yarn start path/to/config.json (From the folder the node is downloaded to.)
    • Everything will be logged to the standard output, most notably watch the first few seconds to see if there are problems with the setup.

Shutdown:

Shutdown node and database using docker-compose:

  • Run docker-compose stop (From the folder the docker-compose file is in.)

Shutdown node using docker:

  • Run docker stop vnode.

Shutdown node standalone:

  • Send a SIGINT for a graceful shutdown, send a SIGTERM for an attempted graceful shutdown, but a hard shutdown after 10 seconds, send a SIGKILL for an immediate shutdown.
    • If the shutdown was not graceful it may be in the middle of processing a block, which won't be finished processing till it is started again.

Clone this wiki locally