Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
with:
path: |
prep/crypto-wasm
key: ${{ runner.os }}-${{ hashFiles('crypto-wasm/*') }}
key: ${{ runner.os }}-${{ hashFiles('crypto-wasm/*', 'etc/task-prep-crypto-wasm.ts') }}
- uses: actions-rust-lang/setup-rust-toolchain@v1
if: steps.prep-cache.outputs.cache-hit != 'true'
with:
Expand Down Expand Up @@ -78,7 +78,7 @@ jobs:
- uses: actions/cache/restore@v4
with:
fail-on-cache-miss: true
key: ${{ runner.os }}-${{ hashFiles('crypto-wasm/*') }}
key: ${{ runner.os }}-${{ hashFiles('crypto-wasm/*', 'etc/task-prep-crypto-wasm.ts') }}
path: |
prep/crypto-wasm
- uses: denoland/setup-deno@v2
Expand Down Expand Up @@ -122,7 +122,7 @@ jobs:
- uses: actions/cache/restore@v4
with:
fail-on-cache-miss: true
key: ${{ runner.os }}-${{ hashFiles('crypto-wasm/*') }}
key: ${{ runner.os }}-${{ hashFiles('crypto-wasm/*', 'etc/task-prep-crypto-wasm.ts') }}
path: |
prep/crypto-wasm
- uses: denoland/setup-deno@v2
Expand Down
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ v8-compile-cache-0

/prep
/.iroha
/packages/crypto-target-*/wasm-target
/packages/core/crypto/wasm-target
/packages/core/crypto/wasm/
**/*_generated_.ts
/packages/core/data-model/schema/schema.json

6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# Iroha JavaScript

The JavaScript (TypeScript) SDK of [Iroha 2](https://github.com/hyperledger-iroha/iroha).

Works in Deno, Node.js, and the Browser. (TODO: check in Bun and Cloudflare Workers).
The JavaScript (TypeScript) SDK of [Iroha 2](https://github.com/hyperledger-iroha/iroha) for Node.js, Deno, Bun and the
browser\*.

Packages and documentation are available on JSR: https://jsr.io/@iroha

Expand All @@ -24,7 +23,6 @@ bunx jsr add @iroha/core
### Quick Example

```ts
import '@iroha/crypto-target-node/install'
import { Client } from '@iroha/client'
import * as types from '@iroha/core/data-model'

Expand Down
32 changes: 21 additions & 11 deletions crypto-wasm/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crypto-wasm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ iroha_crypto = { git = "https://github.com/0x009922/iroha.git", branch = "5302-e

getrandom = { version = "0.2", features = ["js"] }

wasm-bindgen = "0.2.91"
wasm-bindgen = "0.2.100"
serde = { version = "1", default-features = false, features = ["derive"] }
serde-wasm-bindgen = "0.6"
hex = { version = "0.4", default-features = false, features = ["alloc"] }
Expand Down
14 changes: 3 additions & 11 deletions crypto-wasm/README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
# Iroha Crypto WASM (Rust sources)
# WebAssembly port of Iroha Crypto

This Cargo project is a port of [`iroha_crypto` crate](https://github.com/hyperledger/iroha/tree/iroha2-lts/crypto) with
`wasm_bindgen`s.

## Rebuild WASMs

To re-create `./wasm-pkg-*`, run in the monorepo root:

```bash
pnpm jake crypto-wasm:rebuild
```
This Cargo project is a port of [`iroha_crypto` crate](https://github.com/hyperledger/iroha/) with `wasm_bindgen`s.
Building is done with `deno task prep:crypto-wasm`.

## Be aware of moves

Expand Down
17 changes: 10 additions & 7 deletions deno.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
"exclude": ["**/docs"],
"workspace": [
"./packages/core",
"./packages/crypto-target-node",
"./packages/crypto-target-web",
"./packages/client",
"./packages/client-web-socket-node",

Expand All @@ -25,8 +23,14 @@
"description": "Build Iroha artifacts and produce `/prep/iroha` directory",
"command": "deno task prep:iroha --build"
},
"prep:crypto-wasm": "deno run --allow-read --allow-env --allow-run --allow-write ./etc/task-prep-crypto-wasm.ts",
"prep:crypto-wasm:copy": "deno task prep:crypto-wasm --onlyCopy",
"prep:crypto-wasm": {
"description": "Prepare crypto wasm and put into `@iroha/core`",
"command": "deno run -A ./etc/task-prep-crypto-wasm.ts"
},
"prep:crypto-wasm:copy": {
"description": "Only copy already built crypto wasm into `@iroha/core`",
"command": "deno task prep:crypto-wasm --copy"
},
"prep:codegen": {
"command": "deno run --allow-write --allow-read ./etc/task-codegen.ts",
"dependencies": ["prep:iroha:check"]
Expand Down Expand Up @@ -70,7 +74,7 @@
},
"fmt": {
"include": ["."],
"exclude": ["**/*_generated_.ts"],
"exclude": ["**/*_generated_.ts", "**/pnpm-lock.yaml"],
"semiColons": false,
"lineWidth": 120,
"singleQuote": true
Expand Down Expand Up @@ -105,8 +109,7 @@
"publish": {
"exclude": [
"!**/*_generated_.ts",
"!packages/crypto-target-*/wasm-target",
"!packages/core/crypto/wasm-target",
"!packages/core/crypto/wasm/",
"!packages/core/data-model/schema/schema.json"
]
},
Expand Down
44 changes: 38 additions & 6 deletions deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading