Validator / Lightning Node Setup

Script Network / Script Node

Script Network is based on nodes and made only by the aggregation of more and more nodes, we call them lightning nodes because they are responsible for block finalization and blockchain settlement.

The accountability is trusted because the network is resilient against attacks or games executed by evil nodes without single-points-of-failure.

Blockchain implies nascent technology that leverages untrusted nodes that are publicly executing a distributed consensus algorithm in order to amazingly form a trustable, resilient and censorship resistant settlement system.

Benefits of running nodes:

  • Nodes are your tool for participating in consensus rounds, and obtain rewards based on staked amounts.

  • With a Node you can accept delegation requests, for which users that are not running nodes can participate in consensus with a profit-share model.

  • Control/automate anything related to your relation among other nodes in the Script Network and TV users

  • Use/customize your own wallet backend/frontend, e.g. automating interations with other’s wallets.

  • Use/customize your own blockchain explorer backend/frontend.

For improved privacy run your node in trusted hardware, e.g. the preferred choice for privacy-exigent users is to run the node in dedicated hardware. A VM in a datacenter or computer at home is a good-enough option for many.

Node Hardware/OS requirements

  • 16 Gb HD

  • 2 cores

  • 8 GB Ram

  • Debian/Debian-based GNU/Linux Operating System.

[Advanced]: Build from sources

For developers, code enthusiasts and those who might not trust our pre-compiled distribution consider visiting our github repository.

Downloads

Provides access to different method for running a Linux node.

Support for node installations has been discontinued for platforms Windows and Mac.

  • Build and run your node in console mode. Ideal for developers.

Follow instructions at our github page: https://github.com/scriptnetwork/script-4

  • Install a precompiled OS/image on a fresh Operating System. Fully featured with Web GUI Wallet/Explorer interface. Ideal for professional or stable node runners.

Follow on-screen instructions until you reach the 1-liner installer. Copy that line.

screenshot__downloads_1liner

Major sequence of steps to follow for stable installations:

  • 1.- get debian-12 VM at datacentre. (e.g linode.com, digitalocean.com)

  • 2.- ssh as root. (Priviledged access to the VM command shell).

  • 3.- paste the 1-liner installer you copied from downloads page. Press Enter. (watch: this process is showcased in manic_beret’s asciinema video

  • 4.- Provide your DNS domain (e.g. my_scriptnode.com) and public IP address.

  • 5.- wait 1 minute… Voila! your node is up and running!.

  • 5.5 - Play around with commands… it’s your node! everything is transparent.

  • 6.- Stake your node.

You have successfully completed your node setup.

All following items check out:

  • ssh as root to your node. This action is perfomed ideally by muscle memory, but much better providing seamless experience is to set up passwordless authentication

      linux/Mac: `ssh root@<your node>`
              Windows: `putty` [download](https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html)
screenshot__user_node_root_login
  • switch to user ‘stv’ and go to home directory /home/stv (su stv, cd)

  • run the program scriptcli

screenshot__user_node_stv_scriptcli

The program stv described below provides a function for starting a software upgrade automatically.

Node bash shell

About GNU/Linux

Main SYSOP interface: Text Command-line console, also known as shell.

Linux prompts. Line Prefixes is given by the computer to indicate us context: user and path

        root:~$

SYSOP role operates under user root, and can control all aspects of the operating system. This prompt indicates that our path in the filesystem is /root (root home directory)

    root:/home/stv

This prompt indicate we are SYSOP, although our current path in the filesystem is /home/stv (stv user’s home directory again)

        stv:~$ 

Finally, this prompt indicates our hat is Script-Network user and that our current directory is home (/home/stv)

SYSOP Role/hat: user root

Available commands for SYSOPs:

        * script_tv__uninstall.sh           # uninstalls the node software from your VM
                * script_tv__test.sh                # subsystem health checks 
                * script_tv__ctl stop               # stops all services for node maintenance
                * script_tv__ctl start              # resume all services after node maintenance
                * cat /var/script_tv/data_sheet     # Prints Operational Data sheet detailing daemons, URLs and ports used among other technical data.

SCRIPT P2P Network User/Community Role/hat: user stv

Changing to user stv from root

        root$> su stv                  # change to user stv
                stv:/root$ cd                  # go to our new home dir at /home/stv
                stv:~$ pwd                     # optional: verify our directory is /home/stv

Returning back to root user (SYSOP mode)

        stv:~$ exit
                root$> 

If you exited change again to user stv. The following command are defined in the file .bashrc as aliases and active only during sessions as user stv:

        scriptcli                 
                script                    # access to public ledger 

These two commands are the lowest-level console interface to operate the script L1 private and public daemons respectively.

L1. core applications

* `script`:  #  can be regarded as the launcher of the script Ledger node. Interact with the public ledger (blockchain).
        * `scriptcli` # access to wallet functions via command line.

scriptcli - Core Wallet Client

the scriptcli command must be executed as user stv.

use this command to check the status:

        stv:~$ scriptcli query status
                {
                    "address": "0x8d1F3236d790415d631d554091dE7A25913FB561",
                    "chain_id": "testnet",
                    "current_epoch": "1007",
                    "current_hash": "0xd2390cb67e49939a1f7ee71fb1e754f2f9c05dd0f66c2c71d75721fee4159806",
                    "current_height": "1005",
                    "current_time": "1721812083",
                    "genesis_block_hash": "0x42a81f3f7ef0a5297997c8428ae945d5176f07082224b006f1979a5ebbe2744c",
                    "latest_finalized_block_epoch": "1005",
                    "latest_finalized_block_hash": "0x7ead0d6e526f6489f5ccf58a33a25257e57667fbad6e5ac9beee66e8b28efdef",
                    "latest_finalized_block_height": "1005",
                    "latest_finalized_block_time": "1721812070",
                    "peer_id": "0x8d1F3236d790415d631d554091dE7A25913FB561",
                    "snapshot_block_hash": "0x42a81f3f7ef0a5297997c8428ae945d5176f07082224b006f1979a5ebbe2744c",
                    "snapshot_block_height": "0",
                    "syncing": false,
                    "tip_hash": "0xc0ca980d8000241f396de5b80403f3a4f57bf27b5e21d713b0a349f55184b5cb"
                }

From the returned information we learn:

* Our node address is `0x8d1F3236d790415d631d554091dE7A25913FB561`
        * we are on `testnet` network
        * our peer_id is our node address, for node-node communications.
        * The genesis block hash `0x42a81f3f7ef0a5297997c8428ae945d5176f07082224b006f1979a5ebbe2744c` must match on all nodes of this network.
        * Other information about the chain: block height, last block (`current_hash`).
        * Syncing indicates the type of activity that is going on. true/false indicates whether an sync activity is ongoing or not. 

The core wallet manages the node_address. It can be verified:

        stv:~$ scriptcli key list
                0x8d1F3236d790415d631d554091dE7A25913FB561

We can use the scriptcli command line tool to send Script tokens from one address to another by executing the following command.

        stv:~$ scriptcli tx send --chain="testnet" --from=98fd878cd2267577ea6ac47bcb5ff4dd97d2f9e5 --to=8d1F3236d790415d631d554091dE7A25913FB561 --script=0 --spay=20 --seq=1

The balance of an address can be retrieved with the following query command, after the transaction has been included in the blockchain, it should take only a few seconds.

        stv:~$ scriptcli query account --address=8d1F3236d790415d631d554091dE7A25913FB561

Now let’s send 20 more Script tokens. We need to increment the seq parameter. The sequence seq is a monotonic counter associated with each account determining the transaction execution order.

        stv:~$ scriptcli tx send --chain="testnet" --from=98fd878cd2267577ea6ac47bcb5ff4dd97d2f9e5 --to=8d1F3236d790415d631d554091dE7A25913FB561 --script=0 –spay=20 --seq=2

We can query the recipient address again to verify the account balance changes calling scriptcli query account.

Account/Key Management

The scriptcli is a wallet that can manage keys for multiple accounts.

Create a new account/address and store the key in ~/script4/wallet/keys:

        stv:~$ scriptcli key new 

List all the keys in the wallet:

        stv:~$ scriptcli key list 

Delete the account/address.

        stv:~$ scriptcli key delete

Invocation of script and scriptcli programs are meant to be done always as user stv from its home directory (stv:~$ or stv:/home/stv$).

Your keys are stored in directory /home/stv/script4/wallet/keys/plain

        stv:~$ find script4/wallet/keys/plain -exec cat {} \;
                {"address":"8d1f3236d790415d631d554091de7a25913fb561","privatekey":"d8604ad2430cd7292c1374838c4ffee8edb5a6723f4ca3cb8d1e8e8bab28c905","id":"0fc641f5-18c3-47ea-ba7d-83126ea0e32

As protection against loss, it is encouraged to backup the keys directory.

testnet Faucet:

Obtain funds from script.tv

It’s natural we want to fund our node address.

If we run a testnet node we would use a faucet or token fountain, usually found in testnet nodes.

Every script node has a faucet service that would kindly transfer you funds on request. No questions. The objective of testnet is to give users the opportunity to test the system with ‘play money’

However if we run a mainnet node we would use an exchange and buy tokens instead.

Before asking the faucet let’s use an address we control.

If you wanted to fund this-node address, your node, such address can be obtained in the following way:

        stv:~$ scriptcli query status
                {
                    "address": "0x8d1F3236d790415d631d554091dE7A25913FB561",                       <=== address
                    "chain_id": "testnet",
                    "current_epoch": "1019",
                    "current_hash": "0x44d71c52e6ddc4a905dc1901e7cc1a5b9bceed11ab4ea4cd023bb3b82b8d9147",
                    "current_height": "1017",
                    "current_time": "1721812158",
                    "genesis_block_hash": "0x42a81f3f7ef0a5297997c8428ae945d5176f07082224b006f1979a5ebbe2744c",
                    "latest_finalized_block_epoch": "1017",
                    "latest_finalized_block_hash": "0x270bdf99bea4a90554ef13138721d33a4302f9c55925e0a14f8ca2ef8bda3359",
                    "latest_finalized_block_height": "1017",
                    "latest_finalized_block_time": "1721812142",
                    "peer_id": "0x8d1F3236d790415d631d554091dE7A25913FB561",
                    "snapshot_block_hash": "0x42a81f3f7ef0a5297997c8428ae945d5176f07082224b006f1979a5ebbe2744c",
                    "snapshot_block_height": "0",
                    "syncing": false,
                    "tip_hash": "0xc7134d79a766cef0bcd32f267c0662fa6cafb7e4a22c73620ad5baeff1238ff3"
                }

Our address can be found on the response, 0x8d1F3236d790415d631d554091dE7A25913FB561.

Let’s then invoke stvtool to obtain funds for this aforementioned address, we do it with the command query_faucet, passing the recipient address as argument:

        stv:~$ bin/stvtool query_faucet 0x8d1F3236d790415d631d554091dE7A25913FB561

The command can be repeated as many times as wished up to a balance limit of 1M. We can easy earn tokens this way.

By feeding with tokens your node address your faucet is automatically enabled using it as source of funds and making the faucet service available to other participants in the script network.

After a few seconds from ordering the transfer we can check our balance:

        stv:~$ scriptcli query account --address=0x8d1F3236d790415d631d554091dE7A25913FB561
                {
                    "code": "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",
                    "coins": {
                        "scptwei": "12000000000000000000000",
                        "spaywei": "1200000000000000000000"
                    },
                    "last_updated_block_height": "1180",
                    "reserved_funds": [],
                    "root": "0x0000000000000000000000000000000000000000000000000000000000000000",
                    "sequence": "0"
                }

Which effectively shows the expected amounts given to us by the remote faucet.

Removing 18 trailing zeroes we obtain our balance of tokens (provided you called the faucet 12 times)

    SCPT token: 12000;  SPAY token:1200

The command will use by default the Script Network reference Node at https://backend-wallet-testnet.script.tv

Other nodes offer the same service on URsL:

    * Human: https://wallet-testnet.<your-domain>
            * API: https://backend-wallet-testnet.<your-domain>

Last updated