# Setting up the Edge Node

### Windows

{% embed url="<https://youtu.be/A82wzF6v3kU>" %}

1. You need to install GitBash” and “go” for windows. If you do already have it, start GitBash as an administrator and proceed to step 3. To download GitBash navigate to [gti.scm.com/download/win](https://gti.scm.com/download/win) to download the latest version.

2. Head over to [go.dev/doc/install](https://go.dev/doc/install) and download the latest version of go. Once finished, start GitBash as an administrator.

3. We need to add a software package manager chocolatey-&#x20;

&#x20;(a)  Please enter the following commands.&#x20;

&#x20;       $ git config --global user.name "Linus Torvalds"&#x20;

&#x20;       $ git config --global user.email "<Linus@tux.com>"

&#x20;       Replace the username as well as email-id with your own.

(b) Press start and type in PowerShell, right-click, and select run as an administrator.&#x20;

With PowerShell, you must first ensure that Get-ExecutionPolicy is not Restricted. We suggest using Bypass to bypass the policy to get things installed or AllSigned for quite a bit more security.&#x20;

Run Get-ExecutionPolicy. If it returns Restricted, then run Set-ExecutionPolicy AllSigned or Set-ExecutionPolicy Bypass -Scope Process.

(c) Now run the following command:&#x20;

Set-ExecutionPolicy Bypass -Scope Process -Force \[System.Net.ServicePointManager]::SecurityProtocol = \[System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('<https://community.chocolatey.org/install.ps1>'))

(d) Once finished proceeding with the commands below.&#x20;

&#x20;     $ choco install make&#x20;

&#x20;     $ choco install mingw

If you get prompted to run the Script type in A + enter (needs to be a capital letter).&#x20;

4. &#x20;Close both PowerShell as well as GitBash and then reopen GitBash again by right-clicking the icon and selecting run as an administrator, then execute the below command.

&#x20;       git clone <https://github.com/scriptnetwork/Node-Network-guide.git>                             &#x20;

&#x20;       $GOPATH/src/github.com/scripttoken/script &#x20;

5. Navigate to the very same folder in which you cloned the files. The normal path should be “$GOPATH/src/github.com/scripttoken/script”. Run the following command.&#x20;

&#x20;      cp -r ./integration/scriptnet ../scriptnet

6. If you are encountering any issues with this next command, please close and reopen GitBash again as an administrator.&#x20;

&#x20;      make install (It will generate two binaries i.e., script.exe and scriptcli.exe)

7. Switch to "bin" directory i.e $GOPATH/bin/ where your binary has been generated using the above command. Navigate to the bin folder by typing “cd $GOPATH/bin”.
8. This step requires you to start 3 separate GitBash sessions. Do so by pressing ALT + F2 or by pressing the logo in the top left corner and selecting a new window. In each window execute the respective commands to start node and cli in the background session. If windows defender pops up it is OK to allow traffic from Script.

&#x20;      First window

&#x20;      script.exe start --config=../src/github.com/scripttoken/scriptnet/node --password={ENTER\_PWD}

&#x20;      Delete the brackets and ENTER\_PWD, select a strong password and press enter to start the node.

&#x20;      Second window&#x20;

&#x20;      scriptcli.exe daemon start --port=16889

&#x20;      Third window&#x20;

&#x20;      scriptcli.exe query Lightning

&#x20;      The output in the last window shows the node address and summary address that you are going to use in the following steps.

9. Now, navigate to [wallet.script.tv/](https://wallet.script.tv) and create a new wallet if you don’t already have one already. To be able to stake you would need to have at least 10001 SCPT in your wallet.

&#x20;      (a) Enter the wallet application by using the Keystore file that is stored on your computer locally and the password you have set.&#x20;

&#x20;      (b) Once signed in press stake on the left-hand side and then click on the deposit stake option. Select lightning stake.&#x20;

&#x20;      (c) Now enter the node address which you have got from the previous command in step 8 and enter 10000 SCPT.&#x20;

&#x20;      (d) Enter the wallet password to confirm the transaction.

Now open another tab in your browser, navigate to [token.script.tv/download](https://token.script.tv/download), and select Windows to download the Edge Node application. Follow the setup guide instructions and open the application once installed. Click activate wallet on the left-hand side and enter the required node address as well as summary details that you have got from step 4, check the T\&C box and proceed, toggle the button to on in order to activate the Edge node. The transcoding jobs will start and you will be earning rewards.

### Linux

{% embed url="<https://youtu.be/KMgmHAasrE0>" %}

1. Start by heading over to the terminal and running the respective commands.

&#x20;      sudo apt-get update&#x20;

&#x20;      sudo apt-get upgrade -y&#x20;

&#x20;      sudo apt-get install build-essential -y&#x20;

&#x20;      sudo apt-get install git

&#x20;      sudo apt install tmux

2. Install Go

&#x20;      wget <https://go.dev/dl/go1.19.2.linux-amd64.tar.gz&#x20>;

&#x20;      sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go1.19.2.linux-amd64.tar.gz

&#x20;3\.  Adding the PATH variable

&#x20;     Add /usr/local/go/bin to the PATH environment variable. You can do so by adding the following line to your $HOME/.profile or /etc/profile (for a system-wide installation):

&#x20;     sudo vim .profile

&#x20;     export PATH=$PATH:/usr/local/go/bin

Please note: Changes made to a profile file may not apply until the next time you sign in your computer. To apply the changes immediately, run the shell commands directly or execute them from the profile using a command such as source $HOME/.profile.

Verify that you've installed Go by typing in the following command in terminal: go version

4. Build and Install

Next, clone this repo into your $GOPATH. The path should look like this:

&#x20;      $GOPATH/src/github.com/scripttoken/script

&#x20;      sudo git clone <https://github.com/scriptnetwork/Node-Network-guide.git> &#x20;

&#x20;      $GOPATH/src/github.com/scripttoken/script&#x20;

&#x20;      export SCRIPT\_HOME=$GOPATH/src/github.com/scripttoken/script&#x20;

&#x20;      cd $SCRIPT\_HOME

Now, execute the following commands to build the Script binaries under $GOPATH/bin. Two binaries script and scriptcli are generated.

&#x20;      sudo cp -r ./integration/scriptnet ../scriptnet&#x20;

&#x20;      sudo chmod -R 777 /usr/local/go&#x20;

&#x20;      git config --global --add safe.directory /usr/local/go/src/github.com/scripttoken/script&#x20;

&#x20;      make install

5. This step requires you to start 3 separate terminal sessions or run all three commands from the same terminal by creating a session using a background service called tmux.

First terminal or tmux session

&#x20;       tmux new -s node&#x20;

&#x20;       /usr/local/go/bin/script start --config=../scriptnet/node

Second terminal or tmux session

&#x20;       tmux new -s cli&#x20;

&#x20;       /usr/local/go/bin/scriptcli daemon start --port=16889

Third terminal or tmux session

&#x20;       tmux new -s detail&#x20;

&#x20;      /usr/local/go/bin/scriptcli query Lightning

Please note - The output in the last session, shows the node address and summary address which you are going to use in the following steps. To exit any of the tmux session press ctrl+b and d. To enter any created tmux session press "tmux a -t SESSION\_NAME"

6. Now open your browser, navigate to [wallet.script.tv/](https://wallet.script.tv), and create a new wallet if you haven't done so already. To be able to stake you would need to have at least 10001 SCPT in your wallet. Please open a ticket in our discord to receive tokens.

(a) Enter the wallet application by using the Keystore file that is stored on your computer locally and the password you have set.&#x20;

(b) Once signed in press stake on the left-hand side and then select the deposit stake option. Click on lightning stake.&#x20;

(c) Now enter the node address which you have got from the previous command in step 4 and enter 10000 SCPT.&#x20;

(d) Enter the wallet password to confirm the transaction.

Now open another tab in your browser, navigate to [token.script.tv/download](https://token.script.tv/download), and select linux to download the Edge Node application. Follow the setup guide instructions and open the application once installed. Click activate wallet on the left-hand side and enter the required node address as well as summary details that you have got from step 4, check the T\&C box and proceed, toggle the button to on in order to activate the Edge node. The transcoding jobs will start and you will be earning rewards.

### MacOS

{% embed url="<https://youtu.be/29_xNI9xKgw>" %}

1. Go to [go.dev/doc/install](https://go.dev/doc/install) and download the latest version of go.

Open the package file you downloaded and follow the prompts to install Go. The package installs the Go distribution to /usr/local/go. The package should put the /usr/local/go/bin directory in your PATH environment variable. You may need to restart any open Terminal sessions for the change to take effect.

Verify that you've installed Go by opening a command prompt and typing the following command: go version

2. Install brew package by typing in the following command:

&#x20;/bin/bash -c "$(curl -fsSL <https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh>)"

Note - To continue and finish the installation execute the two echo commands which will be printed on the terminal while executing the above command.

Continue by typing respective commands

brew install make&#x20;

brew install mingw-w64

3. Build and Install

Next, clone this repo into your $GOPATH. The path should look like this: $GOPATH/src/github.com/scripttoken/script

git clone <https://github.com/scriptnetwork/Node-Network-guide.git> $GOPATH/src/github.com/scripttoken/script&#x20;

export SCRIPT\_HOME=$GOPATH/src/github.com/scripttoken/script&#x20;

cd $SCRIPT\_HOME

Now, execute the following commands to build the Script binaries under $GOPATH/bin. Two binaries script and scriptcli are generated.

cp -r ./integration/scriptnet ../scriptnet&#x20;

chmod -R 777 /usr/local/go&#x20;

git config --global --add safe.directory /usr/local/go/src/github.com/scripttoken/script&#x20;

make install

4. Now for this step, you are going to have to start 3 terminal sessions. In each terminal execute respective commands to start node and cli in the background session.

First Terminal&#x20;

/usr/local/go/bin/script start --config=../scriptnet/node

Second Terminal&#x20;

/usr/local/go/bin/scriptcli daemon start --port=16889

Third Terminal&#x20;

/usr/local/go/bin/scriptcli query Lightning

\*Note - The output in the last terminal or session shows the node address and summary address in which you are going to use in the following steps.

5. Now open your browser, navigate to [wallet.script.tv/](https://wallet.script.tv), and create a new wallet if you haven't done so already. To be able to stake you would need to have at least 10001 SCPT in your wallet.

(a) Enter the wallet application by using the Keystore file that is stored on your computer locally and the password you have set.&#x20;

(b) Once signed in press stake on the left-hand side and then select the deposit stake option. Click on lightning stake.&#x20;

(c) Now enter the node address which you have got from the previous command in step 5 and enter 10000 SCPT.&#x20;

(d) Enter the wallet password to confirm the transaction.

Now open another tab in your browser, navigate to [token.script.tv/download](https://token.script.tv/download), and select Mac to download the Edge Node application. Follow the setup guide instructions and open the application once installed. Click activate wallet on the left-hand side and enter the required node address as well as summary details that you have got from step 4, check the T\&C box and proceed, toggle the button to on in order to activate the Edge node. The transcoding jobs will start and you will be earning rewards.&#x20;


---

# Agent Instructions: Querying This Documentation

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

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

```
GET https://documentation.script.tv/nodes/edge-node-overview/setting-up-the-edge-node.md?ask=<question>
```

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

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