-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade running node doc due to Hawaii hard fork (#39)
- Loading branch information
1 parent
34658ed
commit adb8262
Showing
7 changed files
with
374 additions
and
153 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
--- | ||
id: run-archive-node | ||
title: Run Archive Node | ||
--- | ||
|
||
## What is an archive node? | ||
|
||
Simply speaking, an archive node is a full node running with an additional special option, `--gcmode archive`. It stores all the historical data of the blockchain starting from the genesis block. As compared to a typical full node that just holds all the state change data for some latest blocks, an archive node always stores them for each block. | ||
|
||
## Why is an archive node important? | ||
|
||
Developers are limited to querying the limited recent blocks to check the balance of an address and the state of a smart contract with a full node. It is hard to get all what they want as the blockchain is moving forward at the same time, while they can query any block at a specific point in time with an archive node. Archive nodes are used by various applications on the blockchain for challenging use cases, including but not limited to the followings: | ||
|
||
- Automatic trading system needs historical data to optimize trading model | ||
- Verification modules need state data to verify transactions in time | ||
- Analytical tools need full historical data to do data analysis | ||
- Exchange in some wallets depends on archive node for fast and efficient transfers | ||
|
||
## Suggested Requirements | ||
|
||
Running an archive node will take a high cost as it includes all the block and state change data. | ||
|
||
First of all it needs the disk with sufficient capacity; besides this, the CPU and disk performance should be good enough to catch up with the latest block height. | ||
|
||
## How to run an archive node for Dogechain mainnet? | ||
|
||
#### 1. Run one segment archive node with a snapshot | ||
|
||
A segment archive node is a node which has all the data from one starting block height to one ending block height, such as [19000000, latest]. To create such one archive node, you need a snapshot with starting block number, less than 19000000. | ||
|
||
You can get snapshot from BNB Chain official documentation: | ||
|
||
- [Dogechain Chain Snapshot Repo](https://github.com/dogechain-lab/dogechain-snapshots). | ||
|
||
- Command to run: | ||
|
||
```bash | ||
/usr/local/bin/geth \ | ||
--config=${local_config_dir}/config.toml \ | ||
--datadir=${local_data_dir} \ | ||
--rpc.allow-unprotected-txs \ | ||
--rpccorsdomain=* \ | ||
--rangelimit \ | ||
--syncmode=full \ | ||
--gcmode=archive \ | ||
--txlookuplimit=0 \ | ||
--txpool.pricelimit=250000000000 \ | ||
--miner.gasprice=250000000000 \ | ||
--miner.gaslimit=300000000 | ||
``` | ||
|
||
#### 2. Build one full archive node with segmented archive nodes | ||
|
||
Instead of putting all archive data on a single Geth instance, it is suggested to create multiple segment instances, each of them only serving part of the chain. To get better performance, it is suggested that each segment's size is better to control under 4TB. There will be around 2.7TB data in all(up to October, 2023). | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
id: tutorials | ||
title: Tutorials | ||
--- | ||
|
||
In this section, we have provided tutorials on usage of different components of Dogechain. | ||
|
||
### Full Node | ||
|
||
* Tutorial on [How to Run a Full Node on Dogechain](./full-node-deployment) | ||
* Tutorial on [How to Upgrade Geth (Full Node) on Dogechain](./upgrade-full-node) | ||
|
||
### Archive Node | ||
|
||
* Tutorial on [How to Run an Archive Node on Dogechain](./run-archive-node) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
--- | ||
id: upgrade-full-node | ||
title: How to Upgrade Geth on Dogechain | ||
--- | ||
|
||
You just need to download and install the newer version of `geth`, restart with the new software. Geth will automatically use the data of your old node and sync the latest blocks that were mined since you shut down the old software. | ||
|
||
### Step 1: Compile the New Version or download new pre-build binaries from release | ||
|
||
```bash | ||
git clone https://github.com/bnb-chain/bsc | ||
# Enter the folder bsc was cloned into | ||
cd bsc | ||
# Compile and install bsc | ||
make geth | ||
``` | ||
|
||
|
||
|
||
```bash | ||
# Download pre-build binaries | ||
|
||
# Linux | ||
wget $(curl -s https://api.github.com/repos/bnb-chain/bsc/releases/latest |grep browser_ |grep geth_linux |cut -d\" -f4) | ||
mv geth_linux geth | ||
chmod -v u+x geth | ||
|
||
# MacOS | ||
wget $(curl -s https://api.github.com/repos/bnb-chain/bsc/releases/latest |grep browser_ |grep geth_mac |cut -d\" -f4) | ||
mv geth_mac geth | ||
chmod -v u+x geth | ||
make geth | ||
``` | ||
|
||
|
||
|
||
### Step 2: Stop Geth | ||
|
||
```text | ||
$ pid=`ps -ef | grep geth | grep -v grep | awk '{print $2}'` | ||
$ kill $pid | ||
``` | ||
|
||
|
||
|
||
### Step 3: Restart | ||
|
||
NOTE | ||
|
||
Make sure to use the same start-up command you used before the upgrade. So in this case we use the same command as in our [tutorial](https://docs.bnbchain.org/docs/validator/fullnode) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters