Skip to content

Commit

Permalink
Merge pull request crypto-org-chain#233 from crypto-org-chain/232-pro…
Browse files Browse the repository at this point in the history
…blem-add-doc-for-best-practises-for-node-hosts

Config best practises for node hosts
  • Loading branch information
lezzokafka authored Jul 12, 2022
2 parents 5775926 + 9621460 commit 5a79324
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 10 deletions.
5 changes: 5 additions & 0 deletions docs/.vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ module.exports = {
text: "Local network deployment",
link: "/getting-started/local-devnet"
},
{
text: "Cronos node setup best practises",
link: "/getting-started/cronos-node-best-practises"
},
{
text: "Deploy Smart Contract at Cronos",
link: "/getting-started/cronos-smart-contract"
Expand Down Expand Up @@ -152,6 +156,7 @@ module.exports = {
"cronos-testnet",
"cronos-gbtestnet",
"local-devnet",
"cronos-node-best-practises",
"security-checklist.md",
"defi-practice",
"cronos-smart-contract"
Expand Down
32 changes: 32 additions & 0 deletions docs/getting-started/cronos-node-best-practises.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Best Practices for node hosts in Cronos

In order to make it more convenient for Dapps and node hosts to setup a node, we put together a list of useful settings and configurations. Feel free to refer to this guide, and adapt settings to suit your use-case.

## config.toml

### Log_level
- `info` Depending on the needs of your application it is ok to stick to `info` (default), but do consider setting up log-rotation for your logs, and archive logs after a certain amount of time or size, e.g. use a cron job with weekly rotation or until your file size hits ~5GB.
- set to `debug` only for debugging purpose, turn off after you are finished with debugging.

### db_backend
- `goleveldb` (default) db: for low / medium level traffic use case. The reason being there can be some lock contention, especially with P2P.
- `rocksdb` suited for a lot of use-cases, especially for high query load ~ few M / day. Has a better balance between rpc queries and p2p at high traffic. Note that`Rocksdb` however might have a slower startup time and requires a higher memory allocation.

### max_num_inbound_peers and max_num_outbound_peers
- `max_num_inbound_peers` For node providers the number of inbound peers can be set to a higher value for example 50.
- `max_num_outbound_peers` For users on a private network set a higher number of outbound peers to 30 for example.
- After peers are connected, set it back to its default value. Note that some trial values might be needed to get it right.


## app.toml

### pruning
- `default` Normal usage can just set to default. In the Cosmos SDK this is defined as:
```go
PruneDefault = NewPruningOptions(362880, 100, 10)
```
meaning the app will keep the latest 362880 versions (around 21 days by 5 secs block time), and then only keep 1 version for every 100 blocks past the keepRecent period( the rest will be put into the pruning list), and then execute the pruning every 10 blocks.
- `everything` if you only need to do transaction broadcasting and only need the last blocks.
- `nothing` for DApps that want to be able to query information at a certain known blockheight. Note that this is only needed for `archive` nodes.


26 changes: 16 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5a79324

Please sign in to comment.