Skip to content

Commit

Permalink
Merge pull request #47 from jcam1/develop
Browse files Browse the repository at this point in the history
Release 2024-08-27 00:12:03 +0900
  • Loading branch information
SeiyaKobayashi authored Aug 26, 2024
2 parents 6cec26c + 0f47ae5 commit a4080e9
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 27 deletions.
10 changes: 4 additions & 6 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,14 @@ jobs:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./
working-directory: ./packages/v1
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/install-dependencies
- name: Compile
run: |
yarn workspace @jpyc/sdk-core run compile
yarn workspace @jpyc/sdk-v1 run compile:sdk
run: yarn run compile
- name: Lint
run: yarn workspace @jpyc/sdk-v1 run lint:dry-run
run: yarn run lint:dry-run
- name: Format
run: yarn workspace @jpyc/sdk-v1 run format:dry-run
run: yarn run format:dry-run
6 changes: 2 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,13 @@ jobs:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./
working-directory: ./packages/v1
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/install-dependencies
- name: Build package
run: |
yarn workspace @jpyc/sdk-core run compile
yarn workspace @jpyc/sdk-v1 run compile:sdk
run: yarn run compile
- uses: ./.github/actions/publish-package
with:
working-directory: ./packages/v1
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
],
"repository": "https://github.com/jcam1/sdks.git",
"license": "MIT",
"version": "1.6.0",
"version": "1.7.0",
"engines": {
"node": "^20.12.0",
"yarn": "^1.22.22"
Expand Down
2 changes: 1 addition & 1 deletion packages/core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The following commands are available as yarn scripts for local development & tes
| Command | Description |
| ---------------: | :---------------------------------------------------- |
| `docs` | Generate Markdown documents from TSDoc-style comments |
| `compile` | Compile (transpile) TypeScript files |
| `compile` | Compile (transpile) SDK |
| `lint` | Run Eslint |
| `lint:dry-run` | Run Eslint without fixing |
| `format` | Run Prettier |
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "Core SDK for JPYC protocol",
"repository": "https://github.com/jcam1/sdks.git",
"license": "MIT",
"version": "1.3.0",
"version": "1.4.0",
"publishConfig": {
"access": "public"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/v1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ The following commands are available as yarn scripts for local development & tes
| `lint:dry-run` | Run Eslint without fixing |
| `format` | Run Prettier |
| `format:dry-run` | Run Prettier without fixing |
| `compile:sdk` | Compile (transpile) TypeScript files |
| `compile` | Compile (transpile) SDK |
| `compile:contracts` | Compile contracts |
| `clean` | Delete contract artifacts |
| `node` | Run hardhat network & node locally |
Expand Down
28 changes: 18 additions & 10 deletions packages/v1/examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,44 @@

We provide code examples that use JPYC V1 SDK as an interface to locally-deployed `JPYCv2` contracts. Please read and follow the instructions below to learn how to set up local environment as well as how to run our code examples.

### 1. Run Local Network
> [!NOTE]
> Please run the following commands in `/packages/v1` directory.
Run the following command to start running local Hardhat network and its accompanying node.
### 1. Build Packages

The first thing to do is to build packages.

```sh
$ yarn run compile
```

### 2. Run Local Network

Start running local Hardhat network and its accompanying node.

```sh
$ yarn run node
```

### 2. Deploy Contracts
### 3. Deploy Contracts

**Open a different window** and run the following command to deploy JPYCv2 contracts to the local network. Once successfully deployed, a new directory will be created, and you can find deployed contract addresses at `/packages/v1/ignition/deployments/chain-31337/deployed_addresses.json`.

```sh
$ yarn run deploy
```

### 3. Set Environment Variables
### 4. Set Environment Variables

Run the following commands, and edit the generated `.env` file accordingly. Set `LOCAL_PROXY_ADDRESS` to the value of `JPYCV2Module#FiatTokenV1` at [here](../ignition/deployments/chain-31337/deployed_addresses.json). See [here](../README.md/) for more details.
Run the following commands and edit the generated `.env` file accordingly. Set `LOCAL_PROXY_ADDRESS` to the value of `JPYCV2Module#FiatTokenV1` at [here](../ignition/deployments/chain-31337/deployed_addresses.json). See [here](../README.md/) for more details.

```sh
# cd into this directory
$ cd /packages/v1
# copy `.env.example` to `.env`
$ yarn run env
```

### 4. Run Code Examples
### 5. Run Code Examples

Run the following commands to execute our code examples.
Finally, let's execute our code examples!

| Command | Description |
| ----------------------------: | :------------------------------------------------------ |
Expand Down
6 changes: 3 additions & 3 deletions packages/v1/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "SDK v1 for JPYC v2 protocol",
"repository": "https://github.com/jcam1/sdks.git",
"license": "MIT",
"version": "1.1.0",
"version": "1.2.0",
"publishConfig": {
"access": "public"
},
Expand All @@ -23,11 +23,11 @@
"lint:dry-run": "eslint ./src",
"format": "prettier --write .",
"format:dry-run": "prettier --check .",
"compile:sdk": "tsc",
"compile": "yarn workspace @jpyc/sdk-core run compile && tsc",
"compile:contracts": "hardhat compile",
"clean": "hardhat clean",
"node": "hardhat node",
"deploy": "rm -r ignition/deployments && hardhat run ./scripts/deployments.ts --network localhost",
"deploy": "rm -f -r ignition/deployments && hardhat run ./scripts/deployments.ts --network localhost",
"mint": "hardhat run ./examples/mint.ts --network localhost",
"total-supply": "hardhat run ./examples/total-supply.ts --network localhost",
"transfer": "hardhat run ./examples/transfer.ts --network localhost",
Expand Down

0 comments on commit a4080e9

Please sign in to comment.