How to start working on Mysterium node
How to spin up a node on Docker
This section will explain how to run, build and test node during development. If you are yet to set up your environment please follow the environment setup guide first.
You can check out our source code on Github and talk to us and our community over at Discord.
Forking
Node repository is located at: https://github.com/mysteriumnetwork/node You will have to fork the repository in order to work on it. You can follow the official Github guide on how to do that.
After creating a fork execute:
Make sure you've read our environment setup guide and you have Mage installed as it will come in handy going further.
Building
Mage makes it easy to build the project, to do that you execute the mage build command in project's root directory:
After doing so you should see similar output to this:
If you don't have mage installed you can use the go build command to generate a binary:
Running
A node can be started as a daemon by executing:
Or without (using a built binary) mage:
This will start node in a daemon mode where no service is running, meaning that it will basically only operate in consumer mode. To start providing service you'd need to start a node with a running service (default is wireguard):
TequilAPI REST API and CLI app
Interacting with node can be done using its TequilaAPI endpoints. This API allows us to control both consumer and provider sides of our node.
The default port is: 4050
Node comes with built-in CLI commands which call the API endpoints making it easy to interact, test and control your node from the command-line.
Or without mage:
For greater control you can skip the CLI step and interact with TequilaAPI yourself using curl, postman or any other HTTP based tool you like. For example to check if a node is running you can send a healthcheck request:
To explore everything TequilAPI can do, we host its Swagger docs on: https://tequilapi.mysterium.network/
Feel free to check the Swagger docs of your own node which are available on the same port as the TequilAPI: http://localhost:4050/docs.
Testing
If you've added new features or changed old ones, make sure to cover them with tests as much as possible.
- Unit tests are all the *_test.go files outside the e2e directory. They can be executed by running:
- Long-running or "e2e" tests can be found in the e2e directory. They can be executed by running:
- To check if you haven't missed copyright notices or haven't made any linting mistakes run:
Contributing
If you've made changes to the api make sure to generate new documentation and files:
That's it! Once you're ready to publish your changes, please create a pull request in the official node repository.
Our developers are always happy to receive feedback and code contributions. We look forward to hearing from you!