# Building Orakuru node from source

### Requirements

Before you start building your node, you need to:

* Prepare your configuration the same way as you would in [install guide](https://orakuru.gitbook.io/crystal-ball/running-the-node/installing-orakuru-node#step-2-prepare-your-configuration).
* Install Go 1.16+ toolchain by following [this guide](https://golang.org/doc/install).
* Have Git, GCC, G++, Linux headers (only for Linux) installed on your server.

### Step 1: Download Orakuru node sources

We use GitHub to store our code, as such, you can use this command to download latest sources:

```
$ git clone https://github.com/orakurudata/crystal-ball
$ cd crystal-ball
```

This will download sources into `crystal-ball` directory. You can build latest sources, but we recommend building latest stable tag. You can see the latest tag [here](https://github.com/orakurudata/crystal-ball/releases). v0.2.6 is the latest tag at the moment of writing:

```
$ git checkout v0.2.6
```

### Step 2: Build and install crystal-ball binary

Building Orakuru node itself is a matter of running two commands:

```
$ go get ./...
$ go install ./cmd/crystal-ball
```

After that, you'll have `crystal-ball` binary installed in `$GOPATH/go/bin` directory. As long as that directory was added to your `$PATH`, you'll be able to start it by just typing `crystal-ball`.

### Step 3: Starting the node

Make sure to set correct environment variables according to [this document](https://orakuru.gitbook.io/crystal-ball/configuration/environment-variables) and you have a configuration directory ready. We suggest using `trace` log level in case you encounter a bug. Afterwards, starting the node is a matter of executing

```
$ crystal-ball
```

{% hint style="warning" %}
As with Binance Smart Chain node, running crystal-ball this way will stop it when you end your session. In order to prevent this from happening you should use `tmux`, `screen`, or your initialization system of choice (`systemd`, `openrc`, etc.)
{% endhint %}

{% hint style="warning" %}
Beware that by default, node will try to search for configuration in `etc/` directory. This might not be the desired behavior. If your configuration is placed in a different directory, make sure to modify `CB_CONFIG_DIR` accordingly.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://orakuru.gitbook.io/crystal-ball/advanced-guides/building-orakuru-node-from-source.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
