Skip to content

Commit

Permalink
Merge pull request #107 from geniusyield/106-v0.8.0
Browse files Browse the repository at this point in the history
feat(#106): update to atlas v0.8.0, add section on certificates & governance actions
  • Loading branch information
sourabhxyz authored Jan 14, 2025
2 parents 993d2f4 + 5c279c4 commit 13a2bdc
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 6 deletions.
2 changes: 2 additions & 0 deletions src/pages/additional-features/_meta.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"blueprint": "Blueprint",
"simple-scripts": "Simple Scripts",
"certificates": "Certificates",
"governance": "Governance Procedures",
"monad-io": "Provide MonadIO instances"
}
8 changes: 8 additions & 0 deletions src/pages/additional-features/certificates.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Certificates

Atlas has rich support of all possible certificates. [`GeniusYield.Types.TxCert`](https://haddock.atlas-app.io/GeniusYield-Types-TxCert.html) module provide constructors to build them along with useful instructions describing conditions for certificate to be considered valid. Following tests illustrate how one can construct & work with these certificates:

* Certificates related to registering, updating & unregistering a delegated representative (DRep): [`GeniusYield.Test.Privnet.DRep`](https://github.com/geniusyield/atlas/blob/main/tests-privnet/GeniusYield/Test/Privnet/DRep.hs).
* Certificates pertaining to stake address registration, delegation & deregistration (this also illustrates usage of stake validator): [`GeniusYield.Test.Privnet.Stake`](https://github.com/geniusyield/atlas/blob/main/tests-privnet/GeniusYield/Test/Privnet/Stake.hs).
* Those related to stake pool registration & retirement: [`GeniusYield.Test.Privnet.StakePool`](https://github.com/geniusyield/atlas/blob/main/tests-privnet/GeniusYield/Test/Privnet/StakePool.hs).
* Committee related certificates: [`GeniusYield.Test.Privnet.Committee`](https://github.com/geniusyield/atlas/blob/main/tests-privnet/GeniusYield/Test/Privnet/Committee.hs).
3 changes: 3 additions & 0 deletions src/pages/additional-features/governance.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Governance procedures

Atlas has support for facilitating proposal & voting procedures. Test [`GeniusYield.Test.Privnet.Gov`](https://github.com/geniusyield/atlas/blob/main/tests-privnet/GeniusYield/Test/Privnet/Gov.hs) illustrates how to make a proposal and then how to vote on it. Governance related types are defined in [`GeniusYield.Types.Governance`](https://haddock.atlas-app.io/GeniusYield-Types-Governance.html) module.
9 changes: 7 additions & 2 deletions src/pages/getting-started/how-to-build.mdx
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
import { Callout } from 'nextra-theme-docs'

# How to build?

We currently support GHC version 9.6.5 and compilation is tested with cabal version 3.10.2.0.

Besides basic Haskell tooling (GHC and cabal), since we depend upon libraries used in [`cardano-node`](https://github.com/IntersectMBO/cardano-node), one would need to have additional dependencies as described in [this](https://github.com/input-output-hk/cardano-node-wiki/blob/0e31e6805407ea7059bcf1afccdd84fb275c12e6/docs/getting-started/install.md) guide related to building node from source. When referring to that guide, for our purposes, section on _"Installing the Haskell environment"_ and sections following (& including) _"Downloading the source code for cardano-node"_ are irrelevant.
Besides basic Haskell tooling (GHC and cabal), since we depend upon libraries used in [`cardano-node`](https://github.com/IntersectMBO/cardano-node), one would need to have additional dependencies as described in [this](https://github.com/input-output-hk/cardano-node-wiki/blob/602fe3a56a13a773cd6c0e00420ee3e5c56f2857/docs/getting-started/install.md) guide related to building node from source. When referring to that guide, for our purposes, section on _"Installing the Haskell environment"_ and sections following (& including) _"Downloading the source code for cardano-node"_ are irrelevant.

Additionally one would need `libpq-dev` or `postgresql` installed in their environment otherwise an error suggesting missing `pg_config` can occur.

We build Atlas in our Github CI using environment described [here](https://github.com/geniusyield/atlas/blob/main/.github/workflows/haskell.yml) which one can also refer if they encounter a build failure.

To verify if environment is configured properly, one can clone Atlas repository from [here](https://github.com/geniusyield/atlas/tree/main) and run `cabal build all` to see if build is successful.
To verify if environment is configured properly, one can clone Atlas repository from [here](https://github.com/geniusyield/atlas/tree/main) and run `cabal update && cabal build all` to see if build is successful.

<Callout>
If you receive an error related to building `postgresql-libpq:+use-pkg-config`, try unsetting `use-pkg-config` flag in your `cabal.project.local` file.
</Callout>

## Building with Nix

Expand Down
14 changes: 12 additions & 2 deletions src/pages/getting-started/operations.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ As mentioned before, we just mention at high level what we want in a transaction
| Valid after | `gytxInvalidBefore` | Just the corresponding node slot. |
| Valid before | `gytxInvalidAfter` | Same as above. |
| Metadata | `gytxMetadata` | Transaction metadata. |
| Voting procedures | `gytxVotingProcedures` | Transaction voting procedures. |
| Proposal procedures | `gytxProposalProcedures` | Transaction proposal procedures. |

When constructing the transaction, we just need to specify what we want in this skeleton.

Expand Down Expand Up @@ -235,7 +237,7 @@ input brp refScript inputRef dat red =
{ gyTxInTxOutRef = inputRef
, gyTxInWitness =
GYTxInWitnessScript
(GYInReference refScript $ betRefValidator' brp)
(GYBuildPlutusScriptReference refScript $ betRefValidator' brp)
(datumFromPlutusData dat)
(redeemerFromPlutusData red)
}
Expand All @@ -245,7 +247,7 @@ input brp refScript inputRef dat red =
In case we didn't want to use reference script, we would write `gyTxInWitness` as:
```haskell
gyTxInWitness = GYTxInWitnessScript
(GYInScript (betRefValidator' brp))
(GYBuildPlutusScriptInlined (betRefValidator' brp))
(datumFromPlutusData dat)
(redeemerFromPlutusData red)
```
Expand Down Expand Up @@ -331,6 +333,14 @@ We weren't minting any tokens in our example here and thus didn't make use of `m

We haven't made use of withdrawals, stake certificates and stake validators in our example. A sample illustration is provided in [this](https://github.com/geniusyield/atlas/blob/main/tests-privnet/GeniusYield/Test/Privnet/Stake.hs) privnet test.

### Additional certificates

Atlas has rich support of all possible certificates, see our section on [Certificates](./../additional-features/certificates) to learn more about working with them.

### Governance procedures

See [Governance procedures](./../additional-features/governance) section to learn how to do governance procedures using Atlas.

## Monad hierarchy

In Atlas we have hierarchy of monads with increasing level of capabilities. We already introduced `GYTxQueryMonad`. Besides it, we also have following monads. Don't worry if it appears overwhelming, they are mainly there for advanced usage and you would very rarely need to bother about their internals.
Expand Down
4 changes: 2 additions & 2 deletions src/pages/introduction.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ Use Atlas' test harness to write realistic [test](./getting-started/testing) har
which can be run against either an emulator or a private Cardano network. Atlas offers a unified testing approach and the same test code can seamlessly execute on both an emulated mock ledger and an actual private Cardano test network.

### Stay up to date
Benefit from Cardano's latest innovations such as **Reference Inputs**, **Inline Datums**, **Reference Scripts**, governance actions and so on.
Benefit from Cardano's latest innovations such as **Governance Actions**, **Reference Inputs**, **Inline Datums**, **Reference Scripts**, and so on.

## Where to next?
Work through an end-to-end example here: [Getting Started](./getting-started).

<Callout>

This guide tracks the Atlas version [0.7.0](https://github.com/geniusyield/atlas/releases/tag/v0.7.0).
This guide tracks the Atlas version [0.8.0](https://github.com/geniusyield/atlas/releases/tag/v0.8.0).

</Callout>

0 comments on commit 13a2bdc

Please sign in to comment.