# Installation

### Install Goracle Binary

First step to install goracle node testnet is you need to download the binary and put it into your system.

{% code overflow="wrap" %}

```bash
sudo wget -qO /usr/bin/goracle https://staging.dev.goracle.io/downloads/latest-staging/goracle && sudo chmod u+x /usr/bin/goracle
```

{% endcode %}

{% hint style="info" %}
Don't worry about no result after running that command.
{% endhint %}

### Setup Your Node

{% hint style="danger" %}
If you're already run goracle node (using Algonode or Purestake), please go to this step [#switch-to-your-own-node-optional](#switch-to-your-own-node-optional "mention")
{% endhint %}

In this step you need to setup your node with all requirement needed to run goracle node. Make sure your Algorand Node is running with **same machine**. If you're using different machine, you need to open 8080 or custom port.

{% hint style="warning" %}
This tutorial is using own algorand node. Make sure your Algorand Node is fully synced.
{% endhint %}

If you want to run goracle node using **Algonode** or **Purestake**, you can follow this guide.

{% embed url="<https://teletype.in/@ttimmatti/goracle-node#g1kl>" %}

If you want to run goracle node using own algorand node, you can do by the following command below.

{% code overflow="wrap" %}

```
goracle init
```

{% endcode %}

* Continue? \[y/N]? **y**
* Use Algonode Algorand API service (recommended)? \[Y/n]? **n**
* Use a Purestake account for Algorand API service? \[y/N]? **n**
* Enter full Algorand node API URL (e.g. <http://example.com:4001>): **<http://127.0.0.1:8080>**

{% hint style="danger" %}
Don't forget to add **http\://** in the beginning of your server ip. example **<http://127.0.0.1:8080>** . Don't put the server like this **127.0.0.1:8080** . Make sure your port is same as from the **algod.net** output.
{% endhint %}

* Enter Algorand API auth token, or press enter for default: **yourtoken**

{% hint style="warning" %}
If you confuse how to get API URL and auth token, you can follow this link below.
{% endhint %}

{% content-ref url="../algorand/find-server-and-token" %}
[find-server-and-token](https://docs.strnan.top/testnet/algorand/find-server-and-token)
{% endcontent-ref %}

* Enter your main Algorand account address: **yourmainaddress** (Pera Wallet)

Next step is register your participation address and you'll get the link after put your main address. Don't forget to top up your main address use the following link below.

{% embed url="<https://bank.testnet.algorand.network/>" %}

* Register your participation address and sign the transaction.

{% hint style="warning" %}
Don't forget to top up your participation address before start your node.
{% endhint %}

* After the transaction is done, now you back to the machine and press enter.
* Now you need to stake GORA.

<figure><img src="https://3513762394-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHnfaXqsjt2Q8hoDykMmk%2Fuploads%2FoRENYInClQFRRKdMjixP%2Fimage_2023-04-07_174116935.png?alt=media&#x26;token=5b897fde-9575-475f-87f7-72dd148e4a02" alt=""><figcaption></figcaption></figure>

* minimum is 10k GORA to stake (if you don't have access code, you need to ask in their discord).

{% embed url="<https://discord.gg/PBvdsrbU8Y>" %}

* Done your node account already setup and next step is run your goracle node.

### Run Goracle Node

Before run your goracle node, make sure your machine is already install the **docker.io**. *If not*, you can use this following command to install.

{% code overflow="wrap" %}

```bash
bash <(wget -qO- https://raw.githubusercontent.com/ttimmatti/dependencies/main/docker.sh)
```

{% endcode %}

After installation complete, next step is run your goracle node using docker.

{% code overflow="wrap" %}

```
goracle docker-start --background
```

{% endcode %}

Check your goracle node logs using this command.

{% code overflow="wrap" %}

```
docker logs -f goracle-nr
```

{% endcode %}

If your node setup correctly, you'll see the logs like this.

<figure><img src="https://3513762394-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHnfaXqsjt2Q8hoDykMmk%2Fuploads%2FYattErC9JpsgLdeOT2WM%2Fimage_2023-04-07_174149853.png?alt=media&#x26;token=0924b4e1-0ebe-4bc7-a952-ec64fe5458fe" alt=""><figcaption></figcaption></figure>

Now your node is ready to vote in goracle node.

### Switch to Your Own Node (Optional)

If you're already run a node using Algonode or Purestake and want to use your own algorand node, You need to use the following command below.

{% hint style="danger" %}
Don't forget to backup your **`.goracle`** file before do this step to avoid being lost.
{% endhint %}

* Stop your docker container.

```
goracle docker-stop
```

* Remove your container

```
docker rm goracle-nr
```

* Edit your `.goracle` file

```
cd $HOME
nano .goracle
```

If you see inside `.goracle` file like this.

{% code title=".goracle" overflow="wrap" %}

```javascript
{
  "blockchain": {
    "authKey": "xxx",
    "server": "https://testnet-algorand.api.purestake.io/ps2",
    "authHeader": "x-api-key",
    "token": "",
    "mnemonic": "xxx",
    "mainAddr": "xxx"
  }
}
```

{% endcode %}

You need to **delete** `authKey` and `authHeader`. Then change your server and your token that you get from [previous step](https://docs.strnan.top/testnet/algorand/find-server-and-token). The result will be like this.

{% hint style="warning" %}
Make sure your server same as **`algod.net`**. Make sure your Algorand Node is **fully synced**. Don't forget to add **http\://** when you put the server.
{% endhint %}

{% code title=".goracle" overflow="wrap" %}

```javascript
{
  "blockchain": {
    "server": "http://127.0.0.1:8080",
    "token": "yourtoken",
    "mnemonic": "xxx",
    "mainAddr": "xxx"
  }
}
```

{% endcode %}

Then save your `.goracle` file using `CTRL + X` and `CTRL + Y` and `enter`.

* Start your node

{% code overflow="wrap" %}

```
goracle docker-start --background
```

{% endcode %}

* Track your goracle node logs

```
docker logs -f goracle-nr
```

<figure><img src="https://3513762394-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHnfaXqsjt2Q8hoDykMmk%2Fuploads%2FpAcJFUsxLcKgNUuiPDkG%2Fimage_2023-04-07_182741145.png?alt=media&#x26;token=c667f321-9655-448c-a036-9ed7560eba90" alt=""><figcaption></figcaption></figure>

* Done, goracle node is working and ready to vote.
