Skip to content

Commit

Permalink
Merge branch 'v1.0-docs-update' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
seedlings-calm committed Feb 17, 2022
2 parents 1f2f207 + 6e818fd commit d498d19
Show file tree
Hide file tree
Showing 57 changed files with 2,017 additions and 1,190 deletions.
8 changes: 4 additions & 4 deletions docs/cli-client/gov.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,8 @@ Where proposal.json contains:
"title": "Community Pool Spend",
"description": "Pay me some Atoms!",
"recipient": "gx1mjk4p68mmulwla3x5uzlgjwsc3zrms448rel3q",
"amount": "1000plug",
"deposit": "1000plug"
"amount": "1000uplugcn",
"deposit": "1000uplugcn"
}
```

Expand Down Expand Up @@ -217,7 +217,7 @@ Where proposal.json contains:
"value": 105
}
],
"deposit": "1000plug"
"deposit": "1000uplugcn"
}
```

Expand Down Expand Up @@ -283,5 +283,5 @@ plugchaind tx gov vote [proposal-id] [option] [flags]
### Vote for an active proposal

```bash
plugchaind tx gov vote <proposal-id> <option> --from=<key-name> --fees=20plug
plugchaind tx gov vote <proposal-id> <option> --from=<key-name> --fees=20uplugcn
```
4 changes: 2 additions & 2 deletions docs/cli-client/nft.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ The above `issue-class`,`issue-nft`,`edit-nft`,`transfer-class`,`transfer-nft`,`
| Name, shorthand | Optional value | Description | Required |
| ----------- | ---- | ------------------ | ---- |
| --from | | The address used to sign the transaction sent by the execution function | true |
| --chain-id | plugchain | ID of the chain | true |
| --fees | 200plug | Pay transaction fees | true |
| --chain-id | plugchain_520-1 | ID of the chain | true |
| --fees | 200uplugcn | Pay transaction fees | true |
| --home | ~/.plugchain | The directory where the chain data is located | Optional |


Expand Down
8 changes: 4 additions & 4 deletions docs/cli-client/params.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ Among them, the parameters available for query for each subspace are as follows:
| `UnbondingTime` | Mortgage redemption time | 3w(weeks) |
| `MaxValidators` | Maximum number of validators | 100 |
| `MaxEntries` | The maximum number of unbinding/redelegation orders in progress | 7 |
| `BondDenom` | Bond denom | plug |
| `BondDenom` | Bond denom | uplugcn |
| `HistoricalEntries` | The number of historical entries | 100 |

## mint

| key | description | default |
| ----------- | --------------------------- | ------- |
| `Inflation` | Token issuance frequency | 0.04 |
| `MintDenom` | Denom of the token mintable | plug |
| `MintDenom` | Denom of the token mintable | uplugcn |

## distribution

Expand Down Expand Up @@ -75,11 +75,11 @@ Among them, the parameters available for query for each subspace are as follows:

| key | description | default |
| ------------- | ------------ | --------- |
| `ConstantFee` | Constant Fee | 1000plug |
| `ConstantFee` | Constant Fee | 1000uplugcn |

## token

| key | description | default |
| ------------- | ----------- | --------- |
| `IssueTokenBaseFee` | Constant Fee | 10000plug |
| `IssueTokenBaseFee` | Constant Fee | 10000uplugcn |
| `OperateTokenFeeRatio` | Operation Fee | 0.1 |
10 changes: 5 additions & 5 deletions docs/cli-client/staking.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ plugchaind tx staking create-validator [flags]
### Create a validator

```bash
plugchaind tx staking create-validator --chain-id=plugchain --from=<key-name> --fees=20plug --pubkey=<validator-pubKey> --commission-rate=0.1 --amount=100plug --moniker=<validator-name>
plugchaind tx staking create-validator --chain-id=plugchain_520-1 --from=<key-name> --fees=20uplugcn --pubkey=<validator-pubKey> --commission-rate=0.1 --amount=100uplugcn --moniker=<validator-name>
```

:::tip
Expand Down Expand Up @@ -269,7 +269,7 @@ plugchaind tx staking edit-validator [flags]
### Edit validator information

```bash
plugchaind tx staking edit-validator --from=<key-name> --chain-id=plugchain --fees=20plug --commission-rate=0.10 --moniker=<validator-name>
plugchaind tx staking edit-validator --from=<key-name> --chain-id=plugchain_520-1 --fees=20uplugcn --commission-rate=0.10 --moniker=<validator-name>
```

### Upload validator avatar
Expand All @@ -285,7 +285,7 @@ plugchaind tx staking delegate [validator-addr] [amount] [flags]
```

```bash
plugchaind tx staking delegate <gxvaloper...> <amount> --chain-id=plugchain --from=<key-name> --fees=20plug
plugchaind tx staking delegate <gxvaloper...> <amount> --chain-id=plugchain_520-1 --from=<key-name> --fees=20uplugcn
```

## plugchaind tx staking unbond
Expand All @@ -299,7 +299,7 @@ plugchaind tx staking unbond [validator-addr] [amount] [flags]
### Unbond some tokens from a validator

```bash
plugchaind tx staking unbond <gxvaloper...> 10plugchaind --from=<key-name> --chain-id=plugchain --fees=20plug
plugchaind tx staking unbond <gxvaloper...> 10uplugcn --from=<key-name> --chain-id=plugchain_520-1 --fees=20uplugcn
```

## plugchaind tx staking redelegate
Expand All @@ -317,5 +317,5 @@ plugchaind tx staking redelegate [src-validator-addr] [dst-validator-addr] [amou
### Redelegate some tokens to another validator

```bash
plugchaind tx staking redelegate <gxvaloper...> <gxvaloper...> 10plugchaind --chain-id=plugchain --from=<key-name> --fees=20plug
plugchaind tx staking redelegate <gxvaloper...> <gxvaloper...> 10uplugcn --chain-id=plugchain_520-1 --from=<key-name> --fees=20uplugcn
```
20 changes: 10 additions & 10 deletions docs/cli-client/tx.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ You can generate any type of txs offline by appending the flag `--generate-only`
We use a transfer tx in the following examples:

```bash
plugchaind tx bank send gx1w9lvhwlvkwqvg08q84n2k4nn896u9pqx93velx gx15uys54epmd2xzhcn32szps56wvev40tt908h62 10plugchaind --chain-id=plugchain --generate-only
plugchaind tx bank send gx1w9lvhwlvkwqvg08q84n2k4nn896u9pqx93velx gx15uys54epmd2xzhcn32szps56wvev40tt908h62 10uplugcn --chain-id=plugchain_520-1 --generate-only
```

The `unsigned.json` should look like:
Expand All @@ -56,7 +56,7 @@ The `unsigned.json` should look like:
"to_address": "gx15uys54epmd2xzhcn32szps56wvev40tt908h62",
"amount": [
{
"denom": "plug",
"denom": "uplugcn",
"amount": "10"
}
]
Expand Down Expand Up @@ -94,7 +94,7 @@ The `signed.json` should look like:
"address": "gx106nhdckyf996q69v3qdxwe6y7408pvyvyxzhxh",
"coins": [
{
"denom": "plug",
"denom": "uplugcn",
"amount": "1000000"
}
]
Expand All @@ -105,7 +105,7 @@ The `signed.json` should look like:
"address": "gx1893x4l2rdshytfzvfpduecpswz7qtpstevr742",
"coins": [
{
"denom": "plug",
"denom": "uplugcn",
"amount": "1000000"
}
]
Expand All @@ -117,7 +117,7 @@ The `signed.json` should look like:
"fee": {
"amount": [
{
"denom": "plug",
"denom": "uplugcn",
"amount": "4000000"
}
],
Expand Down Expand Up @@ -150,7 +150,7 @@ This command is used to broadcast an offline signed transaction to the network.
### Broadcast offline signed transaction

```bash
plugchaind tx broadcast signed.json --chain-id=plugchain
plugchaind tx broadcast signed.json --chain-id=plugchain_520-1
```

## plugchaind tx multisign
Expand All @@ -168,7 +168,7 @@ No multisig key? [Create one](keys.md#create-a-multisig-key)
:::

```bash
plugchaind tx bank send <from> <to> 10plugchaind --fees=20plug --chain-id=plugchain --from=<multisig-keyname> --generate-only > unsigned.json
plugchaind tx bank send <from> <to> 10uplugcn --fees=20uplugcn --chain-id=plugchain_520-1 --from=<multisig-keyname> --generate-only > unsigned.json
```

### Sign the multisig tx
Expand All @@ -186,21 +186,21 @@ Assume the multisig-threshold is 2, here we sign the `unsigned.json` by 2 of the
Sign the tx by signer-1:

```bash
plugchaind tx sign unsigned.json --from=<signer-keyname-1> --chain-id=plugchain --multisig=<multisig-address> --signature-only > signed-1.json
plugchaind tx sign unsigned.json --from=<signer-keyname-1> --chain-id=plugchain_520-1 --multisig=<multisig-address> --signature-only > signed-1.json
```

Sign the tx by signer-2:

```bash
plugchaind tx sign unsigned.json --from=<signer-keyname-2> --chain-id=plugchain --multisig=<multisig-address> --signature-only > signed-2.json
plugchaind tx sign unsigned.json --from=<signer-keyname-2> --chain-id=plugchain_520-1 --multisig=<multisig-address> --signature-only > signed-2.json
```

#### Merge the signatures

Merge all the signatures into `signed.json`

```bash
plugchaind tx multisign --chain-id=plugchain unsigned.json <multisig-keyname> signed-1.json signed-2.json > signed.json
plugchaind tx multisign --chain-id=plugchain_520-1 unsigned.json <multisig-keyname> signed-1.json signed-2.json > signed.json
```

Now you can [broadcast the signed tx](#plugchaind-tx-broadcast).
Expand Down
105 changes: 105 additions & 0 deletions docs/concepts/disk_optimization.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
---
order: 8
---



# Disk Usage Optimization

Customize the configuration settings to lower the disk requirements for your validator node

Blockchain database tends to grow over time, depending e.g. on block
speed and transaction amount. For Plugchain, we are talking about close to
100GB of disk usage in first two weeks.

There are few configurations that can be done to reduce the required
disk usage quite significantly. Some of these changes take full effect
only when you do the configuration and start syncing from start with
them in use.

## Indexing

If you do not need to query transactions from the specific node, you can
disable indexing. On `config.toml` set

```toml
indexer = "null"
```

If you do this on already synced node, the collected index is not purged
automatically, you need to delete it manually. The index is located
under the database directory with name `data/tx_index.db/`.

## State-sync snapshots

I believe this was disabled by default on Plugchain, but listing it in any
case here. On `app.toml` set

```toml
snapshot-interval = 0
```

Note that if state-sync was enabled on the network and working properly,
it would allow one to sync a new node in few minutes. But this node
would not have the history.

## Configure pruning

By default every 500th state, and the last 100 states are kept. This
consumes a lot of disk space on long run, and can be optimized with
following custom configuration:

```toml
pruning = "custom"
pruning-keep-recent = "100"
pruning-keep-every = "0"
pruning-interval = "10"
```

Configuring `pruning-keep-recent = "0"` might sound tempting, but this
will risk database corruption if the `plugchaind` is killed for any reason.
Thus, it is recommended to keep the few latest states.

## Logging

By default the logging level is set to `info`, and this produces a lot of
logs. This log level might be good when starting up to see that the
node starts syncing properly. However, after you see the syncing is
going smoothly, you can lower the log level to `warn` (or `error`). On
`config.toml` set the following

```toml
log_level = "warn"
```

Also ensure your log rotation is configured properly.

## Results

Below is the disk usage after two weeks of Plugchain Arsia Mons testnet. The default
configuration results in disk usage of 90GB.

```bash
5.3G ./state.db
70G ./application.db
20K ./snapshots/metadata.db
24K ./snapshots
9.0G ./blockstore.db
20K ./evidence.db
1018M ./cs.wal
4.7G ./tx_index.db
90G .
```

This optimized configuration has reduced the disk usage to 17 GB.

```bash
17G .
1.1G ./cs.wal
946M ./application.db
20K ./evidence.db
9.1G ./blockstore.db
24K ./snapshots
20K ./snapshots/metadata.db
5.3G ./state.db
```
4 changes: 2 additions & 2 deletions docs/concepts/general-concepts.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ The validator and its delegators can share the following rewards by proportion:

- **Fee**

Various transactions in the plug network need to pay a certain fee. Plug Chain Hub sets the minimum unit price of Gas (ie min-gas-price) in the system.
Various transactions in the uplugcn network need to pay a certain fee. Plug Chain Hub sets the minimum unit price of Gas (ie min-gas-price) in the system.

Handling fees can only be paid using plug at present. In the future, a whitelist of handling fees may be maintained through on-chain governance. Any token in the whitelist can be used to pay for handling fees.
Handling fees can only be paid using uplugcn at present. In the future, a whitelist of handling fees may be maintained through on-chain governance. Any token in the whitelist can be used to pay for handling fees.

The fee income will be distributed according to the weight of the validator.

Expand Down
9 changes: 6 additions & 3 deletions docs/concepts/gov-params.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
---
order: 6
---
# Gov Parameters

In Plug Chain Hub, there are some special parameters that can be modified through on-chain governance.
Expand Down Expand Up @@ -37,7 +40,7 @@ Details in [Distribution](../features/distribution.md)

| key | Description | Range | Current |
| ------------------- | ------------------------------------------------ | -------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
| `gov/depositparams` | Related parameters of the deposit mortgage phase | max_deposit_period:(0, 9223372036854775807] | {"min_deposit": [{"denom": "plug", "amount": "10000000"}], "max_deposit_period": "604800s" } |
| `gov/depositparams` | Related parameters of the deposit mortgage phase | max_deposit_period:(0, 9223372036854775807] | {"min_deposit": [{"denom": "uplugcn", "amount": "10000000"}], "max_deposit_period": "604800s" } |
| `gov/votingparams` | Related parameters of the voting mortgage phase | voting_period:(0, 9223372036854775807] | {"voting_period": "1209600s"} |
| `gov/tallyparams` | Related parameters of the voting tally phase | quorum:[0,1]<br>threshold:(0,1]<br/>veto_threshold:(0,1] | {"quorum":"0.334000000000000000","threshold": "0.500000000000000000","veto_threshold": "0.334000000000000000"} |

Expand All @@ -56,7 +59,7 @@ Details in [Governance](../features/governance.md)
| key | Description | Range | Current |
| ---------------- | --------------------------- | -------- | ------- |
| `mint/Inflation` | Token issuance frequency | [0, 0.2] | 0.13 |
| `mint/MintDenom` | Denom of the token mintable | | plug |
| `mint/MintDenom` | Denom of the token mintable | | uplugcn |

Details in [Mint](../features/mint.md)

Expand All @@ -80,7 +83,7 @@ Details in [Slashing](../features/slashing.md)
| `staking/UnbondingTime` | Mortgage redemption time | (0, 9223372036854775807] | 1814400s |
| `staking/MaxValidators` | Maximum number of validators | (0, 4294967295] | 100 |
| `staking/MaxEntries` | The maximum number of unbinding/redelegation orders in progress | (0, 4294967295] | 7 |
| `staking/BondDenom` | Bond denom | | plug |
| `staking/BondDenom` | Bond denom | | uplugcn |
| `staking/HistoricalEntries` | Historical entries | [0, 4294967295] | 10000 |

Details in [Staking](../features/staking.md)
3 changes: 3 additions & 0 deletions docs/concepts/key.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
---
order: 7
---
# Key

## A note on HD wallet
Expand Down
4 changes: 2 additions & 2 deletions docs/concepts/validator-faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ Self-delegation is delegation from a validator to himself. This amount can be in

### Is there a minimum amount of plugchaind that must be delegated to be an active (=bonded) validator

The minimum amount is `1000000plug`.
The minimum mortgage `1plugcn`, on the chain is `1*10^6 uplugcn`, you can create a validator, but whether you can become an active validator depends on whether the number of your mortgage (including delegated) exceeds the 100th validator.

### Can a validator run away with their delegators' funds

Expand Down Expand Up @@ -204,7 +204,7 @@ If you got jailed, you can get your voting power back to your validator.
First, if `plugchaind` is not running, start it up again:

```bash
plugchaind start --minimum-gas-prices 0.0001plug
plugchaind start --minimum-gas-prices 0.0001uplugcn
```

Wait for your full node to catch up to the latest block. Then, you can [unjail your validator](../cli-client/slashing.md#plugchaind-tx-slashing-unjail) if you have been jailed over the [DowntimeJailDuration](gov-params.md#parameters-in-slashing)
Expand Down
1 change: 1 addition & 0 deletions docs/daemon/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ plugchaind <command>
| [testnet](local-testnet.md#build-and-init) | Initialize files for a Plug Chain Hub testnet |
| [reset](local-testnet.md#plugchaind-reset) | Reset app state to the specified height |
| [export](export.md) | Export state to JSON |
| [config](config.md) | Query and modify the client configuration of the specified data directory |
| version | Show executable binary version |

## Global Flags
Expand Down
Loading

0 comments on commit d498d19

Please sign in to comment.