- 04 Oct, 2022 1 commit
-
-
Niklas Adolfsson authored
* server: add protocol details to logger trait * fix tests
-
- 13 Sep, 2022 1 commit
-
-
Niklas Adolfsson authored
* ws server: support both http and ws * clean things up * ws server: add http logger and ws logger * more cleanup * fix nits * middleware example * remove http and ws server crates * move things around * some minor fixes * fix stop in http context * fix tests * fix features * use header constants * remove access_control & expose only host filtering CORS has been removed to tower middleware and doesn't need to supported anymore * fix merge logging traits + move to server * supress warnings faulty dead code * remove unwrap * support http2 * doesnt work * feat: simpler stop handling * Update server/src/future.rs * some cleanup * Update server/src/future.rs Co-authored-by:
Alexandru Vasile <60601340+lexnv@users.noreply.github.com> * Update server/src/future.rs Co-authored-by:
Alexandru Vasile <60601340+lexnv@users.noreply.github.com> * fix nits * address grumbles * commit examples and nits * clarify comment * remove noise * remove impl Future for ServerHandle * remove needless async {} * add http2 test * add ServerBuilder::build_from_tcp * fix super nit: no more Option<SocketAddr> * fix Option<SocketAddr> * Update server/src/future.rs Co-authored-by:
Alexandru Vasile <60601340+lexnv@users.noreply.github.com> * Update server/src/future.rs Co-authored-by:
Alexandru Vasile <60601340+lexnv@users.noreply.github.com> Co-authored-by:
Alexandru Vasile <60601340+lexnv@users.noreply.github.com>
-
- 06 Sep, 2022 1 commit
-
-
Alexandru Vasile authored
* core: Fix doc typo Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * types: Implement generic `ParamBuilder` for RPC parameters Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * types: Add specialized RPC parameter builder for arrays and maps Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * types: Implement parameter builder for batch requests Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * types: Implement `rpc_params` in the `types` crate Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * core: Adjust `ClientT` for generic efficient parameters Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * proc-macro: Render clients using the parameter builders Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Adjust testing to the `ToRpcParams` interface Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * core: Move `rpc_params` to core and simplify testing Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * core: Rename server's trait to `ToRpcServerParams` Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * bench: Adjust benches to the `ToRpcParams` interface Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Fix clippy Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * types: Rename batch builder to `BatchRequestBuilder` Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * examples: Re-enable proc-macro example Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * types: Fix doc tests and add panic documentation Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * core: Fix documentation link Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * client: Use BatchRequestBuilder as parameter for batch requests Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Update core/src/server/rpc_module.rs Co-authored-by:
Niklas Adolfsson <niklasadolfsson1@gmail.com> * Update core/src/server/rpc_module.rs Co-authored-by:
Niklas Adolfsson <niklasadolfsson1@gmail.com> * types: Add specialized constructors for internal `ParamsBuilder` Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * types: Implement `EmptyParams` for client's parameters Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * tests: Fix macos disabled test Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * types: Improve comment Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Fix clippy Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * benches: Rename functions Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * types: Rename param types to `ArrayParams` and `ObjectParams` Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Move paramters to core crate Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * core: Return `core::Error` from `ToRpcParams` trait Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Fix doc link Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Fix `ArrayParamsBuilder` doc links Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Remove `ToRpcServerParams` trait Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * core: Fix `ToRpcParams` docs Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Remove `ParamsSer` and extend benchmarking Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * core: Optimise `rpc_params` to avoid allocation on error Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * params: zero allocation for empty params Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * examples: Add copyright back Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * traits: Remove empty doc line Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Update core/src/traits.rs Co-authored-by:
James Wilson <james@jsdw.me> * Update core/src/traits.rs Co-authored-by:
James Wilson <james@jsdw.me> * examples: Restore `proc_macro` example to origin/master Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * core: Remove empty case for `rpc_params` macro Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> Co-authored-by:
Niklas Adolfsson <niklasadolfsson1@gmail.com> Co-authored-by:
James Wilson <james@jsdw.me>
-
- 04 Aug, 2022 1 commit
-
-
Alexandru Vasile authored
* Rename Middleware to Metrics Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Change documentation to reflect the `Metrics` trait Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Middleware name refactoring Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Http middleware renaming Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Rename examples Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Update http-server/src/server.rs Co-authored-by:
James Wilson <james@jsdw.me> * http: Use `request` instead of `HeaderMap` for logging Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Rename `Metrics` -> `Logger` Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Fix cargo clippy Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Fix examples Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Fix tests Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Fix cargo fmt Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Fix hyper dependency Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> Co-authored-by:
James Wilson <james@jsdw.me>
-
- 20 Jul, 2022 1 commit
-
-
Niklas Adolfsson authored
-
- 06 Jul, 2022 1 commit
-
-
Niklas Adolfsson authored
* WIP: refactoring * refactor http server * fix tests * Delete TODO.txt * fix tests again * add benches/src/lib.rs * remove bench changes; fast less deps * no more env_logger * update examples * ws server; expose headers in middleware * add back uncommented code * fix nits * make the code more readable * add back the tracing stuff * simplify code but one extra clone * fix tests again * revert async accept API * fix nits * different traits for WS and HTTP middleware * fix tests * revert benchmark change * Update core/src/server/helpers.rs * Update ws-server/Cargo.toml * add limit to batch responses as well * pre-allocate string for batches * small refactor
-
- 13 May, 2022 1 commit
-
-
Alexandru Vasile authored
* Move examples under dedicated folder to simplify `Cargo.toml` Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Fix readme links for examples Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Fix deadlinks Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io>
-
- 20 Dec, 2021 1 commit
-
-
Niklas Adolfsson authored
* extract ws client to async client * bring back jsonrpsee-ws-client crate * new crate core client * add missing file * jsonrpsee crate: add core client * rexport core client * more re-exports * downgrade trait bounds * update version * fix nits * send close reason * Update types/src/traits.rs * move 'TEN_MB_CONST' to core * Update client/core-client/Cargo.toml Co-authored-by:
David <dvdplm@gmail.com> * Update client/core-client/src/lib.rs Co-authored-by:
David <dvdplm@gmail.com> * cargo fmt * Update client/ws-client/src/lib.rs Co-authored-by:
David <dvdplm@gmail.com> * Update client/ws-client/src/lib.rs Co-authored-by:
David <dvdplm@gmail.com> * move `async-client` core The `async-client` is hidden behind a new feature flag `async-client` because it brings in additional dependecies such as tokio rt. * fix docs * add example how to use "core client" * fix build * Update http-server/Cargo.toml * Update client/transport/Cargo.toml Co-authored-by:
David <dvdplm@gmail.com>
-
- 17 Dec, 2021 1 commit
-
-
Maciej Hirsz authored
* Nuke V2 * fmt * Formatting and imports * Updated benches * Fix doc comment link * Brace imports in ws-server * Reworking imports * std first * fmt * std on top * Update to match changed line numbers * Rename jsonrpsee_utils -> jsonrpsee_core * Migrating things types -> core * RpcError -> ErrorResponse * Merge types::client into core::client * Continued move types -> core * Removing features to make checks pass * Move rpc_module tests to tests crate * Fixed doc comment links * Add futures-util dependency for client * Remove dead code Co-authored-by:
Niklas Adolfsson <niklasadolfsson1@gmail.com> * fmt * Feature gate the Client trait * Move `Client` traits to `client` module Co-authored-by:
Niklas Adolfsson <niklasadolfsson1@gmail.com>
-
- 01 Dec, 2021 1 commit
-
-
Maciej Hirsz authored
* Squashed MethodSink * Middleware WIP * Passing all the information through * Unnecessary `false` * Apply suggestions from code review Co-authored-by:
David <dvdplm@gmail.com> * Add a setter for middleware (#577) * Fix try-build tests * Add a middleware setter and an example * Actually add the example * Grumbles * Use an atomic * Set middleware with a constructor instead * Resolve a todo * Update ws-server/src/server.rs Co-authored-by:
Maciej Hirsz <1096222+maciejhirsz@users.noreply.github.com> * Update ws-server/src/server.rs Co-authored-by:
Maciej Hirsz <1096222+maciejhirsz@users.noreply.github.com> * Update ws-server/src/server.rs Co-authored-by:
Maciej Hirsz <1096222+maciejhirsz@users.noreply.github.com> Co-authored-by:
Maciej Hirsz <1096222+maciejhirsz@users.noreply.github.com> * Middleware::on_response for batches * Middleware in HTTP * fmt * Server builder for HTTP * Use actual time in the example * HTTP example * Middleware to capture method not found calls * An example of adding multiple middlewares. (#581) * Add an example of adding multiple middlewares. * Update examples/multi-middleware.rs Co-authored-by:
Maciej Hirsz <1096222+maciejhirsz@users.noreply.github.com> * Update examples/Cargo.toml Co-authored-by:
Maciej Hirsz <1096222+maciejhirsz@users.noreply.github.com> Co-authored-by:
Maciej Hirsz <1096222+maciejhirsz@users.noreply.github.com> * Move `Middleware` to jsonrpsee-types (#582) * Move `Middleware` to jsonrpsee-types * Move Middleware trait to jsonrpsee-types * Add some docs. * Link middleware to `with_middleware` methods in docs * Doctests * Doc comment fixed * Clean up a TODO * Switch back to `set_middleware` * fmt * Tests * Add `on_connect` and `on_disconnect` * Add note to future selves Co-authored-by:
David <dvdplm@gmail.com>
-
- 09 Nov, 2021 1 commit
-
-
Niklas Adolfsson authored
* ws server: don't kill connection max limit exceeds * Update ws-server/src/server.rs * actually use max size in soketto * rewrite me * improve logs * use soketto fix * rewrite me * fix nit * revert unintentional change * use soketto 0.7.1 * fix logger * Update ws-server/src/server.rs Co-authored-by:
David <dvdplm@gmail.com> * Update ws-server/src/server.rs Co-authored-by:
David <dvdplm@gmail.com> * Update ws-server/src/server.rs Co-authored-by:
David <dvdplm@gmail.com> * Update ws-server/src/server.rs Co-authored-by:
David <dvdplm@gmail.com> * Update ws-server/src/server.rs Co-authored-by:
David <dvdplm@gmail.com> * fix build Co-authored-by:
David <dvdplm@gmail.com>
-
- 15 Oct, 2021 1 commit
-
-
Niklas Adolfsson authored
-
- 11 Oct, 2021 2 commits
-
-
Niklas Adolfsson authored
* fix(ParamsSer): serialize to empty array Serialize `ParamsSer::NoParams` to an empty array inorder to comply with the jsonrpc v2 spec. * fix tests * remove ParamsSer::NoParams * address grumbles: adjust rpc params macro
-
Maciej Hirsz authored
* Squash post merge * RAII claims and some comments * Adding resources to Methods * Use arrays for claiming all resources at once * Register resources on ws-server * Return MethodResourcesBuilder from register_method * Return MethodResourcesBuilder from register_async_method * fmt and comments * Add `verify_and_insert` to get rid of `or_insert` in order to get mut ref to value * Resources initialization * No need for ResourceBuilder * Comment all the things * Handle errors on ws-server `start` method * Passing ResourceGuard to method execution * Start ws-server in background, simplify all the tests! * Claiming resources on runtime * Do checked math on resource claiming * Clearer error path for resources at limit * Resource limiting tests WIP * Unbox async futures * fmt * Cleaner proc macro * Fix lifetime issues with ResourceGuard with internal Arc * Remove unnecessary lifetime generic * Working tests * Use turbofish in tests * fmt * Fixed (?) benches * Apply suggestions from code review Co-authored-by:
David <dvdplm@gmail.com> * Tweak more grumbles * Adding a test for resource limiting with proc macros (WIP) * Reworking attribute macros for resource limiting (#507) * Squashed macros WIP * bae-less macros! * Make things simpler and more readable * Some comments and DRY aliases parsing * Naming things is hard * Respan is no longer needed * Simpler Arguments * Remove stale code * Apply suggestions from code review Co-authored-by:
Niklas Adolfsson <niklasadolfsson1@gmail.com> * syn-up all the things, handle resources on methods Co-authored-by:
Niklas Adolfsson <niklasadolfsson1@gmail.com> * Resource limiting on the http server * Test two resources at once * Test the HTTP server for resource limiting * Apply suggestions from code review Co-authored-by:
David <dvdplm@gmail.com> Co-authored-by:
Niklas Adolfsson <niklasadolfsson1@gmail.com> * Comment tweaks * More explicit error type for `AttributeMeta::retain` * Remove generic from ResourceTable; derive Default on ws Builder * Make the macros shorter Co-authored-by:
David <dvdplm@gmail.com> Co-authored-by:
Niklas Adolfsson <niklasadolfsson1@gmail.com>
-
- 16 Sep, 2021 1 commit
-
-
David authored
* Re-export v2::params, error, request and response types * Use shallow type paths
-
- 15 Sep, 2021 1 commit
-
-
David authored
* Renames * More renames * fmt * s/RpcParams/Params/ * Add a type alias `SubscriptionResponse` to `Notification` which is parametrized to `SubscriptionPayload` Move `SubscriptionResponse` to the `response` module * Fix doc links * Cleanup and some docs * Review feedback * cleanup
-
- 25 Aug, 2021 1 commit
-
-
David authored
* Add license headers where missing and update year * Update examples/http.rs Co-authored-by:
Niklas Adolfsson <niklasadolfsson1@gmail.com> Co-authored-by:
Niklas Adolfsson <niklasadolfsson1@gmail.com>
-
- 12 Jul, 2021 2 commits
-
-
Maciej Hirsz authored
* Do not register methods on servers * fmt * Infallible `to_rpc` proc macro * Remove dead code * Check for duplicate names at compile time * Add a UI test for name conflicts * Apply suggestions from code review Co-authored-by:
David <dvdplm@gmail.com> Co-authored-by:
David Palm <dvdplm@gmail.com>
-
David authored
* Include "macros" in the "server" feature * Re-export SubscriptionSink * Include the "types" feature in both the "client" and "server" features Export types::* from façade when the "types" is active Export types::* from servers * fmt * Export jsonrpsee_types under types * fmt * broken doc link * fix benches * fmt * Fix test imports
-
- 03 Jun, 2021 1 commit
-
-
David authored
* Add a builder to the ws server * Use the WsServerBuilder in tests&examples * cleanup * fmt * Fix benches * fix error message * Add connection count limiting and associated config item * Use the strong_count to `methods` to know how many connections we currently have * Fix test
-
- 01 Jun, 2021 1 commit
-
-
David authored
* Remove register_* from Server * Tests pass * Some cleanup * more cleanup * Less bounds * Remove the `RpcMethod` trait – I don't think we need it. * fmt * Fix benches * Enable merging two modules with different contexts * Module registration returns number of methods on the server and checks for dupes Tests for module registration and some cleanup * Export `RpcModule` from façade crate fmt * Revert to return error from `Server::register_module` * Remove Server::methods * Remove TODO * Fix tests Fix http server to work the same as ws-server * Server::method_names * fmt * fix clippy warnings Co-authored-by:
Niklas Adolfsson <niklasadolfsson1@gmail.com>
-
- 24 May, 2021 1 commit
-
-
David authored
* Switch from anyhow::Result to std Result * fmt * Use thiserror `#[from]` * Remove sadness
-
- 20 Apr, 2021 1 commit
-
-
Niklas Adolfsson authored
* rewrite me * v2 * PoC works without batch request * remove `PartialEq` bounds * add naive benches types * misc * remove useless lifetime * [ws client]: move request ID generation to client * make tests compile again * [client transport]: kill leaky abstractions. * [http client transport]: minor changes in the API. * [ws client]: fix batch requests. * fix nits * [ws client]: generate two request IDs for subscrib * fix tests * remove unused types + less alloc for params. * fix nits * more tweaks. * remove unused code * fix more nits * remove unused legacy types * reorg types_v2 mod * port macros to new types * fix tests again; more jsonvalue * [proc macros]: bring back impl Into for params. * fix build * [proc macros]: make it work for external crates. * [types]: remove weird From<Option<T>> to impl. * cleanup again * [examples]: remove unused async-std dep * Update types/src/v2/mod.rs * [types]: remove unsed dep smallvec * rewrite me * [types]: error code impl ser/deser Manual implementation of serialize/deserialize to get rid of duplicated message string * [types v2]: re-org with explicit mods * fix faulty test * add missed files * [ws client]: req_manager reserve unsubscribe slot. * simplify test code * add tracking issue for TODO * remove unused deps
-
- 15 Apr, 2021 1 commit
-
-
Niklas Adolfsson authored
* add wrapper crate * add jsonrpsee crate back * [jsonrpsee]: feature gate modules * [proc macros]: support crate renaming of `types` * Update proc-macros/src/lib.rs Co-authored-by:
David <dvdplm@gmail.com> * re-export types * [proc macros]: remove unused features * Update proc-macros/Cargo.toml * fix bad merge Co-authored-by:
David <dvdplm@gmail.com>
-
- 01 Apr, 2021 1 commit
-
-
Niklas Adolfsson authored
* refactor benches * start * fix build: enable `raw value` feature serde_json * start * port it * make tests compile * fix bench * fix bench * introduce builder pattern * tweaks * remove unused code * cleanup * [http server]: configure tcp socket manually. The major reason is to provide a uniform API with the WebSocket server to return the local address. * remove unused deps * [examples]: remove needless sleep * chore: add docs and refactor noise. * Update types/src/jsonrpc/error.rs * http server use constants
-
- 02 Mar, 2021 1 commit
-
-
Niklas Adolfsson authored
* draft: client trait sketch... * use async_trait instead of `Box<Future>` * refactor client trait * [types]: shared client types. * integrate with `jsonrpsee_proc_macros::rpc_api` * Update proc-macros/src/lib.rs * integrate with proc macros * fix: hacky support for generic types in proc macro * fix: make the examples work. * trait: error associated type * Update types/src/traits.rs * client trait: make object safe. Make the trait usable as a trait object i.e, `Box<dyn Trait>` * client trait: remove `Self::Sized` * add tests for proc macros. * fix build * fmt * [client trait]: remove unused associated error typ * [proc macros]: separate enum variant each return_t * add tracking issue to `TODO` * doc(client trait): improve documentation. * separate trait for subscribing client * add documentation * proc macros: remove debug impl * fix compile warns * address grumbles: remove fn process_response * Update types/src/client.rs Co-authored-by:
David <dvdplm@gmail.com> * Update types/src/client.rs Co-authored-by:
David <dvdplm@gmail.com> * Update types/src/client.rs Co-authored-by:
David <dvdplm@gmail.com> * Update types/src/client.rs Co-authored-by:
David <dvdplm@gmail.com> * Update types/src/client.rs Co-authored-by:
David <dvdplm@gmail.com> * remove old proc macro tests * address grumbles: shorter lines Co-authored-by:
David <dvdplm@gmail.com>
-
- 27 Jan, 2021 1 commit
-
-
Niklas Adolfsson authored
* fix examples * fix nit
-
- 18 Jan, 2021 1 commit
-
-
Niklas Adolfsson authored
* update http example * ungeneric crate * update dependencies * [client]: add WebSocket client again. * [deps]: remove needless dev dependencies * nits: forgot to commit new files * [ws client]: `send_text` instead of `send_binary` This is temporary fix to work with the `server` which assumes that `WebSocket` resonses are `text` * chore: add a bunch of more logging * [ws]: port tests but some are failing. * chore: fmt * [server API]: expose `fn local_addr` as public API. * [tests]: make them less ugly by using `127.0.0.1:0` * fix: a bunch of compiler warnings. * [api]: uniform naming, `bind -> new` in transport. * [websocket server]: reply when deserial fails When the server receives an request with invalid JSON `-32700, Parse error shall be returned` * chore: fmt * [tests]: fix remaining tests * [websocket server]: support `binary` and `text` * [ws server]: fix bug in subscription response. `.await` was missing in RegisteredSubscription::send() and no responses were actually sent which this commit fixes. * [client API]: export `WsSubscription` * [examples]: use `localhost` instead of `127.0.0.1` Hostname is required when using `wss` and `127.0.0.1` is not valid hostname. * [examples]: add subscription example. * chore: fmt * [ws server]: fix bug register new subscription. Fixes newly introduced bug that causes `register_subscription` to have side-effects even if the subscription fails. * fmt * more uniform logs * [ws server]: simple subscription test. * [ws server]: subscription tests improved. * [tests]: extract test helpers to a separate crate (#125) * [ws server]: don't close connection when `deserialization` fails (#131) * [ws server]: don't close conn. when `deser` fails * Update src/ws/transport.rs * grumbles: prefer matching of if else. * chore: CI warn `intra_doc_link_resolution_failure` (#139) Since we have not updated the documentation properly it's annoying that the entire job fails. * chore: rustfmt.toml (#138) * chore: add `rustfmt.toml` for formatting * style: `cargo fmt --all` with new config * [server raw params]: fix debug implementation (#137) * [server]: simply raw params impl Use debug implementation of `common::Params` instead of doing something similar that doesn't work properly. * [raw params]: derive `Debug` impl. * [ws server]: parse subscription ID for unsubscription instead of hardcoding `JsonValue::Null` (#136) * [ws server]: fix broken unsubscribe. Try to parse the subscription ID as the first element of an Array or the `subscription` field of an Object/Map. If both of those fails then regard it as a error. * fmt * fix grumbles: remove space indentation * fix(ws server): sub/unsubscribe to same method should generate an error (#140) * fix(ws server): sub/unsubscribe to same method err Subscribe and unsubscribe to the same method should generate an error, which this commit fixed. This bug was introduced by myself in https://github.com/paritytech/jsonrpsee/commit/fc87889de2615dbb3d0cf2d91a306f016d48df2d * Update src/ws/server.rs Co-authored-by:
David <dvdplm@gmail.com> Co-authored-by:
David <dvdplm@gmail.com> * chore: add naive benches for request/response (#142) Co-authored-by:
Niklas <niklasadolfsson1@gmail.com> * fix(ws server): remove faulty debug_assert (#145) The code assumed that `subscription id` is still in `active_subscriptions` when the connection was dropped. The list of subscriptions (kept in raw server) are not notified when a client dropped its subscription/unsubscribed thus it's possible that the actual subscriptions are closed before the entire client was dropped. * ci(benches): cargo check on benches. (#146) * fix(http client): implement `clone` uniform API. (#147) * chore(deps): update `futures v0.3.7` (#148) * chore(deps): update remaining crates (#149) * chore(deps): update `futures v0.3.7` * chore(deps): bump the rest of deps * Improve HTTP client background thread (#150) * refactor: resultify API + some crate reorg (#144) * [ws client]: resultify API and fix subscribe. * The commit changes the API to return `Err` when it's possible and to not ignore underlying errors. * Fix that `fn subscribe` doesn't accept the subscription and unsubscription to be same which causes errors in the server. * nits: Err::SubscriptionMetod -> Err::Subscription * refactor(client): common error type * refactor(http client): resultify * refactor(common): rename common -> types.. This commit renames the `common module` to `types` and tries to distinguish the types that is directly related to the `JSON-RPC v2 specification` from others. Somethings are a little big sloppy named as naming is hard. Also, as bonus a removed a bunch of needless stuff in http server related to subscription. * Update src/ws/tests.rs * style: cargo fmt * fix(grumble): matches -> assert(matches) * fix(grumbles): `jsonrpc_v2` -> `jsonrpc` * fix(nit): remove unused code. * fix(benches): make it compile again. * style: cargo fmt * fix nits (#151) * fix(ws client): send binary (1 byte less payload) * docs(ws server): fix bad comment. * chore: add `editorconfig` (#152) * chore: make `debug log` less verbose. (#153) * chore: make `debug log` less verbose. The debug logging was just too verbose and this commit simplies it as follows: ``` DEBUG recv: {"jsonrpc":"2.0","method":"<METHOD>","params":<PARAMS>,"id":<ID>} DEBUG send: {"jsonrpc":"2.0","result":"<RESULT>","id":<ID>} ``` * style: cargo fmt * fix: missed logs * [jsonrpc types]: implement Display for Request/Response (#160) * feat(jsonrpc response/request): impl `Display` * refactor(logging): use display impl * use serde_json for verbosity * [http client]: refactor with "syncronous-like" design (#156) * experimental * ci(benches): sync and concurrent roundtrips Improve benchmarks to take concurrent requests into account. * ci(benches): sync and concurrent roundtrips Improve benchmarks to take concurrent requests into account. * fix(nits) * feat(http client): limit max request body size * test(http transport): request limit test * test(http client): add tests. * fix typo * fix(benches): make it compile again. * fix(ws example): revert unintentional change. * test(http client): subscription response on call. * fix(cleanup) * fix(benches): make it compile again. * Update src/client/http/transport.rs * fix(http client): `&str` -> `AsRef<str>` * docs(client types): better docs for Mismatch type. * style: `Default::default` -> `HttpConfig::default` * fix(http client): read body size from header. Expermential to read number of bytes from `HTTP Content Length` to pre-allocate the number of bytes and bail early if the length is bigger than the `max_request_body size` Need to be benched with bigger requests. * test(raw http): enable tests to works again. * style: cargo fmt * benches: address grumbles * feat(jsonrpc response/request): impl `Display` * refactor(logging): use display impl * fix(http client): nits. * Update benches/benches.rs * fix bad merge. * chore(deps): update dependencies. (#164) * feat(http server): configurable request body limit (#162) * feat(http server): configurable request body limit * refactor(crate reorg): to have shared http helpers. * Merge client and server errors. * Move `http_server_utils` to `utils/http` * Minor cleanup * fix nits * fix(hyper helper): u64 -> u32 * Update src/utils/http/hyper_helpers.rs Co-authored-by:
David <dvdplm@gmail.com> * Update src/utils/http/hyper_helpers.rs Co-authored-by:
David <dvdplm@gmail.com> * fix: grumbles * Update src/utils/http/hyper_helpers.rs Co-authored-by:
David <dvdplm@gmail.com> * Update src/http/server.rs Co-authored-by:
David <dvdplm@gmail.com> Co-authored-by:
David <dvdplm@gmail.com> * ci: remove nightly (#167) Use stabilized `broken_intra_doc_links` instead of `intra_doc_link_resolution_failure` * fix(websocket client): drop subscriptions that can't keep up with the internal buffer size (#166) * fix(ws client): drop subscriptions when full. This commit changes the behavior in the `WebSocket Client` where each subscription channel is used in a non-blocking matter until it is determined as full or disconnected. When that occurs the channel is simply dropped and when the user `poll` the subscription it will return all sent subscriptions before it was and terminate (return None) once it's polled one last time. Similarly as `Streams` works in Rust. It also adds configuration for the `WebSocket Client` to configure capacity for the different internal channels to avoid filling the buffers when it's not expected. * tests(ws client): simple subscription test. * fix: nits * Update src/client/ws/client.rs * refactor(tests): introduce integration_tests Make the repo structure more understable w.r.t testing. * chore(license): add missing license headers * Update src/client/ws/client.rs * Update src/client/ws/client.rs * style: remove unintended spaces. * tests: add concurrent deadlock test Ensure that if more than the requested channel buffer capacity is exceeded it should not deadlock. Such as spawning alot of concurrent requests, notifications or new subscriptions. * Update src/client/ws/client.rs * fix: review grumbles * fix nits: `remove needless closure` * fix: cargo fmt * Update src/client/ws/client.rs Co-authored-by:
David <dvdplm@gmail.com> * fix more nits Co-authored-by:
David <dvdplm@gmail.com> * fix(ws client): embed request id in `SubscriptionClosed` (#170) * fix(ws client): embed request id SubscriptClosed Fixes https://github.com/paritytech/jsonrpsee/issues/169 * Update src/client/ws/client.rs * Update src/client/ws/client.rs Co-authored-by:
David <dvdplm@gmail.com> * Update src/client/ws/client.rs Co-authored-by:
David <dvdplm@gmail.com> Co-authored-by:
David <dvdplm@gmail.com> * chore(deps): bump dependencies (#172) * [ws client]: add tests (#134) * [test utils]: add `internal_err` and consts [errors]: unify client/server errors [test utils]: fake WebSocket jsonrpc server [ws client]: export errors [ws client]: add some basic tests * fmt * remove log target * fix nits * [ws client]: add subscription test * revert unintendend changes. * fmt * [ws client]: fix panic in tests * cleanup * tests(ws client): test for invalid request ID. * fix nits * [ws client]: kill raw client (#171) * getting started * WIP WIP * cleanup * cleanup v2 * cleanup v3 * perf: use BufReader BufWriter * fix(request manager): resultify insert API The rationale behind this change is that the `insert_methods` takes ownership of the `send_back_oneshot` and if the operation fails it should be propagated the frontend. So returning the `Err(send_back_oneshot)` if it fails makes it possible. * fix nits * examples(ws): revert changes * Update tests/integration_tests.rs * nits: fix unwraps * Update src/client/ws/manager.rs Co-authored-by:
David <dvdplm@gmail.com> * Update src/client/ws/transport.rs Co-authored-by:
David <dvdplm@gmail.com> * Update src/client/ws/client.rs Co-authored-by:
David <dvdplm@gmail.com> * fix build * refactor: simplify `Error::InvalidRequestId` It was hard to use when the expected id is not known. * fix(ws client): error handling. * fix(grumble error type): better error message. * fix(grumble): docs `JSONRPC WebSocket transport` * fix(ws manager): fix grumbles. * Add better documentation * Rename methods. * Add `proof` to unreachable! * fix(ws manager): fix nit in docs. * fix(grumbles): ws client * fix more nits * fix compile warning: export websocket transports. * Update src/client/ws/manager.rs Co-authored-by:
David <dvdplm@gmail.com> * deps: tokio 1.0 and hyper 0.14 (#176) * deps: tokio 1.0 and hyper 0.14 * Update Cargo.toml * refactor: crate re-organization with separate crates (#177) * [ci]: feature `http` and `ws` removed. * refactor: re-org crate with smaller crates. * fmt * [ci]: remove default features Currently there are no features in the crates, so that check is not needed. * [http client]: remove unused dependency tokio * docs(http client): fix nits tokio 0.2 -> tokio 1.0 (#178) * docs(http client): tokio 0.2 -> tokio 1.0 * fix: better link * [ci]: github actions (#179) * docs(http client): tokio 0.2 -> tokio 1.0 * [ci]: remove travis * [ci]: add github actions. * [ci]: fix identation nits * [ci]: use cache for actions * [ci]: filter to clippy * [ci]: remove hacks * separate action for ci and benchmarks * [ci]: tweak to run on master branch. * examples/subscription -> examples/ws_subscription * force CI Co-authored-by:
David <dvdplm@gmail.com> Co-authored-by:
Maciej Hirsz <1096222+maciejhirsz@users.noreply.github.com> Co-authored-by:
Atkins <atkinschang@gmail.com>
-
- 29 Jun, 2020 1 commit
-
-
Pierre Krieger authored
* Adds a ws_server function at the root, and not some async qualifiers * Rustfmt
-
- 28 Feb, 2020 1 commit
-
-
Pierre Krieger authored
* Move common to crate root * Move transport traits to own module * Hide transport::client and transport::server * Move ws and http to transport * Typo fix * Remove the shortcuts for raw client and servers * Rename core to raw * Remove commented-out code * Fix docs of raw module * Rustfmt * Force inline * Rustfmt
-
- 09 Jan, 2020 1 commit
-
-
* Update to stable futures * Fix breaking hyper and tokio changes * Fix breaking soketto changes * Try to fix hyper update errors * Fix remaining hyper compilation error * Update futures timer * Update to tokio 0.2 * Enable basic_scheduler * Enable logging in example * Bind server inside runtime context * Format code * Return error via channel if async server bind fails * Apply suggestions from code review Co-Authored-By:
Pierre Krieger <pierre.krieger1708@gmail.com> * Question mark Co-authored-by:
Pierre Krieger <pierre.krieger1708@gmail.com>
-
- 03 Jan, 2020 1 commit
-
-
Pierre Krieger authored
* Rename Client/Server -> RawClient/RawServer * SharedClient/Server -> Client/Server * Rename http/ws constructors * Rustfmt * Fix some bad renames * Rustfmt * More fixing
-
- 18 Nov, 2019 1 commit
-
-
Pierre Krieger authored
* Apply Rustfmt and add a CI check * Install rustfmt
-
- 29 Oct, 2019 1 commit
-
-
Pierre Krieger authored
* Add license header everywhere * Update company name * Fix bad merge
-
- 22 Oct, 2019 1 commit
-
-
Pierre Krieger authored
-
- 18 Sep, 2019 2 commits
-
-
Pierre Krieger authored
-
Pierre Krieger authored
* Properly support params in rpc_api! * Respond with invalid param in case of parsing error
-
- 12 Sep, 2019 1 commit
-
-
Pierre Krieger authored
-
- 11 Sep, 2019 2 commits
-
-
Pierre Krieger authored
-
Pierre Krieger authored
-