Skip to content

Explain peer id conversion in staking docs #107

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

Merged
merged 1 commit into from
Apr 8, 2025
Merged
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
18 changes: 14 additions & 4 deletions zq2/docs/staking/delegatedstaking.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,22 @@ add your fully synced node to the staking pool and activate it as a validator by
cast send --legacy --value <YOUR_ZIL>ether --private-key $PRIVATE_KEY \
<DELEGATION_CONTRACT_PROXY_ADDRESS> "depositFromPool(bytes,bytes,bytes)" \
<BLS_PUBLIC_KEY> \
<PEER_ID> \
<HEX_PEER_ID> \
<DEPOSIT_AUTH_SIGNATURE>
```
where `<BLS_PUBLIC_KEY>`, `<PEER_ID>` and `<DEPOSIT_AUTH_SIGNATURE>` are values from the JSON output
generated by the (convert-key)[https://github.com/Zilliqa/zq2/blob/main/z2/docs/staking.md#generating-required-values]
utility. Note that `<DELEGATION_CONTRACT_PROXY_ADDRESS>` must be set as the value of `control_address`
where `<BLS_PUBLIC_KEY>`, and `<DEPOSIT_AUTH_SIGNATURE>` are the values corresponding from the JSON output
of the [convert-key](https://github.com/Zilliqa/zq2/blob/main/z2/docs/staking.md#generating-required-values)
utility and `<HEX_PEER_ID>` is the `<PEER_ID>` output value converted from `base58` to hexadecimal encoding.
For the conversion you can use the following command:
```bash
echo <PEER_ID> | base58 -d | xxd -ps -c 1000
```
Example:
```bash
echo 12D3KooWQDT1rcThrxoSmnCt9n35jrhy5wo4BHsM5JuVz8LstQpN | base58 -d | xxd -ps -c 1000
002408011220d5ed74b09dcbe84d3b32a56c01ab721cf82809848b6604535212a219d35c412f
```
Note that `<DELEGATION_CONTRACT_PROXY_ADDRESS>` must be set as the value of `control_address`
in the JSON input passed to `convert-key`.

Example: If your contract has collected 8M ZIL from delegators but is still short of another 2M ZIL,
Expand Down