Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update snapshot and localnet.sh #70

Merged
merged 3 commits into from
Aug 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions docs/get-started/mainnet.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,10 @@ Sync mainnet block data
Depending on the snapshot height, lock the `plugchaind` binary version to use


| Block height | Database | plugchaind version | Download address |
| ---- | --------- | -------- | ----|
| 4879326 | goleveldb (default) | [v1.5](https://github.com/oracleNetworkProtocol/plugchain/releases/tag/v1.5.0) | [mainnet-4879326-20220712-goleveldb.zip](https://snapshot-node-mainnet.oss-cn-hangzhou.aliyuncs.com/mainnet-4879326-20220712-goleveldb.zip.zip) |
| Block height | Database | plugchaind version | Download address | Desc |
| ---- | --------- | -------- | ----| ----- |
| 5205489 | goleveldb (default) | [v1.5](https://github.com/oracleNetworkProtocol/plugchain/releases/tag/v1.5.0) | [mainnet-5205489-20220802-goleveldb.zip](https://snapshot-node-mainnet.oss-cn-hangzhou.aliyuncs.com/mainnet-5205489-20220802-goleveldb.zip) | (68.864GB)crop data |
| 5098752 | goleveldb (default) | [v1.5](https://github.com/oracleNetworkProtocol/plugchain/releases/tag/v1.5.0) | [mainnet-5098752-archive-20220726-goleveldb.zip](https://snapshot-node-mainnet.oss-cn-hangzhou.aliyuncs.com/mainnet-5098752-archive-20220726-goleveldb.zip) | (153.079GB)Archive data - for use by archive nodes only|

1. Download snapshot data

Expand Down
7 changes: 4 additions & 3 deletions docs/zh/get-started/mainnet.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,10 @@ curl -o ~/.plugchain/config/config.toml https://raw.githubusercontent.com/oracle
根据快照高度,锁定`plugchaind`二进制版本使用


| 块高 | 数据库 | plugchaind 版本 | 下载地址 |
| ---- | --------- | -------- | ----|
| 4879326 | goleveldb (default) | [v1.5](https://github.com/oracleNetworkProtocol/plugchain/releases/tag/v1.5.0) | [mainnet-4879326-20220712-goleveldb.zip](https://snapshot-node-mainnet.oss-cn-hangzhou.aliyuncs.com/mainnet-4879326-20220712-goleveldb.zip.zip) |
| 块高 | 数据库 | plugchaind 版本 | 下载地址 | 描述 |
| ---- | --------- | -------- | ----| ----|
| 5205489 | goleveldb (default) | [v1.5](https://github.com/oracleNetworkProtocol/plugchain/releases/tag/v1.5.0) | [mainnet-5205489-20220802-goleveldb.zip](https://snapshot-node-mainnet.oss-cn-hangzhou.aliyuncs.com/mainnet-5205489-20220802-goleveldb.zip) | (68.864GB) 裁剪数据|
| 5098752 | goleveldb (default) | [v1.5](https://github.com/oracleNetworkProtocol/plugchain/releases/tag/v1.5.0) | [mainnet-5098752-archive-20220726-goleveldb.zip](https://snapshot-node-mainnet.oss-cn-hangzhou.aliyuncs.com/mainnet-5098752-archive-20220726-goleveldb.zip) | (153.079GB)存档数据-仅供存档节点使用|

1. 下载快照数据

Expand Down
40 changes: 5 additions & 35 deletions scripts/setup-localnet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ rm -rf $NODEDIR
plugchaind config keyring-backend $KEYRING --home $NODEDIR
plugchaind config chain-id $CHAINID --home $NODEDIR

# if $KEY exists it should be deleted
plugchaind keys add $KEY --keyring-backend $KEYRING --algo $KEYALGO --home $NODEDIR
VAL_MNEMONIC="ticket used error wait wave wait top what fix garlic jewel body frozen tone reject tomorrow voyage album aware shop safe trumpet slush skin"

echo $VAL_MNEMONIC | plugchaind keys add $KEY --keyring-backend $KEYRING --algo $KEYALGO --recover --home $NODEDIR

# Set moniker and chain-id for Evmos (Moniker can be anything, chain-id must be an integer)
plugchaind init $MONIKER --chain-id $CHAINID --home $NODEDIR
Expand All @@ -32,47 +33,16 @@ cat $NODEDIR/config/genesis.json | jq '.app_state["crisis"]["constant_fee"]["den
cat $NODEDIR/config/genesis.json | jq '.app_state["gov"]["deposit_params"]["min_deposit"][0]["denom"]="uplugcn"' > $NODEDIR/config/tmp_genesis.json && mv $NODEDIR/config/tmp_genesis.json $NODEDIR/config/genesis.json
cat $NODEDIR/config/genesis.json | jq '.app_state["mint"]["params"]["mint_denom"]="uplugcn"' > $NODEDIR/config/tmp_genesis.json && mv $NODEDIR/config/tmp_genesis.json $NODEDIR/config/genesis.json
cat $NODEDIR/config/genesis.json | jq '.app_state["evm"]["params"]["evm_denom"]="uplugcn"' > $NODEDIR/config/tmp_genesis.json && mv $NODEDIR/config/tmp_genesis.json $NODEDIR/config/genesis.json
cat $NODEDIR/config/genesis.json | jq '.app_state["feemarket"]["params"]["initial_base_fee"]="1000"' > $NODEDIR/config/tmp_genesis.json && mv $NODEDIR/config/tmp_genesis.json $NODEDIR/config/genesis.json
cat $NODEDIR/config/genesis.json | jq '.app_state["feemarket"]["params"]["base_fee"]="7"' > $NODEDIR/config/tmp_genesis.json && mv $NODEDIR/config/tmp_genesis.json $NODEDIR/config/genesis.json
cat $NODEDIR/config/genesis.json | jq '.app_state["liquidity"]["params"]["pool_creation_fee"][0]["denom"]="uplugcn"' > $NODEDIR/config/tmp_genesis.json && mv $NODEDIR/config/tmp_genesis.json $NODEDIR/config/genesis.json

# increase block time (?)
cat $NODEDIR/config/genesis.json | jq '.consensus_params["block"]["time_iota_ms"]="30000"' > $NODEDIR/config/tmp_genesis.json && mv $NODEDIR/config/tmp_genesis.json $NODEDIR/config/genesis.json

# Set gas limit in genesis
cat $NODEDIR/config/genesis.json | jq '.consensus_params["block"]["max_gas"]="10000000"' > $NODEDIR/config/tmp_genesis.json && mv $NODEDIR/config/tmp_genesis.json $NODEDIR/config/genesis.json

# disable produce empty block
if [[ "$OSTYPE" == "darwin"* ]]; then
sed -i '' 's/create_empty_blocks = true/create_empty_blocks = false/g' $NODEDIR/config/config.toml
sed -i '' 's/172800s/300s/g' $NODEDIR/config/genesis.json
else
sed -i 's/create_empty_blocks = true/create_empty_blocks = false/g' $NODEDIR/config/config.toml
sed -i '' 's/172800s/300s/g' $NODEDIR/config/genesis.json
fi

if [[ $1 == "pending" ]]; then
if [[ "$OSTYPE" == "darwin"* ]]; then
sed -i '' 's/create_empty_blocks_interval = "0s"/create_empty_blocks_interval = "30s"/g' $NODEDIR/config/config.toml
sed -i '' 's/timeout_propose = "3s"/timeout_propose = "30s"/g' $NODEDIR/config/config.toml
sed -i '' 's/timeout_propose_delta = "500ms"/timeout_propose_delta = "5s"/g' $NODEDIR/config/config.toml
sed -i '' 's/timeout_prevote = "1s"/timeout_prevote = "10s"/g' $NODEDIR/config/config.toml
sed -i '' 's/timeout_prevote_delta = "500ms"/timeout_prevote_delta = "5s"/g' $NODEDIR/config/config.toml
sed -i '' 's/timeout_precommit = "1s"/timeout_precommit = "10s"/g' $NODEDIR/config/config.toml
sed -i '' 's/timeout_precommit_delta = "500ms"/timeout_precommit_delta = "5s"/g' $NODEDIR/config/config.toml
sed -i '' 's/timeout_commit = "5s"/timeout_commit = "150s"/g' $NODEDIR/config/config.toml
sed -i '' 's/timeout_broadcast_tx_commit = "10s"/timeout_broadcast_tx_commit = "150s"/g' $NODEDIR/config/config.toml
else
sed -i 's/create_empty_blocks_interval = "0s"/create_empty_blocks_interval = "30s"/g' $NODEDIR/config/config.toml
sed -i 's/timeout_propose = "3s"/timeout_propose = "30s"/g' $NODEDIR/config/config.toml
sed -i 's/timeout_propose_delta = "500ms"/timeout_propose_delta = "5s"/g' $NODEDIR/config/config.toml
sed -i 's/timeout_prevote = "1s"/timeout_prevote = "10s"/g' $NODEDIR/config/config.toml
sed -i 's/timeout_prevote_delta = "500ms"/timeout_prevote_delta = "5s"/g' $NODEDIR/config/config.toml
sed -i 's/timeout_precommit = "1s"/timeout_precommit = "10s"/g' $NODEDIR/config/config.toml
sed -i 's/timeout_precommit_delta = "500ms"/timeout_precommit_delta = "5s"/g' $NODEDIR/config/config.toml
sed -i 's/timeout_commit = "5s"/timeout_commit = "150s"/g' $NODEDIR/config/config.toml
sed -i 's/timeout_broadcast_tx_commit = "10s"/timeout_broadcast_tx_commit = "150s"/g' $NODEDIR/config/config.toml
fi
fi

# Allocate genesis accounts (cosmos formatted addresses)
plugchaind add-genesis-account $KEY 100000000000000000000000000uplugcn --keyring-backend $KEYRING --home $NODEDIR
Expand All @@ -91,4 +61,4 @@ if [[ $1 == "pending" ]]; then
fi

# Start the node (remove the --pruning=nothing flag if historical queries are not needed)
plugchaind start --pruning=nothing $TRACE --log_level $LOGLEVEL --minimum-gas-prices=0.0001uplugcn --json-rpc.api eth,txpool,personal,net,debug,web3 --home $NODEDIR
# plugchaind start --pruning=nothing $TRACE --evm.max-tx-gas-wanted 20000 --log_level $LOGLEVEL --minimum-gas-prices=0.0001uplugcn --json-rpc.api eth,txpool,personal,net,debug,web3 --home $NODEDIR