Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
fbfa5b1
feat(truapi-provider): add native and wasm ChainProvider with WebSock…
BigTava Jul 13, 2026
b997d6c
Merge remote-tracking branch 'origin/main' into tiago-truapi-provider
BigTava Jul 13, 2026
5441861
feat(truapi-provider): resolve the network from the genesis hash at c…
BigTava Jul 13, 2026
2691fbb
feat(truapi-provider-ffi): add UniFFI Swift bindings and iOS xcframew…
BigTava Jul 13, 2026
3a3b15c
refactor(truapi-provider): move the Swift/UniFFI bindings into the cr…
BigTava Jul 13, 2026
d25a3ed
fix(truapi-provider): fail-fast dropped requests, non-poisoning share…
BigTava Jul 13, 2026
f9bd97e
refactor(truapi-provider): add a typed ProviderError that converts to…
BigTava Jul 13, 2026
377b3af
feat(truapi-provider): add a connect tracing span, correct the vendor…
BigTava Jul 13, 2026
aba63fa
refactor(truapi-provider)!: rename NativeChainProvider to EmbeddedCha…
BigTava Jul 13, 2026
5be1aac
feat(truapi-provider): add warm-start snapshot() with builder databas…
BigTava Jul 13, 2026
0829d86
refactor(truapi-provider): trim comments to intent-only and fix the w…
BigTava Jul 13, 2026
7e501b3
refactor(truapi-provider): drop the only mod.rs and use core:: for pi…
BigTava Jul 13, 2026
7d4a1bb
feat(truapi-provider): reclaim implicitly-added relay chains once the…
BigTava Jul 13, 2026
cac1e5a
feat(truapi-provider): bound the native request buffer and end the st…
BigTava Jul 13, 2026
8448d3c
test(truapi-provider): add concurrency coverage and CI wasm compile-c…
BigTava Jul 13, 2026
e4d26c1
refactor(truapi-provider): store chain specs as Cow<'static, str> so …
BigTava Jul 14, 2026
fe1be49
refactor(truapi-provider): name the light-client spec field `specific…
BigTava Jul 14, 2026
b6bad63
refactor(truapi-provider): derive a parachain's relay from the catalo…
BigTava Jul 14, 2026
54bc801
feat(truapi-provider): add the @parity/truapi-provider npm package bu…
BigTava Jul 14, 2026
9aac737
refactor(truapi-provider): make ChainSource transport-only and resolv…
BigTava Jul 14, 2026
7da5a0a
feat(truapi-provider): release @parity/truapi-provider through the np…
BigTava Jul 14, 2026
57a9672
refactor(truapi-provider): make statement-store placement catalog-own…
BigTava Jul 14, 2026
ff7ab82
feat(truapi-provider): publish dev snapshots via a workflow_dispatch …
BigTava Jul 14, 2026
0d97407
refactor(truapi-provider): drop the statement-protocol setter from th…
BigTava Jul 14, 2026
d8eb6cb
refactor(truapi-provider): rename the asset_hub network field to asse…
BigTava Jul 14, 2026
cf3bab1
ci(truapi-provider): allow triggering the dev publish by pushing a tr…
BigTava Jul 14, 2026
634d933
fix(truapi-provider): survive the first dev publish with 404-safe npm…
BigTava Jul 14, 2026
b702515
docs(truapi-provider): trim dev-publish workflow comments to intent
BigTava Jul 14, 2026
5e6b28b
feat(truapi-provider): bundle previewnet in the network catalog
BigTava Jul 14, 2026
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
27 changes: 26 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ jobs:
- name: cargo check wasm32
run: cargo check --target wasm32-unknown-unknown -p truapi-server

- name: cargo check wasm32 (truapi-provider browser backends)
run: cargo check -p truapi-provider --target wasm32-unknown-unknown --no-default-features --features "js smoldot networks" --all-targets

- name: cargo +nightly fmt --check
run: cargo +nightly fmt --check

Expand All @@ -52,6 +55,27 @@ jobs:
- name: cargo test
run: cargo test --workspace --all-features

wasm-provider:
name: truapi-provider (wasm browser tests)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false

- uses: dtolnay/rust-toolchain@5b842231ba77f5c045dba54ac5560fed2db780e2 # stable
with:
toolchain: stable
targets: wasm32-unknown-unknown

- uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2

- name: Install wasm-pack
run: cargo install wasm-pack --locked

- name: wasm-pack test --headless --chrome
run: wasm-pack test --headless --chrome rust/crates/truapi-provider --no-default-features --features "js smoldot"

licenses:
name: Dependency licenses
runs-on: ubuntu-latest
Expand Down Expand Up @@ -293,12 +317,13 @@ jobs:
name: CI Status
if: always()
runs-on: ubuntu-latest
needs: [rust, licenses, codegen, ts-client, playground, explorer, e2e]
needs: [rust, wasm-provider, licenses, codegen, ts-client, playground, explorer, e2e]
steps:
- name: Check all jobs
run: |
results=(
"${{ needs.rust.result }}"
"${{ needs.wasm-provider.result }}"
"${{ needs.licenses.result }}"
"${{ needs.codegen.result }}"
"${{ needs.ts-client.result }}"
Expand Down
121 changes: 121 additions & 0 deletions .github/workflows/dev-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
name: Dev publish

# Publish a dev-tagged snapshot of @parity/truapi-provider without moving
# `latest`. Stable releases go through release.yml.

on:
workflow_dispatch:
inputs:
npm_tag_suffix:
description: 'Optional dev dist-tag suffix. Empty -> "dev-<YYYYMMDD>"; else "dev-<YYYYMMDD>-<suffix>". Charset: [A-Za-z0-9-].'
type: string
required: false
default: ""
# Push a `truapi-provider-dev` or `truapi-provider-dev-<suffix>` tag to publish
# a dev snapshot; the part after `truapi-provider-dev-` becomes the dist-tag suffix.
push:
tags:
- "truapi-provider-dev*"

permissions:
contents: read

concurrency:
group: dev-publish-truapi-provider
cancel-in-progress: false

jobs:
dev-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false

- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: "22"
registry-url: "https://registry.npmjs.org"

- uses: dtolnay/rust-toolchain@5b842231ba77f5c045dba54ac5560fed2db780e2 # stable
with:
toolchain: stable
targets: wasm32-unknown-unknown

- uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2

- name: Install wasm-pack
run: cargo install wasm-pack --version 0.14.0 --locked

# Stamp <next-patch>-dev-<date>[-suffix].N (sorts below any future stable)
# into package.json; never committed.
- name: Compute dev version and dist-tag
id: devver
shell: bash
env:
NPM_TAG_SUFFIX: ${{ inputs.npm_tag_suffix }}
run: |
set -euo pipefail
suffix="${NPM_TAG_SUFFIX:-}"
# On a tag push, derive the suffix from the tag name
# (truapi-provider-dev[-<suffix>]); workflow_dispatch supplies it directly.
if [[ -z "$suffix" && "${GITHUB_REF_TYPE:-}" == "tag" ]]; then
suffix="${GITHUB_REF_NAME#truapi-provider-dev}"
suffix="${suffix#-}"
fi
if [[ -n "$suffix" && ! "$suffix" =~ ^[A-Za-z0-9-]+$ ]]; then
echo "::error::dev suffix must match [A-Za-z0-9-]+ or be empty"
exit 1
fi
pkg=js/packages/truapi-provider
base="$(jq -r .version "$pkg/package.json")"
stable="${base%%-*}"
IFS='.' read -r major minor patch <<< "$stable"
next="$major.$minor.$((patch + 1))"
date="$(date -u +%Y%m%d)"
if [[ -z "$suffix" ]]; then
tag="dev-${date}"
else
tag="dev-${date}-${suffix}"
fi
prefix="${next}-${tag}"
# `|| echo '[]'`: npm view 404s before the first publish; `|| true`:
# no version matches the prefix on the first same-day build.
max_n="$(
{ npm view --json @parity/truapi-provider versions 2>/dev/null || echo '[]'; } \
| jq -r '.[]?' \
| { grep -E "^${prefix}\.[0-9]+$" || true; } \
| sed -E "s|^${prefix}\.||" \
| sort -n | tail -1
)"
n=$(( ${max_n:--1} + 1 ))
version="${prefix}.${n}"
jq --arg v "$version" '.version = $v' "$pkg/package.json" > "$pkg/package.json.tmp"
mv "$pkg/package.json.tmp" "$pkg/package.json"
echo "version=$version" >> "$GITHUB_OUTPUT"
echo "tag=$tag" >> "$GITHUB_OUTPUT"
echo "Computed @parity/truapi-provider@${version} -> dist-tag ${tag}"

- name: Build wasm
run: npm run build:wasm --prefix js/packages/truapi-provider

- name: Pack
run: |
set -euo pipefail
mkdir -p artifacts
(cd js/packages/truapi-provider && npm pack --pack-destination "$GITHUB_WORKSPACE/artifacts/")

- name: Upload package artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: truapi-provider-dev-${{ github.sha }}
path: artifacts/*.tgz

- name: Publish via npm_publish_automation
uses: octokit/request-action@b91aabaa861c777dcdb14e2387e30eddf04619ae # v3.0.0
with:
route: POST /repos/paritytech/npm_publish_automation/actions/workflows/publish.yml/dispatches
ref: main
inputs: '${{ format(''{{ "repo": "{0}", "run_id": "{1}", "artifact_name": "truapi-provider-dev-{2}", "npm_tag": "{3}" }}'', github.repository, github.run_id, github.sha, steps.devver.outputs.tag) }}'
env:
GITHUB_TOKEN: ${{ secrets.NPM_PUBLISH_AUTOMATION_TOKEN }}
6 changes: 5 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ jobs:
packages=(
"@parity/truapi js/packages/truapi"
"@parity/truapi-host js/packages/truapi-host"
"@parity/truapi-provider js/packages/truapi-provider"
)
pending="$(mktemp)"
for entry in "${packages[@]}"; do
Expand Down Expand Up @@ -97,7 +98,7 @@ jobs:
run: npm ci

- name: Install wasm-pack
if: steps.version.outputs.proceed == 'true' && contains(steps.version.outputs.packages, '@parity/truapi-host|')
if: steps.version.outputs.proceed == 'true' && (contains(steps.version.outputs.packages, '@parity/truapi-host|') || contains(steps.version.outputs.packages, '@parity/truapi-provider|'))
run: cargo install wasm-pack --version 0.14.0 --locked

- name: Build packages
Expand All @@ -109,6 +110,9 @@ jobs:
npm run build --prefix js/packages/truapi-host
npm run build:wasm --prefix js/packages/truapi-host
fi
if grep -q '^@parity/truapi-provider|' <<< "${STEPS_VERSION_OUTPUTS_PACKAGES}"; then
npm run build:wasm --prefix js/packages/truapi-provider
fi
env:
STEPS_VERSION_OUTPUTS_PACKAGES: ${{ steps.version.outputs.packages }}

Expand Down
1 change: 1 addition & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ rust/crates/
truapi-codegen/ rustdoc JSON → TypeScript client + Rust dispatcher
truapi-macros/ #[wire(id = N)] proc-macro
truapi-platform/ Host syscall traits (storage, navigation, consent, ...)
truapi-provider/ network provider backends (WebSocket RPC or smoldot light-client)
truapi-server/ Rust runtime hosts implement; ships as WASM (browser/node)
js/packages/
truapi/ @parity/truapi TS package; generated TS lives under ignored paths
Expand Down
Loading
Loading