Skip to content

Commit d69d76a

Browse files
authored
Merge pull request #459 from King31T/gh-pages
Feat: update docs of database config and tron rewards
2 parents cf775e5 + ed5e51a commit d69d76a

File tree

8 files changed

+131
-1873
lines changed

8 files changed

+131
-1873
lines changed

architecture/database/index.html

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1543,14 +1543,37 @@ <h1 id="database-configuration">Database configuration<a class="headerlink" href
15431543
<p>The following describes how to set the storage engine of the java-tron node to RocksDB, and how to perform data conversion between leveldb and rocksdb.</p>
15441544
<h2 id="rocksdb">RocksDB<a class="headerlink" href="#rocksdb" title="Permanent link">&para;</a></h2>
15451545
<h3 id="configuration">Configuration<a class="headerlink" href="#configuration" title="Permanent link">&para;</a></h3>
1546-
<p>Use RocksDB as the data storage engine, need to set <code>db.engine</code> to "ROCKSDB".</p>
1547-
<p><img alt="image" src="https://raw.githubusercontent.com/tronprotocol/documentation-en/master/images/db_engine.png" /></p>
1548-
<p>Note: RocksDB only supports <code>db.version=2</code>, yet does not supports <code>db.version=1</code></p>
1546+
<p>Use RocksDB as the data storage engine, need to set <code>db.engine</code> to "ROCKSDB":</p>
1547+
<div class="highlight"><pre><span></span><code>storage {
1548+
# Directory for storing persistent data
1549+
db.engine = &quot;ROCKSDB&quot;,
1550+
db.sync = false,
1551+
db.directory = &quot;database&quot;,
1552+
index.directory = &quot;index&quot;,
1553+
transHistory.switch = &quot;on&quot;,
1554+
</code></pre></div>
15491555
<p>The optimization parameters RocksDB support:</p>
1550-
<p><img alt="image" src="https://raw.githubusercontent.com/tronprotocol/documentation-en/master/images/rocksdb_tuning_parameters.png" /></p>
1556+
<div class="highlight"><pre><span></span><code>dbSettings = {
1557+
levelNumber = 7
1558+
//compactThreads = 32
1559+
blocksize = 64 // n * KB
1560+
maxBytesForLevelBase = 256 // n * MB
1561+
maxBytesForLevelMultiplier = 10
1562+
level0FileNumCompactionTrigger = 4
1563+
targetFileSizeBase = 256 // n * MB
1564+
targetFileSizeMultiplier = 1
1565+
}
1566+
</code></pre></div>
15511567
<h3 id="use-rocksdbs-data-backup-function">Use RocksDB's data backup function<a class="headerlink" href="#use-rocksdbs-data-backup-function" title="Permanent link">&para;</a></h3>
1552-
<p>Choose RocksDB to be the data storage engine, you can use its data backup function while running</p>
1553-
<p><img alt="image" src="https://raw.githubusercontent.com/tronprotocol/documentation-en/master/images/db_backup.png" /></p>
1568+
<p>Choose RocksDB to be the data storage engine, you can use its data backup function while running:</p>
1569+
<div class="highlight"><pre><span></span><code>backup = {
1570+
enable = false // indicate whether enable the backup plugin
1571+
propPath = &quot;prop.properties&quot; // record which bak directory is valid
1572+
bak1path = &quot;bak1/database&quot; // you must set two backup directories to prevent application halt unexpected(e.g. kill -9).
1573+
bak2path = &quot;bak2/database&quot;
1574+
frequency = 10000 // indicate backup db once every 10000 blocks processed.
1575+
}
1576+
</code></pre></div>
15541577
<p>Note: FullNode can use data backup function. In order not to affect SuperNode's block producing performance, SuperNode does not support backup service, but SuperNode's backup service node can use this function.</p>
15551578
<h3 id="convert-leveldb-to-rocksdb">Convert LevelDB to RocksDB<a class="headerlink" href="#convert-leveldb-to-rocksdb" title="Permanent link">&para;</a></h3>
15561579
<p>The data storage structure of LevelDB and RocksDB is not compatible, please make sure the node use the same type of data engine all the time. We provide data conversion script which can convert LevelDB data to RocksDB data.</p>

0 commit comments

Comments
 (0)