Skip to content

Commit 5a79324

Browse files
authored
Merge pull request #233 from crypto-org-chain/232-problem-add-doc-for-best-practises-for-node-hosts
Config best practises for node hosts
2 parents 5775926 + 9621460 commit 5a79324

3 files changed

Lines changed: 53 additions & 10 deletions

File tree

docs/.vuepress/config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ module.exports = {
3636
text: "Local network deployment",
3737
link: "/getting-started/local-devnet"
3838
},
39+
{
40+
text: "Cronos node setup best practises",
41+
link: "/getting-started/cronos-node-best-practises"
42+
},
3943
{
4044
text: "Deploy Smart Contract at Cronos",
4145
link: "/getting-started/cronos-smart-contract"
@@ -152,6 +156,7 @@ module.exports = {
152156
"cronos-testnet",
153157
"cronos-gbtestnet",
154158
"local-devnet",
159+
"cronos-node-best-practises",
155160
"security-checklist.md",
156161
"defi-practice",
157162
"cronos-smart-contract"
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Best Practices for node hosts in Cronos
2+
3+
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.
4+
5+
## config.toml
6+
7+
### Log_level
8+
- `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.
9+
- set to `debug` only for debugging purpose, turn off after you are finished with debugging.
10+
11+
### db_backend
12+
- `goleveldb` (default) db: for low / medium level traffic use case. The reason being there can be some lock contention, especially with P2P.
13+
- `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.
14+
15+
### max_num_inbound_peers and max_num_outbound_peers
16+
- `max_num_inbound_peers` For node providers the number of inbound peers can be set to a higher value for example 50.
17+
- `max_num_outbound_peers` For users on a private network set a higher number of outbound peers to 30 for example.
18+
- After peers are connected, set it back to its default value. Note that some trial values might be needed to get it right.
19+
20+
21+
## app.toml
22+
23+
### pruning
24+
- `default` Normal usage can just set to default. In the Cosmos SDK this is defined as:
25+
```go
26+
PruneDefault = NewPruningOptions(362880, 100, 10)
27+
```
28+
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.
29+
- `everything` if you only need to do transaction broadcasting and only need the last blocks.
30+
- `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.
31+
32+

package-lock.json

Lines changed: 16 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)