Skip to content

AtomicFinance/p2pderivatives-oracle

 
 

Repository files navigation

p2pderivatives-oracle

Repository for the P2PDerivatives oracle

Requirements

Confirmed working with Go v1.14.

Getting started

Run make setup to setup the repository. You will need to setup a postgresql database connection in the configuration file (or via environment variables).
You can easily setup a running database using docker-compose up db
Once that is done, the server can be run locally using make run-local-server.

Integration Test

The integration tests uses the go REST client library Resty. You can run integration tests by using make integration-test on local (with an oracle server running). or by using
gotestsum -- -tags=integration -parallel=4 ./test/integration/... -config-file-name <config-file> -oracle-base-url <oracle-url>

Running using Docker

Docker Compose

You can easily start and build the docker environment using docker-compose
To build from scratch the server use: docker-compose up --build

Building the image

In the root of the repository:

docker build -t p2pd-oracle .

The name p2pd-oracle can be changed to any other docker compliant name.

Running the container

Once built, you can start running the server (a database connection is necessary): docker-compose up To run the container in the background use the -d flag.

Docker configuration

You can override any variable from the configuration file .yaml using environment variables with this format APPNAME_MY_PATH_TO_VARIABLE
Example:

  • To override the database.host property in configuration file : P2PDORACLE_DATABASE_HOST=mynewhost

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 97.3%
  • Makefile 1.5%
  • Dockerfile 1.2%