# Integrate a new Blockchain/API

If you miss any Blockchain, we invite you to integrate it yourself and make a [PR](https://phoenix-7.gitbook.io/nodechain-en/develop/contributing) with the integration.&#x20;

To do so, follow this tutorial.

## Create a Dockerfile

First of all, you need to create a Dockerfile with the blockchain node. In case there is already an official, native node, you do not need to perform this step.

Dockerfiles are inside the `packages` directory. Each required service will implement a package in this directory.

## Create a Docker-compose

The entire node architecture is routed through network-separated docker-composes in the `docker-compose` directory. These docker-composes are used to define the configuration of all the necessary containers on the node.

## Adding a token configuration in the Connector

First, you need to create a package with the following structure in the Connector folder:

```
/Connector/
    /{TOKEN}/
        /rpcschemas/
            config.json
        __init.py__
        apirpc.py
        config.py
        constants.py
        handler.py
        utils.py
```

{% hint style="info" %}
You have to replace `{TOKEN}` with the token symbol you are testing in lower case
{% endhint %}

* `__init.py__`: import the necessary files
* `apirpc.py`: Wrapper API implementation
* `config.py`: Wrapper API configuration. It contains a class with the necessary variables.
* `constants.py`: Constants file
* `handler.py`: Admin API implementation for the token
* `utils.py`: Some useful methods

{% hint style="success" %}
To implement these files, you can take a look at the rest of the token packages
{% endhint %}

To maintain uniformity in the code, try to follow the standard methods already implemented in `apirpc.py`.

## Adding the Wrapper API definition

Inside the `Connector` folder, there is a file called `availableCurrencies.json`. This file contains the definition of each one of the Wrapper APIs.

The `availableCurrencies.json` file defines all the information necessary to raise the API corresponding to a currency.

In order to add a Wrapper API you need to define the new Wrapper API here. Here is a template you can use:

```json
[
  {
    "name": "${CURRENCY}",
    "token": "${TOKEN}",
    "networks": {
      "${NETWORK_1}": {
        "services": ["${DOCKER_COMPOSE_SERVICE_1}", "DOCKER_COMPOSE_SERVICE_2", ...],
        "dockerComposePath": "${PATH_TO_DOCKER-COMPOSE}",
        "configurable": [
          "${CONFIGURABLE_ENDPOINT_1}",
          "${CONFIGURABLE_ENDPOINT_2}",
          ...
        ]
      },
      "${NETWORK_2}": {
        "services": ["${DOCKER_COMPOSE_SERVICE_1}", "DOCKER_COMPOSE_SERVICE_2", ...],
        "dockerComposePath": "${PATH_TO_DOCKER-COMPOSE}",
        "configurable": [
          "${CONFIGURABLE_ENDPOINT_1}",
          "${CONFIGURABLE_ENDPOINT_2}",
          ...
        ]
      }
      ... MORE NETWORKS HERE ...
    }
  },
  ... MORE WRAPPER API DEFINITIONS HERE ...
]
```

## Adding a default configuration

Optionally, you can create a default configuration so that you do not have to enter the configuration each time you start the node.

Go to `scripts` folder and create a new default configuration for your Blockchain inside the `defaultConfig.json` file:

```json
[
  {
    "token": "${TOKEN}",
    "networks": {
      "${NETWORK_1}": {
        "config": {
          "${CONFIGURABLE_ENDPOINT_1}": "${ENDPOINT_1}",
          "${CONFIGURABLE_ENDPOINT_2}": "${ENDPOINT_2}"
        }
      },
      "${NETWORK_2}": {
        "config": {
          "${CONFIGURABLE_ENDPOINT_1}": "${ENDPOINT_1}",
          "${CONFIGURABLE_ENDPOINT_2}": "${ENDPOINT_2}"
        }
      }
    }
  },
```

{% hint style="warning" %}
Check that the `token`, `network` and `configurable_endpoint` match those defined in the file `availableCurrencies.json`
{% endhint %}
