Skip to content

Commit

Permalink
register a multisignature drep using native scripts.
Browse files Browse the repository at this point in the history
  • Loading branch information
CarlosLopezDeLara committed May 13, 2024
1 parent 892a570 commit e1f5004
Show file tree
Hide file tree
Showing 4 changed files with 479 additions and 31 deletions.
30 changes: 19 additions & 11 deletions docs/tutorials/delegate-to-drep.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ In addition to the registered SanchoNet DReps, the system features a couple of d
* Payment keys and address with funds
* Stake key
* Default SanchoNet DRep selection: `--always-abstain` or `--always-no-confidence`
* SanchoNet DRep ID (or verification key) of a registered DRep
* SanchoNet DRep ID (key hash or script hash) of a registered DRep. See [useful cli queries](queries.mdx)
* A SanchoNet node

### Generating the vote delegation certificate
Expand All @@ -27,28 +27,36 @@ In addition to the registered SanchoNet DReps, the system features a couple of d

* Delegating to the `--always-abstain` default DRep:

```
```shell
cardano-cli conway stake-address vote-delegation-certificate \
--stake-verification-key-file stake.vkey \
--always-abstain \
--out-file vote-deleg.cert
--stake-verification-key-file stake.vkey \
--always-abstain \
--out-file vote-deleg.cert
```

* Delegating to the `--always-no-confidence` default DRep:

```
```shell
cardano-cli conway stake-address vote-delegation-certificate \
--stake-verification-key-file stake.vkey \
--always-no-confidence \
--out-file vote-deleg.cert
--stake-verification-key-file stake.vkey \
--always-no-confidence \
--out-file vote-deleg.cert
```

* Delegating to a registered SanchoNet DRep:
* Delegating to a **key-based** registered SanchoNet DRep:

```shell
cardano-cli conway stake-address vote-delegation-certificate \
--stake-verification-key-file stake.vkey \
--drep-key-hash $(cat drep.id) \
--out-file vote-deleg.cert
```
* Delegating to a **script-based** (i.e. multisignature) registered SanchoNet DRep:

```
cardano-cli conway stake-address vote-delegation-certificate \
--stake-verification-key-file stake.vkey \
--drep-key-hash $(cat drep.id) \
--drep-script-hash $(cat drep-multisig.id) \
--out-file vote-deleg.cert
```

Expand Down
63 changes: 43 additions & 20 deletions docs/tutorials/queries.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,33 @@ slug: /tutorials/cli queries
---

### Query the constitution:
````

```shell
cardano-cli conway query constitution --testnet-magic 4
{
"anchor": {
"dataHash": "5d372dca1a4cc90d7d16d966c48270e33e3aa0abcb0e78f0d5ca7ff330d2245d",
"url": "https://tinyurl.com/4xdkkjm3"
}
}
````
```
### Query the DRep state for all DReps:
````
cardano-cli conway query drep-state --testnet-magic 4

```shell
cardano-cli conway query drep-state --testnet-magic 4 --all-dreps


[
[
{
"scriptHash": "1d8fe9486b5fb282287568f04445c8f4d6cddf76ce2df527fd7debbe"
},
{
"anchor": null,
"deposit": 2000000,
"expiry": 108
}
],
[
{
"keyHash": "1da9afe241a10fe5ee9590843134d0eebd4a32af448c9ec91db2e863"
Expand Down Expand Up @@ -47,13 +61,15 @@ cardano-cli conway query drep-state --testnet-magic 4
"anchor": null,
"deposit": 2000000,
"expiry": 176
}
},

]
]
````
```

### Query the DRep state for an individual DRep:
````

```shell
cardano-cli conway query drep-state --drep-key-hash 1da9afe241a10fe5ee9590843134d0eebd4a32af448c9ec91db2e863 --testnet-magic 4
[
[
Expand All @@ -67,9 +83,10 @@ cardano-cli conway query drep-state --drep-key-hash 1da9afe241a10fe5ee9590843134
}
]
]
````
```
### Query the DRep stake distribution (voting power):
````

```shell
cardano-cli conway query drep-stake-distribution --testnet-magic 4
[
[
Expand All @@ -85,9 +102,11 @@ cardano-cli conway query drep-stake-distribution --testnet-magic 4
500000000000
]
]
````
```

### Query the committee state:
````

```shell
cardano-cli conway query committee-state --testnet-magic 4
{
"committee": {
Expand Down Expand Up @@ -128,9 +147,11 @@ cardano-cli conway query committee-state --testnet-magic 4
"epoch": 86,
"quorum": 0.6666666666666666666
}
````
```

### Query the state of an individual committee key hash:
````

```shell
cardano-cli conway query committee-state --cold-verification-key-hash da9f5c5c94a6709a9188838ce8cd7fe1c39a1923de4933c16d67c1e0 --testnet-magic 4
{
"committee": {
Expand All @@ -149,9 +170,10 @@ cardano-cli conway query committee-state --cold-verification-key-hash da9f5c5c94
"epoch": 89,
"quorum": 0.6666666666666666666
}
````
```
### Query expired committee members
````

```shell
cardano-cli conway query committee-state --expired --testnet-magic 4
{
"committee": {
Expand All @@ -170,10 +192,10 @@ cardano-cli conway query committee-state --expired --testnet-magic 4
"epoch": 169,
"quorum": 0.6
}
````
```
### Query active committee members

````
```shell
cardano-cli conway query committee-state --active --testnet-magic 4
{
"committee": {
Expand Down Expand Up @@ -214,13 +236,14 @@ cardano-cli conway query committee-state --active --testnet-magic 4
"epoch": 105,
"quorum": 0.6
}
````
```
### Query unrecognized committee keys
````

```shell
cardano-cli conway query committee-state --unrecognized --testnet-magic 42
{
"committee": {},
"epoch": 106,
"quorum": 0.6
}
````
```
Loading

0 comments on commit e1f5004

Please sign in to comment.