Integrate a new Blockchain/API
Last updated
Last updated
If you miss any Blockchain, we invite you to integrate it yourself and make a with the integration.
To do so, follow this tutorial.
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.
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.
First, you need to create a package with the following structure in the Connector folder:
__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
To implement these files, you can take a look at the rest of the token packages
To maintain uniformity in the code, try to follow the standard methods already implemented in apirpc.py
.
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:
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:
Check that the token
, network
and configurable_endpoint
match those defined in the file availableCurrencies.json