Skip to main content

Full Node

Introduction

We decided to not publish the source code of the full node yet for one strategic reason: we do not want others launching another mainnet using a fork of our software before we do. We think we deserve the right to be the first ones, and then others will be able to do so. Thus, we plan to publish the source code just a few weeks before the launch of the mainnet. Even so, we are interested in giving access to the source code to a selected group of people/companies. If you would like to have access, you can send us an email requesting it.

However, we plan on releasing the API documentation ASAP so everyone can build their own application to interact with our full nodes. Our wallet code is already open-source, as well as our mining tools.

Technology stack

Hathor has been developed mostly in Python 3 using Twisted (an event-driven library) for performance and type annotations for code reliability. Python has a huge community and is easy to learn, which allows anyone to contribute promptly. We plan to migrate some parts to C, but only those which improve performance.

The cryptography part is using the OpenSSL library, which is already in C, and the communication between processes is using gRPC. As soon as we publish the source code, we believe the community will be able to smoothly run it, contribute with pull-requests, and integrate with many tools which already exist in the crypto ecosystem.

Our full node has basically eight components: (i) storage, (ii) transaction validation, (iii) consensus algorithm, (iv) p2p network, (v) synchronization algorithm, (vi) Stratum protocol, (vii) HTTP API & websocket, and (viii) general tools.

Testing

Hathor is a complex piece of software and must be well tested.

Automated tests

The full node is primarily tested by unit tests and integration tests, which have a coverage of 94% of the codebase. We have also developed a simulator inside our full node, so anyone can easily run tests with different networking topologies, miners, and random transaction generators.

Testnets

We constantly run private testnets distributed across the globe to test Hathor under different scenarios. These testnets run on Amazon AWS and face real networking conditions, including packet loss, latency, and jitter. We have four types of instances: full nodes, miners, random transaction generators, and attackers. Using these instance types, we can easily test different parts of Hathor.