Skip to content

Commit

Permalink
- Release v8.
Browse files Browse the repository at this point in the history
- Add more docs.
  • Loading branch information
klntsky committed May 5, 2024
1 parent f8d2c52 commit 2fcd8ad
Show file tree
Hide file tree
Showing 5 changed files with 91 additions and 19 deletions.
54 changes: 35 additions & 19 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,61 +9,76 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)

- [[Unreleased]](#unreleased)
- [Added](#added)
- [Removed](#removed)
- [Changed](#changed)
- [Fixed](#fixed)
- [Removed](#removed)
- [[v7.0.0]](#v700)
- [[v8.0.0]](#v800)
- [Added](#added-1)
- [Changed](#changed-1)
- [Fixed](#fixed-1)
- [Removed](#removed-1)
- [[v6.0.0]](#v600)
- [[v7.0.0]](#v700)
- [Added](#added-2)
- [Changed](#changed-2)
- [Fixed](#fixed-2)
- [Removed](#removed-2)
- [[v5.0.0]](#v500)
- [[v6.0.0]](#v600)
- [Added](#added-3)
- [Changed](#changed-3)
- [Removed](#removed-3)
- [Fixed](#fixed-3)
- [Runtime Dependencies](#runtime-dependencies)
- [[v4.0.2] - 2023-01-17](#v402---2023-01-17)
- [Fixed](#fixed-4)
- [[v4.0.1] - 2022-12-20](#v401---2022-12-20)
- [Removed](#removed-3)
- [[v5.0.0]](#v500)
- [Added](#added-4)
- [[v4.0.0] - 2022-12-15](#v400---2022-12-15)
- [Added](#added-5)
- [Changed](#changed-4)
- [Removed](#removed-4)
- [Fixed](#fixed-4)
- [Runtime Dependencies](#runtime-dependencies)
- [[v4.0.2] - 2023-01-17](#v402---2023-01-17)
- [Fixed](#fixed-5)
- [Runtime Dependencies](#runtime-dependencies-1)
- [[3.0.0] - 2022-11-21](#300---2022-11-21)
- [[v4.0.1] - 2022-12-20](#v401---2022-12-20)
- [Added](#added-5)
- [[v4.0.0] - 2022-12-15](#v400---2022-12-15)
- [Added](#added-6)
- [Changed](#changed-5)
- [Removed](#removed-5)
- [Fixed](#fixed-6)
- [Runtime Dependencies](#runtime-dependencies-2)
- [[2.0.0] - 2022-09-12](#200---2022-09-12)
- [Runtime Dependencies](#runtime-dependencies-1)
- [[3.0.0] - 2022-11-21](#300---2022-11-21)
- [Added](#added-7)
- [Changed](#changed-6)
- [Removed](#removed-6)
- [Fixed](#fixed-7)
- [[2.0.0-alpha] - 2022-07-05](#200-alpha---2022-07-05)
- [Runtime Dependencies](#runtime-dependencies-2)
- [[2.0.0] - 2022-09-12](#200---2022-09-12)
- [Added](#added-8)
- [Removed](#removed-7)
- [Changed](#changed-7)
- [Removed](#removed-7)
- [Fixed](#fixed-8)
- [[1.1.0] - 2022-06-30](#110---2022-06-30)
- [[2.0.0-alpha] - 2022-07-05](#200-alpha---2022-07-05)
- [Added](#added-9)
- [Removed](#removed-8)
- [Changed](#changed-8)
- [Fixed](#fixed-9)
- [[1.0.1] - 2022-06-17](#101---2022-06-17)
- [[1.1.0] - 2022-06-30](#110---2022-06-30)
- [Fixed](#fixed-10)
- [[1.0.1] - 2022-06-17](#101---2022-06-17)
- [Fixed](#fixed-11)
- [[1.0.0] - 2022-06-10](#100---2022-06-10)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

## [Unreleased]

### Added

### Removed

### Changed

### Fixed

## [v8.0.0]

In this version, we've refactored CTL and split it into multiple reusable sub-packages, most notably:

- this package
Expand Down Expand Up @@ -200,6 +215,7 @@ Starting from this version, CTL does not use Plutus-domain types anymore. This c
- `getTxFinalFee`
- `Contract.Numeric.NatRatio` - the module was not used in the library.
- `Contract.AssocMap` - use `Cardano.Plutus.Types.Map` from [`purescript-plutus-types`](https://github.com/mlabs-haskell/purescript-plutus-types)
- CIP-25 metadata machinery (we need to keep the API surface thin for CTL)

## [v7.0.0]

Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,14 @@ Please explore our documentation to discover how to use CTL, how to set up its r
- [Testing on local testnets with Plutip](./doc/plutip-testing.md)
- [End-to-end dApp testing with headless browsers](./doc/e2e-testing.md)
- [Assertion utilities for testing](./doc/test-utils.md)
- [Using a directory with private keys to run tests](./doc/keydir.md)
- [Transaction balancing](./doc/balancing.md)
- [Transaction chaining](./doc/tx-chaining.md)
- [Ada staking support](./doc/staking.md)
- [Key management](./doc/key-management.md)
- [SECP256k1 support (CIP-49)](./doc/secp256k1-support.md)
- [Custom query layers](./doc/custom-query-layers.md)
- [Going to production with CTL](./doc/production.md)
- [FAQs](./doc/faq.md)
- [Feature overview video](./doc/video-intro.md)
- [Comparison with other frameworks (Lucid)](./doc/comparisons.md)
Expand Down
1 change: 1 addition & 0 deletions doc/blockfrost.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,4 +210,5 @@ This function is never used for constraints resolution, the only way to make it

## See also

- [key-directory test suite](./keydir.md) that is used under the hood by `executeContractTestsWithBlockfrost`. This test machinery can be used with any runtime backend, not just Blockfrost.
- [Testing utilities for CTL](./test-utils.md).
5 changes: 5 additions & 0 deletions doc/keydir.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- [Generating private keys](#generating-private-keys)
- [Funding your address](#funding-your-address)
- [Setting up a directory for temporary keys](#setting-up-a-directory-for-temporary-keys)
- [See also](#see-also)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

Expand Down Expand Up @@ -73,6 +74,10 @@ directories. We don't dispose of the keys automatically, as there may be some
on-chain state that's uniquely tied to them, which the user might not want to
lose access to.

### See also

- [Blockfrost-powered test suite](./blockfrost.md) for an example of how to use key-directory-based test suite with Blockfrost.

[mote]: https://github.com/garyb/purescript-mote
[cardano-handbook-keys-addresses]: https://developers.cardano.org/docs/stake-pool-course/handbook/keys-addresses
[ctl-generate-keys]: https://github.com/Plutonomicon/cardano-transaction-lib/blob/develop/scripts/generate-keys.sh
Expand Down
48 changes: 48 additions & 0 deletions doc/production.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->

- [Going to production with CTL](#going-to-production-with-ctl)
- [Setup security](#setup-security)
- [Achieving best performance](#achieving-best-performance)
- [Balancing](#balancing)
- [Monitoring](#monitoring)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

# Going to production with CTL

## Setup security

Ensure that:

- You have thoroughly tested your dApp. Your tests should be based on security properties you want to maintain (who should/shouldn't be able to do X? under what conditions?). Write these properties down and review them as well.
- There are no private keys in the bundles
- Your private keys are stored securely (e.g. not served by the webserver)
- If you have private keys that are used specifically to control/shut down the system in case of a disaster, you are not storing them on the same server as the app.
- Blockfrost keys are not exposed to the user. If you run with Blockfrost, you have to set up a reverse proxy that attaches the project ID header.

## Achieving best performance

Most likely, you will need a custom query layer to scale your dApp. Kupo is not very performant when it comes to handling a lot of queries on mainnet if it is configured to index the whole blockchain: [it has a slightly different purpose](https://github.com/CardanoSolutions/kupo/issues/146#issuecomment-1810571796).

The best approach would be to maintain your dApp state by folding incoming transactions (while handling rollbacks). Consider using [Ogmios chain-sync API](https://ogmios.dev/mini-protocols/local-chain-sync/).

[Here's how to plug your own query layer as a "provider" into CTL](./custom-query-layers.md).

## Balancing

Use multiple backend instances if you have a lot of users, but avoid switching between different instances for a single user: CTL mildly relies on consistency of the state.

How many instances to run? Compute the number based on the response times of your query layer and expected number of users.

## Monitoring

Set up monitoring and alerts for your backend services.

Ensure that you actively check the following:

- Disk space
- RAM usage
- Rate of failed requests to the query layer backend (e.g. kupo returns 503 when overloaded)
- Average response time
- Usage limits for Blockfrost

0 comments on commit 2fcd8ad

Please sign in to comment.