Skip to content

Commit

Permalink
ci: update developer preview sanchonet build (#1419)
Browse files Browse the repository at this point in the history
* ci: update developer preview sanchonet build

* chore: fix md linting

* ci: align dev preview workflow with ci workflow

* ci: use live sanchonet url for preview build

* ci: update shared build step to include sanchonet url

* chore: update static feature flag toggles for dev preview build
  • Loading branch information
mchappell authored Sep 11, 2024
1 parent 9007bf3 commit 3cb56ba
Show file tree
Hide file tree
Showing 9 changed files with 102 additions and 76 deletions.
11 changes: 8 additions & 3 deletions .github/shared/build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ inputs:
required: false
default: 'https://lacewallet.banxa-sandbox.com/'
CARDANO_SERVICES_URL_MAINNET:
description: 'Url for mainnet env'
required: false
default: 'https://dev-mainnet.lw.iog.io'
description: 'Url for mainnet env'
required: false
default: 'https://dev-mainnet.lw.iog.io'
CARDANO_SERVICES_URL_PREPROD:
description: 'Url for preprod env'
required: false
Expand All @@ -43,6 +43,10 @@ inputs:
description: 'Url for preview env'
required: false
default: 'https://dev-preview.lw.iog.io'
CARDANO_SERVICES_URL_SANCHONET:
description: 'Url for sanchonet env'
required: false
default: 'https://dev-sanchonet.lw.iog.io'
runs:
using: 'composite'
steps:
Expand Down Expand Up @@ -100,4 +104,5 @@ runs:
CARDANO_SERVICES_URL_MAINNET: ${{ inputs.CARDANO_SERVICES_URL_MAINNET }}
CARDANO_SERVICES_URL_PREPROD: ${{ inputs.CARDANO_SERVICES_URL_PREPROD }}
CARDANO_SERVICES_URL_PREVIEW: ${{ inputs.CARDANO_SERVICES_URL_PREVIEW }}
CARDANO_SERVICES_URL_SANCHONET: ${{ inputs.CARDANO_SERVICES_URL_SANCHONET }}
run: yarn browser build
24 changes: 12 additions & 12 deletions .github/workflows/build-dev-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,32 @@ on:
jobs:
build:
name: Build + test
runs-on: self-hosted
runs-on: ubuntu-20.04
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Decrypt test data
working-directory: ./packages/e2e-tests
run: ./decrypt_secret.sh
env:
WALLET_1_PASSWORD: ${{ secrets.WALLET_PASSWORD_TESTNET }}
- name: Build chrome stable version of Lace

- name: Setup Node.js and install dependencies
uses: ./.github/actions/install
with:
WALLET_PASSWORD: ${{ secrets.WALLET_PASSWORD_TESTNET }}
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}

- name: Build dev preview version of Lace
uses: ./.github/shared/build
with:
BUILD_DEV_PREVIEW: 'true'
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
LACE_EXTENSION_KEY: ${{ secrets.DEV_PREVIEW_MANIFEST_PUBLIC_KEY }}
CARDANO_SERVICES_URL_SANCHONET: 'https://live-sanchonet.lw.iog.io'
PRODUCTION_MODE_TRACKING: 'false'
- name: Check for linter issues
run: yarn lint
- name: Run unit tests
env:
AVAILABLE_CHAINS: 'Preprod,Preview,Mainnet'
DEFAULT_CHAIN: 'Preprod'
run: yarn test --maxWorkers=2 --silent
- name: Execute unit tests
uses: ./.github/actions/test/unit
- name: Upload build
uses: actions/upload-artifact@v4
with:
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,33 +34,33 @@ Lace depends on `@input-output-hk/lace-ui-toolkit` package, which is published f
2. Select at least `read:packages` permissions to be able to download packages from GitHub Package Registry
3. Create `~/.yarnrc.yml` file in your home directory and insert:

```
```yaml
npmScopes:
input-output-hk:
npmAlwaysAuth: true
npmAuthToken: YOUR_GITHUB_PAT
npmRegistryServer: "https://npm.pkg.github.com"
npmRegistryServer: 'https://npm.pkg.github.com'
```
For more details check GitHub's guide: [Authenticating with personal access token](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-npm-registry#authenticating-with-a-personal-access-token)
### Install dependencies
```
```sh
yarn install
```

### Setup environment variables

```
```sh
cp ./apps/.env.defaults ./apps/.env
```

Once `.env` files is created adjust it to your needs, and update `LACE_EXTENSION_KEY`

### Build packages and extension

```
```sh
yarn build
```

Expand All @@ -73,7 +73,7 @@ yarn build

## Dev commands

```console
```sh
yarn [app] [command]
```

Expand Down
45 changes: 26 additions & 19 deletions apps/README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,36 @@
### Working with UI Toolkit on an app level
# Working with UI Toolkit on an app level

To setup linking for local development between **UI Toolkit** and **Lace** or any other app, you need to link **UI Toolkit** with it on an app level. To achieve this follow steps listed below.
To setup linking for local development between **UI Toolkit** and **Lace** or any other app, you need to link **UI Toolkit** with it on an app level.
To achieve this follow steps listed below.

> [!IMPORTANT]
> [yalc](https://github.com/wclr/yalc) is a prerequisite for this setup to work. Install it using `yarn global add yalc`
> [!IMPORTANT] > [yalc](https://github.com/wclr/yalc) is a prerequisite for this setup to work. Install it using `yarn global add yalc`
#### UI Toolkit repository
## UI Toolkit repository

1. Clone code repository
```
git clone git@github.com:input-output-hk/lace-ui-toolkit.git
```

```sh
git clone git@github.com:input-output-hk/lace-ui-toolkit.git
```

2. Follow steps described in UI Toolkit's [README.md](https://github.com/input-output-hk/lace-ui-toolkit?tab=readme-ov-file#link-lace-ui-toolkit-for-local-development--testing)

#### Lace repository
## Lace repository

1. Go to app directory ex. `apps/browser-extension-wallet` and setup linking
```
yalc link @input-output-hk/lace-ui-toolkit
```
2. Start dev mode
```
yarn dev
```

```sh
yalc link @input-output-hk/lace-ui-toolkit
```

2. Start dev mode

```sh
yarn dev
```

3. Once development done remove linking
```
yalc remove @input-output-hk/lace-ui-toolkit
```

```sh
yalc remove @input-output-hk/lace-ui-toolkit
```
5 changes: 3 additions & 2 deletions apps/browser-extension-wallet/.env.developerpreview
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,12 @@ USE_MULTI_DELEGATION_STAKING_TREZOR=true
USE_MULTI_DELEGATION_STAKING_ACTIVITY=true
USE_MULTI_DELEGATION_STAKING_GRID_VIEW=true
USE_ROS_STAKING_COLUMN=false
USE_FOOR_TOPUP=true
USE_FOOR_TOPUP=false

USE_POSTHOG_ANALYTICS_FOR_OPTED_OUT=false
USE_MULTI_WALLET=false
USE_MULTI_WALLET=true
USE_SHARED_WALLET=false
USE_MESSAGE_SIGNING=true

# In App URLs
CATALYST_GOOGLE_PLAY_URL=https://play.google.com/store/apps/details?id=io.iohk.vitvoting
Expand Down
43 changes: 25 additions & 18 deletions packages/README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,37 @@
### Working with UI Toolkit on a package level
# Working with UI Toolkit on a package level

To setup linking for local development in Storybook for packages like **Core**, **Staking** or any other package, you need to link **UI Toolkit** with it on a package level. To achieve this follow steps listed below.
To setup linking for local development in Storybook for packages like **Core**,
**Staking** or any other package, you need to link **UI Toolkit** with it on a package level.
To achieve this follow steps listed below.

> [!IMPORTANT]
> [yalc](https://github.com/wclr/yalc) is a prerequisite for this setup to work. Install it using `yarn global add yalc`
> [!IMPORTANT] > [yalc](https://github.com/wclr/yalc) is a prerequisite for this setup to work. Install it using `yarn global add yalc`
#### UI Toolkit repository
## UI Toolkit repository

1. Clone code repository
```
git clone git@github.com:input-output-hk/lace-ui-toolkit.git
```

```sh
git clone git@github.com:input-output-hk/lace-ui-toolkit.git
```

2. Follow steps described in UI Toolkit's [README.md](https://github.com/input-output-hk/lace-ui-toolkit?tab=readme-ov-file#link-lace-ui-toolkit-for-local-development--testing)

#### Lace repository
## Lace repository

1. Go to package directory ex. `packages/core` and setup linking
```
yalc link @input-output-hk/lace-ui-toolkit
```

```sh
yalc link @input-output-hk/lace-ui-toolkit
```

2. Start dev mode (Storybook)
```
yarn dev
```

```sh
yarn dev
```

3. Once development done remove linking
```
yalc remove @input-output-hk/lace-ui-toolkit
```

```sh
yalc remove @input-output-hk/lace-ui-toolkit
```
25 changes: 15 additions & 10 deletions packages/core/src/shared-wallets/docs/schema/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ This directory contains JSON schemas and example files for the shared wallet str

### `shared-wallet-schema.json`

This schema defines the structure of a shared wallet. It includes metadata about the wallet and a reference to the native script. The metadata contains the shared wallet name and a list of participants, each with a name and an Ed25519KeyHash public key.
This schema defines the structure of a shared wallet.
It includes metadata about the wallet and a reference to the native script.
The metadata contains the shared wallet name and a list of participants, each with a name and an Ed25519KeyHash public key.

### `cardano-babbage.json`

Expand All @@ -16,37 +18,40 @@ This schema defines various types used in Cardano transactions, including defini

### `shared-wallet-scriptAll-example.json`

This example demonstrates a shared wallet using the `ScriptAll` native script type, which requires all specified scripts to validate for the transaction to be considered valid.
This example demonstrates a shared wallet using the `ScriptAll` native script type,
which requires all specified scripts to validate for the transaction to be considered valid.

### `shared-wallet-scriptAny-example.json`

This example demonstrates a shared wallet using the `ScriptAny` native script type, which requires at least one of the specified scripts to validate for the transaction to be considered valid.
This example demonstrates a shared wallet using the `ScriptAny` native script type,
which requires at least one of the specified scripts to validate for the transaction to be considered valid.

### `shared-wallet-scriptNOfK-example.json`

This example demonstrates a shared wallet using the `ScriptNOfK` native script type, which requires a minimum number (`N`) of the specified scripts to validate for the transaction to be considered valid.
This example demonstrates a shared wallet using the `ScriptNOfK` native script type,
which requires a minimum number (`N`) of the specified scripts to validate for the transaction to be considered valid.

## Schema Validation with Zod

### Running Your JSON Schema Against a Validator Sandbox

You can run your schema against a validator online using https://zod-playground.vercel.app/.
You can run your schema against a validator online using <https://zod-playground.vercel.app/>.

### Your Reference for Comprehensive Zod Documentation

How to validate, information on types and inference can be found on https://zod.dev/.
How to validate, information on types and inference can be found on <https://zod.dev/>.

### Generating a Zod Schema Online

You can generate a Zod compatible schema from a JSON schema online using https://stefanterdell.github.io/json-schema-to-zod-react/.
You can generate a Zod compatible schema from a JSON schema online using <https://stefanterdell.github.io/json-schema-to-zod-react/>.

### Zod Usage Example

The following code snippets show how to validate using Zod.

#### Raw Parsing

```
```js
try {
const result = sharedWalletJsonSchema.parse(<my json schema>);
console.log("Schema is valid.")
Expand All @@ -59,7 +64,7 @@ try {

Safe parsing does not throw errors, but rather logs them as part of the returned object. It is preferrable when you need to know what went wrong in the validation.

```
```js
try {
const result = sharedWalletJsonSchema.safeParse(<my json schema>);

Expand All @@ -78,6 +83,6 @@ try {

To regenerate the TypeScript types from the JSON schema, use the following command:

```bash
```sh
npx --package json-schema-to-typescript -c 'json2ts shared-wallet-schema.json > shared-wallet-types-autogenerated.ts'
```
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

## Problem

Shared wallet transactions would be coordinated by moving a JSON file between cosigners in a sequential format. This JSON file would contain all the necessary information to broadcast, sign and eventually submit a transaction.
Shared wallet transactions would be coordinated by moving a JSON file between cosigners in a sequential format.
This JSON file would contain all the necessary information to broadcast, sign and eventually submit a transaction.

## Solution

Expand Down Expand Up @@ -66,12 +67,12 @@ const multsigTxData = {
version: '1.0.0',
metadata: {
createdAt: '2023-09-29T14:00:00Z',
note: "Shared account transaction",
note: 'Shared account transaction',
createdBy: 'acct_shared_xvk1z8kc04y...',
chainId: 'cip34:0-1'
chainId: 'cip34:0-1',
},
transaction: {
cborHex: '84a30081825820a0b16c2044cfa596ab3274fae8879d4c98d1dcd0539a95a96...',
},
}
};
```
4 changes: 2 additions & 2 deletions packages/translation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@

First, install the dependencies:

```bash
```sh
yarn install --frozen-lockfile
```

## Storybook

Storybook is used for development

```bash
```sh
yarn storybook
```

Expand Down

0 comments on commit 3cb56ba

Please sign in to comment.