Testnet
Razor network is a proof of stake network. In order to participate in the network as a validator, you will need to "Stake" your RAZORs. RAZORs are the native tokens in the network and they are compatible with the ERC20 tokens standard.
Get tokens
You will need some Skale Testnet Tokens to pay for transaction fees. You can get testnet ETH tokens from here: https://faucet.skale.network/
- Skale Endpoint: https://staging-v3.skalenodes.com/v1/staging-aware-chief-gianfar
- Account: address which should receive the testnet tokens.
In order to get started, you will also need some RAZORs on Skale Testnet chain. Drop a message in our Discord server for tokens.
Add Skale Testnet network to metamask
Use an ethereum compatible browser (e.g. Chrome browser with Metamask plugin)
In metamask, click on top right account icon > Settings > Add Network.
Fill in the following details:
Particulars Value Network Name staging-aware-chief-gianfar New RPC URL https://staging-v3.skalenodes.com/v1/staging-aware-chief-gianfar Chain ID 1517929550 Currency Symbol ETH Block Explorer URL https://staging-aware-chief-gianfar.explorer.staging-v3.skalenodes.com/ Note: You can also add network from https://staging.razorscan.io/ by clicking on "Connect wallet" and switching network to Skale.
Now you are all set! Let's download the client and start staking!
Using Docker
It is recommended to run a Oracle Node using Docker. This is because you dont need a complete development enviroment to run a node. Since code is updated and deployed frequently from our github repository, we keep the Oracle Node docker image updated.
Hardware Requirements
16GB RAM
4 Core (arm64 or amd64 architecture)
Software dependencies
Docker: You can find more information about installing docker here.
Oracle-Node(github): You can check the Razor-go:dev at develop branch.
You can download the docker image of Razor-go:dev - ab83868
from [here]https://hub.docker.com/layers/razornetwork/razor-go/ab83868/images/sha256-c3d9efc9cbb56fb30544d4eba7c264c7fdb176f3cb8b012e4873883c18394601?context=explore.
Run the Razor Network Docker Node
One of the quickest ways to get razor-go
up and running on your machine is by using Docker:
- Create docker network
docker network create razor_network
- Start razor-go container
docker run -d -it --entrypoint /bin/sh --network=razor_network --name razor-go -v "$(echo $HOME)"/.razor:/root/.razor razornetwork/razor-go:ab83868
This spins up a razor-go docker image. You can find all the images on the Razor Network dockerhub.
Set Config
There are a set of parameters that are configurable. These include:
- Provider: The RPC URL of the provider you are using to connect to the blockchain.
- Alternate Provider: This is the secondary RPC URL of the provider used to connect to the blockchain if the primary one is not working.
- Gas Multiplier: The value with which the gas price will be multiplied while sending every transaction.
- Buffer Size: Buffer size determines, out of all blocks in a state, in how many blocks the voting or any other operation can be performed.
- Wait Time: This is the number of seconds the system will wait while voting.
- Gas Price: The value of gas price if you want to set manually. If you don't provide any value or simply keep it to 1, the razor client will automatically calculate the optimum gas price and send it.
- Log Level: Normally debug logs are not logged into the log file. But if you want you can set
logLevel
todebug
and fetch the debug logs. - Gas Limit: The value with which the gas limit will be multiplied while sending every transaction.
- Gas Limit Override: This value would be used as a gas limit for all the transactions instead of estimating for each transaction.
- RPC Timeout: Number of seconds after which any contract and client calls will time out if it's not responding.
- HTTP Timeout: This is the threshold number of seconds after which an HTTP request for a job will time out.
- Maximum size of log file: This is the maximum size of log file in MB
- Maximum number of backups of log file: This is the maximum number of old log files to retain.
- Maximum age of log file: This is the maximum number of days to retain old log files.
docker exec -it razor-go razor setConfig --provider https://staging-v3.skalenodes.com/v1/staging-aware-chief-gianfar --gasmultiplier 1 --buffer 20 --wait 30 --gasprice 0 --logLevel debug --gasLimit 2 --rpcTimeout 10 --httpTimeout 10 --logFileMaxSize 200 --logFileMaxBackups 52 --logFileMaxAge 365
Note: This will create
razor.yaml
with all necessary parameter at$HOME/.razor
directory. We can view that via command:cat $HOME/.razor/razor.yaml
.
Commands
Run the commands in following way:
docker exec -it razor-go razor <command>
Note: It is recomended to use
--logFile <filename>
flag with every razor command this will generate logfile in.razor
directory which will be helpfull in debuging any issue.
Create an account using the following command:
docker exec -it razor-go razor create
Import an account using the following command:
docker exec -it razor-go razor import
Fund this account with sFUEL and RAZOR tokens to start participating in the network.
You can use the full commands (stake) or the short form (s) as shown below.
Start staking using the addStake
command
docker exec -it razor-go razor addStake --address <account> --value <value> --logFile <filename>
where address
is the address that contains RAZOR tokens and value
is the amount of RAZOR that you want to stake.
An example of this command would be:
docker exec -it razor-go razor addStake --address 0x5a0b54d5dc17e0aadc383d2db43b0a0d3e029c4c --value 10000 --logFile logs
Note: --weiRazor flag can be passed to provide values in wei
If you have a 1000.25 razors in your account, you can stake those using the stake command with weiRazor flag.
Example:
$ razor addStake --address 0x5a0b54d5dc17e0aadc383d2db43b0a0d3e029c4c --value 1000250000000000000000 --weiRazor true
If you have a 5678.1001 razors in your account, you can stake those using the stake command with weiRazor flag.
Example:
$ ./razor addStake --address 0x5a0b54d5dc17e0aadc383d2db43b0a0d3e029c4c --value 5678100100000000000000 --weiRazor true
To start accepting delegation, use the delegation command in a new terminal:
docker exec -it razor-go razor setDelegation --address <address> --status <bool> --commission <commission> --logFile <filename>
where address
is the address that contains RAZOR tokens, status
is true or false to turn on or off delegation, and commission
is the percentage of commission that you can set.
An example of this command would be:
docker exec -it razor-go razor setDelegation --address 0x5a0b54d5dc17e0aadc383d2db43b0a0d3e029c4c --status true --commission 20 --logFile logs
It will enable delegation, and participants can delegate RAZOR tokens to your staker's account.
Start voting using the vote
command
docker exec -it razor-go razor vote --address <account> --logFile <filename>
Note: To run vote command in background you can use
tmux
for that.
- Run:
tmux new -s razor-go
- Run vote command
- To exit from tmux session: press
ctrl+b
, release those keys and pressd
- To list your session:
tmux ls
- To attach Session back:
tmux attach-session -t razor-go
An example of this command would be:
docker exec -it razor-go razor vote --address 0x5a0b54d5dc17e0aadc383d2db43b0a0d3e029c4c --logFile logs
If you have delegation enabled and have some commission set, then you can claim that earned commission anytime via the following command:
docker exec -it razor-go razor claimCommission --address <address> --logFile <filename>
An example of this command would be:
docker exec -it razor-go razor claimCommission --address 0x5a0b54d5dc17e0aadc383d2db43b0a0d3e029c4c --logFile logs
View Logs
tail -f $HOME/.razor/logs/[filename].log
An example of this command would be:
tail -f $HOME/.razor/logs/logs.log
That's it! You should have a staker up and running. Your node will start automatically fetching and answering queries. You must keep your computer online to be able to validate without any interruptions. You can monitor the logs, and use Staging Razorscan to monitor your staker.
For more details around all the commands of razor-go
, please check out the oracle-node
Readme.
Installation From Source
If you would rather install from source, please follow Instructions here to run a Razor Network node from source.