Skip to content

Commit

Permalink
feat: create soroban-rpc crate
Browse files Browse the repository at this point in the history
  • Loading branch information
willemneal committed Nov 21, 2023
1 parent 5c4130c commit db5cec8
Show file tree
Hide file tree
Showing 25 changed files with 2,382 additions and 109 deletions.
55 changes: 50 additions & 5 deletions Cargo.lock

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

29 changes: 27 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,29 +56,54 @@ rev = "fb422beae0d4944dc0e83559a8940b31f5ebd89d"
version = "20.0.0-rc4"
path = "cmd/soroban-cli"

[workspace.dependencies.soroban-rpc]
version = "20.0.0-rc4"
path = "cmd/crates/soroban-rpc"

[workspace.dependencies.stellar-xdr]
version = "20.0.0-rc1"
git = "https://github.com/stellar/rs-stellar-xdr"
rev = "9c97e4fa909a0b6455547a4f4a95800696b2a69a"
default-features = true

[workspace.dependencies]
stellar-strkey = "0.0.7"
sep5 = "0.0.2"
base64 = "0.21.2"
thiserror = "1.0.46"
sha2 = "0.10.7"
ethnum = "1.3.2"
hex = "0.4.3"
itertools = "0.10.0"
sep5 = "0.0.2"

serde-aux = "4.1.2"
serde_json = "1.0.82"
serde = "1.0.82"
stellar-strkey = "0.0.7"

clap = { version = "4.1.8", features = [
"derive",
"env",
"deprecated",
"string",
] }
clap_complete = "4.1.4"

tracing = "0.1.37"
tracing-subscriber = "0.3.16"
tracing-appender = "0.2.2"
which = "4.4.0"
wasmparser = "0.90.0"
directories = "5.0.1"
termcolor = "1.1.3"
termcolor_output = "1.0.1"
ed25519-dalek = "2.0.0"

# networking
http = "1.0.0"
jsonrpsee-http-client = "0.20.1"
jsonrpsee-core = "0.20.1"
tokio = "1.28.1"



# [patch."https://github.com/stellar/rs-soroban-env"]
Expand Down
59 changes: 59 additions & 0 deletions cmd/crates/soroban-rpc/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
[package]
name = "soroban-rpc"
description = "Soroban RPC client for rust"
homepage = "https://github.com/stellar/soroban-tools"
repository = "https://github.com/stellar/soroban-tools"
authors = ["Stellar Development Foundation <[email protected]>"]
license = "Apache-2.0"
readme = "README.md"
version.workspace = true
edition = "2021"
rust-version = "1.70"
autobins = false


[lib]
crate-type = ["rlib"]


[dependencies]
soroban-sdk = { workspace = true }
soroban-spec-tools = { workspace = true }

soroban-env-host = { workspace = true }
stellar-strkey = { workspace = true }
stellar-xdr = { workspace = true, features = ["curr", "std", "serde"] }
soroban-spec = { workspace = true }


termcolor = { workspace = true }
termcolor_output = { wokspace = true }
clap = { workspace = true }

serde_json = { workspace = true }
serde-aux = { workspace = true }
itertools = { workspace = true }
ethnum = { workspace = true }
hex = { workspace = true }
wasmparser = { workspace = true }
base64 = { workspace = true }
thiserror = { worspace = true }
serde = { workspace = true }
tokio = { workspace = true }
sha2 = { workspace = true }
ed25519-dalek = { workspace = true }
tracing = { workspace = true }


# networking
jsonrpsee-http-client = { workspace = true }
jsonrpsee-core = { workspace = true }
http = { workspace = true }

# soroban-ledger-snapshot = { workspace = true }
# soroban-sdk = { workspace = true }
# sep5 = { workspace = true }


[dev-dependencies]
which = { workspace = true }
3 changes: 3 additions & 0 deletions cmd/crates/soroban-rpc/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# soroban-rpc

Tools and utilities for soroban rpc.
39 changes: 39 additions & 0 deletions cmd/crates/soroban-rpc/src/fixtures/event_response.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"events": [{
"eventType": "system",
"ledger": "43601283",
"ledgerClosedAt": "2022-11-16T16:10:41Z",
"contractId": "CDR6QKTWZQYW6YUJ7UP7XXZRLWQPFRV6SWBLQS4ZQOSAF4BOUD77OO5Z",
"id": "0164090849041387521-0000000003",
"pagingToken": "164090849041387521-3",
"topic": [
"AAAABQAAAAh0cmFuc2Zlcg==",
"AAAAAQB6Mcc="
],
"value": "AAAABQAAAApHaWJNb255UGxzAAA="
}, {
"eventType": "contract",
"ledger": "43601284",
"ledgerClosedAt": "2022-11-16T16:10:41Z",
"contractId": "CDR6QKTWZQYW6YUJ7UP7XXZRLWQPFRV6SWBLQS4ZQOSAF4BOUD77OO5Z",
"id": "0164090849041387521-0000000003",
"pagingToken": "164090849041387521-3",
"topic": [
"AAAABQAAAAh0cmFuc2Zlcg==",
"AAAAAQB6Mcc="
],
"value": "AAAABQAAAApHaWJNb255UGxzAAA="
}, {
"eventType": "system",
"ledger": "43601285",
"ledgerClosedAt": "2022-11-16T16:10:41Z",
"contractId": "CCR6QKTWZQYW6YUJ7UP7XXZRLWQPFRV6SWBLQS4ZQOSAF4BOUD77OTE2",
"id": "0164090849041387521-0000000003",
"pagingToken": "164090849041387521-3",
"topic": [
"AAAABQAAAAh0cmFuc2Zlcg==",
"AAAAAQB6Mcc="
],
"value": "AAAABQAAAApHaWJNb255UGxzAAA="
}]
}
Loading

0 comments on commit db5cec8

Please sign in to comment.