Introduction

Hey Fantomians! In this guide we would like to spend some time on guiding you all through participating in the XAR Network as either a validator node or as a delegator. The XAR mainnet is quickly approaching its official launch, so we want to make sure that all future validators and users are familiar with the documentation and tools to ensure a safe and secure network launch.

This guide will be slated for usage initially as we prepare our complete documentation which will accompany the launch.

Table of Contents

Installing build tools Installing XAR Joining the mainnet Transferring tokens from ERC20 or BEP2 to mainnet Issuing a CSDT and minting ucsdt Creating a validator

1. INSTALLING BUILD TOOLS

To install XAR you will need golang version 13 or higher and make.

Update your environment.

sudo apt-get update

sudo apt-get -y upgrade

Install build-essential to install make

sudo apt-get install -y build-essential

Install golang



sudo tar -xvf go1.13.3.linux-amd64.tar.gz

sudo mv go /usr/local wget https://dl.google.com/go/go1.13.3.linux-amd64.tar.gz sudo tar -xvf go1.13.3.linux-amd64.tar.gzsudo mv go /usr/local

Setup golang environment variables

export GOROOT=/usr/local/go

export GOPATH=$HOME/go

export PATH=$GOPATH/bin:$GOROOT/bin:$PATH

2. INSTALLING XAR



cd $HOME/go/src/github.com/xar-network/

git clone

cd xar-network/

make install mkdir -p $HOME/go/src/github.com/xar-networkcd $HOME/go/src/github.com/xar-network/git clone https://github.com/xar-network/xar-network.git --branch hub_2_invariantscd xar-network/make install

Confirm your xard version

xard version --long name: xar

server_name: xar

client_name: xarcli

version: 2.0.7-126-g8dd84fd

commit: 8dd84fd3b17377cbb41ca56761943528935621b9

build_tags: netgo,ledger

go: go version go1.13.3 linux/amd64

Confirm your xarcli version

xarcli version --long name: xar

server_name: xar

client_name: xarcli

version: 2.0.7-126-g8dd84fd

commit: 8dd84fd3b17377cbb41ca56761943528935621b9

build_tags: netgo,ledger

go: go version go1.13.3 linux/amd64

3. JOINING THE MAINNET

First initialize en empty chain with your moniker

xard init <moniker>

Copy over the genesis.json so that it matches the mainnet configuration

Copy over the config.toml so that it matches the mainnet configuration (or see below to manually edit)

Edit the config.toml to add your moniker

vi $HOME/.xard/config/config.toml # A custom human readable name for this node

moniker = "<moniker-here>"

You can instead simply edit the config.toml, change the following variables

# Time to wait before flushing messages out on the connection

flush_throttle_timeout = "25ms"timeout_propose = "2s"

timeout_propose_delta = "500ms"

timeout_prevote = "1s"

timeout_prevote_delta = "500ms"

timeout_precommit = "1s"

timeout_precommit_delta = "500ms"

timeout_commit = "1s"# Reactor sleep duration parameters

peer_gossip_sleep_duration = "25ms"

Lastly, add the seed nodes;

# Comma separated list of seed nodes to connect to

seeds = "1e0553f274dfc0a804dfa519eaace49dbff51ac1@34.250.125.195:26656,535c42c3f80f1e73b6d25f731caa57f0ca9f55dd@34.255.175.156:26656,06d418e3c110884f85a9f67e1d16aeb523b8195c@63.33.124.239:26656,84d764244913bddbf0067df16289aece2b17b5cc@34.245.237.110:26656,29ef8ef118c74a8bf71150ded103cb5f386e1e49@52.51.127.79:26656"

Start the node and let it sync

xard start

4. TRANSFERRING TOKENS FROM ERC20 OR BEP2 TO MAINNET

First you need a xar wallet, you can create one via the cli tool

xarcli keys add <key-name>Enter keyring passphrase: Re-enter keyring passphrase:- name: key-name

type: local

address: xar1zppm70tq2xx9xz95tdn9umqcvl7dta6x4nvjs2

pubkey:

mnemonic: ""

threshold: 0

pubkeys: []**Important** write this mnemonic phrase in a safe place. It is the only way to recover your account if you ever forget your password.

Next go to the bridge https://bnbridge.exchange

Choose your incoming transaction (ERC20 if you are transferring from Ethereum to native FTM, or BEP2 if you are transferring from Binance to native FTM)

ERC20 to FTM selected

Select FTM as the token and specify your xar receive address, created above with the xarcli tool. Select Next

Transfer your FTM on Ethereum and select Next, your Xar account will be credited with your native uFTM. 1 FTM = 1,000,000 uFTM.

Confirm your received uFTM on https://explorer.xar.network/

5. ISSUING A CSDT AND MINTING UCSDT

Now that you have an account with FTM, you can deposit the FTM as collateral (maximum 150%, recommended 300%) and mint ucsdt. We can do this via the xarcli tool

xarcli tx csdt modifycsdt <key-name> uftm 10000000000000 0 --chain-id=xar-chain-dora-2

If you are running the cli API you can confirm the deposited amount via the REST call.

xarcli rest-server --trust-node http://localhost:1317/csdts?collateralDenom=uftm&owner=xar1zppm70tq2xx9xz95tdn9umqcvl7dta6x4nvjs2&underCollateralizedAt=0

Which will give you the following output based on the above command

{"height":"0","result":[

{

"owner": "xar1zppm70tq2xx9xz95tdn9umqcvl7dta6x4nvjs2",

"collateral_denom": "uftm",

"collateral_amount": "10000000000000",

"debt": "0"

}

]}

You can confirm the current prices for uftm <> ucsdt from the price oracle

With output

{"height":"0","result":{

"asset_code": "uftm",

"price": "0.011592000000000000",

"expiry": "20000"

}}

So with 10,000,000 FTM (10,000,000,000,000 uFTM) and 300% collateralization we can mint up to 38,640,000,000 ucsdt. So let’s mint 30,000,000,000 ucsdt (30,000 CSDT)

xarcli tx csdt modifycsdt <key-name> uftm 0 30000000000 --chain-id=xar-chain-dora-2

After this we can confirm our balance has increased by 30,000,000,000 ucsdt

6. CREATING A VALIDATOR

First we need to get our validator ID

xard tendermint show-validator

Next we can issue our create-validator command using ucsdt as collateral

xarcli tx staking create-validator --amount=30000000000ucsdt --pubkey=<key from xard tendermint show-validator> --moniker=<moniker> --chain-id=xar-chain-dora-2 --commission-rate="0.10" --commission-max-rate="0.20" --commission-max-change-rate="0.01" --min-self-delegation="1" --gas="auto" --from=<key-name>

You can view if your validator was added via the validators list