How to run a full node on Frietor Saar?
Full node deployment guide for the Frietor Saar testnet blockchain! This guide is based on ubuntu 20.04 LTS. You can use any other operating system, but the commands may be different.
Requirements
- OS - See Supported Operating Systems
- vCPUs >= 4
- RAM - at least 16GB
- Disk space (Important)
- At least 1TB for the data directory ( recommended SSD ), solid-state drive(SSD), gp3, 8k IOPS, 250MB/S throughput, read latency less than 1ms. (for the best performance, it will need NVMe SSD) Data disk mount to /datas
- Suggested m5zn.3xlarge instance type on AWS, c2-standard-16 on Google cloud.
- A broadband Internet connection with upload/download speeds of 5 megabyte per second.
- curl or wget
- git
- tar
- gzip
- Latest Frietor Binary For Your Operating System - See Supported Operating Systems
Snapshots
- You can get snapshots from - https://github.com/Esportzvio/FrietorSaar_Snapshots (opens in a new tab) (updated every 24 hours)
Download and Installation
- Download the latest Frietor binary for your operating system from the Supported Operating Systems page.
- Extract the downloaded archive.
Create Data Directory
- Create a directory for the Frietor blockchain data.
make_data.sh
mkdir -p data
Recover data from snapshot
recover_data.sh
git clone https://github.com/Esportzvio/FrietorSaar_Snapshots.git
cd FrietorSaar_Snapshots
gunzip -c Snapshot-${Date in YYYY-MM-DD}.dat.gz | ./frietor server --restore - --data-dir ../data
Download The Saar Testnet Genesis File
- Download the Saar testnet genesis file to the same directory as the frietor binary.
download_genesis.sh
wget https://raw.githubusercontent.com/Esportzvio/FrietorChain/main/genesis-saar.json -O genesis.json
- Alternatively, you can copy the genesis file from here
Generate Secrets
- Polygon Edge uses a vault manager to store secrets such as validator keys, wallet keys, and passwords. You can use any vault manager from (AWS SSM , Google Secret Manager, Hashicorp Vault) to store secrets. The following examples will use AWS SSM.
Secrets Configuration
- Create a folder named secrets_config in the same directory as the frietor binary.
create_secrets_config.sh
mkdir -p secrets_config
- Create a file named aws.json in the secrets_config folder.
create_aws_json.sh
touch secrets_config/aws.json
- Open the secrets_config/aws.json file using nano or your preferred text editor.
open_aws_json.sh
nano secrets_config/aws.json
- Add The Following Content To secrets_config/aws.json.
edit_aws_json.sh
{
"Type": "aws-ssm",
"Name": "node",
"Extra": {
"region": "ap-south-1",
"ssm-parameter-path": "/frietor-saar"
}
}
-
Replace the name, region and ssm-parameter-path values with the name, region and path of your AWS SSM parameter store. (Optional)
-
Save the file and exit the text editor.
Secret Generation
- Run the following command to generate secrets.
generate_secrets.sh
./frietor polybftsecrets generate --secrets-config secrets_config
-
The command will generate a file named secrets.json in the same directory as the frietor binary.
-
Check The secrets.json File To Make Sure It Contains The Following Keys.
check_secrets_json.sh
cat secrets.json
The Output Should Be Similar To The Following.
secrets.json
{
"address": "",
"bls_private_key": "",
"bls_pubkey": "",
"generated": "",
"insecure": "false",
"node_id": "",
"private_key": ""
}
Start The Node
- Run the following command to start the node.
start_node.sh
./frietor server --data-dir data -secrets-config secrets_config/aws.json --chain genesis.json --relayer --seal
-
The node will start syncing with the network. It will take a few minutes to sync with the network.
-
By Default The Node Will Start Services On The Following Ports.
Service | Port |
---|---|
JSON RPC | 8545 |
LibP2P | 30301 |
Metrics (Prometheus) | 10002 |
GRPC | 9632 |
Check The Node Status
- Run the following command to check the node status.
check_node_status.sh
./frietor status
Setting custom parameters
Flag | Description | Example |
---|---|---|
--access-control-allow-origins | The CORS header indicating whether any JSON-RPC response can be shared with the specified origin. | --access-control-allow-origins "*" |
--block-gas-target | The target block gas limit for the chain. | --block-gas-target "0x0" |
--chain | The genesis file used for starting the chain. | --chain "./genesis.json" |
--config | The path to the CLI config. | --config "/path/to/config.json" |
--data-dir | The data directory used for storing Frietor client data. | --data-dir "/path/to/data-dir" |
--dns | The host DNS address which can be used by a remote peer for connection. | --dns "example.com" |
--grpc-address | The GRPC interface. | --grpc-address "127.0.0.1:9632" |
--json-rpc-batch-request-limit | Max length to be considered when handling JSON-RPC batch requests. | --json-rpc-batch-request-limit 20 |
--json-rpc-block-range-limit | Max block range to be considered when executing JSON-RPC requests that consider fromBlock/toBlock values. | --json-rpc-block-range-limit 1000 |
--jsonrpc | The JSON-RPC interface. | --jsonrpc "0.0.0.0:8545" |
--libp2p | The address and port for the libp2p service. | --libp2p "127.0.0.1:1478" |
--log-level | The log level for console output. | --log-level "INFO" |
--log-to | Write all logs to the file at specified location instead of writing them to console. | --log-to "/path/to/log-file.log" |
--max-enqueued | Maximum number of enqueued transactions per account. | --max-enqueued 128 |
--max-inbound-peers | The client's max number of inbound peers allowed. | --max-inbound-peers 32 |
--max-outbound-peers | The client's max number of outbound peers allowed. | --max-outbound-peers 8 |
--max-peers | The client's max number of peers allowed. | --max-peers 40 |
--max-slots | Maximum slots in the pool. | --max-slots 4096 |
--nat | The external IP address without port, as can be seen by peers. | --nat "203.0.113.1" |
--no-discover | Prevent the client from discovering other peers. | --no-discover |
--num-block-confirmations | Minimal number of child blocks required for the parent block to be considered final. | --num-block-confirmations 64 |
--price-limit | The minimum gas price limit to enforce for acceptance into the pool. | --price-limit 0 |
--prometheus | The address and port for the Prometheus instrumentation service. If only port is defined, it will bind to all available network interfaces. | --prometheus 0.0.0.0:9090 |
--relayer | Start the state sync relayer service. PolyBFT only. | |
--restore | The path to the archive blockchain data to restore on initialization. | --restore /path/to/archive |
--seal | The flag indicating that the client should seal blocks. | |
--secrets-config | The path to the SecretsManager config file. Used for AWS SSM. If omitted, the local FS secrets manager is used. | --secrets-config /path/to/secrets/config |