You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+68-51Lines changed: 68 additions & 51 deletions
Original file line number
Diff line number
Diff line change
@@ -43,7 +43,7 @@ Development of the COOP is led by [MLabs](https://mlabs.city/) with feedback and
43
43
direction provided by the [Orcfax](https://www.orcfax.link/about/) oracle
44
44
project which will implement the COOP on its platform.
45
45
46
-
This project was graciously funded from the Cardano Treasury in [Catalyst Fund
46
+
This project was graciously funded by the Cardano Treasury in [Catalyst Fund
47
47
8](https://cardano.ideascale.com/c/idea/402572).
48
48
49
49
## Documentation
@@ -54,7 +54,7 @@ The protocol is described in further detail in the following documents
54
54
-[Plutus protocol](coop-docs/02-plutus-protocol.md) contains information about the wallets, tokens, minting policies, validators and transactions used in COOP and their relationship,
55
55
-[Frontend protocol](coop-docs/03-frontend-protocol.md) contains information about how users must interact with the COOP Publisher in order to publish new Fact Statements and garbage collect obsolete Fact Statements,
56
56
-[Backend protocol](coop-docs/04-backend-protocol.md) contains information on the back-end operations needed to serve the Frontend protocol,
57
-
-[Mapping between JSON and Plutus Data](coop-docs/05-json-plutus.md) contains information about how JSON encodings maps into PlutusData encoding that can be used 'onchain'.
57
+
-[Mapping between JSON and Plutus Data](coop-docs/05-json-plutus.md) contains information about how JSON encodings map into PlutusData encoding that can be used 'onchain'.
Your shell and editors should pick up on the `.envrc` files in different
122
122
directories and prepare the environment accordingly. Use `direnv allow` to
123
123
enable the direnv environment and `direnv reload` to reload it when necessary.
124
-
Otherwise, each `.envrc` file in COOP sub-directories contain a proper Nix
125
-
target you can use with the `nix develop` command. For example `nix develop #dev-pab` will build a Nix development shell that has everything needed for
126
-
developing and compiling the `coop-pab` component.
124
+
Otherwise, each `.envrc` file in COOP sub-directories contains a proper Nix
125
+
target you can use with the `nix develop` command.
126
+
For example, `nix develop #dev-pab` will build a Nix development shell
127
+
that has everything needed for developing and compiling the `coop-pab` component.
127
128
128
129
Additionally, throughout the repository one can use the [pre-commit](https://pre-commit.com/) tool:
129
130
@@ -162,7 +163,7 @@ coop-get-state ()
162
163
```
163
164
164
165
Additionally, each cli tool provided by COOP support a `--help` flag that
165
-
provides detailed explanation on the purpose of commands and their options:
166
+
provides the detailed explanation of the purpose of commands and their options:
@@ -227,15 +228,15 @@ The environment should now have the following tools available:
227
228
228
229
-[cardano-node](https://github.com/input-output-hk/cardano-node#using-cardano-node) for running a Cardano network,
229
230
-[cardano-cli](https://github.com/input-output-hk/cardano-node/tree/master/cardano-cli) for orchestrating a `cardano-node`, building, signing and submitting transactions,
230
-
-[chain-index](https://github.com/input-output-hk/plutus-apps/tree/main/plutus-chain-index) for storing and indexing datums used by the [COOP Plutus protocol](coop-docs/02-plutus-protocol.md),
231
+
-[plutus-chain-index](https://github.com/input-output-hk/plutus-apps/tree/main/plutus-chain-index) for storing and indexing datums used by the [COOP Plutus protocol](coop-docs/02-plutus-protocol.md),
231
232
-[local-cluster](https://github.com/mlabs-haskell/plutip/tree/master/local-cluster) for running a local/private Cardano network,
232
233
-[coop-pab-cli](coop-pab) for initializing and operating the [COOP Plutus Protocol](coop-docs/02-plutus-protocol.md) and operating the [COOP TxBuilder gRPC](coop-proto/tx-builder-service.proto) service,
233
234
-[coop-plutus-cli](coop-plutus) for providing serialized Plutus programs (ie. on-chain scripts) that implement the [COOP Plutus Protocol](coop-docs/02-plutus-protocol.md),
234
235
-[coop-publisher-cli](coop-publisher) for running a [COOP Publisher gRPC](coop-proto/publisher-service.proto) service that implements the [COOP Frontend protocol](coop-docs/03-frontend-protocol.md),
235
236
-[json-fs-store-cli](coop-extras/json-fact-statement-store) for running a generic JSON-based implementation of the [COOP FactStatementStore gRPC](coop-proto/fact-statement-store-service.proto) service
236
237
-[plutus-json-cli](coop-extras/plutus-json) utility tool for converting between JSON and PlutusData formats
237
238
238
-
and some other convenience utilities including some Bash functions that wrap the invocation of above mentioned services and command line tools.
239
+
and some other convenience utilities including some Bash functions that wrap the invocation of the bove-mentioned services and command line tools.
You should see the cluster running with instructions on how to stop it if
276
-
necessary:
270
+
You can use the provided `run-cluster` Bash function to run these commands for you
271
+
(inspect the content with `type run-cluster`).
272
+
You should see the cluster running with instructions on how to stop it if necessary:
277
273
278
274
```sh
275
+
run-cluster
276
+
...
279
277
Cluster is running. Ctrl-C to stop.
280
278
```
281
279
282
-
This creates the directories needed for the `local-cluster` to work and starts a Cardano network with 10 wallets (made available in the `$WALLETS` directory) that will be used in the Protocol. You can use the provided `run-cluster` Bash function to run these commands for you (inspect the content with `type run-cluster`).
280
+
This creates the directories needed for the `local-cluster` to work and starts a Cardano network with 10 wallets (made available in the `$WALLETS` directory) that will be used in the Protocol.
283
281
284
282
Let's leave the `local-cluster` process running in the foreground of the current shell and open a new `[coop-env ~ coop-tutorial]` shell session to continue with the tutorial.
Output shows some named wallets with their base16 public keys hash identifier. The `SUBMITTER_PKH` is the only wallet not used by the `COOP Publisher` that belongs to the user. In fact, we need to hide this wallet from the `local-cluster`as to emulate a real scenario:
303
+
Output shows some named wallets with their base16 public keys hash identifier. The `SUBMITTER_PKH` is the only wallet not used by the `COOP Publisher` that belongs to the user. In fact, we need to hide this wallet from the `local-cluster` to emulate a real scenario:
@@ -314,7 +312,10 @@ The `make-exports` and `show-env` are provided Bash functions that wrap the pars
314
312
315
313
#### 4. Initializing the Protocol
316
314
317
-
We're ready now to perform the [COOP Plutus protocol genesis](coop-docs/02-plutus-protocol.md#protocol-genesis) using the `coop-pab-cli` command line tool. We prepare the working directory and run the cli:
315
+
We're ready now to perform the [COOP Plutus protocol genesis](coop-docs/02-plutus-protocol.md#protocol-genesis)
316
+
using the `coop-pab-cli` command line tool.
317
+
We prepare the working directory and run the CLI.
318
+
You can use Bash function `coop-genesis` to do the same:
@@ -327,7 +328,7 @@ We should see confirmation the command executed successfully.
327
328
[CONTRACT] [INFO [Any]] deployCoop: Finished
328
329
```
329
330
330
-
At this point a `$COOP_PAB_DIR/coop-deployment.json` file was created that contains all the Plutus scripts associated with the `COOP Publisher`.
331
+
At this point, a `$COOP_PAB_DIR/coop-deployment.json` file was created that contains all the Plutus scripts associated with the `COOP Publisher`.
331
332
332
333
> NOTE:
333
334
> The `coop-deployment.json` file is intended to be shared with the users of the Protocol to enable them to assert proper script addresses and token authenticity.
@@ -372,15 +373,16 @@ getState: Success
372
373
```
373
374
374
375
As we can see there's currently nothing of interest there.
375
-
The `cs'certificates`contains a list of
376
-
[Certificates](coop-docs/02-plutus-protocol.md#cert-validator) available in the
377
-
Protocol, and the `cs'factStatements` contains a list of all the published [Fact
378
-
Statements](coop-docs/02-plutus-protocol.md#fs-validator). `cs'currentTime` is
379
-
included for convenience to observe the on-chain time.
376
+
The `cs'certificates` list contains [Certificates](coop-docs/02-plutus-protocol.md#cert-validator)
377
+
available in the Protocol,
378
+
and the `cs'factStatements` contains a list of all the published
> A [Fee wallet](coop-docs/02-plutus-protocol.md#fee-collector) is where the COOP Publisher receives the fees after a successful [Fact Statement Publishing](coop-docs/03-frontend-protocol.md).
555
563
@@ -563,17 +571,21 @@ continue with the tutorial.
563
571
564
572
#### 6. Running a FactStatementStore gRPC service
565
573
574
+
> You can use Bash function `run-js-fs-store` to execute commands
575
+
> described in this section.
576
+
566
577
COOP provides a low-scale implementation of the [FactStatementStore
> Any Cardano wallet could be used as COOP provides a raw CBOR encoded transaction, we just used [cardano-cli](https://github.com/input-output-hk/cardano-node/tree/master/cardano-cli) for convenience to demonstrate the concept.
772
789
773
-
Finally we can sign the transaction:
790
+
Finally, we can sign the transaction:
774
791
775
792
```sh
776
793
cardano-cli transaction sign \
@@ -947,7 +964,7 @@ obsolete:
947
964
```
948
965
949
966
The [Publisher gRPC](coop-proto/publisher-service.proto) service successfully
950
-
serviced the request and returned a CBORencoded Cardano transaction in the
967
+
serviced the request and returned a CBOR-encoded Cardano transaction in the
951
968
`gcFsTx` field of the response. Let's format the transaction so
The COOP Publisher operators can also manage reclaiming the [Min UTxO
1004
+
The COOP Publisher operators can also manage the reclaiming of [Min UTxO
988
1005
Ada](https://docs.cardano.org/native-tokens/minimum-ada-value-requirement) they
989
1006
had to pay for each [Certificate
990
1007
UTxO](coop-docs/02-plutus-protocol.md#cert-validator) they created when issuing
@@ -1065,7 +1082,7 @@ Garbage collection should complete successfully:
1065
1082
garbageCollect: Collected $CERT UTxOs from @CertV using $CERT-RDMR tokens
1066
1083
```
1067
1084
1068
-
This is where [Certificate redeemer wallets](coop-docs/02-plutus-protocol.md#certificate-redeemer) come into play as they hold the tokens that the the verifying Plutus script checks when validating the consumption of its outputs.
1085
+
This is where [Certificate redeemer wallets](coop-docs/02-plutus-protocol.md#certificate-redeemer) come into play as they hold the tokens that the verifying Plutus script checks when validating the consumption of its outputs.
0 commit comments