Skip to main content

ShareLedger FAQ

Answers to frequently asked questions about the ShareLedger Network.

Why does ShareLedger crashes because of too many open files?

The default number of files Linux can open (per-process) is 1024. ShareLedger is known to open more than 1024 files. This causes the process to crash. To change the number of files that can be opened per-process complete the following steps:

  1. Stop the ShareLedger process:
systemctl stop shareledger
  1. Edit the /etc/security/limits.conf file and add the following lines to the end of the file:
*     soft   nofile  10000
* hard nofile 100000
  1. Update the Service file:

With a text editor open and edit the shareledger.service file, which is located at /etc/systemd/system/shareledger.service.

Under [Service] add the following to a new line LimitNOFILE=20000:

# For reference on systemd unit files, please see: https://www.freedesktop.org/software/systemd/man/systemd.unit.html -- it is the best source of information on this topic.  
[Unit]
Description=shareledger
StartLimitIntervalSec=600
StartLimitBurst=5
[Service]
ExecStart=/usr/bin/shareledger start --home /shareledger --state-sync.snapshot-interval 10000 --state-sync.snapshot-keep-recent 2 --p2p.persistent_peers 30351e72ce595c23079b5df8a92764a67fc50084@10.0.196.13:26656,24da27bb5ce294f108403e18c2699615ed121dcb@10.0.196.5:26656,96a0cd9b0f2bb582c03f84bad0700acbd30feeef@10.0.196.9:26656,b234b56e9ad3dad6bd6e30c59e45c9c916960f34@10.0.192.15:26656,ce6a6b53409ec9b523c4895278c5a0047033a5ad@10.0.196.3:26656,0821c6dcd3759a26aab1350053612c53df3b7405@10.0.192.6:26656,bc28a3cea04ef99fa874c58ddc0072d52eb86ef9@10.0.192.16:26656,ae87db11132e52bdc5e055bdd4380091fd6edc3c@10.0.196.2:26656
User=shrnode
Restart=always
RestartSec=5
PrivateTmp=true
# ADD THIS LINE
LimitNOFILE=20000
ProtectSystem=full
NoNewPrivileges=true
[Install]
WantedBy=multi-user.target
## security
  1. Start the ShareLedger process:
systemctl start shareledger

How do I restart the ShareLedger process?

Run the following command:

systemctl restart shareledger

How I can check the process is running?

Run the following command:

sudo systemctl status shareledger #sudo is optional if you already logged in as root user 

If the output is Active: active, your ShareLedger process is running:

shareledger.service - shareledger
Loaded: loaded (/etc/systemd/system/shareledger.service; disabled; vendor preset: enabled)
Active: active (running) since Wed 2023-02-22 12:44:17 CST; 2 months 2 days ago
Main PID: 3681698 (shareledger)
Tasks: 13 (limit: 8819)
Memory: 5.1G
CGroup: /system.slice/shareledger.service

How do I use state sync to join the network?

# 1. Run the new_validator_v1.2.0 script (only run this if the machine doesn't have the shareledger systemd daemon)

# download the new_validator_v1.2.0.sh script
curl -LJ https://github.com/ShareRing/Shareledger/releases/download/v1.2.0/new_validator_v1.2.0.sh > new_validator_v1.2.0.sh

# give exec permission
chmod +x new_validator_v1.2.0.sh

# run the script with sudo privilege
sudo ./new_validator_v1.2.0.sh

# stop shareledger process
systemctl stop shareledger

# 2. (OPTIONAL: only do this if you want to create a validator that already exist in the network)

#Copy <moniker>_key_seed.json to /shareledger
#Copy node_key.json from old node to /shareledger/config
#Copy priv_validator_key.json from old node to /shareledger/config

# 3. run state sync script

wget -O - https://github.com/ShareRing/Shareledger/releases/download/v1.4.1/statesync.sh | sudo bash

# 4. Let it run until you see it committing blocks (it'll take 5-10 min)

systemctl stop shareledger_statesync
systemctl start shareledger

What can I do to reduce to disk space?

You can use state sync to clean all the data in the node and start a fresh node.

How can I claim consensus rewards?

To withdraw your distribution rewards, you can use x/ditribution. To give the validator operator address start with the prefix shareledgervaloper.......

To claim your reward with your key seed:

shareledger tx distribution withdraw-rewards <validator operator address> --key-seed <your key seed json file>

To claim your reward with your key-ring:

shareledger tx distribution withdraw-rewards <validator operator address> --from <key-name> --keyring-backend <os|test|file> --keyring-dir <your keyring-dir> 

If you want to withdraw your commission, you can add the flag --commission:

shareledger tx distribution withdraw-rewards <validator operator address> --commission --key-seed <your key seed json file>

Why is my node unavailable?

Most ShareLedger validators run ShareLedger process as background services. Some times the ShareLedger process might be unavailable. You can use the following command to view the last 24 lines of the error log and determine why your node was unavailable:

journalctl -u shareledger -n 24 --no-pager

If you're unable to determine why your node was unavailable, please forward the details from the error log to ShareRing support.

What should I do if my node is jailed?

The jail is a mechanism cosmosSDK uses to punish nodes that miss too many blocks in the consensus algorithm. If your node is jailed, you can the use unjail command to un-jail your node.

Before you run unjail:

  1. Check your jail time is expired:

    The jail time must expire before you can run unjail on your node. Use the following command to check:

VAL_PUB_KEY=$(shareledger q staking validator <Jailed operator address> --output json | jq -r '.consensus_pubkey')
shareledger q slashing signing-info $VAL_PUB_KEY --output json | jq '.'

The result will show you jailed_until. You can run unjail on your node after this time:

{
"address": "shareledgervalcons1yh39aanelyufuczl8gty5v2a3y5537f5u3r8pl",
"start_height": "6241622",
"index_offset": "2",
"jailed_until": "2023-02-16T07:30:16.122043644Z", #you need to wait until this time before running unjail
"tombstoned": false,
"missed_blocks_counter": "2"
}
  1. Your node balance must be greater than the transaction fee:
//TODO
shareledger query bank balances <node address>
  1. Check your node is active and catching up.

    There are many reasons why your node could be jailed. One of the common reasons is your ShareLedger process is inactive. If you un-jail your node and your node is still inactive, eventually you will miss another block and be jailed again.

shareledger status 2>&1 | jq '.SyncInfo.catching_up' 
false

You will see the result false if your node is already catching up.

To Un-jail your node, run the slashing transaction:

shareledger tx slashing unjail --key-seed <path to your node key seed> -b block 

How can I tell if my node is pruning?

To see if your node is pruning the node data, run the following command:

systemctl status shareledger

If you see any --pruning nothing in the result, your node doesn't prune the data store.

Where is my seed?

You will often need your key seed. If you need to locate your key seed file, you can use the following commands.

  1. Find your key seed inside the ShareLedger directory, commonly you will see your key seed file in the ShareLedger directory:
cd /shareledger
ls -l /shareledger/*seed.json
  1. To search your computer for your seed file, you can run:
  find ~ -type f -name "*_seed.json"