> Agents can also search and read this documentation through its [MCP server](https://docs.strnan.top/~gitbook/mcp).

# Home

Welcome to STR-NaN Docs.

<figure><img src="https://3513762394-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHnfaXqsjt2Q8hoDykMmk%2Fuploads%2FsdgAIJLr26hUbfdl1y7C%2Flogo%20hd.png?alt=media&amp;token=774ee12c-45b3-410b-bda5-afd8a6cd8882" alt="" width="188"><figcaption></figcaption></figure>

Welcome to STR-NaN, I'm a individual validator based in Indonesian. This docs will share the tutorial how to run node on every blockchain. Hopefully you can learn and understand how to run the node well. We learn and build together.


# Algorand

Follow this step if you want to run Algorand Node locally or skip this step if you're already using Purestake API or other platform.

<figure><img src="https://3513762394-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHnfaXqsjt2Q8hoDykMmk%2Fuploads%2Fo1H9fXh3XWfJIEEUcu3R%2Fimage_2023-04-07_173005198.png?alt=media&amp;token=333984c2-6283-47f8-8db8-38037c4fab6a" alt=""><figcaption></figcaption></figure>

To make sure your algorand node testnet run smoothly on your machine, you need to have the following hardware requirement :

* at least 4GB of RAM (8GB strongly recommended)
* a not-too-slow SSD: HDD and SD cards are too slow for a testnet node and will most likely prevent the node to sync
* at least 100Mbps connection (1Gbps recommended)


# Installation

How to install Algorand Node in your VPS.

In this step we are preparing to install all tools needed in your server to run this Algorand Node. Use this command one by one to avoid some of these command not executed.

{% code overflow="wrap" %}

```bash
sudo apt-get update

sudo apt-get install -y gnupg2 curl software-properties-common

curl -o - https://releases.algorand.com/key.pub | sudo tee /etc/apt/trusted.gpg.d/algorand.asc

sudo add-apt-repository "deb [arch=amd64] https://releases.algorand.com/deb/ stable main"

sudo apt-get update

sudo apt-get install -y algorand-devtools
```

{% endcode %}

Check to make sure your algorand tools already installed in your server.

{% code overflow="wrap" %}

```
algod -v
```

{% endcode %}

and this the result when you run the command above.

{% hint style="warning" %}
No need to copy the result.
{% endhint %}

{% code overflow="wrap" %}

```
12885884928
3.15.0.stable [rel/stable] (commit #814bc0bd)
go-algorand is licensed with AGPLv3.0
source code available at https://github.com/algorand/go-algorand
```

{% endcode %}


# Switching Network

Switching network algorand node to Mainnet.

#### Stop the algorand service

{% code overflow="wrap" %}

```bash
sudo systemctl stop algorand
```

{% endcode %}

#### Go to directory

{% code overflow="wrap" %}

```bash
cd /var/lib/algorand/genesis/mainnet
```

{% endcode %}

#### Copy the mainnet genesis

{% code overflow="wrap" %}

```bash
sudo cp genesis.json /var/lib/algorand/
```

{% endcode %}

## Start Node

Start the node to make sure you're already switched in mainnet.

{% code overflow="wrap" %}

```bash
sudo systemctl start algorand
```

{% endcode %}

Check your node after start the service.

{% code overflow="wrap" %}

```bash
goal node status -d /var/lib/algorand
```

{% endcode %}

Here is the result if you're already set up to testnet.

<figure><img src="https://3513762394-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHnfaXqsjt2Q8hoDykMmk%2Fuploads%2F4PnrEa0rNvNGjfNzzaBs%2Fimage_2023-04-07_173639702.png?alt=media&amp;token=9b7f726a-f8c4-43f0-9864-fb261865faf6" alt=""><figcaption><p>example screenshot from testnet</p></figcaption></figure>


# Fast Sync

How to reach the latest block using fast sync. Don't waste your time to wait.

In this step you need to use fast sync or catch up to make more faster to reach the latest block.

{% code overflow="wrap" %}

```bash
goal node catchup $(curl -s https://algorand-catchpoints.s3.us-east-2.amazonaws.com/channel/mainnet/latest.catchpoint) -d /var/lib/algorand/
```

{% endcode %}

Check your node status.

```bash
goal node status -d /var/lib/algorand
```

Here is the result after your node fully synced using fast sync.

<figure><img src="https://3513762394-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHnfaXqsjt2Q8hoDykMmk%2Fuploads%2FFkPdqemjBWXqHZEdeoow%2Fimage_2023-04-07_173729213.png?alt=media&amp;token=216f6794-e593-478c-af1b-3f4ed3795cbc" alt=""><figcaption><p>example screenshot from testnet</p></figcaption></figure>

{% hint style="info" %}
If your **Sync Time** is *0.0s*, that means your node already reach latest block. To reach the latest block, it depends your VPS specs, It takes around 1-2 hours.
{% endhint %}

Now your Algorand Node Mainnet is ready to use. Now you can do next step to run goracle node and using your own algorand node API.


# Find Server and Token

How to find your IP:PORT and API token in Algorand Node.

In this step if you're confusing what's your IP:PORT and token for your algorand node. You can use this following command to get that server and token you need to setup Goracle Node.

#### Go To the Algorand Directory

```bash
cd /var/lib/algorand
```

#### Check algod.net and algod.token

{% hint style="danger" %}
Copy all result and save in your notepad. The result of **algod.net** file for the port may be different. Because i saw someone not using **8080** port by default. So make sure double check.
{% endhint %}

```
cat algod.net
```

the result :&#x20;

**127.0.0.1:8080**

{% hint style="danger" %}
Don't forget to add **http\://** in "server" configuration of your `.goracle` file later.
{% endhint %}

```
cat algod.token
```

the result :&#x20;

**85a6891e0ea.................**

This is just example and now you can go to the next step to setup your goracle node.


# Custom Port (Optional)

This step is to resolve port conflicts, as the algorand node uses the default port of 8080. You can skip this step if you want to use default port.

If your 8080 port is already using on other apps, you can using custom with this following command.

#### Go to algorand node directory

```bash
cd /var/lib/algorand
```

#### Copy the config example

```bash
cp config.json.example config.json
```

#### Edit the config.json

```bash
nano config.json
```

Search `EndpointAddress` and here is the example.

<figure><img src="https://3513762394-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHnfaXqsjt2Q8hoDykMmk%2Fuploads%2Fpa67vZvD6NLxcIAclJtm%2Fimage_2023-04-09_010903053.png?alt=media&amp;token=bf8eef84-d637-4aa4-b837-55f54fcee246" alt=""><figcaption></figcaption></figure>

Then change the port from `127.0.0.1:0` to `127.0.0.1:8980` or you can use port you want. Next step is save your config using `CTRL +X` , `CTRL + Y` and then press `enter`.

#### Restart your node

```bash
sudo systemctl restart algorand
```

#### Check your node status

```bash
sudo systemctl status algorand
```

Check your node status to make sure your port is already changed. Here is the example.

<figure><img src="https://3513762394-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHnfaXqsjt2Q8hoDykMmk%2Fuploads%2F51rzHyYR8Paxa2iznuJD%2Fimage_2023-04-09_011630397.png?alt=media&amp;token=142d3bf6-8387-4b70-8a2e-835d724da763" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Don't forget to remember which port you're using for algorand node to run goracle node later.
{% endhint %}

Now your algorand node is ready to use.&#x20;


# Troubleshooting

Fix the issue when installing the algorand node.

If you have some problem with your algorand installation, try remove and install again using this command. Because i saw some user have this problem and didn't show any files inside `/var/lib/algorand`.

#### :warning: Remove the algorand:warning:&#x20;

```
sudo apt purge algorand
```

#### :warning: Install the algorand:warning:&#x20;

```
sudo apt install algorand
```

Now you can go to next step with this link below.

{% content-ref url="/pages/pnkocV3CHy3dnwRnogmH" %}
[Switching Network](https://docs.strnan.top/mainnet/algorand/switching-network)
{% endcontent-ref %}

I will add more soon.


# Useful Command

{% hint style="info" %}
Add **sudo** if you're not in ROOT users.
{% endhint %}

#### Check your node status using curl

{% hint style="info" %}
Change your port if you're using custom port.
{% endhint %}

{% code overflow="wrap" %}

```javascript
curl -X GET \
     -H "X-Algo-API-Token: yourtoken" \
     "http://127.0.0.1:8080/v2/status"
```

{% endcode %}

#### Check your algorand service status

{% hint style="info" %}
In this step you will find the port you are using in the algorand node.
{% endhint %}

```
systemctl status algorand
```

#### Restart node

```
systemctl restart algorand
```

#### Check node status

```
goal node status -d /var/lib/algorand
```

#### :warning: Stop node :warning:

```
systemctl stop algorand
```

#### :warning: Delete Algorand from your server :warning:

```
apt-get remove algorand algorand-devtools
```

```
sudo rm -rf /var/lib/algorand/
```

#### Add variable

In this step if you want to use `goal node status` without using -d flags you can follow this command below.

{% code overflow="wrap" %}

```bash
echo "export ALGORAND_DATA=/var/lib/algorand" >> ~/.bash_profile
source ~/.bash_profile
```

{% endcode %}

Now you can use this command without using -d flags.

```bash
goal node status
```

I'll add more command soon, i just exploring algorand node.


# Goracle

<figure><img src="https://3513762394-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHnfaXqsjt2Q8hoDykMmk%2Fuploads%2F1SfHc2s7SiBVehairAby%2Fimage_2023-04-07_174004017.png?alt=media&amp;token=365dd1de-f882-43bf-8feb-603dd6e4c8dd" alt=""><figcaption></figcaption></figure>

Hardware requirement to run goracle node testnet.

* Cpu: 1-2 cores
* Ram: 4gb
* Storage: 10gb SSD
* Fast Internet
* Ubuntu: 20.04+


# Installation

How to install Goracle Node Validator in your VPS.

## Run Validator

In this step you're running a node validator on Goracle Mainnet, make sure you have enough ALGO to participate.

### Install Goracle Binary

First step to install goracle node mainnet is you need to download the binary.

{% code overflow="wrap" %}

```bash
cd $HOME
sudo wget goracle https://download.goracle.io/1.1.13/linux/goracle && sudo chmod u+x goracle
```

{% endcode %}

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

### Setup Your Node

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** Or if you're using Algonode/Purestake API, you can answer yes if you get the question about API service.

{% 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 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="/pages/oHt9jmDWGBvwUbk3oEJg" %}
[Find Server and Token](https://docs.strnan.top/mainnet/algorand/find-server-and-token)
{% endcontent-ref %}

* Enter your main Algorand account address: **yourmainaddress** (From validator dashboard)

Next step is register your participation address and you'll get the link after put your main address.

* Register your participation address and sign the transaction.
* After the transaction is done, now you back to the machine and press enter.
* 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.

<pre data-overflow="wrap"><code><strong>./goracle docker-start --background
</strong></code></pre>

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&amp;token=0924b4e1-0ebe-4bc7-a952-ec64fe5458fe" alt=""><figcaption><p>Example picture from testnet</p></figcaption></figure>

Now your node is ready to vote in goracle node.


# Upgrade

Upgrade to the latest version of goracle binary.

**Latest Mainnet Version**: 1.1.13&#x20;

You can check latest version of goracle binary mainnet on [here](https://download.goracle.io/latest-release.txt).

### Docker Stop

```bash
./goracle docker-stop
```

### Docker Remove Exited Container

<pre><code><strong>docker rm $(docker ps --filter=exited -q)
</strong></code></pre>

### Goracle Update

```
./goracle update
```

<figure><img src="https://3513762394-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHnfaXqsjt2Q8hoDykMmk%2Fuploads%2FhLWZAEL4tCJtpOBzVBSu%2Fimage_2023-04-15_214241694.png?alt=media&amp;token=7940012c-1020-44f0-8fbe-ccb87cdc0059" alt=""><figcaption><p>this screenshot is just example</p></figcaption></figure>

Answer **`y`** if you see this question.

**`Update "/usr/bin/goracle" [y/N]?`** y

### Docker Start

<pre><code><strong>./goracle docker-start --background
</strong></code></pre>

### Check Docker 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%2Fpzx7jeGxheMQv0GDeSn9%2Fimage_2023-04-15_214303888.png?alt=media&amp;token=1f11ab38-4c53-4344-aaab-21c60d01f170" alt=""><figcaption></figcaption></figure>


# Troubleshooting

Problems that often occur in running goracle nodes and how to solve them. All of these issues are not fully worked out, I share based on my own experience.

### AppError.General: Invalid Configuration

<figure><img src="https://3513762394-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHnfaXqsjt2Q8hoDykMmk%2Fuploads%2Fnzm7fYIdZhXOKiK3jWQW%2Fimage_2023-04-17_181050276.png?alt=media&amp;token=cb81909e-a7ca-4b19-8dd9-12b6d31d4240" alt=""><figcaption></figcaption></figure>

If you facing error like screenshot above, your goracle binary is not match to the latest version. Make sure you update to the latest version to solve this issue by the following command below.

{% hint style="danger" %}
Make sure you copy this command one by one.
{% endhint %}

{% code overflow="wrap" %}

```bash
goracle docker-stop

rm /usr/bin/goracle

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

goracle docker-start --background
```

{% endcode %}

Now check your logs using this command.

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

### TransactionPool.Remember: txn dead round: xxx

<figure><img src="https://3513762394-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHnfaXqsjt2Q8hoDykMmk%2Fuploads%2FjLEo8PZlxkgrJ56QH9Bk%2Fimage_2023-04-16_035154286.png?alt=media&amp;token=e042ae74-26c8-42a9-b6fe-37163642135e" alt=""><figcaption></figcaption></figure>

This error is related to your algorand node did not catch up to the latest block. Make sure you check the algorand node status by the following command below.

```bash
goal node status -d /var/lib/algorand
```

<figure><img src="https://3513762394-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHnfaXqsjt2Q8hoDykMmk%2Fuploads%2FA5Ktsv3AmhY7o3kLkszd%2Fimage_2023-04-16_035344015.png?alt=media&amp;token=4706399b-ab55-4f53-9290-192bbe5a75aa" alt=""><figcaption></figcaption></figure>

Make sure your Sync Time is **`0.0s`** and check Last commited block is same as the [algoexplorer testnet](https://testnet.algoexplorer.io). If your algorand node catch up slowly, you can restart by the following command below.

```bash
sudo systemctl restart algorand
```

After use this command, you can go back to check the algorand status.

### Request Not Coming

Don't worry about this error, because this error is normal. The oracle request sometime not coming because this is related to their server temporary stopped.

### AppError.General: Error getting Goracle info for

This error also related to **RangeError: Maximum call stack size exceeded** and also some mistake on your `.goracle` file, your `.goracle` file configuration should be like this.

{% code title=".goracle" %}

```javascript
{
  "blockchain": {
    "server": "http://127.0.0.1:8080", // your server from algod.net. port may be different
    "token": "yourtoken", // your token from algod.token
    "mnemonic": "xxx", // this mnemonic is from generated using goracle init
    "mainAddr": "xxx" // this is your main address from pera wallet
  }
}
```

{% endcode %}

\
Delete all related to `authKey` and `authHeader` and save your `.goracle` file. Then do this command to restart your node.

```bash
goracle docker-stop
docker rm goracle-nr
goracle docker-start --background
docker logs -f goracle-nr
```

### Error to get vote

<figure><img src="https://3513762394-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHnfaXqsjt2Q8hoDykMmk%2Fuploads%2FSL2RLJ3tXFtxGiarbtqO%2Fimage.png?alt=media&amp;token=6c4ae378-d0e6-4cd7-82f9-a77daa1d1466" alt=""><figcaption><p>Screenshot from users discord</p></figcaption></figure>

If you facing error like this, you need to top up the participation address. You can go to this link below.

{% embed url="<https://testnet-app.goracle.io/nodes>" %}

{% hint style="warning" %}
Participation address is different from your Pera Wallet. Participation address generated from **goracle init**.&#x20;
{% endhint %}

Next step, you need to copy the participation address and top up your participation address from top up button from link above.

### RangeError: Maximum call stack size exceeded

{% hint style="info" %}
**Update**: In the new version of goracle binary, they already fixed for this error. So you if you get this error, you can update to latest version in [Upgrade](https://docs.strnan.top/testnet/goracle/upgrade).
{% endhint %}

* **Solution 1**

Your node is running in the docker and you need to stop it using this command below.

```
goracle docker-stop
docker rm goracle-nr
```

This command will stop and remove your container. Then try again to start your goracle node.

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

Check your logs

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

* **Solution 2**

If didn't work, you can check the `.goracle` file if there is something mistake in your configuration. Then try again. This is the example :&#x20;

{% code lineNumbers="true" %}

```javascript
{
  "blockchain": {
    "server": "http://127.0.0.1:8080",
    "token": "xxx",
    "mnemonic": "xxx",
    "mainAddr": "xxx", // see this comma (incorrect)
  }
}
```

{% endcode %}

As you can see in the line 6, You see the **comma** on the last line, you need to remove it in order to run the node again. So this is example if your `.goracle` file didn't have any mistake.

{% code lineNumbers="true" %}

```javascript
{
  "blockchain": {
    "server": "http://127.0.0.1:8080",
    "token": "xxx",
    "mnemonic": "xxx",
    "mainAddr": "xxx" // this is without comma (correct)
  }
}
```

{% endcode %}

* **Solution 3**

Also another solution is make sure your server configuration is correct.

This is correct

```javascript
"server": "http://127.0.0.1:8080",
```

This is not correct

```javascript
"server": "127.0.0.1:8080",
```

* **Solution 4**

Remove all exited container using this following command.

```bash
docker rm $(docker ps --filter status=exited -q)
```

After doing that, back to **Solution 1**.

### Your participation address not configured

You can solve this issue by adding sudo in goracle init section. here is the example.

{% code overflow="wrap" %}

```bash
sudo goracle init
```

{% endcode %}

{% hint style="info" %}
add **sudo** every command if that command are needed to access using root.
{% endhint %}

### ERROR URLTokenBaseHTTPError: Network request error. Received status 404 (Not Found)

If you're using Purestake, don't worry about this error. As long as your goracle node still submitted vote, your node is fine. Because this error is from Purestake API, maybe their server are overloaded.

### Node Stopped

This problem is from your API (Purestake or Algonode), maybe have some problem with their server or not sure what's the problem. The only way is running own algorand node or wait for goracle team to fix this issue. Because this issue is from their server. But you can use this command to make your goracle node when stopped will automatically restarted.

```docker
docker update --restart on-failure:5 goracle-nr
```

With this command, the container will attempt to maximum of 5 retries to restart when it failure, but it will not attempt to restart if you stop it manually.

Check to make sure this command already applied to your goracle node.

```
docker inspect --format='{{.HostConfig.RestartPolicy}}' goracle-nr
```

Ping me on discord (*Lightbulb#0667*) if this step is working or not, since i haven't tested it yet.

Thanks to **Moon1215i#4745** for sharing this guide how to restart node.


# Useful Command

Useful command to check your goracle node and many more.

{% hint style="warning" %}
Add **sudo** if you're not **ROOT** users.
{% endhint %}

#### Update your goracle binary

{% code overflow="wrap" %}

```
goracle update
```

{% endcode %}

If you're using old version like `1.0.14`, you need to download manually using the following command below.

{% 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 %}

#### Check your goracle node logs

{% code overflow="wrap" %}

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

{% endcode %}

#### Check your goracle information

```
goracle info
```

#### Check your goracle node status

```
goracle docker-status
```

#### Stop your node

```
goracle docker-stop
```

#### :warning: Delete container :warning:

```
docker rm goracle-nr
```

#### :warning: Delete all container with exited status :warning:

```bash
docker rm $(docker ps --filter status=exited -q)
```

#### Start node

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

{% hint style="info" %}
**--background** flags use for your node to run in the background.
{% endhint %}

#### Backup your node

```
cat .goracle
```

Copy all the the input to notepad or you can use [**mobaxterm**](https://mobaxterm.mobatek.net/download.html) and download `.goracle` file and save to your pc.


# Algorand

<figure><img src="https://3513762394-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHnfaXqsjt2Q8hoDykMmk%2Fuploads%2Fo1H9fXh3XWfJIEEUcu3R%2Fimage_2023-04-07_173005198.png?alt=media&amp;token=333984c2-6283-47f8-8db8-38037c4fab6a" alt=""><figcaption></figcaption></figure>

To make sure your algorand node testnet run smoothly on your machine, you need to have the following hardware requirement :

* at least 4GB of RAM (8GB strongly recommended)
* a not-too-slow SSD: HDD and SD cards are too slow for a testnet node and will most likely prevent the node to sync
* at least 100Mbps connection (1Gbps recommended)


# Installation

How to install Algorand Node in your VPS.

In this step we are preparing to install all tools needed in your server to run this Algorand Node. Use this command one by one to avoid some of these command not executed.

{% code overflow="wrap" %}

```bash
sudo apt-get update

sudo apt-get install -y gnupg2 curl software-properties-common

curl -o - https://releases.algorand.com/key.pub | sudo tee /etc/apt/trusted.gpg.d/algorand.asc

sudo add-apt-repository "deb [arch=amd64] https://releases.algorand.com/deb/ stable main"

sudo apt-get update

sudo apt-get install -y algorand-devtools
```

{% endcode %}

Check to make sure your algorand tools already installed in your server.

{% code overflow="wrap" %}

```
algod -v
```

{% endcode %}

and this the result when you run the command above.

{% hint style="warning" %}
No need to copy the result.
{% endhint %}

{% code overflow="wrap" %}

```
12885884928
3.15.0.stable [rel/stable] (commit #814bc0bd)
go-algorand is licensed with AGPLv3.0
source code available at https://github.com/algorand/go-algorand
```

{% endcode %}


# Switching Network

Switching network algorand node from mainnet to testnet.

In this step you need to switch the default network (mainnet) to testnet. If your algorand already in testnet network, you just skip all of this step and go to next step (Fast Sync).

#### Stop the algorand service

{% code overflow="wrap" %}

```bash
sudo systemctl stop algorand
```

{% endcode %}

#### Go to directory

{% code overflow="wrap" %}

```bash
cd /var/lib/algorand/genesis/testnet
```

{% endcode %}

#### Copy the testnet genesis

{% code overflow="wrap" %}

```bash
sudo cp genesis.json /var/lib/algorand/
```

{% endcode %}

## Start Node

Start the node to make sure you're already switched in testnet.

{% code overflow="wrap" %}

```bash
sudo systemctl start algorand
```

{% endcode %}

Check your node after start the service.

{% code overflow="wrap" %}

```bash
goal node status -d /var/lib/algorand
```

{% endcode %}

Here is the result if you're already set up to testnet.

<figure><img src="https://3513762394-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHnfaXqsjt2Q8hoDykMmk%2Fuploads%2F4PnrEa0rNvNGjfNzzaBs%2Fimage_2023-04-07_173639702.png?alt=media&amp;token=9b7f726a-f8c4-43f0-9864-fb261865faf6" alt=""><figcaption></figcaption></figure>


# Fast Sync

How to reach the latest block using fast sync. Don't waste your time to wait.

In this step you need to use fast sync or catch up to make more faster to reach the latest block.

{% code overflow="wrap" %}

```bash
goal node catchup $(curl -s https://algorand-catchpoints.s3.us-east-2.amazonaws.com/channel/testnet/latest.catchpoint) -d /var/lib/algorand/
```

{% endcode %}

Check your node status.

```bash
goal node status -d /var/lib/algorand
```

Here is the result after your node fully synced using fast sync.

<figure><img src="https://3513762394-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHnfaXqsjt2Q8hoDykMmk%2Fuploads%2FFkPdqemjBWXqHZEdeoow%2Fimage_2023-04-07_173729213.png?alt=media&amp;token=216f6794-e593-478c-af1b-3f4ed3795cbc" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
If your **Sync Time** is *0.0s*, that means your node already reach latest block. To reach the latest block, it depends your VPS specs, It takes around 1-2 hours.
{% endhint %}

Now your Algorand Node Testnet is ready to use. Now you can do next step to run goracle node and using your own algo node API.

{% embed url="<https://docs.strnan.top/algorand-testnet/goracle/installation#switch-to-your-own-node-optional>" %}


# Find Server and Token

How to find your IP:PORT and API token in Algorand Node.

In this step if you're confusing what's your IP:PORT and token for your algorand node. You can use this following command to get that server and token you need to setup Goracle Node.

#### Go To the Algorand Directory

```
cd /var/lib/algorand
```

#### Check algod.net and algod.token

{% hint style="danger" %}
Copy all result and save in your notepad. The result of **algod.net** file for the port may be different. Because i saw someone not using **8080** port by default. So make sure double check.
{% endhint %}

```
cat algod.net
```

the result :&#x20;

**127.0.0.1:8080**

{% hint style="danger" %}
Don't forget to add **http\://** in "server" configuration of your `.goracle` file later.
{% endhint %}

```
cat algod.token
```

the result :&#x20;

**85a6891e0ea.................**

This is just example and now you can go to the next step to setup your goracle node.


# Custom Port (Optional)

This step is to resolve port conflicts, as the algorand node uses the default port of 8080. You can skip this step if you want to use default port.

If your 8080 port is already using on other apps, you can using custom with this following command.

#### Go to algorand node directory

```bash
cd /var/lib/algorand
```

#### Copy the config example

```bash
cp config.json.example config.json
```

#### Edit the config.json

```bash
nano config.json
```

Search `EndpointAddress` and here is the example.

<figure><img src="https://3513762394-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHnfaXqsjt2Q8hoDykMmk%2Fuploads%2Fpa67vZvD6NLxcIAclJtm%2Fimage_2023-04-09_010903053.png?alt=media&amp;token=bf8eef84-d637-4aa4-b837-55f54fcee246" alt=""><figcaption></figcaption></figure>

Then change the port from `127.0.0.1:0` to `127.0.0.1:8980` or you can use port you want. Next step is save your config using `CTRL +X` , `CTRL + Y` and then press `enter`.

#### Restart your node

```bash
systemctl restart algorand
```

#### Check your node status

```
systemctl status algorand
```

Check your node status to make sure your port is already changed. Here is the example.

<figure><img src="https://3513762394-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHnfaXqsjt2Q8hoDykMmk%2Fuploads%2F51rzHyYR8Paxa2iznuJD%2Fimage_2023-04-09_011630397.png?alt=media&amp;token=142d3bf6-8387-4b70-8a2e-835d724da763" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Don't forget to remember which port you're using for algorand node to run goracle node later.
{% endhint %}

Now your algorand node is ready to use.&#x20;


# Troubleshooting

Fix the issue when installing the algorand node.

If you have some problem with your algorand installation, try remove and install again using this command. Because i saw some user have this problem and didn't show any files inside `/var/lib/algorand`.

#### Remove the algorand

```
sudo apt purge algorand
```

#### Install the algorand

```
sudo apt install algorand
```

Now you can go to next step with this link below.

{% content-ref url="/pages/qGTNUpfxUdustgojM2dh" %}
[Switching Network](https://docs.strnan.top/testnet/algorand/switching-network)
{% endcontent-ref %}

I will add more soon.


# Useful Command

{% hint style="info" %}
Add **sudo** if you're not in ROOT users.
{% endhint %}

#### Check your node status using curl

{% hint style="info" %}
Change your port if you're using custom port.
{% endhint %}

{% code overflow="wrap" %}

```javascript
curl -X GET \
     -H "X-Algo-API-Token: yourtoken" \
     "http://127.0.0.1:8080/v2/status"
```

{% endcode %}

#### Check your algorand service status

{% hint style="info" %}
In this step you will find the port you are using in the algorand node.
{% endhint %}

```
systemctl status algorand
```

#### Restart node

```
systemctl restart algorand
```

#### Check node status

```
goal node status -d /var/lib/algorand
```

#### :warning: Stop node :warning:

```
systemctl stop algorand
```

#### :warning: Delete Algorand from your server :warning:

```
apt-get remove algorand algorand-devtools
```

```
sudo rm -rf /var/lib/algorand/
```

#### Add variable

In this step if you want to use `goal node status` without using -d flags you can follow this command below.

{% code overflow="wrap" %}

```bash
echo "export ALGORAND_DATA=/var/lib/algorand" >> ~/.bash_profile
source ~/.bash_profile
```

{% endcode %}

Now you can use this command without using -d flags.

```bash
goal node status
```

I'll add more command soon, i just exploring algorand node.


# Aleo

Where Applications Become Private. Aleo is a Layer 1 blockchain bringing privacy to the web.

<figure><img src="https://3513762394-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHnfaXqsjt2Q8hoDykMmk%2Fuploads%2FqxypNwj4ozpr2mOX677b%2Fimage_2023-07-22_195123159.png?alt=media&amp;token=a6f2b106-be14-4add-bb3e-51da120ad30b" alt=""><figcaption></figcaption></figure>

Where Applications Become Private. Aleo is a Layer 1 blockchain bringing privacy to the web.

The following are minimum requirements to Deploy:

* CPU: 2-cores&#x20;
* RAM: 4GB of memory&#x20;
* Storage: 128GB of disk space&#x20;
* Network: 10 Mbps of upload and download bandwidth&#x20;
* Software: Linux, MacOS


# Installation

Cara melakukan Deploy dan Execute Contract di Aleo Testnet.

### Siapkan Aleo Wallet

pertama kita generate aleo wallet di [link](https://aleo.tools/) ini dan klik generate.

{% hint style="danger" %}
Jangan berikan data ini ke siapapun dan foto ini hanya contoh.
{% endhint %}

<figure><img src="https://3513762394-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHnfaXqsjt2Q8hoDykMmk%2Fuploads%2FRep10MjqOQxzocEHo2rq%2Fimage_2023-07-22_190054234.png?alt=media&amp;token=87bd968a-b07e-4cff-8255-ca46f58fc3a8" alt=""><figcaption></figcaption></figure>

Simpan 3 kolom tersebut ke tempat yang aman dan jangan sampai siapapun mengetahui private key kalian.

### Request Faucet via SMS

Kalian perlu test token ALEO untuk deploy contract nanti, kalian bisa kirim SMS pada nomor ini `+1-867-888-5688` dan kirim pesan seperti dibawah ini.

{% code overflow="wrap" %}

```
Send 50 credits to aleo1hcgx79gqerlj4ad2y2w2ysn3pc38nav69vd2r5lc3hjycfy6xcpse0cag0
```

{% endcode %}

{% hint style="warning" %}
Ubah address-nya dengan address yang sudah kamu dapatkan di step pertama.
{% endhint %}

Setelah mendapatkan respon dari SMS, kalian bisa cek status faucet sudah dikirim atau tidak dengan mencarinya di [link](https://faucet.aleo.org/) ini. Kemudian masukkan address kalian dan jangan lupa simpan **Transaction ID**-nya jika sudah muncul dan tidak dalam status **pending**.&#x20;

### Download Packages Yang Diperlukan

Download bahan-bahan yang diperlukan untuk deploy dan excute contract nanti beserta tmux untuk mengantisipasi ketika kehilangan koneksi VPS, instalasi kalian tetap berjalan. Fungsinya sama seperti menggunakan screen.

{% code overflow="wrap" %}

```bash
sudo apt update && \
sudo apt install make clang pkg-config libssl-dev build-essential gcc xz-utils git curl vim tmux ntp jq llvm ufw -y && \
tmux new -s deploy
```

{% endcode %}

### Buat Variable Untuk Wallet

Tujuannya agar mempermudah untuk menjalankan command dengan menggunakan variable.

{% code overflow="wrap" %}

```bash
echo Enter your Private Key: && read PK && \
echo Enter your View Key: && read VK && \
echo Enter your Address: && read ADDRESS
```

{% endcode %}

{% hint style="info" %}
Tidak perlu edit command diatas.
{% endhint %}

Setelah itu kalian enter dan masukkan satu per satu kolom yang dibutuhkan. Jika sudah selesai kalian bisa double check kembali apakah data yang kalian masukkan sudah sama atau tidak dengan menggunakan command dibawah ini.

{% code overflow="wrap" %}

```bash
echo Private Key: $PK && \
echo View Key: $VK && \
echo Address: $ADDRESS
```

{% endcode %}

Jika sudah sama seperti yang kalian input, kemudian lanjut buat variable untuk **Transaction ID** dari request faucet tadi.

{% code overflow="wrap" %}

```bash
echo Enter your Transaction ID: && read TI
```

{% endcode %}

Setelah itu tekan enter dan masukkan **Transaction ID** kalian yang sudah didapatkan melalui faucet link sebelumnya. Kemudian buat variable **CIPHERTEXT** untuk melakukan deploy nanti.

{% code overflow="wrap" %}

```bash
CIPHERTEXT=$(curl -s https://vm.aleo.org/api/testnet3/transaction/$TI | jq -r '.execution.transitions[0].outputs[0].value')
```

{% endcode %}

### **Install SnarkOS dan Leo**

Pertama kalian install snarkOS dan build.

{% code overflow="wrap" %}

```bash
cd $HOME
git clone https://github.com/AleoHQ/snarkOS.git --depth 1
cd snarkOS
bash ./build_ubuntu.sh
source $HOME/.bashrc
source $HOME/.cargo/env
```

{% endcode %}

Setelah itu install leo dengan cargo.

{% code overflow="wrap" %}

```bash
cd $HOME
git clone https://github.com/AleoHQ/leo.git
cd leo
cargo install --path .
```

{% endcode %}

### **Deploy Contract**

Pertama kalian buat variable dan folder untuk persiapan deploy contract.

{% code overflow="wrap" %}

```bash
NAME=helloworld_"${ADDRESS:4:6}"
mkdir $HOME/leo_deploy
cd $HOME/leo_deploy
leo new $NAME
```

{% endcode %}

Setelah itu buat variable RECORD untuk melakukan deploy contract.

{% code overflow="wrap" %}

```bash
RECORD=$(snarkos developer decrypt --ciphertext $CIPHERTEXT --view-key $VK)
```

{% endcode %}

Kemudian gunakan command dibawah ini untuk men-deploy contract.

{% code overflow="wrap" %}

```bash
snarkos developer deploy "$NAME.aleo" \
--private-key "$PK" \
--query "https://vm.aleo.org/api" \
--path "$HOME/leo_deploy/$NAME/build/" \
--broadcast "https://vm.aleo.org/api/testnet3/transaction/broadcast" \
--fee 4000000 \
--record "$RECORD"
```

{% endcode %}

Setelah selesai maka hasilnya kurang lebih seperti gambar dibawah ini.

<figure><img src="https://3513762394-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHnfaXqsjt2Q8hoDykMmk%2Fuploads%2FCo1FipNyuI8RaS5uiQUP%2Fimage_2023-07-22_193723531.png?alt=media&amp;token=1950d523-ba60-4145-88d3-5101e76f910a" alt=""><figcaption></figcaption></figure>

Jangan lupa cek transaksi kalian di [explorer](https://explorer.hamp.app/) untuk memastikan jika deploy contract kalian sudah berhasil atau tidak. Kalian cukup copy tx hash yang berawalan `at1...` setelah itu cari di explorer.

### **Execute Contract**

Gunakan tx hash yang tadi kalian dapatkan setelah deploy contract. Kemudian jalankan command dibawah ini dan tekan enter, lalu isi dengan tx hash yang sudah kalian simpan tadi.

{% code overflow="wrap" %}

```bash
echo Enter your Deploy hash: && read DH
```

{% endcode %}

Setelah itu buat variable CIPHERTEXT lagi untuk melakukan execute contract.

{% code overflow="wrap" %}

```bash
CIPHERTEXT=$(curl -s https://vm.aleo.org/api/testnet3/transaction/$DH | jq -r '.fee.transition.outputs[].value')
```

{% endcode %}

Jika sudah selesai, buat kembali variable RECORD.

{% code overflow="wrap" %}

```bash
RECORD=$(snarkos developer decrypt --ciphertext $CIPHERTEXT --view-key $VK)
```

{% endcode %}

Kemudian buat execute contract dengan menggunakan command dibawah ini.

{% code overflow="wrap" %}

```bash
snarkos developer execute "$NAME.aleo" "hello" "1u32" "2u32" \
--private-key $PK \
--query "https://vm.aleo.org/api" \
--broadcast "https://vm.aleo.org/api/testnet3/transaction/broadcast" \
--fee 1000000 \
--record "$RECORD"
```

{% endcode %}

Jika sudah selesai menggunakan command diatas, maka hasilnya akan seperti gambar dibawah ini.

<figure><img src="https://3513762394-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHnfaXqsjt2Q8hoDykMmk%2Fuploads%2FwUqDbPgQPf04UZ87rVAE%2Fimage_2023-07-22_194401925.png?alt=media&amp;token=8233139a-28bb-4597-b0b5-82fb4a0aaaad" alt=""><figcaption></figcaption></figure>

Jangan lupa cek kembali ke [explorer](https://explorer.hamp.app/) dan copy id transaksi yang berawalan `at1...` dan jika sudah sukses, maka kalian sudah selesai melakukan Deploy dan Execute Contract.

Sumber : [Testnet-Pride](https://github.com/testnet-pride/Node-manuals/tree/main/Testnets/Aleo/Testnet3-phase2)


# Useful Command

### **Membuat tmux session baru**

membuat session baru.

{% code overflow="wrap" %}

```bash
tmux new -s name
```

{% endcode %}

{% hint style="info" %}
kamu bisa ubah **name** sesuai yang kalian mau.
{% endhint %}

### **Menampilkan semua tmux session**

Kalian bisa cek list tmux sessions yang sudah kalian buat sebelumnya.

{% code overflow="wrap" %}

```
tmux ls
```

{% endcode %}

### **Kembali ke tmux session**

Jika sebelumnya kalian sudah membuat session, kalian bisa jalankan kembali dengan menggunakan command dibawah ini.

{% code overflow="wrap" %}

```bash
tmux attach -t name
```

{% endcode %}

{% hint style="info" %}
Ubah **name** sesuai dengan nama tmux session kalian.
{% endhint %}

### **Keluar dari tmux session**

Keluar dari tmux session tanpa harus menghilangkan session yang sudah kalian jalankan. Jangan lupa kalian jalankan command ini saat masih didalam tmux session.

{% code overflow="wrap" %}

```
tmux detach
```

{% endcode %}


# BlockX


# Installation

### Install dependencies <a href="#install-dependencies" id="install-dependencies"></a>

UPDATE SYSTEM AND INSTALL BUILD TOOLS

```
sudo apt -q update
sudo apt -qy install curl git jq lz4 build-essential
sudo apt -qy upgrade
```

### Install Golang

Install latest go version <https://golang.org/doc/install>

{% code overflow="wrap" %}

```
wget -q -O - https://raw.githubusercontent.com/canha/golang-tools-install-script/master/goinstall.sh | bash -s -- --version 1.18
source ~/.profile
```

{% endcode %}

To verify that Golang installed

```
go version
```

It should return go version go1.18 linux/amd64

### Run Full Node

{% code overflow="wrap" %}

```
git clone https://github.com/defi-ventures/blockx-node-public-compiled.git
cd blockx-node-public-compiled
./run-fullnode-cosmovisor.sh
```

{% endcode %}


# Goracle

<figure><img src="https://3513762394-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHnfaXqsjt2Q8hoDykMmk%2Fuploads%2F1SfHc2s7SiBVehairAby%2Fimage_2023-04-07_174004017.png?alt=media&amp;token=365dd1de-f882-43bf-8feb-603dd6e4c8dd" alt=""><figcaption></figcaption></figure>

Hardware requirement to run goracle node testnet.

* Cpu: 1-2 cores
* Ram: 4gb
* Storage: 10gb SSD
* Fast Internet
* Ubuntu: 20.04+


# Installation

How to install Goracle Node in your VPS.

### 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="/pages/NVU6IPcpsILokI52GBW8" %}
[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&amp;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&amp;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&amp;token=c667f321-9655-448c-a036-9ed7560eba90" alt=""><figcaption></figcaption></figure>

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


# Upgrade

Upgrade to the latest version of goracle binary.

**Latest Version**: 1.0.26

### Docker Stop

```bash
goracle docker-stop
```

### Docker Remove Exited Container

```
docker rm $(docker ps --filter=exited -q)
```

### Goracle Update

```
goracle update
```

<figure><img src="https://3513762394-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHnfaXqsjt2Q8hoDykMmk%2Fuploads%2FhLWZAEL4tCJtpOBzVBSu%2Fimage_2023-04-15_214241694.png?alt=media&amp;token=7940012c-1020-44f0-8fbe-ccb87cdc0059" alt=""><figcaption></figcaption></figure>

Answer **`y`** if you see this question.

**`Update "/usr/bin/goracle" [y/N]?`** y

### Docker Start

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

### Check Docker 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%2Fpzx7jeGxheMQv0GDeSn9%2Fimage_2023-04-15_214303888.png?alt=media&amp;token=1f11ab38-4c53-4344-aaab-21c60d01f170" alt=""><figcaption></figcaption></figure>

## Old Version

If you're in old version like `1.0.14` or the binary don't have `update` cli you use this step to remove the old version and download the latest version of goracle binary.

#### Stop Docker

If your output logs `no job stopped` you can skip this part.

```bash
goracle docker-stop
```

#### Remove Old Version

```bash
rm /usr/bin/goracle
```

#### Download Latest Binary

{% 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 %}

#### Start Goracle Node

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

#### Check Your Logs

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


# Troubleshooting

Problems that often occur in running goracle nodes and how to solve them. All of these issues are not fully worked out, I share based on my own experience.

### AppError.General: Invalid Configuration

<figure><img src="https://3513762394-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHnfaXqsjt2Q8hoDykMmk%2Fuploads%2Fnzm7fYIdZhXOKiK3jWQW%2Fimage_2023-04-17_181050276.png?alt=media&amp;token=cb81909e-a7ca-4b19-8dd9-12b6d31d4240" alt=""><figcaption></figcaption></figure>

If you facing error like screenshot above, your goracle binary is not match to the latest version. Make sure you update to the latest version to solve this issue by the following command below.

{% hint style="danger" %}
Make sure you copy this command one by one.
{% endhint %}

{% code overflow="wrap" %}

```bash
goracle docker-stop

rm /usr/bin/goracle

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

goracle docker-start --background
```

{% endcode %}

Now check your logs using this command.

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

### TransactionPool.Remember: txn dead round: xxx

<figure><img src="https://3513762394-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHnfaXqsjt2Q8hoDykMmk%2Fuploads%2FjLEo8PZlxkgrJ56QH9Bk%2Fimage_2023-04-16_035154286.png?alt=media&amp;token=e042ae74-26c8-42a9-b6fe-37163642135e" alt=""><figcaption></figcaption></figure>

This error is related to your algorand node did not catch up to the latest block. Make sure you check the algorand node status by the following command below.

```bash
goal node status -d /var/lib/algorand
```

<figure><img src="https://3513762394-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHnfaXqsjt2Q8hoDykMmk%2Fuploads%2FA5Ktsv3AmhY7o3kLkszd%2Fimage_2023-04-16_035344015.png?alt=media&amp;token=4706399b-ab55-4f53-9290-192bbe5a75aa" alt=""><figcaption></figcaption></figure>

Make sure your Sync Time is **`0.0s`** and check Last commited block is same as the [algoexplorer testnet](https://testnet.algoexplorer.io). If your algorand node catch up slowly, you can restart by the following command below.

```bash
sudo systemctl restart algorand
```

After use this command, you can go back to check the algorand status.

### Request Not Coming

Don't worry about this error, because this error is normal. The oracle request sometime not coming because this is related to their server temporary stopped.

### AppError.General: Error getting Goracle info for

This error also related to **RangeError: Maximum call stack size exceeded** and also some mistake on your `.goracle` file, your `.goracle` file configuration should be like this.

{% code title=".goracle" %}

```javascript
{
  "blockchain": {
    "server": "http://127.0.0.1:8080", // your server from algod.net. port may be different
    "token": "yourtoken", // your token from algod.token
    "mnemonic": "xxx", // this mnemonic is from generated using goracle init
    "mainAddr": "xxx" // this is your main address from pera wallet
  }
}
```

{% endcode %}

\
Delete all related to `authKey` and `authHeader` and save your `.goracle` file. Then do this command to restart your node.

```bash
goracle docker-stop
docker rm goracle-nr
goracle docker-start --background
docker logs -f goracle-nr
```

### Error to get vote

<figure><img src="https://3513762394-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHnfaXqsjt2Q8hoDykMmk%2Fuploads%2FSL2RLJ3tXFtxGiarbtqO%2Fimage.png?alt=media&amp;token=6c4ae378-d0e6-4cd7-82f9-a77daa1d1466" alt=""><figcaption><p>Screenshot from users discord</p></figcaption></figure>

If you facing error like this, you need to top up the participation address. You can go to this link below.

{% embed url="<https://testnet-app.goracle.io/nodes>" %}

{% hint style="warning" %}
Participation address is different from your Pera Wallet. Participation address generated from **goracle init**.&#x20;
{% endhint %}

Next step, you need to copy the participation address and top up your participation address from top up button from link above.

### RangeError: Maximum call stack size exceeded

{% hint style="info" %}
**Update**: In the new version of goracle binary, they already fixed for this error. So you if you get this error, you can update to latest version in [Upgrade](https://docs.strnan.top/testnet/goracle/upgrade).
{% endhint %}

* **Solution 1**

Your node is running in the docker and you need to stop it using this command below.

```
goracle docker-stop
docker rm goracle-nr
```

This command will stop and remove your container. Then try again to start your goracle node.

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

Check your logs

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

* **Solution 2**

If didn't work, you can check the `.goracle` file if there is something mistake in your configuration. Then try again. This is the example :&#x20;

{% code lineNumbers="true" %}

```javascript
{
  "blockchain": {
    "server": "http://127.0.0.1:8080",
    "token": "xxx",
    "mnemonic": "xxx",
    "mainAddr": "xxx", // see this comma (incorrect)
  }
}
```

{% endcode %}

As you can see in the line 6, You see the **comma** on the last line, you need to remove it in order to run the node again. So this is example if your `.goracle` file didn't have any mistake.

{% code lineNumbers="true" %}

```javascript
{
  "blockchain": {
    "server": "http://127.0.0.1:8080",
    "token": "xxx",
    "mnemonic": "xxx",
    "mainAddr": "xxx" // this is without comma (correct)
  }
}
```

{% endcode %}

* **Solution 3**

Also another solution is make sure your server configuration is correct.

This is correct

```javascript
"server": "http://127.0.0.1:8080",
```

This is not correct

```javascript
"server": "127.0.0.1:8080",
```

* **Solution 4**

Remove all exited container using this following command.

```bash
docker rm $(docker ps --filter status=exited -q)
```

After doing that, back to **Solution 1**.

### Your participation address not configured

You can solve this issue by adding sudo in goracle init section. here is the example.

{% code overflow="wrap" %}

```bash
sudo goracle init
```

{% endcode %}

{% hint style="info" %}
add **sudo** every command if that command are needed to access using root.
{% endhint %}

### ERROR URLTokenBaseHTTPError: Network request error. Received status 404 (Not Found)

If you're using Purestake, don't worry about this error. As long as your goracle node still submitted vote, your node is fine. Because this error is from Purestake API, maybe their server are overloaded.

### Node Stopped

This problem is from your API (Purestake or Algonode), maybe have some problem with their server or not sure what's the problem. The only way is running own algorand node or wait for goracle team to fix this issue. Because this issue is from their server. But you can use this command to make your goracle node when stopped will automatically restarted.

```docker
docker update --restart on-failure:5 goracle-nr
```

With this command, the container will attempt to maximum of 5 retries to restart when it failure, but it will not attempt to restart if you stop it manually.

Check to make sure this command already applied to your goracle node.

```
docker inspect --format='{{.HostConfig.RestartPolicy}}' goracle-nr
```

Ping me on discord (*Lightbulb#0667*) if this step is working or not, since i haven't tested it yet.

Thanks to **Moon1215i#4745** for sharing this guide how to restart node.


# Useful Command

Useful command to check your goracle node and many more.

{% hint style="warning" %}
Add **sudo** if you're not **ROOT** users.
{% endhint %}

#### Update your goracle binary

{% code overflow="wrap" %}

```
goracle update
```

{% endcode %}

If you're using old version like `1.0.14`, you need to download manually using the following command below.

{% 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 %}

#### Check your goracle node logs

{% code overflow="wrap" %}

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

{% endcode %}

#### Check your goracle information

```
goracle info
```

#### Check your goracle node status

```
goracle docker-status
```

#### Stop your node

```
goracle docker-stop
```

#### :warning: Delete container :warning:

```
docker rm goracle-nr
```

#### :warning: Delete all container with exited status :warning:

```bash
docker rm $(docker ps --filter status=exited -q)
```

#### Start node

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

{% hint style="info" %}
**--background** flags use for your node to run in the background.
{% endhint %}

#### Backup your node

```
cat .goracle
```

Copy all the the input to notepad or you can use [**mobaxterm**](https://mobaxterm.mobatek.net/download.html) and download `.goracle` file and save to your pc.


# Impact Protocol

<figure><img src="https://3513762394-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHnfaXqsjt2Q8hoDykMmk%2Fuploads%2FzagapTkk4Po9es8zXcc6%2FIMPACT_PROTOCOL-LOGO-512--GREEN-ONE-LAYER.png?alt=media&amp;token=ad209d68-5216-4723-b262-b5ba895086e9" alt=""><figcaption></figcaption></figure>

Soon


# Installation

How to install Impact Protocol Node in your server.

### Install Dependencies

{% hint style="danger" %}
Skip this step if you're already run Impact Protocol before. Run this command if you're using new server. Make sure you use this command one by one.
{% endhint %}

{% code overflow="wrap" %}

```bash
sudo apt-get update
sudo apt install --assume-yes git clang curl libssl-dev llvm libudev-dev make protobuf-compiler
sudo apt install build-essential
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/env
rustc --version
rustup default stable
rustup update
rustup update nightly
rustup target add wasm32-unknown-unknown --toolchain nightly
rustup show
rustup +nightly show
```

{% endcode %}

### Install Impact Protocol

* Remove old folder

```bash
rm -rf impactprotocol
```

* Clone repository

```bash
git clone https://github.com/GlobalBoost/impactprotocol
```

* Go the folder

```bash
cd impactprotocol
```

* Build

{% hint style="info" %}
It will take some time to build, it depend on your server specs.
{% endhint %}

```bash
cargo build --release
```

* Copy impact binary to system

{% code overflow="wrap" %}

```bash
sudo cp $HOME/impactprotocol/target/release/impact /usr/local/bin/
```

{% endcode %}

* Remove old data chain

Change the **--base-path** directory with your own folder name. It depend what is your directory name that you run before. Skip this step if you're running on new server.

{% code overflow="wrap" %}

```bash
impact purge-chain --chain=impact-testnet --base-path /tmp/impactnode
```

{% endcode %}

* Generate mining key

{% hint style="danger" %}
Skip this step if you're already have account before.
{% endhint %}

```bash
impact generate-mining-key --chain=impact-testnet
```

* Import mining key

Change **\<seed\_phrase>** with your seed phrase.&#x20;

{% code overflow="wrap" %}

```bash
impact import-mining-key <seed_phrase> \--base-path /tmp/impactnode \--chain=impact-testnet
```

{% endcode %}

* Create Impact as a service

{% hint style="danger" %}
Change the "xxx" with your own data.\
**--author** is your public key, you can find it when you import the mining key before.

**--name** is your node name.
{% endhint %}

{% code title="impact.service" %}

```bash
sudo tee /etc/systemd/system/impact.service > /dev/null << EOF
[Unit]
Description=Impact Protocol Node
After=network-online.target

[Service]
User=$USER
Restart=on-failure
RestartSec=10
ExecStart=$(which impact) \
--base-path /tmp/impactnode \
--chain=impact-testnet \
--port 30333 \
--ws-port 9945 \
--rpc-port 9933 \
--telemetry-url "wss://telemetry.polkadot.io/submit/ 0" \
--validator \
--author xxx \
--rpc-methods Unsafe \
--name "xxx"

[Install]
WantedBy=multi-user.target
EOF
```

{% endcode %}

* Refresh the service and start

{% code overflow="wrap" %}

```bash
sudo systemctl daemon-reload
sudo systemctl start impact
```

{% endcode %}

* Check your logs

{% code overflow="wrap" %}

```bash
journalctl -fu impact -o cat
```

{% endcode %}


# Useful Command

Soon


# NuLink

<figure><img src="https://3513762394-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHnfaXqsjt2Q8hoDykMmk%2Fuploads%2FN3ONMTFiwvNpfjPZajDN%2Fimage_2024-01-04_152045952.png?alt=media&amp;token=44dfede2-abb3-4efe-94a5-0cbe6bb3b201" alt="" width="200"><figcaption></figcaption></figure>

NuLink provides privacy-preserving technology for decentralized applications via APIs. We enable and make it easy for developers, startups, small businesses and enterprises to build their own applications with all the best security and privacy practices.

Tu run NuLink node on your Cloud VPS, you need to have minimum specs below.

* Debian/Ubuntu (Recommended)
* 30GB available storage
* 4GB RAM
* x86 architecture
* **Static IP address**
* **Exposed TCP port 9151, make sure it's not occupied**
* Nodes can be run on cloud infrastructure.

Official Links for NuLink:

* [Twitter](https://twitter.com/NuLink_)
* [LinkedIn](https://www.linkedin.com/company/76502750)
* [Telegram](https://t.me/NuLink2021)
* [Discord](https://discord.gg/25CQFUuwJS)
* [Documentation](https://docs.nulink.org)[<br>](https://discord.gg/25CQFUuwJS)


# Installation

Guide for NuLink Staking Dashboard and Worker Account Setup

In this guide we use Docker for NuLink worker installation, because this one is easy to setup and monitor your node.

### Staking Dashboard

{% hint style="info" %}
We recommended to create new wallet for Metamask.
{% endhint %}

You need to **Sign In** on [NuLink Staking Dashboard ](https://dashboard.testnet.nulink.org/staking)and if you get this message, just press **Switch Network**, make sure you already installed **Metamask** on your browser.

<figure><img src="https://3513762394-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHnfaXqsjt2Q8hoDykMmk%2Fuploads%2FBf3Gm0YqTy5G4YSg7KJr%2Fimage.png?alt=media&amp;token=d9e88425-bc34-40b6-9030-73292af0930a" alt="" width="443"><figcaption></figcaption></figure>

After that you need to **Approve** this message on **Metamask** and then press Switch Network

<div align="center"><figure><img src="https://3513762394-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHnfaXqsjt2Q8hoDykMmk%2Fuploads%2F93YfVzIttYvC5XP61ocN%2Fimage_2024-01-04_153828848.png?alt=media&amp;token=728ad285-67cd-499d-8c6b-2b10d5e592a3" alt="" width="257"><figcaption></figcaption></figure> <figure><img src="https://3513762394-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHnfaXqsjt2Q8hoDykMmk%2Fuploads%2F01os6smB3o1oHAAEJHeQ%2Fimage_2024-01-04_153914849.png?alt=media&amp;token=98706514-5836-4a1a-962d-46db17271328" alt="" width="258"><figcaption></figcaption></figure></div>

### Get BNB and NLK Faucet for Stake

Before setup your node, you need some BNB for transaction fee and NLK to stake your node. You can get this faucet by using this [link](https://www.bnbchain.org/en/testnet-faucet) and then put your BNB Address from your Metamask.

<figure><img src="https://3513762394-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHnfaXqsjt2Q8hoDykMmk%2Fuploads%2FHRY6N6CbsofIQQGxFuaL%2Fimage.png?alt=media&amp;token=ffd94d33-b8b6-48ec-b315-d1bc2f845969" alt=""><figcaption></figcaption></figure>

Check your Metamask if your BNB Testnet balances is showing **0.3 BNB**. Now you can claim your NLK tokens on NuLink Staking Dashboard. Check arrow on this screenshot below.

<figure><img src="https://3513762394-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHnfaXqsjt2Q8hoDykMmk%2Fuploads%2FHRtLGUTVVW56wfPGiJ5f%2Fimage.png?alt=media&amp;token=d4fdf2b9-6914-4852-a929-1e2a997e614e" alt="" width="563"><figcaption></figcaption></figure>

Press **Proceed** and **Confirm** the transaction on Metamask. Now you need to **Stake** your NLK to prepare for Worker later. Just put all of your NLK tokens, but you can put any amount and minimum is 1 NLK and maximum is 10 NLK

<figure><img src="https://3513762394-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHnfaXqsjt2Q8hoDykMmk%2Fuploads%2Fua0SdQMRUqg2qTaXHuxR%2Fimage.png?alt=media&amp;token=9cbc52e2-abd9-4c73-94c8-bab12f87251a" alt="" width="563"><figcaption></figcaption></figure>

And then press approve and if you see this message like screenshot below, just put same as your NLK amount want to stake before and press **Next** and **Approve**.

<figure><img src="https://3513762394-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHnfaXqsjt2Q8hoDykMmk%2Fuploads%2FtrlUc6KwHDszAFeVOnE0%2Fimage.png?alt=media&amp;token=205eae2a-ec8f-43eb-8825-685322fbc00d" alt="" width="241"><figcaption></figcaption></figure>

After approving your NLK, you need to refresh the page and then go to Stake again and now you need to stake the NLK. I put this 5 NLK as a example and then you can press **Stake** and **Confirm** the transaction.&#x20;

<figure><img src="https://3513762394-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHnfaXqsjt2Q8hoDykMmk%2Fuploads%2FB9rTr47OnLFWclI0SNMx%2Fimage.png?alt=media&amp;token=ace48fb4-942d-45f8-b51f-41738ea68bb3" alt=""><figcaption></figcaption></figure>

After all step is done, now you can see the NLK staking amount is showing on Dashboard. Now it's time to **Setup Worker**.

<figure><img src="https://3513762394-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHnfaXqsjt2Q8hoDykMmk%2Fuploads%2FO8Akc5cAFXtAnArzIMUC%2Fimage.png?alt=media&amp;token=1c177764-e9ec-441e-b3b1-aa0c027c7312" alt="" width="432"><figcaption></figcaption></figure>

### Worker Setup

Before setup your worker, make sure you have minimum specs for your VPS to run this node. You check on this[ link](https://docs.strnan.top/testnet/nulink).&#x20;

#### Download Geth

{% code overflow="wrap" %}

```bash
wget https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-1.10.23-d901d853.tar.gz
```

{% endcode %}

<figure><img src="https://3513762394-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHnfaXqsjt2Q8hoDykMmk%2Fuploads%2Fldjgp1kpk5WYqj9Z116x%2Fimage.png?alt=media&amp;token=ac1d6271-777d-4bb0-bcba-8e68af4e499c" alt=""><figcaption></figcaption></figure>

#### Unzip Geth

{% code overflow="wrap" %}

```bash
tar -xvzf geth-linux-amd64-1.10.23-d901d853.tar.gz
```

{% endcode %}

<figure><img src="https://3513762394-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHnfaXqsjt2Q8hoDykMmk%2Fuploads%2FWFf814lApgxo7pTU31wi%2Fimage.png?alt=media&amp;token=32d6baf9-9403-408b-ad6e-eec3f70d18dd" alt=""><figcaption></figcaption></figure>

#### Open Geth Folder

{% code overflow="wrap" %}

```bash
cd geth-linux-amd64-1.10.23-d901d853/
```

{% endcode %}

<figure><img src="https://3513762394-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHnfaXqsjt2Q8hoDykMmk%2Fuploads%2Fnl3k03oD73wmHVe21sNh%2Fimage.png?alt=media&amp;token=d7642d90-c60f-4809-b400-665c8c8453e7" alt=""><figcaption></figcaption></figure>

#### Generate Ethereum Account and Keystore

{% code overflow="wrap" %}

```bash
./geth account new --keystore ./keystore
```

{% endcode %}

<figure><img src="https://3513762394-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHnfaXqsjt2Q8hoDykMmk%2Fuploads%2FrysQlYfwSG7V5B0z5v0f%2Fimage.png?alt=media&amp;token=e8b415d0-9257-4382-8bb3-306308a27b74" alt=""><figcaption></figcaption></figure>

Put your password in there and make sure you need to remember it. After that you will see this result and don't forget to save your public address and also the secret key, you can use MobaXTerm to access SFTP File and download the keystore.

<figure><img src="https://3513762394-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHnfaXqsjt2Q8hoDykMmk%2Fuploads%2FbGVhQNRCUw1qK2p1gCQb%2Fimage.png?alt=media&amp;token=01511f27-6ac4-4fc4-b4d5-9eae88d08ae2" alt=""><figcaption></figcaption></figure>

{% hint style="danger" %}
Save your **Keystore** that started with **UTC-** to your PC for safety reason. Check on path for your keystore same as the screenshot above.
{% endhint %}

### Install Docker and NuLink Image

```bash
sudo apt install docker.io
```

Don't forget to press Y and enter if they asked for confirmation to install docker. Now install NuLink Image.

```bash
docker pull nulink/nulink:latest
```

Now go to home directory and make folder for NuLink.

```bash
cd /root

mkdir nulink
```

Copy the keystore and move it to NuLink folder you created before using this command.

```bash
cp /root/geth-linux-amd64-1.10.23-d901d853/keystore/* /root/nulink
```

Now change permission using this command.

```bash
chmod -R 777 /root/nulink
```

Setup your password for keystore and worker. You need to remember it.

#### Setup Keystore Password

```bash
export NULINK_KEYSTORE_PASSWORD=xxxxxxxx
```

#### Setup Operator Password

```bash
export NULINK_OPERATOR_ETH_PASSWORD=xxxxxxxx
```

{% hint style="danger" %}
Change **xxxxxxxx** with your password **(8 character minimum)**
{% endhint %}

### Initialize Node Configuration

This is just example if you're running using root and you just need to change **--signer** file name and **--operator-address**. For signer you can see the file name on nulink folder and you will see file started with **UTC-** and then copy the file name and change that on **UTC-xxxxx**. For operator address, you just put the address that you save when you ***generate geth account***.

Example:

```
docker run -it --rm \
-p 9151:9151 \
-v /root/nulink:/code \
-v /root/nulink:/home/circleci/.local/share/nulink \
-e NULINK_KEYSTORE_PASSWORD \
nulink/nulink nulink ursula init \
--signer keystore:///code/UTC-xxxxx \
--eth-provider https://data-seed-prebsc-2-s2.binance.org:8545 \
--network horus \
--payment-provider https://data-seed-prebsc-2-s2.binance.org:8545 \
--payment-network bsc_testnet \
--operator-address xxxxx \
--max-gas-price 10000000000
```

After some changes:&#x20;

```
docker run -it --rm \
-p 9151:9151 \
-v /root/nulink:/code \
-v /root/nulink:/home/circleci/.local/share/nulink \
-e NULINK_KEYSTORE_PASSWORD \
nulink/nulink nulink ursula init \
--signer keystore:///code/UTC--2024-01-01T01-14-32.465358210Z--8b1819341bec211a45a2186c4d0030681ccce0ee \
--eth-provider https://data-seed-prebsc-2-s2.binance.org:8545 \
--network horus \
--payment-provider https://data-seed-prebsc-2-s2.binance.org:8545 \
--payment-network bsc_testnet \
--operator-address 0x8B1819341BEc211a45a2186C4D0030681cccE0Ee \
--max-gas-price 10000000000
```

After put this command on your VPS, you need to answer one by one like confirming your IPv4 and generate seed phrase for worker. You need to save this phrase to safeplace. You will see this step below.

```
# step 1
 Detected IPv4 address (8.219.186.125) - Is this the public-facing address of Ursula? [y/N]: y
 
 Please provide a password to lock Operator keys.
 Do not forget this password, and ideally store it using a password manager.
 
 # step 2
 Enter nulink keystore password (8 character minimum): xxxxxx
 Repeat for confirmation: xxxxxx
 
 Backup your seed words, you will not be able to view them again.
 
 xxxxxxxxxxxxxxxxxxxxxxxx
 
 # step 3
 Have you backed up your seed phrase? [y/N]: y
 
 # step 4
 Confirm seed words: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
 
 
Public Key:   02bb2067d21a677ce928967c0ece79a9
Path to Keystore: /home/circleci/.local/share/nulink/keystore

- You can share your public key with anyone. Others need it to interact with you.
- Never share secret keys with anyone! 
- Backup your keystore! Character keys are required to interact with the protocol!
- Remember your password! Without the password, it's impossible to decrypt the key!


Generated configuration file at default filepath /home/circleci/.local/share/nulink/ursula.json

* Review configuration  -> nulink ursula config
* Start working         -> nulink ursula run

```

After all step done, you will see the output below.

Output :

<figure><img src="https://3513762394-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHnfaXqsjt2Q8hoDykMmk%2Fuploads%2Fkj4CsPfXapZt6U7ekAN6%2Fimage.png?alt=media&amp;token=f0259996-c762-49b0-bfab-eec9c98bc8d4" alt=""><figcaption></figcaption></figure>

Next step is check your environment variables to make sure is still in there for running worker.

#### Keystore Password

```bash
echo $NULINK_KEYSTORE_PASSWORD
```

#### Operator Password

```bash
echo $NULINK_OPERATOR_ETH_PASSWORD
```

{% hint style="danger" %}
Don't forget to send some BNB to your [worker account](#generate-ethereum-account-and-keystore).&#x20;
{% endhint %}

If there is output, now you can run the nulink worker.

```bash
docker run --restart on-failure -d \
--name ursula \
-p 9151:9151 \
-v /root/nulink:/code \
-v /root/nulink:/home/circleci/.local/share/nulink \
-e NULINK_KEYSTORE_PASSWORD \
-e NULINK_OPERATOR_ETH_PASSWORD \
nulink/nulink nulink ursula run --no-block-until-ready
```

Output:

<figure><img src="https://3513762394-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHnfaXqsjt2Q8hoDykMmk%2Fuploads%2FPgzkLGq41ZSCCOJdmttS%2Fimage.png?alt=media&amp;token=58cc5cc7-e9f3-4029-b0fb-187eb52a3fa7" alt=""><figcaption></figcaption></figure>

Check logs:

```shell
docker logs -f ursula
```

Example Output:

```shell
Authenticating Ursula
Loaded Ursula (horus)
✓ External IP matches configuration
Starting services
✓ Node Discovery (Horus)
✓ Work Tracking
✓ Start Operator Bonded Tracker
✓ Rest Server https://8.219.186.125:9151
Working ~ Keep Ursula Online!
```

Now it's time to bond your worker with your account on NuLink Dashboard, you can find it on Staking menu and Node Information, press Bond Worker and put your worker address (the address you save before from geth account).

<figure><img src="https://3513762394-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHnfaXqsjt2Q8hoDykMmk%2Fuploads%2F3PlLkS3Fb7yB47QEB6Qr%2Fimage.png?alt=media&amp;token=fef1abeb-b9e0-417b-af66-c2b04587dd5f" alt=""><figcaption></figcaption></figure>

After Bond and Confirm transaction, check your IP and make sure your node is online. If yes, now relax you can check tomorrow after new epoch started you will see your Node Staking Amount and will be like this.

<figure><img src="https://3513762394-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHnfaXqsjt2Q8hoDykMmk%2Fuploads%2F63CzF6bolgiOwOdP5RJO%2Fimage.png?alt=media&amp;token=d1d67765-f69f-4941-9877-ce922aa4978d" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
~~Don't forget to fill form to participate~~ [~~Horus 2.0 Testnet - Phase 1~~](https://forms.gle/9ZZgECdJFJFQHGuz8) (Finished)

Fill this form for Phase 2 [Horus 2.0 Testnet - Phase 2 Form](https://cform.coinlist.co/forms/e24241d2-e123-4ab9-85a2-cbe6afe66cb9)
{% endhint %}

Source: [Documentation](https://docs.nulink.org)


# Upgrade

## Update NuLink Image Using Docker

Make sure you still hold your staking account and worker account. The update in docker is simple: stop the node, pull the latest image and restart the node.

1. Stop the running node in Docker:

   ```shell
   docker kill <container ID>
   ```

   Delete the container:

   ```shell
   docker rm <container ID>
   ```
2. Pull the latest NuLink image.

   ```shell
   docker pull nulink/nulink:latest
   ```
3. Re-launch the worker node.

   ```shell
   docker run --restart on-failure -d \
   --name ursula \
   -p 9151:9151 \
   -v /root/nulink:/code \
   -v /root/nulink:/home/circleci/.local/share/nulink \
   -e NULINK_KEYSTORE_PASSWORD \
   -e NULINK_OPERATOR_ETH_PASSWORD \
   nulink/nulink nulink ursula run --no-block-until-ready
   ```

{% hint style="info" %}
For **NULINK\_KEYSTORE\_PASSWORD** and **NULINK\_OPERATOR\_ETH\_PASSWORD** you can change with your own password or if you already save your password using environment variables you just keep it.
{% endhint %}

Source : [Official Guide](https://docs.nulink.org/products/stakers/nulink_worker/worker_update)


# Troubleshooting

If you have some problem with your node and still offline on staking dashboard, you can do this way to make your node online.

### Open Port

{% hint style="danger" %}
Remember to use this command one by one to avoid some of this command not applied.
{% endhint %}

```
sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw allow ssh
sudo ufw allow 22
sudo ufw allow 9151/tcp
sudo ufw enable
```

Now you can check if your port is open or not with this [link](https://www.yougetsignal.com/tools/open-ports/).

Put **Remote Address** with your **VPS IP** and **Port Number** 9151 to make sure if your node port is open.

### Send tBNB to Worker Account

Most likely you didn't read all the guide i provided and you didn't send the tBNB to your worker. If you confuse which one is worker account, you can find it when you generate [geth account](https://docs.strnan.top/testnet/nulink/installation#generate-ethereum-account-and-keystore) and then send some tBNB like 0.05 or 0.1 or it's up to you.


# Useful Command

#### Check Logs

```bash
docker logs -f ursula
```

#### Restart Node

```bash
docker restart <container ID>
```

You can find container ID by using this command.

```bash
docker ps -a
```

<figure><img src="https://3513762394-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHnfaXqsjt2Q8hoDykMmk%2Fuploads%2FxP3H70YpmdBvxhjPBgTK%2Fimage.png?alt=media&amp;token=b253c406-3156-4fa9-970f-f78a9ec92e91" alt=""><figcaption></figcaption></figure>

We will add more command soon!


# Polymer


# Challenge 3

## Prepare

Pertama kita membutuhkan new wallet dari **metamask** dan siapkan **export private key**.

Lalu siapkan **Blockscout dan Alchemy API** untuk run challenge 4 ini dan kalian bisa klik link dibawah ini.

#### OP Sepolia API

{% embed url="<https://optimism-sepolia.blockscout.com/account/api-key>" %}

#### Base Sepolia API

{% embed url="<https://base-sepolia.blockscout.com/account/api-key>" %}

#### Alchemy Tutorial&#x20;

{% embed url="<https://docs.alchemy.com/docs/alchemy-quickstart-guide>" %}

Ikutin tutor alchemy yang step 1 dan tinggal ganti jaringannya ke Base Sepolia Testnet dan OP Sepolia Testnet.

### Installation

Lanjut setup VPS dan gunakan **Ubuntu 20.04** untuk run scriptnya.

<pre class="language-bash"><code class="lang-bash">sudo apt-get update
sudo apt-get upgrade -y
<strong>sudo apt install npm -y
</strong>sudo apt install git
</code></pre>

#### Install NodeJS

{% hint style="info" %}
Jika kalian mengalami error, tinggal run command dibawah satu persatu.
{% endhint %}

```bash
sudo apt install curl wget gnupg
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | sudo gpg --dearmor -o /usr/share/keyrings/nodesource.gpg
echo "deb [signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/nodesource.list
sudo apt update
sudo apt install nodejs
node --version
npm --version
```

#### Install Foundry

```bash
curl -L https://foundry.paradigm.xyz | bash
```

Lalu refresh resource

```bash
source /root/.bashrc
```

Kemudian jalankan foundry

```
foundryup 
```

#### Install Just

{% hint style="info" %}
Untuk menghindari error, run command ini satu persatu.
{% endhint %}

```bash
wget -qO - 'https://proget.makedeb.org/debian-feeds/prebuilt-mpr.pub' | gpg --dearmor | sudo tee /usr/share/keyrings/prebuilt-mpr-archive-keyring.gpg 1> /dev/null
echo "deb [arch=all,$(dpkg --print-architecture) signed-by=/usr/share/keyrings/prebuilt-mpr-archive-keyring.gpg] https://proget.makedeb.org prebuilt-mpr $(lsb_release -cs)" | sudo tee /etc/apt/sources.list.d/prebuilt-mpr.list
sudo apt update
sudo apt install just
```

#### Clone Repository (Thanks to Dexanode)

```bash
git clone https://github.com/Dexanode/ibc-app-solidity.git
```

Buka folder

```bash
cd ibc-app-solidity
```

Ubah nama file

```bash
cp .env.example .env
```

Edit isi dari .env

```bash
nano .env
```

Lalu isi bagian **PRIVATE\_KEY\_1** dengan **private key yang kalian dapatkan dari metamask** dan isi didalam ' '. Kemudian dibagian API\_KEY kalian isi sesuai yang kalian dapatkan pada step awal awal dan skip bagian **TENDERLY\_TOKEN**

<figure><img src="https://3513762394-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHnfaXqsjt2Q8hoDykMmk%2Fuploads%2Fk9ZxwtheDG5zZXoo6tSH%2FScreen%20Shot%202024-03-27%20at%2000.47.32%20AM.png?alt=media&amp;token=7d1a0db7-dcfd-44f3-a86d-fa4b659cac4e" alt=""><figcaption></figcaption></figure>

Kemudian save filenya dengan tekan CTRL + X dan CTRL + Y, kemudian enter.

Lalu install templatenya dengan just

```bash
just install
```

### Run Script

Jalankan scriptnya dengan command dibawah ini.\\

```bash
just do-it
```

<figure><img src="https://3513762394-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHnfaXqsjt2Q8hoDykMmk%2Fuploads%2FCLQDEJkJcCg9WmN89v0r%2FScreen%20Shot%202024-03-27%20at%2000.52.51%20AM.png?alt=media&amp;token=b95aff3f-de7c-4966-9d2a-8a81fcb3e417" alt=""><figcaption></figcaption></figure>

Jika sudah muncul **"You've done it!"** maka sudah selesai challenge 3


