Chainlink Developers

Welcome to the Chainlink documentation site. You'll find comprehensive guides and documentation to help you start working with Chainlink as quickly as possible, as well as support if you get stuck. Click here for an introductory walkthrough on how to create a Chainlink request on the Ropsten test network!

Building on Chainlink? Click here to get started!

Get Started

Connecting to a Remote Database

This page will serve as a basic, vendor-neutral guide for setting up a PostgreSQL database and connecting your Chainlink node to it.

PostgreSQL is a popular and secure database available on a variety of platforms. This guide will not show you how to create and set up a PostgreSQL database, however, some common guides can be found below:

Obtain Information About Your Database

In order to connect to a remote database, you will need to obtain information about the database and server. Take note of the database's:

  • Server or IP
  • Port
  • Username
  • Password
  • Database name

The user must be the owner of the desired database. On first run, the migrations will create the tables necessary for the Chainlink node.

Set Your DATABASE_URL Environment Variable

Below is an example for setting the DATABASE_URL environment variable:

DATABASE_URL=postgresql://$USERNAME:[email protected]$SERVER:$PORT/$DATABASE

You will need to change the following placeholders to their real values:

  • $USERNAME: The database username (must be owner)
  • $PASSWORD: The user's password
  • $SERVER: The server name or IP address of the database server
  • $PORT: The port that the database is listening on
  • $DATABASE: The database to use for the Chainlink node

Updated about a year ago

Connecting to a Remote Database

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.