These tools make it easy for us to set up the development environment, everything is handled by scripts provided in the Core's
Firstly, you should have git installed.
With git installed, the first step is to clone the repository so we can have access to some important files locally:
git clone https://github.com/arkecosystem/core cd core
For example, the
.nvmrc file located at
core/.nvmrc will tell us which version of node we should use for development.
If you don't have NodeJS and npm installed, the simplest way to manage both is through following instructions on how to set up nvm for your platform.
Note that the command to install the appropriate version of NodeJS and npm through nvm is:
nvm install [version in .nvmrc file]
Otherwise, you may choose to install a version of NodeJS LTS that has the same major version (10.x or 11.x or 12.x) as the
.nvmrc file shows.
The next important required dependency is a global installation of yarn through npm:
npm i -g yarn
Yarn is the package manager used by Ark Core; it replaces npm from here on out.
With yarn installed globally, we can proceed to set up the Ark Core repository.
If the output of
git branch doesn't show 'develop' as the current branch, but shows 'master' in green (current branch), you need to run the following:
git fetch https://github.com/arkecosystem/core develop:develop git checkout develop
This will ensure that your local files reflect those of the Core's development branch.
Finally, we can set up the entire repository with one command:
If you wish to run tests from this point, follow the instructions in the docker guide (use case #1). Then, you may run tests on the whole repository or individual packages with
Just follow those steps and you are ready to get started. Happy Hacking!
Ark Core stores all the blockchain data in a database. You could read more about it, in the database section.
If you want to start a node which consists of a
forger you can use any of the following commands (inside
If you want to start a
relay, you can use any of the following commands (inside
If you want to start a
forger, you can use any of the following commands (inside
It is possible to run a variation of these commands that enables the Node debugger:
A good introduction about how to use the debugger is the guide to debugging of Node.js.
Every package that is developed should provide tests to guarantee it gives the expected behavior.
Our tool of choice for tests is Jest by Facebook which provides us with the ability to add custom matchers, snapshot testing and parallelizes our test runs.
All packages have a
yarn test command which you should run before sending a PR or pushing to GitHub to make sure all tests are passing.
You could use
yarn test:watch to listen to changes on the files and run the tests automatically.
Additionally, we provide a variant (
yarn test:debug) that enables the Node debugger.
Before sending any PRs or pushing to GitHub, please make sure to run
yarn lint to enforce the rules described in