> For the complete documentation index, see [llms.txt](https://phoenix-7.gitbook.io/nodechain-en/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://phoenix-7.gitbook.io/nodechain-en/develop/how-to/integrate-a-new-blockchain-api.md).

# Integrate a new Blockchain/API

If you miss any Blockchain, we invite you to integrate it yourself and make a [PR](/nodechain-en/develop/contributing.md) 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 %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://phoenix-7.gitbook.io/nodechain-en/develop/how-to/integrate-a-new-blockchain-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
