Skip to content

Commit

Permalink
Fix nonexistent Prism syntax highlighting.
Browse files Browse the repository at this point in the history
  • Loading branch information
katomm committed Dec 1, 2024
1 parent 116aea8 commit eaa003f
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 45 deletions.
10 changes: 5 additions & 5 deletions docs/get-started/cardano-cli/get-started/get-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ keywords: [cardano-cli, cli, keys, addresses, cardano-node]

Cardano CLI uses the *node-to-client* protocol to communicate with the node. This requires setting an environment variable for the node socket path. Ensure you use the path declared when starting the node.

```shell
```bash
export CARDANO_NODE_SOCKET_PATH=~/node.socket
```

Expand All @@ -21,19 +21,19 @@ export CARDANO_NODE_SOCKET_PATH=~/node.socket
Each network has a unique identifier (--mainnet or --testnet-magic NATURAL). This is used by the node-to-client protocol to ensure communication with a node on the desired network. It is useful to set up an environment variable for the network ID. Alternatively, you can provide the flag `--testnet-magic <network-id>` with each command that interacts with the node.

- **Mainnet**
```shell
```bash
export CARDANO_NODE_NETWORK_ID=mainnet
```
- **Pre-production testnet**
```shell
```bash
export CARDANO_NODE_NETWORK_ID=1
```
- **Preview testnet**
```shell
```bash
export CARDANO_NODE_NETWORK_ID=2
```
- **SanchoNet testnet**
```shell
```bash
export CARDANO_NODE_NETWORK_ID=4
```

Expand Down
78 changes: 39 additions & 39 deletions docs/get-started/cardano-cli/governance/register-drep.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,20 +85,20 @@ In this example we use the [test vector of CIP119](https://github.com/cardano-fo

Download the metadata from its URL:

```shell
```bash
wget https://raw.githubusercontent.com/cardano-foundation/CIPs/master/CIP-0119/examples/drep.jsonld
```

Use cardano-cli or b2sum to get its hash

```shell
```bash
cardano-cli conway governance drep metadata-hash \
--drep-metadata-file drep.jsonld

a14a5ad4f36bddc00f92ddb39fd9ac633c0fd43f8bfa57758f9163d10ef916de
```

```shell
```bash
b2sum -l 256 drep.jsonld
a14a5ad4f36bddc00f92ddb39fd9ac633c0fd43f8bfa57758f9163d10ef916de drep.jsonld
```
Expand All @@ -107,14 +107,14 @@ a14a5ad4f36bddc00f92ddb39fd9ac633c0fd43f8bfa57758f9163d10ef916de drep.jsonld

Registering a DRep requires a deposit, query the protocol parameters to find the amount:

```shell
```bash
cardano-cli query protocol-parameters | jq .dRepDeposit
500000000
```

Generate the certificate Using the `drep.vkey` file:

```shell
```bash
cardano-cli conway governance drep registration-certificate \
--drep-verification-key-file drep.vkey \
--key-reg-deposit-amt 500000000 \
Expand All @@ -125,7 +125,7 @@ cardano-cli conway governance drep registration-certificate \

Or using the DRep verification key:

```shell
```bash
cardano-cli conway governance drep registration-certificate \
--drep-verification-key c19e0e939609531cfd04dcfa5bf1a5f3e245aa88e163759341aba296af34cc7e \
--key-reg-deposit-amt 500000000 \
Expand All @@ -136,7 +136,7 @@ cardano-cli conway governance drep registration-certificate \

Or using the DRep ID:

```shell
```bash
cardano-cli conway governance drep registration-certificate \
--drep-key-hash "$(< drep.id)" \
--key-reg-deposit-amt 500000000 \
Expand All @@ -159,7 +159,7 @@ Any of the above methods produces `drep-reg.cert ` in a text envelope:

Build the transaction. Note that we use `--witness-override 2` because this tranaction will contain 2 signatures, with the `payment.skey` and with the `drep.skey`.

```shell
```bash
cardano-cli conway transaction build \
--tx-in $(cardano-cli query utxo --address $(< payment.addr) --output-json | jq -r 'keys[0]') \
--change-address $(< payment.addr) \
Expand All @@ -170,7 +170,7 @@ cardano-cli conway transaction build \

Sign it with payment and DRep signing keys:

```shell
```bash
cardano-cli conway transaction sign \
--tx-body-file tx.raw \
--signing-key-file payment.skey \
Expand All @@ -180,14 +180,14 @@ cardano-cli conway transaction sign \

Submit it to the chain:

```shell
```bash
cardano-cli conway transaction submit \
--tx-file tx.signed
```

### Query the DRep state to confirm:

```shell
```bash
cardano-cli conway query drep-state --all-dreps


Expand Down Expand Up @@ -215,7 +215,7 @@ A basic example of a DRep using a native script is a DRep that consists of vario

### Generate a DRep key pair for each member

```shell
```bash
cardano-cli conway governance drep key-gen \
--verification-key-file drep1.vkey \
--signing-key-file drep1.skey
Expand All @@ -238,13 +238,13 @@ cardano-cli conway governance drep key-gen \

Each member generates the hash of the verification key (This is exactly what the `governance drep id` command do)

```shell
```bash
cardano-cli conway governance drep id \
--drep-verification-key-file drep1.vkey \
--output-format hex \
--out-file drep1.id
```
```shell
```bash
cat drep1.id
e6d27c194fd18f39e080073e5ea02aa78abe4b6c84d78a498302461c
```
Expand Down Expand Up @@ -333,33 +333,33 @@ In this example we use the [test vector of CIP119](https://github.com/cardano-fo

Download the metadata from its URL:

```shell
```bash
wget https://raw.githubusercontent.com/cardano-foundation/CIPs/master/CIP-0119/examples/drep.jsonld
```

Use cardano-cli or b2sum to get its hash:

```shell
```bash
cardano-cli conway governance drep metadata-hash \
--drep-metadata-file drep.jsonld

a14a5ad4f36bddc00f92ddb39fd9ac633c0fd43f8bfa57758f9163d10ef916de
```

```shell
```bash
b2sum -l 256 drep.jsonld
a14a5ad4f36bddc00f92ddb39fd9ac633c0fd43f8bfa57758f9163d10ef916de drep.jsonld
```
### Generate the DRep ID:

This DRep will be registered on-chain as a script, therefore, the hash of the script will serve as the DRep ID. Calculate it with:

```shell
```bash
cardano-cli hash script \
--script-file drep-multisig.json \
--out-file drep-multisig.id
```
```shell
```bash
cat drep-multisig.id
d862ee2eb3ce246b23ff7e1f62ae0705013e793787485cb6e1845356
```
Expand All @@ -368,7 +368,7 @@ d862ee2eb3ce246b23ff7e1f62ae0705013e793787485cb6e1845356

Registering a DRep requires a deposit, query the protocol parameters to find the amount:

```shell
```bash
drepDeposit=$(cardano-cli query protocol-parameters | jq .dRepDeposit)

echo $drepDeposit
Expand All @@ -377,7 +377,7 @@ echo $drepDeposit

Generate the registration certificate:

```shell
```bash
cardano-cli conway governance drep registration-certificate \
--drep-script-hash "$(< drep-multisig.id)" \
--key-reg-deposit-amt "$drepDeposit" \
Expand All @@ -388,7 +388,7 @@ cardano-cli conway governance drep registration-certificate \

Build the transaction. Note that we use `--witness-override 4` because this tranaction will contain up to 4 signatures, 1 from the payment key and up to 3 members of the DRep.

```shell
```bash
cardano-cli conway transaction build \
--tx-in $(cardano-cli conway query utxo --address $(< payment.addr) --output-json | jq -r 'keys[0]') \
--change-address $(< payment.addr) \
Expand All @@ -402,7 +402,7 @@ Each member of the DRep will witness the transaction with its individual keys fr

Witnessing the transaction with the payment key:

```shell
```bash
cardano-cli conway transaction witness \
\
--tx-body-file tx.raw \
Expand All @@ -412,20 +412,20 @@ cardano-cli conway transaction witness \

Witnessing the transaction with the DRep keys from each member:

```shell
```bash
cardano-cli conway transaction witness \
--tx-body-file tx.raw \
--signing-key-file drep1.skey \
--out-file drep1.witness
```

```shell
```bash
cardano-cli conway transaction witness \
--tx-body-file tx.raw \
--signing-key-file drep2.skey \
--out-file drep2.witness
```
```shell
```bash
cardano-cli conway transaction witness \
--tx-body-file tx.raw \
--signing-key-file drep3.skey \
Expand All @@ -434,7 +434,7 @@ cardano-cli conway transaction witness \

Assemble the tranaction with all the witnesses from previous step:

```shell
```bash
cardano-cli transaction assemble \
--tx-body-file tx.raw \
--witness-file payment.witness \
Expand All @@ -446,14 +446,14 @@ cardano-cli transaction assemble \

Submit the transaction

```shell
```bash
cardano-cli conway transaction submit \
--tx-file tx.signed
```

### Query the DRep state to confirm:

```shell
```bash
cardano-cli conway query drep-state \
--drep-script-hash $(< drep-multisig.id)
```
Expand Down Expand Up @@ -494,20 +494,20 @@ In this example we use the [test vector of CIP119](https://github.com/cardano-fo

Download the metadata from its URL:

```shell
```bash
wget https://raw.githubusercontent.com/cardano-foundation/CIPs/master/CIP-0119/examples/drep.jsonld
```

Use cardano-cli or b2sum to get its hash:

```shell
```bash
cardano-cli conway governance drep metadata-hash \
--drep-metadata-file drep.jsonld

a14a5ad4f36bddc00f92ddb39fd9ac633c0fd43f8bfa57758f9163d10ef916de
```

```shell
```bash
b2sum -l 256 drep.jsonld
a14a5ad4f36bddc00f92ddb39fd9ac633c0fd43f8bfa57758f9163d10ef916de drep.jsonld
```
Expand All @@ -516,21 +516,21 @@ a14a5ad4f36bddc00f92ddb39fd9ac633c0fd43f8bfa57758f9163d10ef916de drep.jsonld

This DRep will be registered on-chain as a script, therefore, the hash of the script will serve as the DRep ID. Calculate it with:

```shell
```bash
cardano-cli hash script \
--script-file alwaysVoteYesDrep.plutus \
--out-file alwaysVoteYesDrep.id

```
```shell
```bash
cat alwaysVoteYesDrep.id
3b943c3e9598ef0e8d6bf504e7ddeee73232b1825380765c04e25055
```
### Generate the DRep registration certificate:

Registering a DRep requires a deposit, query the protocol parameters to find the amount:

```shell
```bash
drepDeposit=$(cardano-cli query protocol-parameters | jq .dRepDeposit)

echo $drepDeposit
Expand All @@ -539,7 +539,7 @@ echo $drepDeposit

Generate the registration certificate:

```shell
```bash
cardano-cli conway governance drep registration-certificate \
--drep-script-hash "$(< alwaysVoteYesDrep.id)" \
--key-reg-deposit-amt "$drepDeposit" \
Expand All @@ -549,7 +549,7 @@ cardano-cli conway governance drep registration-certificate \

Build the transaction, we need to provide a collateral and a redeemer value:

```shell
```bash
cardano-cli conway transaction build \
--tx-in $(cardano-cli conway query utxo --address $(< payment.addr) --output-json | jq -r 'keys[0]') \
--tx-in-collateral $(cardano-cli query utxo --address $(< payment.addr) --output-json | jq -r 'keys[0]') \
Expand All @@ -560,13 +560,13 @@ cardano-cli conway transaction build \
--out-file tx.raw
```

```shell
```bash
cardano-cli transaction sign \
--signing-key-file payment.skey \
--tx-body-file tx.raw \
--out-file tx.signed
```
```shell
```bash
cardano-cli transaction submit --tx-file tx.signed
```

Expand Down
2 changes: 1 addition & 1 deletion docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ module.exports = {
prism: {
//theme: prismThemes.github, // uncomment for light mode in code boxes
darkTheme: prismThemes.dracula,
additionalLanguages: ['csharp', 'php', 'bash', 'sh', 'json', 'js', 'typescript', 'yaml', 'diff'],
additionalLanguages: ['csharp', 'php', 'bash', 'json', 'typescript', 'yaml', 'diff'],
},

// Announcement Bar
Expand Down

0 comments on commit eaa003f

Please sign in to comment.