Skip to content

Commit

Permalink
Add an example of native provider
Browse files Browse the repository at this point in the history
  • Loading branch information
Ma233 committed Jan 3, 2024
1 parent 476255d commit 747df16
Show file tree
Hide file tree
Showing 19 changed files with 271 additions and 118 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/qaci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ jobs:
run: cargo test --all --verbose

build_ffi:
name: Build and test for ffi
name: Build and test for examples
timeout-minutes: 20
strategy:
matrix:
Expand Down Expand Up @@ -124,9 +124,12 @@ jobs:
with:
python-version: "3.11"

- name: Smoke test
- name: Smoke test ffi
run: pip install wheel && pip install web3 cffi && python examples/ffi/rings.py

- name: Smoke test native
run: cargo run -p rings-native-example

rustfmt_and_clippy:
name: Check rustfmt style && run clippy
timeout-minutes: 10
Expand Down
97 changes: 54 additions & 43 deletions Cargo.lock

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

4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[workspace]
resolver = "2"
members = ["core", "transport", "node", "rpc", "derive"]
members = ["core", "transport", "node", "rpc", "derive", "examples/native"]

[workspace.package]
version = "0.5.2"
Expand All @@ -10,10 +10,12 @@ authors = ["RND <[email protected]>"]
repository = "https://github.com/RingsNetwork/rings-node"

[workspace.dependencies]
async-trait = "0.1.77"
js-sys = "0.3.64"
jsonrpc-core = "18.0.0"
rings-core = { path = "core", default-features = false }
rings-derive = { path = "derive", default-features = false }
rings-node = { path = "node" }
rings-rpc = { path = "rpc", default-features = false }
rings-transport = { path = "transport" }
serde-wasm-bindgen = "0.6.1"
Expand Down
2 changes: 1 addition & 1 deletion core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ arrayref = "0.3.6"
async-lock = "2.5.0"
async-recursion = "1.0.0"
async-stream = "0.3.2"
async-trait = "0.1.52"
async-trait = { workspace = true }
base58 = "0.2.0"
base58-monero = { version = "0.3", default-features = false, features = ["check"] }
bincode = "1.3.3"
Expand Down
1 change: 0 additions & 1 deletion examples/ffi/rings.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import platform
import re
import time
Expand Down
14 changes: 14 additions & 0 deletions examples/native/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[package]
name = "rings-native-example"
version.workspace = true
edition.workspace = true
license.workspace = true
authors.workspace = true
repository.workspace = true

[dependencies]
async-trait = { workspace = true }
rings-core = { workspace = true }
rings-node = { workspace = true }
rings-rpc = { workspace = true }
tokio = { version = "1.13.0", features = ["full"] }
Loading

0 comments on commit 747df16

Please sign in to comment.