Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
db01058
Client library
gregorydemay Jan 27, 2025
30dd56c
Types library
gregorydemay Jan 27, 2025
7a41cfe
Added canister
gregorydemay Jan 27, 2025
85b0109
Added toolchain
gregorydemay Jan 27, 2025
0f4b8eb
dummy query
gregorydemay Jan 27, 2025
3fbe3ff
conventional commit
gregorydemay Jan 27, 2025
5634226
basic Rust pipeline
gregorydemay Jan 27, 2025
523f8a7
failing test
gregorydemay Jan 27, 2025
a5b5d71
fix path to Github files
gregorydemay Jan 27, 2025
94e90d5
fix test
gregorydemay Jan 27, 2025
d90bd76
ensure Candid canister interface is consistent
gregorydemay Jan 28, 2025
0eee468
Integration tests crate
gregorydemay Jan 28, 2025
54e2422
Setup Pocket IC
gregorydemay Jan 28, 2025
527ad71
test client via Pocket IC
gregorydemay Jan 28, 2025
497e8c4
Try to abstract transport
gregorydemay Jan 28, 2025
04c1ecd
fix int test
gregorydemay Jan 28, 2025
aa94865
PocketIcRuntime
gregorydemay Jan 28, 2025
2fe109b
linting
gregorydemay Jan 28, 2025
418ba1d
formatting
gregorydemay Jan 28, 2025
620879b
formatting
gregorydemay Jan 28, 2025
a27bb94
Pipeline for integration tests
gregorydemay Jan 29, 2025
286d391
Adapt .gitignore
gregorydemay Jan 29, 2025
fd87e90
Fake reproducible build for now
gregorydemay Jan 29, 2025
fe7d1c6
add wasms dir
gregorydemay Jan 29, 2025
e3e96cf
fix path
gregorydemay Jan 29, 2025
cacfad8
fix path
gregorydemay Jan 29, 2025
d9cc0f2
add TODO for reproducible build
gregorydemay Jan 29, 2025
1255a2b
Polishing with some basic docs
gregorydemay Jan 29, 2025
1caccb6
added CODEOWNERS and dependabot config
gregorydemay Jan 29, 2025
304f9ec
change pipeline name
gregorydemay Jan 29, 2025
641f535
added licenses
gregorydemay Jan 30, 2025
632fe57
Basic README and CHANGELOG files
gregorydemay Jan 30, 2025
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
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @dfinity/cross-chain-team
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: 2
updates:
- package-ecosystem: cargo
directory: "/"
schedule:
interval: weekly
time: "01:17"
open-pull-requests-limit: 10
81 changes: 81 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: 'SOL RPC'

on:
pull_request:
push:
branches:
- main
tags:
- v*
paths-ignore:
- "README.md"
env:
CARGO_TERM_COLOR: always
RUSTFLAGS: "-Dwarnings"

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
uses: actions/checkout@v4
- name: 'Check code'
run: |
cargo fmt --all -- --check
cargo clippy --locked --verbose --tests --benches --workspace -- -D clippy::all
cargo clippy --locked --verbose --target wasm32-unknown-unknown -p sol_rpc_canister -- -D clippy::all

reproducible-build:
runs-on: ubuntu-22.04
steps:
- name: 'Checkout'
uses: actions/checkout@v4
# TODO XC-283: setup reproducible build with Docker
- name: Docker build
run: |
cargo build --locked --target wasm32-unknown-unknown --release --package sol_rpc_canister
gzip -fckn9 target/wasm32-unknown-unknown/release/sol_rpc_canister.wasm >./wasms/sol_rpc_canister.wasm.gz

- name: 'Archive Artifact'
uses: actions/upload-artifact@v4
with:
name: sol_rpc_canister.wasm.gz
path: ./wasms/sol_rpc_canister.wasm.gz
if-no-files-found: error

- name: 'Add summary'
run: |
hash=`sha256sum ./wasms/sol_rpc_canister.wasm.gz`
echo "SHA-256 :hash: ${hash}" >> $GITHUB_STEP_SUMMARY

unit-tests:
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
uses: actions/checkout@v4
- name: 'Run unit tests'
run: cargo test --locked --workspace --exclude sol_rpc_int_tests

integration-tests:
needs: [ reproducible-build ]
runs-on: ubuntu-22.04
steps:
- name: 'Checkout'
uses: actions/checkout@v4

- name: 'Download Artifacts'
uses: actions/download-artifact@v4
with:
name: sol_rpc_canister.wasm.gz

- name: 'Set SOL_RPC_CANISTER_WASM_PATH for load_wasm'
run: |
echo "SOL_RPC_CANISTER_WASM_PATH=$GITHUB_WORKSPACE/sol_rpc_canister.wasm.gz" >> "$GITHUB_ENV"

- name: 'Install PocketIC server'
uses: dfinity/pocketic@main
with:
pocket-ic-server-version: "7.0.0"

- name: Cargo test
run: cargo test --package sol_rpc_int_tests -- --test-threads 2 --nocapture
39 changes: 39 additions & 0 deletions .github/workflows/conventional-commits.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: PR title format
on:
pull_request:
types:
- opened
- reopened
- edited
- synchronize

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
# When getting Rust dependencies, retry on network error:
CARGO_NET_RETRY: 10
# Use the local .curlrc
CURL_HOME: .
TITLE: ${{ github.event.pull_request.title }}
jobs:
check:
name: conventional-pr-title:required
runs-on: ubuntu-latest
steps:
# Conventional commit patterns:
# verb: description
# verb!: description of breaking change
# verb(scope): Description of change to $scope
# verb(scope)!: Description of breaking change to $scope
# verb: feat, fix, ...
# scope: refers to the part of code being changed. E.g. " (accounts)" or " (accounts,canisters)"
# !: Indicates that the PR contains a breaking change.
- run: |
if [[ "$TITLE" =~ ^(feat|fix|chore|build|ci|docs|style|refactor|perf|test)(\([-a-zA-Z0-9,]+\))?\!?\: ]]; then
echo pass
else
echo "PR title does not match conventions"
exit 1
fi
73 changes: 63 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,72 @@
debug/
target/

# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
Cargo.lock

# These are backup files generated by rustfmt
**/*.rs.bk

# MSVC Windows builds of rustc generate these, which store debugging information
*.pdb

# RustRover
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
# OS ignore rules
.DS_Store
.AppleDouble
.LSOverride
[Dd]esktop.ini
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db
*.stackdump
*.cab
*.msi
*.msix
*.msm
*.msp
.Trash-*
*~

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea

# Nodejs
## Logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

## Runtime data
pids
*.pid
*.seed
*.pid.lock

## Dependency directories
node_modules/

## Optional npm cache directory
.npm
.eslintcache

## dotenv environment variable files
.env
.env.*

## generate output
out
dist
coverage
.dfx
pocket-ic
ic-wasm
wasms/*.did
wasms/*.wasm.gz
.canbench
.canbench_output
.nx/cache
.nx/workspace-data
/artifacts
Loading