Mainnet

Validators install and use instances of the Main Settlement Bus (MSB). Learn how to install & operate the MSB for Trac Network Mainnet on Windows, MacOS and Linux.

First we need to install Node.js. If you are not tech-savvy, don't worry, it's straight-forward. If you already have Node installed, you can skip its installation and move straight to the Pear installation.

Important: Do NOT apply the below inside trac-msb folders if you previously created a validator for Hypermall. Follow the docs below on what folder names to use as suggestion so there won't be no collision.

Windows

Open a PowerShell (right click > run as admin) and enter:

# allow script execution
# if you are an admin, you may use more restricted settings based on your dev op rules
Set-ExecutionPolicy Unrestricted

# Download and install fnm:
winget install Schniz.fnm

# set some environment options
fnm env --use-on-cd | Out-String | Invoke-Expression

# Download and install Node.js:
fnm install 22

# Verify the Node.js version:
node -v # Should print a version like "v22.14.0".

# Verify npm version:
npm -v # Should print a version like "10.9.2".

MacOS/Linux

Open a terminal/console and enter:

# Download and install nvm:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.2/install.sh | bash

# in lieu of restarting the shell
\. "$HOME/.nvm/nvm.sh"

# Download and install Node.js:
nvm install 22

# Verify the Node.js version:
node -v # Should print a version like "v22.15.0".

nvm current # Should print a version like "v22.15.0".

# Verify npm version:
npm -v # Should print a version like "10.9.2".

Once you confirmed the commands "node -v" and "npm -v" return no error but print a version number, we can proceed. Should curl for some reason not exist, then install it first. If it is missing on MacOS, you can try "/usr/bin/curl" instead of just "curl".

Installing Pear Runtime

Next is installing the Pear Runtime. The MSB runs on top of it and allows for efficient MSB execution. In principle running the MSB using plain Node works, but it is recommended to use Pear.

Simply execute the following in your shell / console / terminal:

npm i -g pear
pear -v

If pear asks you to set the paths after installation, please execute the "export" command that is provided.

"pear -v" should print the current version that you installed and you're ready to continue installing the MSB. It is important that you use the exact version of the MSB as this is the final release that everyone running an MSB must be operating on:

Windows

In your file explorer, create an empty directory called "my-validator". Then use the PowerShell to enter it:

cd my-validator

Linux / MacOS

Create an empty directory using the console / terminal and enter it:

# create
mkdir my-validator

# enter the new folder
cd my-validator

Install/Update the MSB Validator

You may now choose between decentralized MSB distribution or manual install.

Updates works like this:

  • Re-install the latest version (latest are always the versions below)

  • Start with the exact store name(s) that you used upon install and first run (e.g. store1, store2, etc)

  • Type "/add_writer" and hit enter in the validator screen to make sure the network handles your update quicker

  • Skip the onboarding and post-install process below entirely

  • Note: If it asks you for a new seedphrase, you might have not choosen the correct store name upon restart

Decentralized

To run the MSB, execute the following command:

pear run pear://6rpmo1bsedagn4u56a85nkzkrxcibab53d7sgds7ukn6kfyzgiwy store1

You will be asked to enter the word "TRUST" once. Please do so and once done, follow the instructions and simply repeat the above command. You can skip the below and continue from the "Post Install" section.

Manual

Now install the MSB exactly like this (the version number is important):

npm install [email protected]

If the installation finished without errors, we can start the MSB itself.

Starting the MSB

Copy the MSB, as Pear doesn't like to be run in node_modules:

Windows:

Use your file explorer and copy all contents from the folder "my-validator/node_modules/trac-msb/" into "my-validator" (override existing files).

Linux/MacOS

cp -fr node_modules/trac-msb/* .

Then proceed (Windows/Linux/MacOS):

# pull the dependencies
npm install

# run the msb using pear
npm run prod --store=store1

Note: In rare cases, there is a chance nothing appears to happen. In this case, please kill all "pear-runtime" processes using the process manager of your operating system. Then start again. A bug report has been sent to the pear team.

Post Install

"pear run" starts the MSB in the current directory "." and "store1" is the name of the database (located in stores/store1). The database also contains a backup of your identity.

Note: To run multiple instances, simply use a different store name than "store1". You will need to run multiple instances if you own more than one license, because each validator has its associated identity.

After the MSB started the first time without identity, you should see the following information:

Please type "1" and hit enter and show you the seed phrase. Please copy and backup the seed phrase in a safe location:

If you forgot to back it up, you can still make a backup of your identity like so:

Windows

Use your file explorer and copy the file "my-validator/stores/store1/db/keypair.json" to a backup folder of your choice.

Linux / MacOS

cp stores/store1/db/keypair.json /some/backup/location/

The keypair.json file contains the seed phrase that you can use to restore your identity in a new installation.

The MSB has been fully started if you something like this (isWriter: false and balance 0 on new setups):

To stop your MSB, enter "/exit" (use the CTRL + C keys on your keyboard only as last resort).

To restart use the exact same start parameters you used earlier from within your MSB installation folder.

Getting Whitelisted

We are assuming that your MSB instance (your MSB Address) isn't whitelisted yet. In order to validate your license, keep your Bitcoin wallet at hand and navigate to the public onboarding site.

Important: If you previously performed your whitelist for Hypermall already, you will need to do this step once more but this time for the actual MSB Address as of your validator setup above. MSB addresses start with "trac1...". Hypermall on R1 use raw public keys instead of streamlined Trac Network addresses.

Follow the instructions to swap your licenses on Bitcoin to your Trac Network identities (the MSB Addresses).

You will need a minimal amount of $TNK to complete the whitelist (< 1 $TNK). If you do not own any $TNK, then please ask the team in the Trac Network Discord to fund the initial amount for your MSB Address.

Once received, you will be added to the whitelist after some processing time (up to 24 hours). Once added, please restart your MSB, type the command "/add_writer" and hit enter. After a few seconds you should see a confirmation about your MSB being added.

From that moment on, every transaction that your MSB validates will add to your fee balance for your MSB Address. You can use the built-in wallet features to get balances and perform transfers.

As mentioned above, for multiple licenses, please repeat the process of starting the MSB with different stores as each validator is supposed to have its own identity.

Important: Never run the same store twice as you would try to join the network 2 or more times with the same identity and cause "chatter" (permanent logins and logouts). To avoid reconnecting issues, make sure to run each store only once.

Running the MSB in Background

There are several ways to run the MSB in the background. For portability and cross-operating-system support, we recommend to use the Node package "pm2". See here on how to install (using the "npm" method is fine).

Once installed, start the MSB like this:

pm2 start pear --name "My MSB #1" -- run . store1

Important: If you use PM2, please start your instances using the "--no-autorestart" flag, otherwise you may run into issues.

Check the pm2 documentation for further details as it is an extremely powerful tool to manage multiple instances of programs that are supposed to run in the background.

Congratulations!

You just learned how to install and use an MSB and become a validator!

You can use /get_balance <MSB Address> and /transfer to check your earnings and transfer funds from within your validator interface now!

Never, ever, remove all your TNK funds from your validator wallet, leave at least 0.33 TNK in it. The minimum amount is a network safety measure.

Last updated