# Installation

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&#x26;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&#x26;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&#x26;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&#x26;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&#x26;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&#x26;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&#x26;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&#x26;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&#x26;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&#x26;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&#x26;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&#x26;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&#x26;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&#x26;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&#x26;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&#x26;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&#x26;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&#x26;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)
