Skip to content

Commit

Permalink
Upgrade running node doc due to Hawaii hard fork (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
DarianShawn authored Oct 23, 2023
1 parent 34658ed commit adb8262
Show file tree
Hide file tree
Showing 7 changed files with 374 additions and 153 deletions.
356 changes: 229 additions & 127 deletions docs/get-started/full-node-deployment.md

Large diffs are not rendered by default.

40 changes: 21 additions & 19 deletions docs/get-started/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,39 +9,41 @@ Our recommendation is to use the pre-built releases and verify the provided chec

## Pre-built releases

Please refer to the [GitHub Releases](https://github.com/dogechain-lab/dogechain/releases) page for a list of releases.

Dogechain comes with cross-compiled AMD64/ARM64 binaries for Darwin and Linux.

---
### V2

## Docker image
Please refer to the [GitHub Releases](https://github.com/dogechain-lab/dbsc/releases) page for a list of releases.

Official Docker images are hosted under the [hub.docker.com registry](https://hub.docker.com/r/dogechainlab/dogechain).
### V1

`docker pull dogechainlab/dogechain:latest`
**Deprecated**, will be deleted after Hawaii Fork. Please refer to the [GitHub Releases](https://github.com/dogechain-lab/dogechain/releases) page for a list of releases.

---

## Building from source
## Docker image

Prior to using `go install` make sure that you have Go `>=1.16` installed and properly configured.
### V2

The stable branch is `develop`.
To be done.

```shell
git clone https://github.com/dogechain-lab/dogechain.git
cd dogechain/
go build main.go -o dogechain
sudo mv dogechain /usr/local/bin
```
### V1

**Deprecated**. Official Docker images are hosted under the [hub.docker.com registry](https://hub.docker.com/r/dogechainlab/dogechain).

`docker pull dogechainlab/dogechain:latest`

---

## Using `go install`
## Building from source

Prior to using `go install` make sure that you have Go `>=1.16` installed and properly configured.
Prior to using `go install` make sure that you have Go `>=1.19` installed and properly configured.

`go install github.com/dogechain-lab/dogechain@dev`
The stable branch is `dev`.

The binary will be available in your `GOBIN` environment variable, and will include the latest changes from the mainline `develop` branch.
```shell
git clone https://github.com/dogechain-lab/dbsc.git
cd dbsc/
make geth
sudo cp ./build/bin/geth /usr/local/bin # or any other PATH you want
```
55 changes: 55 additions & 0 deletions docs/get-started/run-archive-node.md
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).

15 changes: 15 additions & 0 deletions docs/get-started/tutorials.md
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)
50 changes: 50 additions & 0 deletions docs/get-started/upgrade-full-node.md
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)
3 changes: 1 addition & 2 deletions docs/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ Dogechain is built on Polygon Edge, which lets the project bootstrap a new block

Industry standard wallets can be used to interact with Dogechain through the [JSON-RPC](/docs/working-with-node/query-json-rpc) endpoints and node operators can perform various actions on the nodes through the [gRPC](/docs/working-with-node/query-operator-info) protocol.

To find out more about dogechain-lab, visit the [official website](https://dogecoin.community).

To find out more about dogechain-lab, visit the [official website](https://dogechain.dog).

**[GitHub repository](https://github.com/dogechain-lab/dogechain)**

Expand Down
8 changes: 3 additions & 5 deletions sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@ module.exports = {
type: 'category',
label: 'Get started',
items: [
'get-started/installation',
'get-started/set-up-ibft-locally',
'get-started/set-up-ibft-on-the-cloud',
'get-started/tutorials',
'get-started/full-node-deployment',
'get-started/cli-commands',
'get-started/json-rpc-commands',
'get-started/run-archive-node',
'get-started/installation',
'get-started/performance-reports',
]
},
Expand Down

0 comments on commit adb8262

Please sign in to comment.