Reddit • Twitter • Medium • Docs
Nodechain is a service that allows you to create nodes on a blockchain and connect to them natively through the JSON-RPC protocol to its API. In short, it allows the user to build and manage their own nodes natively without having to rely on external services.
This repository contains all the code related to the RPC and WS APIs, including the connection to the APIs of the native nodes of each blockchain.
All the documentation related to the project can be found here.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
The first thing to do is to download the project from GitHub. To do this we will use the command-line. Follow the CONTRIBUTING.md guidelines before cloning the repository.
$ git clone git@github.com:swapper-org/NodeChain.git
Depending on your setup, you will need to install the requirements.txt file dependencies if you have not installed them previously:
# Go to the scripts folder
$ cd scripts
# Install via pip
$ pip install -r "requirements.txt"
You are ready to start your node. Just type:
$ python3 nodechain.py start
# or
$ ./nodechain.py start
You can get more information about NodeChain:
~$ python3 nodechain.py -h
NodeChain uses the JSON RPC protocol for API requests. The API provides the following endpoints:
https://<URL-SERVER>:<PORT>/<TOKEN>/<NETWORK>/rpc
for RPC requests.wss://<URL-SERVER>:<PORT>/<TOKEN>/<NETWORK>/ws
for real time requests.
We also support REST API (HTTP)
- GET / POST
https://<URL-SERVER>:<PORT>/<TOKEN>/<NETWORK>/<METHOD>
for HTTP requests
More information can be founded here.
This environment is intended for the development and contribution of the project. Blockchains used are created locally (regtest, ganache,...) facilitating the development and waiting times in block mining.
This environment is used to interact with any test network.
IMPORTANT: To work with full nodes in testnet mode, You need to have the blockchain synchronized for its use. If the testnet blockchain is not synchronized locally, some features might not work.
This environment is intended for real cases. You will be able to interact with any mainnet of any blockchain. Be aware that transactions may cost real fees if you use this environment.
IMPORTANT: You must use a different port for each API
We use Flake8 for linting and PyTest for testing.
The Flake8 configuration is inside the .flake8
file. The project is configured only for linting python code from the Connector/
and scripts/
directories.
You can lint with the following command:
~$ flake8 --statistics
As optional, you can create a GitHub Hook to automatically check that your code follows the linting rules before commiting your changes.
You can find the tutorial to lint automatically with hooks here.
Do you need to test your changes without download the whole blockchain?. Follow the tutorial and help to improve NodeChain!
If you have a CircleCI account, you can use it for remote testing. Use the GitHub account with your forked Nodechain repository.
Follow the steps for CircleCI remote testing
- Go to the projects tab and click on the Set Up Project button of your forked Nodechain repository.
- Select the staging branch
- Implement your fix or feature
- Push the code to GitHub and tests will be automatically executed
Note: When running test remotely, CircleCI will execute all the jobs defined in the .circleci/config.yml
Please read Contribution Guidelines for details on our code of conduct, and the process for submitting pull requests to us.
We use GitBook for docs. All the documentation concerning Nodechain is available at NodeChain Docs
All changes to the RPC/WS documentation must be made in the NodeChain-docs repository.
Please read Contribution Guidelines for details on our versioning system. For the version available, see the tags on this repository.
This software is licensed under the MIT License. See LICENSE for the full details.
The main goal of the project is to give the user an easy way to be able to build their own blockchain nodes without external services, either inbuilt on their own local machines or on production servers.
In developing NodeChain we seek to incorporate purely native services and protocols, avoiding unofficial dependencies.
We believe in decentralizing the world and work to make it easily accessible to everyone.
NodeChain is a project by the community and for the community. We stand firm in the context of collaboration by growing the Blockchain ecosystem and enabling the scalability of projects in a simple way.
Growing the ecosystem around NodeChain is an arduous but necessary task. For this reason, we thank all the contributors who give part of their time.
Thanks to every project that make NodeChain possible. You can see the list here.