Postchain troubleshooting
While Postchain is designed to be robust and reliable, issues can still arise from time to time. This topic covers some common troubleshooting steps you can take to identify and resolve problems with your Postchain node.
General troubleshooting steps
Local node
- Check Postchain logs: The logs are a valuable source of information for diagnosing issues. Look for any error messages or indications of what might be going wrong.
- Restart Postchain: A simple restart can often clear temporary glitches. Restart your node using
chr node start
. - Check hardware resources: Ensure your system has sufficient CPU, RAM, storage space, and network bandwidth to handle the workload of the blockchains your node is running. Resource limitations can lead to syncing or processing issues.
- Check Postchain configuration: Review your
node.properties
configuration file to ensure all the settings are correct, such as ports, databases, etc.
Provider node
- Check Postchain logs: The logs are a valuable source of information for diagnosing issues. Look for any error messages or indications of what might be going wrong.
- Check hardware resources: Ensure your system has sufficient CPU, RAM, storage space, and network bandwidth to handle the workload of the blockchains your node is running. Resource limitations can lead to syncing or processing issues.
- Check Postchain configuration: Review your
node-config-<dapp | system>.properties
configuration file to ensure all the settings are correct, such as ports, databases, etc.
Rescuing a stalled Chain0
If your chain0 is stuck at a specific height (e.g., stuck at height 1000), follow these steps to revive it:
-
Create a New Configuration: Manually create a new configuration file (e.g.,
config.0.properties
) for chain0 at height 1000:./chromia-node/postchain-cli.sh add-configuration -nc ./config/config.0.properties -cid 0 -h 1000 -bc ./directory1/manager.xml
-
Restart all nodes: Once the new configuration is added on each node, restart all the nodes in your cluster.
Optimizing transaction speed
Even with well-optimized code and fast transaction execution, delays can occur. This is because Postchain waits for a configurable period to gather more transactions into a block before finalizing it. While this strategy aims for efficiency by maximizing transactions per block, it can lead to unnecessary delays for infrequent transactions.
To address this, you can adjust the maxtxdelay
parameter under the blockstrategy
section in your configuration file.
Lowering this value reduces the waiting time for blocks with few transactions.
Enabling logging
Prometheus
To enable Prometheus, add metrics.prometheus.port=<port>
to the node-config.properties
file. For more information,
see Set up Prometheus monitoring.
Generic logs
Docker supports different log drivers that can be used when collecting logs from a running container. For more information about available log drivers, see the official logging drivers documentation.
To start a node with a specific log driver, add log-driver
and, optionally, log-opt
to the docker run command when
starting the node.
For example:
docker run -d --name postchain \
...
--log-driver=fluentd
--log-opt fluentd-address=fluentdhost:24224
--log-opt fluentd-async=true
...
Subnodes
Since subnodes are started automatically, the log driver and log options need to be added to the node configuration file as follows:
container.docker-log-driver=fluentd
container.docker-log-opts=fluentd-address=fluentdhost:24224;fluentd-async=true
EBFT logging
To enable EBFT messaging logging, add the following lines to your log4j2.yml
file:
- name: net.postchain.network.peer.DefaultPeerCommunicationManager
level: trace
additivity: false
AppenderRef:
- ref: ConsoleAppender