diff --git a/Cargo.lock b/Cargo.lock
index 587c3196c21..6ed18958add 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -24,7 +24,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d122413f284cf2d62fb1b7db97e02edb8cda96d769b16e443a4f6195e35662b0"
dependencies = [
"crypto-common",
- "generic-array 0.14.7",
+ "generic-array",
]
[[package]]
@@ -50,7 +50,7 @@ version = "0.8.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a"
dependencies = [
- "cfg-if 1.0.0",
+ "cfg-if",
"const-random",
"getrandom 0.2.10",
"once_cell",
@@ -133,6 +133,28 @@ version = "1.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bddcadddf5e9015d310179a59bb28c4d4b9920ad0f11e8e14dbadf654890c9a6"
+[[package]]
+name = "async-stream"
+version = "0.3.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "cd56dd203fef61ac097dd65721a419ddccb106b2d2b70ba60a6b529f03961a51"
+dependencies = [
+ "async-stream-impl",
+ "futures-core",
+ "pin-project-lite",
+]
+
+[[package]]
+name = "async-stream-impl"
+version = "0.3.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.38",
+]
+
[[package]]
name = "async-trait"
version = "0.1.74"
@@ -162,6 +184,59 @@ version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
+[[package]]
+name = "axum"
+version = "0.6.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2fb79c228270dcf2426e74864cabc94babb5dbab01a4314e702d2f16540e1591"
+dependencies = [
+ "async-trait",
+ "axum-core",
+ "base64 0.21.5",
+ "bitflags 1.3.2",
+ "bytes",
+ "futures-util",
+ "http",
+ "http-body",
+ "hyper",
+ "itoa",
+ "matchit",
+ "memchr",
+ "mime",
+ "percent-encoding",
+ "pin-project-lite",
+ "rustversion",
+ "serde",
+ "serde_json",
+ "serde_path_to_error",
+ "serde_urlencoded",
+ "sha1",
+ "sync_wrapper",
+ "tokio",
+ "tokio-tungstenite",
+ "tower",
+ "tower-http",
+ "tower-layer",
+ "tower-service",
+]
+
+[[package]]
+name = "axum-core"
+version = "0.3.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "759fa577a247914fd3f7f76d62972792636412fbfd634cd452f6a385a74d2d2c"
+dependencies = [
+ "async-trait",
+ "bytes",
+ "futures-util",
+ "http",
+ "http-body",
+ "mime",
+ "rustversion",
+ "tower-layer",
+ "tower-service",
+]
+
[[package]]
name = "backtrace"
version = "0.3.69"
@@ -170,13 +245,19 @@ checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837"
dependencies = [
"addr2line",
"cc",
- "cfg-if 1.0.0",
+ "cfg-if",
"libc",
"miniz_oxide",
"object",
"rustc-demangle",
]
+[[package]]
+name = "base64"
+version = "0.13.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8"
+
[[package]]
name = "base64"
version = "0.21.5"
@@ -249,34 +330,13 @@ dependencies = [
"cty",
]
-[[package]]
-name = "block-buffer"
-version = "0.7.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b"
-dependencies = [
- "block-padding",
- "byte-tools",
- "byteorder",
- "generic-array 0.12.4",
-]
-
[[package]]
name = "block-buffer"
version = "0.10.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71"
dependencies = [
- "generic-array 0.14.7",
-]
-
-[[package]]
-name = "block-padding"
-version = "0.1.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5"
-dependencies = [
- "byte-tools",
+ "generic-array",
]
[[package]]
@@ -294,44 +354,18 @@ version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3"
-[[package]]
-name = "bstr"
-version = "1.7.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c79ad7fb2dd38f3dabd76b09c6a5a20c038fc0213ef1e9afd30eb777f120f019"
-dependencies = [
- "memchr",
- "serde",
-]
-
[[package]]
name = "bumpalo"
version = "3.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec"
-[[package]]
-name = "byte-tools"
-version = "0.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7"
-
[[package]]
name = "byteorder"
version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b"
-[[package]]
-name = "bytes"
-version = "0.4.12"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "206fdffcfa2df7cbe15601ef46c813fce0965eb3286db6b56c583b814b51c81c"
-dependencies = [
- "byteorder",
- "iovec",
-]
-
[[package]]
name = "bytes"
version = "1.5.0"
@@ -393,12 +427,6 @@ dependencies = [
"nom",
]
-[[package]]
-name = "cfg-if"
-version = "0.1.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"
-
[[package]]
name = "cfg-if"
version = "1.0.0"
@@ -411,7 +439,7 @@ version = "0.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c3613f74bd2eac03dad61bd53dbe620703d4371614fe0bc3b9f04dd36fe4e818"
dependencies = [
- "cfg-if 1.0.0",
+ "cfg-if",
"cipher",
"cpufeatures",
]
@@ -545,7 +573,7 @@ dependencies = [
name = "ckb-bin"
version = "0.113.0-pre"
dependencies = [
- "base64",
+ "base64 0.21.5",
"ckb-app-config",
"ckb-async-runtime",
"ckb-build-info",
@@ -798,7 +826,7 @@ dependencies = [
name = "ckb-gen-types"
version = "0.113.0-pre"
dependencies = [
- "cfg-if 1.0.0",
+ "cfg-if",
"ckb-error",
"ckb-fixed-hash",
"ckb-hash",
@@ -979,7 +1007,7 @@ version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "56ccb671c5921be8a84686e6212ca184cb1d7c51cadcdbfcbd1cc3f042f5dfb8"
dependencies = [
- "cfg-if 1.0.0",
+ "cfg-if",
]
[[package]]
@@ -1043,7 +1071,7 @@ dependencies = [
name = "ckb-miner"
version = "0.113.0-pre"
dependencies = [
- "base64",
+ "base64 0.21.5",
"ckb-app-config",
"ckb-async-runtime",
"ckb-channel",
@@ -1112,7 +1140,7 @@ dependencies = [
"tempfile",
"tentacle",
"tokio",
- "tokio-util 0.7.10",
+ "tokio-util",
"trust-dns-resolver",
]
@@ -1250,7 +1278,11 @@ dependencies = [
name = "ckb-rpc"
version = "0.113.0-pre"
dependencies = [
+ "async-stream",
+ "async-trait",
+ "axum",
"ckb-app-config",
+ "ckb-async-runtime",
"ckb-chain",
"ckb-chain-spec",
"ckb-constant",
@@ -1268,6 +1300,7 @@ dependencies = [
"ckb-pow",
"ckb-reward-calculator",
"ckb-shared",
+ "ckb-stop-handler",
"ckb-store",
"ckb-sync",
"ckb-systemtime",
@@ -1278,20 +1311,18 @@ dependencies = [
"ckb-util",
"ckb-verification",
"ckb-verification-traits",
+ "futures-util",
"itertools 0.11.0",
"jsonrpc-core",
- "jsonrpc-derive",
- "jsonrpc-http-server",
- "jsonrpc-pubsub",
- "jsonrpc-server-utils",
- "jsonrpc-tcp-server",
- "jsonrpc-ws-server",
+ "jsonrpc-utils",
"pretty_assertions",
"reqwest",
"serde",
"serde_json",
"tempfile",
"tokio",
+ "tokio-util",
+ "tower-http",
]
[[package]]
@@ -1387,7 +1418,7 @@ dependencies = [
"once_cell",
"rand 0.8.5",
"tokio",
- "tokio-util 0.7.10",
+ "tokio-util",
]
[[package]]
@@ -1529,7 +1560,7 @@ dependencies = [
"slab",
"tempfile",
"tokio",
- "tokio-util 0.7.10",
+ "tokio-util",
]
[[package]]
@@ -1537,7 +1568,7 @@ name = "ckb-types"
version = "0.113.0-pre"
dependencies = [
"bit-vec",
- "bytes 1.5.0",
+ "bytes",
"ckb-channel",
"ckb-constant",
"ckb-error",
@@ -1629,7 +1660,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0cc004a826b9bc9319ffae0b8415690e1b5f1482266d55fbd43843aa40ddcd63"
dependencies = [
"byteorder",
- "bytes 1.5.0",
+ "bytes",
"cc",
"ckb-vm-definitions",
"derive_more",
@@ -1773,7 +1804,7 @@ version = "1.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d"
dependencies = [
- "cfg-if 1.0.0",
+ "cfg-if",
]
[[package]]
@@ -1818,7 +1849,7 @@ version = "0.5.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200"
dependencies = [
- "cfg-if 1.0.0",
+ "cfg-if",
"crossbeam-utils",
]
@@ -1828,7 +1859,7 @@ version = "0.8.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef"
dependencies = [
- "cfg-if 1.0.0",
+ "cfg-if",
"crossbeam-epoch",
"crossbeam-utils",
]
@@ -1840,7 +1871,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7"
dependencies = [
"autocfg",
- "cfg-if 1.0.0",
+ "cfg-if",
"crossbeam-utils",
"memoffset",
"scopeguard",
@@ -1852,7 +1883,7 @@ version = "0.8.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294"
dependencies = [
- "cfg-if 1.0.0",
+ "cfg-if",
]
[[package]]
@@ -1867,7 +1898,7 @@ version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3"
dependencies = [
- "generic-array 0.14.7",
+ "generic-array",
"rand_core 0.6.4",
"typenum",
]
@@ -1942,7 +1973,7 @@ version = "4.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e77a43b28d0668df09411cb0bc9a8c2adc40f9a048afe863e05fd43251e8e39c"
dependencies = [
- "cfg-if 1.0.0",
+ "cfg-if",
"num_cpus",
]
@@ -1990,22 +2021,13 @@ version = "0.1.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8"
-[[package]]
-name = "digest"
-version = "0.8.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5"
-dependencies = [
- "generic-array 0.12.4",
-]
-
[[package]]
name = "digest"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066"
dependencies = [
- "generic-array 0.14.7",
+ "generic-array",
]
[[package]]
@@ -2014,7 +2036,7 @@ version = "0.10.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292"
dependencies = [
- "block-buffer 0.10.4",
+ "block-buffer",
"crypto-common",
"subtle",
]
@@ -2052,7 +2074,7 @@ version = "0.8.33"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1"
dependencies = [
- "cfg-if 1.0.0",
+ "cfg-if",
]
[[package]]
@@ -2107,12 +2129,6 @@ dependencies = [
"rand 0.7.3",
]
-[[package]]
-name = "fake-simd"
-version = "0.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed"
-
[[package]]
name = "faster-hex"
version = "0.6.1"
@@ -2210,25 +2226,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9564fc758e15025b46aa6643b1b77d047d1a56a1aea6e01002ac0c7026876213"
dependencies = [
"libc",
- "winapi 0.3.9",
-]
-
-[[package]]
-name = "fuchsia-zircon"
-version = "0.3.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82"
-dependencies = [
- "bitflags 1.3.2",
- "fuchsia-zircon-sys",
+ "winapi",
]
-[[package]]
-name = "fuchsia-zircon-sys"
-version = "0.3.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7"
-
[[package]]
name = "futures"
version = "0.3.28"
@@ -2269,7 +2269,6 @@ dependencies = [
"futures-core",
"futures-task",
"futures-util",
- "num_cpus",
]
[[package]]
@@ -2334,15 +2333,6 @@ dependencies = [
"byteorder",
]
-[[package]]
-name = "generic-array"
-version = "0.12.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ffdf9f34f1447443d37393cc6c2b8313aebddcd96906caf34e54c68d8e57d7bd"
-dependencies = [
- "typenum",
-]
-
[[package]]
name = "generic-array"
version = "0.14.7"
@@ -2359,7 +2349,7 @@ version = "0.1.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce"
dependencies = [
- "cfg-if 1.0.0",
+ "cfg-if",
"js-sys",
"libc",
"wasi 0.9.0+wasi-snapshot-preview1",
@@ -2372,7 +2362,7 @@ version = "0.2.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427"
dependencies = [
- "cfg-if 1.0.0",
+ "cfg-if",
"libc",
"wasi 0.11.0+wasi-snapshot-preview1",
]
@@ -2389,19 +2379,6 @@ version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b"
-[[package]]
-name = "globset"
-version = "0.4.13"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "759c97c1e17c55525b57192c06a267cda0ac5210b222d6b82189a2338fa1c13d"
-dependencies = [
- "aho-corasick",
- "bstr",
- "fnv",
- "log",
- "regex",
-]
-
[[package]]
name = "goblin"
version = "0.2.3"
@@ -2456,7 +2433,7 @@ version = "0.3.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "91fc23aa11be92976ef4729127f1a74adf36d8436f7816b185d18df956790833"
dependencies = [
- "bytes 1.5.0",
+ "bytes",
"fnv",
"futures-core",
"futures-sink",
@@ -2465,7 +2442,7 @@ dependencies = [
"indexmap 1.9.3",
"slab",
"tokio",
- "tokio-util 0.7.10",
+ "tokio-util",
"tracing",
]
@@ -2512,7 +2489,7 @@ version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1679e6ea370dee694f91f1dc469bf94cf8f52051d147aec3e1f9497c6fc22461"
dependencies = [
- "winapi 0.3.9",
+ "winapi",
]
[[package]]
@@ -2559,7 +2536,7 @@ checksum = "3c731c3e10504cc8ed35cfe2f1db4c9274c3d35fa486e3b31df46f068ef3e867"
dependencies = [
"libc",
"match_cfg",
- "winapi 0.3.9",
+ "winapi",
]
[[package]]
@@ -2568,7 +2545,7 @@ version = "0.2.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482"
dependencies = [
- "bytes 1.5.0",
+ "bytes",
"fnv",
"itoa",
]
@@ -2579,11 +2556,17 @@ version = "0.4.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1"
dependencies = [
- "bytes 1.5.0",
+ "bytes",
"http",
"pin-project-lite",
]
+[[package]]
+name = "http-range-header"
+version = "0.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0bfe8eed0a9285ef776bb792479ea3834e8b94e13d615c2f66d03dd50a435a29"
+
[[package]]
name = "httparse"
version = "1.8.0"
@@ -2608,7 +2591,7 @@ version = "0.14.27"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468"
dependencies = [
- "bytes 1.5.0",
+ "bytes",
"futures-channel",
"futures-core",
"futures-util",
@@ -2632,7 +2615,7 @@ version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905"
dependencies = [
- "bytes 1.5.0",
+ "bytes",
"hyper",
"native-tls",
"tokio",
@@ -2738,7 +2721,7 @@ version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5"
dependencies = [
- "generic-array 0.14.7",
+ "generic-array",
]
[[package]]
@@ -2747,16 +2730,7 @@ version = "0.1.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c"
dependencies = [
- "cfg-if 1.0.0",
-]
-
-[[package]]
-name = "iovec"
-version = "0.1.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e"
-dependencies = [
- "libc",
+ "cfg-if",
]
[[package]]
@@ -2767,7 +2741,7 @@ checksum = "f7e2f18aece9709094573a9f24f483c4f65caa4298e2f7ae1b71cc65d853fad7"
dependencies = [
"socket2 0.3.19",
"widestring",
- "winapi 0.3.9",
+ "winapi",
"winreg 0.6.2",
]
@@ -2861,102 +2835,33 @@ dependencies = [
]
[[package]]
-name = "jsonrpc-derive"
-version = "18.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5b939a78fa820cdfcb7ee7484466746a7377760970f6f9c6fe19f9edcc8a38d2"
-dependencies = [
- "proc-macro-crate",
- "proc-macro2",
- "quote",
- "syn 1.0.109",
-]
-
-[[package]]
-name = "jsonrpc-http-server"
-version = "18.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e1dea6e07251d9ce6a552abfb5d7ad6bc290a4596c8dcc3d795fae2bbdc1f3ff"
-dependencies = [
- "futures",
- "hyper",
- "jsonrpc-core",
- "jsonrpc-server-utils",
- "log",
- "net2",
- "parking_lot 0.11.2",
- "unicase",
-]
-
-[[package]]
-name = "jsonrpc-pubsub"
-version = "18.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "240f87695e6c6f62fb37f05c02c04953cf68d6408b8c1c89de85c7a0125b1011"
-dependencies = [
- "futures",
- "jsonrpc-core",
- "lazy_static",
- "log",
- "parking_lot 0.11.2",
- "rand 0.7.3",
- "serde",
-]
-
-[[package]]
-name = "jsonrpc-server-utils"
-version = "18.0.0"
+name = "jsonrpc-utils"
+version = "0.2.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fa4fdea130485b572c39a460d50888beb00afb3e35de23ccd7fad8ff19f0e0d4"
+checksum = "dfe6601e4eedf0730aebf2ad532cd22c05c67d3cb20105577dd12a5f004abd3b"
dependencies = [
- "bytes 1.5.0",
- "futures",
- "globset",
+ "anyhow",
+ "axum",
+ "futures-core",
+ "futures-util",
+ "hex",
"jsonrpc-core",
- "lazy_static",
- "log",
+ "jsonrpc-utils-macros",
+ "pin-project-lite",
+ "rand 0.8.5",
+ "serde_json",
"tokio",
- "tokio-stream",
- "tokio-util 0.6.10",
- "unicase",
]
[[package]]
-name = "jsonrpc-tcp-server"
-version = "18.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "60a0a0d35558123e93743d467285196905da1368500378cb5352b71856377874"
-dependencies = [
- "jsonrpc-core",
- "jsonrpc-server-utils",
- "log",
- "parking_lot 0.11.2",
- "tower-service",
-]
-
-[[package]]
-name = "jsonrpc-ws-server"
-version = "18.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f892c7d766369475ab7b0669f417906302d7c0fb521285c0a0c92e52e7c8e946"
-dependencies = [
- "futures",
- "jsonrpc-core",
- "jsonrpc-server-utils",
- "log",
- "parity-ws",
- "parking_lot 0.11.2",
- "slab",
-]
-
-[[package]]
-name = "kernel32-sys"
-version = "0.2.2"
+name = "jsonrpc-utils-macros"
+version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d"
+checksum = "34fe3ce66f7e4909575f6be478862325559bf5b5d0a681d106aae2c9849e1857"
dependencies = [
- "winapi 0.2.8",
- "winapi-build",
+ "proc-macro2",
+ "quote",
+ "syn 2.0.38",
]
[[package]]
@@ -2992,8 +2897,8 @@ version = "0.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f"
dependencies = [
- "cfg-if 1.0.0",
- "winapi 0.3.9",
+ "cfg-if",
+ "winapi",
]
[[package]]
@@ -3063,6 +2968,12 @@ version = "0.1.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5"
+[[package]]
+name = "matchit"
+version = "0.7.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b87248edafb776e59e6ee64a79086f65890d3510f2c656c000bf2a7e8a0aea40"
+
[[package]]
name = "memchr"
version = "2.6.4"
@@ -3093,7 +3004,7 @@ version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "171d2f700835121c3b04ccf0880882987a050fd5c7ae88148abf537d33dd3a56"
dependencies = [
- "cfg-if 1.0.0",
+ "cfg-if",
]
[[package]]
@@ -3140,25 +3051,6 @@ dependencies = [
"adler",
]
-[[package]]
-name = "mio"
-version = "0.6.23"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4afd66f5b91bf2a3bc13fad0e21caedac168ca4c707504e75585648ae80e4cc4"
-dependencies = [
- "cfg-if 0.1.10",
- "fuchsia-zircon",
- "fuchsia-zircon-sys",
- "iovec",
- "kernel32-sys",
- "libc",
- "log",
- "miow",
- "net2",
- "slab",
- "winapi 0.2.8",
-]
-
[[package]]
name = "mio"
version = "0.8.9"
@@ -3170,38 +3062,14 @@ dependencies = [
"windows-sys 0.48.0",
]
-[[package]]
-name = "mio-extras"
-version = "2.0.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "52403fe290012ce777c4626790c8951324a2b9e3316b3143779c72b029742f19"
-dependencies = [
- "lazycell",
- "log",
- "mio 0.6.23",
- "slab",
-]
-
-[[package]]
-name = "miow"
-version = "0.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ebd808424166322d4a38da87083bfddd3ac4c131334ed55856112eb06d46944d"
-dependencies = [
- "kernel32-sys",
- "net2",
- "winapi 0.2.8",
- "ws2_32-sys",
-]
-
[[package]]
name = "molecule"
version = "0.7.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d4fd9767ab5e5f2ea40f71ff4c8bdb633c50509052e093c2fdd0e390a749dfa3"
dependencies = [
- "bytes 1.5.0",
- "cfg-if 1.0.0",
+ "bytes",
+ "cfg-if",
"faster-hex",
]
@@ -3247,17 +3115,6 @@ dependencies = [
"tempfile",
]
-[[package]]
-name = "net2"
-version = "0.2.39"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b13b648036a2339d06de780866fbdfda0dde886de7b3af2ddeba8b14f4ee34ac"
-dependencies = [
- "cfg-if 0.1.10",
- "libc",
- "winapi 0.3.9",
-]
-
[[package]]
name = "nix"
version = "0.27.1"
@@ -3265,7 +3122,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053"
dependencies = [
"bitflags 2.4.1",
- "cfg-if 1.0.0",
+ "cfg-if",
"libc",
]
@@ -3393,12 +3250,6 @@ version = "11.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575"
-[[package]]
-name = "opaque-debug"
-version = "0.2.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c"
-
[[package]]
name = "opaque-debug"
version = "0.3.0"
@@ -3412,7 +3263,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6b8419dc8cc6d866deb801274bba2e6f8f6108c1bb7fcc10ee5ab864931dbb45"
dependencies = [
"bitflags 2.4.1",
- "cfg-if 1.0.0",
+ "cfg-if",
"foreign-types",
"libc",
"once_cell",
@@ -3459,24 +3310,6 @@ dependencies = [
"hashbrown 0.13.2",
]
-[[package]]
-name = "parity-ws"
-version = "0.11.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5983d3929ad50f12c3eb9a6743f19d691866ecd44da74c0a3308c3f8a56df0c6"
-dependencies = [
- "byteorder",
- "bytes 0.4.12",
- "httparse",
- "log",
- "mio 0.6.23",
- "mio-extras",
- "rand 0.7.3",
- "sha-1 0.8.2",
- "slab",
- "url",
-]
-
[[package]]
name = "parking_lot"
version = "0.11.2"
@@ -3504,12 +3337,12 @@ version = "0.8.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc"
dependencies = [
- "cfg-if 1.0.0",
+ "cfg-if",
"instant",
"libc",
"redox_syscall 0.2.16",
"smallvec",
- "winapi 0.3.9",
+ "winapi",
]
[[package]]
@@ -3519,7 +3352,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e"
dependencies = [
"backtrace",
- "cfg-if 1.0.0",
+ "cfg-if",
"libc",
"petgraph",
"redox_syscall 0.4.1",
@@ -3600,6 +3433,26 @@ dependencies = [
"siphasher",
]
+[[package]]
+name = "pin-project"
+version = "1.1.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422"
+dependencies = [
+ "pin-project-internal",
+]
+
+[[package]]
+name = "pin-project-internal"
+version = "1.1.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.38",
+]
+
[[package]]
name = "pin-project-lite"
version = "0.2.13"
@@ -3659,7 +3512,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8159bd90725d2df49889a078b54f4f79e87f1f8a8444194cdca81d38f5393abf"
dependencies = [
"cpufeatures",
- "opaque-debug 0.3.0",
+ "opaque-debug",
"universal-hash",
]
@@ -3695,15 +3548,6 @@ dependencies = [
"syn 2.0.38",
]
-[[package]]
-name = "proc-macro-crate"
-version = "0.1.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785"
-dependencies = [
- "toml",
-]
-
[[package]]
name = "proc-macro-error"
version = "1.0.4"
@@ -3743,7 +3587,7 @@ version = "0.13.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "449811d15fbdf5ceb5c1144416066429cf82316e2ec8ce0c1f6f8a02e7bbcf8c"
dependencies = [
- "cfg-if 1.0.0",
+ "cfg-if",
"fnv",
"lazy_static",
"memchr",
@@ -3797,7 +3641,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d98dc777a7a39b76b1a26ae9d3f691f4c1bc0455090aa0b64dfa8cb7fc34c135"
dependencies = [
"libc",
- "winapi 0.3.9",
+ "winapi",
]
[[package]]
@@ -3968,7 +3812,7 @@ version = "0.1.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f97f7665e51f23760e9e4949d454a4782c76ef954acaeec9d1b0f48a58e4529e"
dependencies = [
- "cfg-if 1.0.0",
+ "cfg-if",
"rustix",
"windows",
]
@@ -4014,8 +3858,8 @@ version = "0.11.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3e9ad3fe7488d7e34558a2033d45a0c90b72d97b4f80705666fea71472e2e6a1"
dependencies = [
- "base64",
- "bytes 1.5.0",
+ "base64 0.21.5",
+ "bytes",
"encoding_rs",
"futures-core",
"futures-util",
@@ -4094,7 +3938,7 @@ dependencies = [
"spin",
"untrusted",
"web-sys",
- "winapi 0.3.9",
+ "winapi",
]
[[package]]
@@ -4103,7 +3947,7 @@ version = "0.19.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7e2a3bcec1f113553ef1c88aae6c020a369d03d55b58de9869a0908930385091"
dependencies = [
- "cfg-if 1.0.0",
+ "cfg-if",
"ordered-multimap",
]
@@ -4141,6 +3985,12 @@ dependencies = [
"windows-sys 0.48.0",
]
+[[package]]
+name = "rustversion"
+version = "1.0.12"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4f3208ce4d8448b3f3e7d168a73f5e0c43a61e32930de3bceeccedb388b6bf06"
+
[[package]]
name = "rusty-fork"
version = "0.3.0"
@@ -4372,6 +4222,15 @@ dependencies = [
"serde",
]
+[[package]]
+name = "serde_path_to_error"
+version = "0.1.11"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f7f05c1d5476066defcdfacce1f52fc3cae3af1d3089727100c02ae92e5abbe0"
+dependencies = [
+ "serde",
+]
+
[[package]]
name = "serde_plain"
version = "0.3.0"
@@ -4393,25 +4252,13 @@ dependencies = [
"serde",
]
-[[package]]
-name = "sha-1"
-version = "0.8.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f7d94d0bede923b3cea61f3f1ff57ff8cdfd77b400fb8f9998949e0cf04163df"
-dependencies = [
- "block-buffer 0.7.3",
- "digest 0.8.1",
- "fake-simd",
- "opaque-debug 0.2.3",
-]
-
[[package]]
name = "sha-1"
version = "0.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f5058ada175748e33390e40e872bd0fe59a19f265d0158daa551c5a88a76009c"
dependencies = [
- "cfg-if 1.0.0",
+ "cfg-if",
"cpufeatures",
"digest 0.10.7",
]
@@ -4422,7 +4269,7 @@ version = "0.10.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba"
dependencies = [
- "cfg-if 1.0.0",
+ "cfg-if",
"cpufeatures",
"digest 0.10.7",
]
@@ -4433,7 +4280,7 @@ version = "0.10.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8"
dependencies = [
- "cfg-if 1.0.0",
+ "cfg-if",
"cpufeatures",
"digest 0.10.7",
]
@@ -4513,9 +4360,9 @@ version = "0.3.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "122e570113d28d773067fab24266b66753f6ea915758651696b6e35e49f88d6e"
dependencies = [
- "cfg-if 1.0.0",
+ "cfg-if",
"libc",
- "winapi 0.3.9",
+ "winapi",
]
[[package]]
@@ -4525,7 +4372,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d"
dependencies = [
"libc",
- "winapi 0.3.9",
+ "winapi",
]
[[package]]
@@ -4550,12 +4397,12 @@ version = "9.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "da7a2b3c2bc9693bcb40870c4e9b5bf0d79f9cb46273321bf855ec513e919082"
dependencies = [
- "base64",
+ "base64 0.21.5",
"digest 0.10.7",
"hex",
"miette",
"serde",
- "sha-1 0.10.1",
+ "sha-1",
"sha2",
"thiserror",
"xxhash-rust",
@@ -4601,13 +4448,19 @@ dependencies = [
"unicode-ident",
]
+[[package]]
+name = "sync_wrapper"
+version = "0.1.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160"
+
[[package]]
name = "tempfile"
version = "3.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cb94d2f3cc536af71caac6b6fcebf65860b347e7ce0cc9ebe8f70d3e521054ef"
dependencies = [
- "cfg-if 1.0.0",
+ "cfg-if",
"fastrand",
"redox_syscall 0.3.5",
"rustix",
@@ -4621,7 +4474,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6ffbbdb4f54a9605ceda168884efcf5fb24ef655103362af211e6cfe61eff832"
dependencies = [
"async-trait",
- "bytes 1.5.0",
+ "bytes",
"futures",
"igd",
"js-sys",
@@ -4637,11 +4490,11 @@ dependencies = [
"tentacle-secio",
"thiserror",
"tokio",
- "tokio-util 0.7.10",
+ "tokio-util",
"tokio-yamux",
"wasm-bindgen",
"wasm-bindgen-futures",
- "winapi 0.3.9",
+ "winapi",
]
[[package]]
@@ -4651,7 +4504,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "895b25a7de42f7bba27b011495a4a48ea7f0591c079f59c8fdb07936ca8aa3d1"
dependencies = [
"bs58",
- "bytes 1.5.0",
+ "bytes",
"serde",
"sha2",
"unsigned-varint",
@@ -4664,7 +4517,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "78a41abd9ae459d1f744f59670d8f4e9a25c4597b12b9060740fbd17bf9687fc"
dependencies = [
"bs58",
- "bytes 1.5.0",
+ "bytes",
"chacha20poly1305",
"futures",
"hmac",
@@ -4679,7 +4532,7 @@ dependencies = [
"secp256k1",
"sha2",
"tokio",
- "tokio-util 0.7.10",
+ "tokio-util",
"unsigned-varint",
"x25519-dalek",
]
@@ -4730,7 +4583,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f0ec81c46e9eb50deaa257be2f148adf052d1fb7701cfd55ccfab2525280b70b"
dependencies = [
"libc",
- "winapi 0.3.9",
+ "winapi",
]
[[package]]
@@ -4834,9 +4687,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4f38200e3ef7995e5ef13baec2f432a6da0aa9ac495b2c0e8f3b7eec2c92d653"
dependencies = [
"backtrace",
- "bytes 1.5.0",
+ "bytes",
"libc",
- "mio 0.8.9",
+ "mio",
"num_cpus",
"parking_lot 0.12.1",
"pin-project-lite",
@@ -4879,17 +4732,15 @@ dependencies = [
]
[[package]]
-name = "tokio-util"
-version = "0.6.10"
+name = "tokio-tungstenite"
+version = "0.18.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "36943ee01a6d67977dd3f84a5a1d2efeb4ada3a1ae771cadfaa535d9d9fc6507"
+checksum = "54319c93411147bced34cb5609a80e0a8e44c5999c93903a81cd866630ec0bfd"
dependencies = [
- "bytes 1.5.0",
- "futures-core",
- "futures-sink",
+ "futures-util",
"log",
- "pin-project-lite",
"tokio",
+ "tungstenite",
]
[[package]]
@@ -4898,7 +4749,7 @@ version = "0.7.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15"
dependencies = [
- "bytes 1.5.0",
+ "bytes",
"futures-core",
"futures-sink",
"pin-project-lite",
@@ -4912,12 +4763,12 @@ version = "0.3.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f2ed88a04bfbf9e70343a5748a423200ee0591c55e7e487d784a55ee8af17db9"
dependencies = [
- "bytes 1.5.0",
+ "bytes",
"futures",
"log",
"nohash-hasher",
"tokio",
- "tokio-util 0.7.10",
+ "tokio-util",
]
[[package]]
@@ -4929,6 +4780,48 @@ dependencies = [
"serde",
]
+[[package]]
+name = "tower"
+version = "0.4.13"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c"
+dependencies = [
+ "futures-core",
+ "futures-util",
+ "pin-project",
+ "pin-project-lite",
+ "tokio",
+ "tower-layer",
+ "tower-service",
+ "tracing",
+]
+
+[[package]]
+name = "tower-http"
+version = "0.3.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f873044bf02dd1e8239e9c1293ea39dad76dc594ec16185d0a1bf31d8dc8d858"
+dependencies = [
+ "bitflags 1.3.2",
+ "bytes",
+ "futures-core",
+ "futures-util",
+ "http",
+ "http-body",
+ "http-range-header",
+ "pin-project-lite",
+ "tokio",
+ "tower",
+ "tower-layer",
+ "tower-service",
+]
+
+[[package]]
+name = "tower-layer"
+version = "0.3.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0"
+
[[package]]
name = "tower-service"
version = "0.3.2"
@@ -4941,6 +4834,7 @@ version = "0.1.40"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef"
dependencies = [
+ "log",
"pin-project-lite",
"tracing-core",
]
@@ -4961,7 +4855,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ca94d4e9feb6a181c690c4040d7a24ef34018d8313ac5044a61d21222ae24e31"
dependencies = [
"async-trait",
- "cfg-if 1.0.0",
+ "cfg-if",
"data-encoding",
"enum-as-inner",
"futures-channel",
@@ -4985,7 +4879,7 @@ version = "0.20.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ecae383baad9995efaa34ce8e57d12c3f305e545887472a492b838f4b5cfb77a"
dependencies = [
- "cfg-if 1.0.0",
+ "cfg-if",
"futures-util",
"ipconfig",
"lazy_static",
@@ -5005,6 +4899,25 @@ version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed"
+[[package]]
+name = "tungstenite"
+version = "0.18.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "30ee6ab729cd4cf0fd55218530c4522ed30b7b6081752839b68fcec8d0960788"
+dependencies = [
+ "base64 0.13.1",
+ "byteorder",
+ "bytes",
+ "http",
+ "httparse",
+ "log",
+ "rand 0.8.5",
+ "sha1",
+ "thiserror",
+ "url",
+ "utf-8",
+]
+
[[package]]
name = "typenum"
version = "1.17.0"
@@ -5035,15 +4948,6 @@ version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94"
-[[package]]
-name = "unicase"
-version = "2.7.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89"
-dependencies = [
- "version_check",
-]
-
[[package]]
name = "unicode-bidi"
version = "0.3.13"
@@ -5111,6 +5015,12 @@ dependencies = [
"serde",
]
+[[package]]
+name = "utf-8"
+version = "0.7.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9"
+
[[package]]
name = "utf8parse"
version = "0.2.1"
@@ -5185,7 +5095,7 @@ version = "0.2.87"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342"
dependencies = [
- "cfg-if 1.0.0",
+ "cfg-if",
"wasm-bindgen-macro",
]
@@ -5210,7 +5120,7 @@ version = "0.4.37"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03"
dependencies = [
- "cfg-if 1.0.0",
+ "cfg-if",
"js-sys",
"wasm-bindgen",
"web-sys",
@@ -5279,12 +5189,6 @@ version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7f44b95f62d34113cf558c93511ac93027e03e9c29a60dd0fd70e6e025c7270a"
-[[package]]
-name = "winapi"
-version = "0.2.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a"
-
[[package]]
name = "winapi"
version = "0.3.9"
@@ -5295,12 +5199,6 @@ dependencies = [
"winapi-x86_64-pc-windows-gnu",
]
-[[package]]
-name = "winapi-build"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc"
-
[[package]]
name = "winapi-i686-pc-windows-gnu"
version = "0.4.0"
@@ -5313,7 +5211,7 @@ version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596"
dependencies = [
- "winapi 0.3.9",
+ "winapi",
]
[[package]]
@@ -5479,7 +5377,7 @@ version = "0.6.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b2986deb581c4fe11b621998a5e53361efe6b48a151178d0cd9eeffa4dc6acc9"
dependencies = [
- "winapi 0.3.9",
+ "winapi",
]
[[package]]
@@ -5488,20 +5386,10 @@ version = "0.50.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1"
dependencies = [
- "cfg-if 1.0.0",
+ "cfg-if",
"windows-sys 0.48.0",
]
-[[package]]
-name = "ws2_32-sys"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e"
-dependencies = [
- "winapi 0.2.8",
- "winapi-build",
-]
-
[[package]]
name = "x25519-dalek"
version = "1.1.1"
diff --git a/ckb-bin/src/subcommand/run.rs b/ckb-bin/src/subcommand/run.rs
index fd6355af330..64185401926 100644
--- a/ckb-bin/src/subcommand/run.rs
+++ b/ckb-bin/src/subcommand/run.rs
@@ -12,7 +12,6 @@ pub fn run(args: RunArgs, version: Version, async_handle: Handle) -> Result<(),
deadlock_detection();
info!("ckb version: {}", version);
-
let mut launcher = Launcher::new(args, version, async_handle);
let block_assembler_config = launcher.sanitize_block_assembler_config()?;
@@ -45,7 +44,7 @@ pub fn run(args: RunArgs, version: Version, async_handle: Handle) -> Result<(),
launcher.start_block_filter(&shared);
- let (network_controller, _rpc_server) = launcher.start_network_and_rpc(
+ let network_controller = launcher.start_network_and_rpc(
&shared,
chain_controller.clone(),
miner_enable,
diff --git a/rpc/Cargo.toml b/rpc/Cargo.toml
index eaf36a7eed4..adf0bb27ea1 100644
--- a/rpc/Cargo.toml
+++ b/rpc/Cargo.toml
@@ -17,19 +17,14 @@ ckb-shared = { path = "../shared", version = "= 0.113.0-pre" }
ckb-store = { path = "../store", version = "= 0.113.0-pre" }
ckb-sync = { path = "../sync", version = "= 0.113.0-pre" }
ckb-chain = { path = "../chain", version = "= 0.113.0-pre" }
-ckb-logger = { path = "../util/logger", version = "= 0.113.0-pre"}
-ckb-logger-service = { path = "../util/logger-service", version = "= 0.113.0-pre"}
+ckb-logger = { path = "../util/logger", version = "= 0.113.0-pre" }
+ckb-logger-service = { path = "../util/logger-service", version = "= 0.113.0-pre" }
ckb-network-alert = { path = "../util/network-alert", version = "= 0.113.0-pre" }
ckb-app-config = { path = "../util/app-config", version = "= 0.113.0-pre" }
ckb-constant = { path = "../util/constant", version = "= 0.113.0-pre" }
jsonrpc-core = "18.0"
-jsonrpc-derive = "18.0"
-jsonrpc-http-server = "18.0"
-jsonrpc-tcp-server = "18.0"
-jsonrpc-ws-server = "18.0"
-jsonrpc-server-utils = "18.0"
-jsonrpc-pubsub = "18.0"
serde_json = "1.0"
+jsonrpc-utils = { version = "0.2.6", features = ["server", "macros", "axum"] }
ckb-jsonrpc-types = { path = "../util/jsonrpc-types", version = "= 0.113.0-pre" }
ckb-verification = { path = "../verification", version = "= 0.113.0-pre" }
ckb-verification-traits = { path = "../verification/traits", version = "= 0.113.0-pre" }
@@ -43,8 +38,16 @@ ckb-tx-pool = { path = "../tx-pool", version = "= 0.113.0-pre" }
ckb-memory-tracker = { path = "../util/memory-tracker", version = "= 0.113.0-pre" }
ckb-pow = { path = "../pow", version = "= 0.113.0-pre" }
ckb-indexer = { path = "../util/indexer", version = "= 0.113.0-pre" }
+ckb-stop-handler = { path = "../util/stop-handler", version = "= 0.113.0-pre" }
itertools.workspace = true
tokio = "1"
+async-trait = "0.1"
+axum = "0.6.1"
+tokio-util = { version = "0.7.3", features = ["codec"] }
+futures-util = { version = "0.3.21" }
+tower-http = { version = "0.3.5", features = ["timeout"] }
+async-stream = "0.3.3"
+ckb-async-runtime = { path = "../util/runtime", version = "= 0.113.0-pre" }
[dev-dependencies]
reqwest = { version = "=0.11.20", features = ["blocking", "json"] }
diff --git a/rpc/README.md b/rpc/README.md
index 3dec06f930e..a243ae33ba0 100644
--- a/rpc/README.md
+++ b/rpc/README.md
@@ -99,7 +99,6 @@ The crate `ckb-rpc`'s minimum supported rustc version is 1.71.1.
* [Method `get_deployments_info`](#method-get_deployments_info)
* [Module Subscription](#module-subscription)
* [Method `subscribe`](#method-subscribe)
- * [Method `unsubscribe`](#method-unsubscribe)
* [RPC Errors](#rpc-errors)
* [RPC Types](#rpc-types)
* [Type `Alert`](#type-alert)
@@ -4956,7 +4955,7 @@ The type of the `params.result` in the push message is a two-elements array, whe
###### Examples
-Request
+Subscribe Request
```
@@ -4971,32 +4970,19 @@ Request
```
-Response
+Subscribe Response
```
{
"id": 42,
"jsonrpc": "2.0",
- "result": "0x2a"
+ "result": "0xf3"
}
```
-#### Method `unsubscribe`
-* `unsubscribe(id)`
- * `id`: `string`
-* result: `boolean`
-
-Unsubscribes from a subscribed topic.
-
-###### Params
-
-* `id` - Subscription ID
-
-###### Examples
-
-Request
+Unsubscribe Request
```
@@ -5005,13 +4991,13 @@ Request
"jsonrpc": "2.0",
"method": "unsubscribe",
"params": [
- "0x2a"
+ "0xf3"
]
}
```
-Response
+Unsubscribe Response
```
diff --git a/rpc/src/lib.rs b/rpc/src/lib.rs
index ebbd2227e4b..3156c6003f4 100644
--- a/rpc/src/lib.rs
+++ b/rpc/src/lib.rs
@@ -10,9 +10,12 @@ pub mod module;
#[cfg(test)]
mod tests;
+use jsonrpc_core::MetaIoHandler;
+use jsonrpc_utils::pub_sub::Session;
+
pub use crate::error::RPCError;
pub use crate::server::RpcServer;
pub use crate::service_builder::ServiceBuilder;
#[doc(hidden)]
-pub type IoHandler = jsonrpc_pubsub::PubSubHandler