Commit Graph

589 Commits

Author SHA1 Message Date
jangko ab3dd0009b
RPC server handle null return value correctly 2024-01-11 13:57:18 +07:00
jangko 08ceae27e0
Move errors module back to json_rpc folder 2024-01-08 10:37:29 +07:00
jangko c688889c85
Fix example in the README.md 2024-01-07 16:50:33 +07:00
jangko 09d1281a62
Add onProcessMessage hook to client 2024-01-07 16:12:23 +07:00
jangko 20b4c9a0fb
Let the OS choose the port for tests 2024-01-07 15:33:43 +07:00
jangko 31b741720b
Add test for createRpcSigsFromNim and createSingleRpcSig 2024-01-04 20:36:43 +07:00
jangko 2f6a605aa2
Reenable test hhtps 2024-01-04 11:53:15 +07:00
jangko 834de413d9
Rename jrpc_sys module back to jsonmarshal 2024-01-04 11:40:22 +07:00
jangko 014658d1e4
Fix optional parameter parsing fails in rpc macro with generics 2024-01-04 11:17:31 +07:00
kdeme f59e387da2
Add example test case that currently fails the Option parsing 2024-01-04 11:01:49 +07:00
jangko 76dd352ace
Remove StringOfJson 2024-01-04 07:49:19 +07:00
andri lim e0b077fea4
Upgrade rpc router internals (#178)
* Upgrade rpc router internals

* use new chronos asyncraises

* Fix style mismatch

* Fix nim v2 compilation error

* Addresing review

* Remove unnecessary custom serializer and let the library do the work

* fix error message

* Update readme.md
2024-01-03 20:06:53 +07:00
jangko c3769f9130
Add copyright to source file 2023-12-14 08:34:13 +07:00
coffeepots 819b6fed37
Use nim-json-serialization for RPCs (#172)
* Use nim-json-serialization for RPCs

* Add distinct serializers for RPC types

* Avoid ConvFromXtoItselfNotNeeded in testing

* Remove redundent `==` template

* Rename Eth1JsonRpc to JsonRpc

* Fix generic instantiation clash

---------

Co-authored-by: jangko <jangko128@gmail.com>
2023-12-14 08:29:11 +07:00
jangko 08d7fccfe2
v0.2.0 2023-12-13 09:27:19 +07:00
Jacek Sieka 33360528d2
fix improper yield usage (#175)
`yield` does not work with chronos futures
2023-12-13 09:21:50 +07:00
jangko a8731e91bc
Support decoding nil ref object 2023-12-12 09:55:21 +07:00
Etan Kissling 60c4c9b5f2
improve RPC client logging (#171)
We currently only debug log successfully sent messages to RPC.
For debugging, it would be better to see the attempt and any failures.
Adjust logging to provide more information when debugging.
Also include the message name at debug level instead of just trace.
2023-08-23 14:20:19 +02:00
jangko b067143788
fix ws server param type 2023-08-15 13:49:31 +07:00
jangko 26abc0e3d2
fix router example 2023-08-15 13:49:02 +07:00
tersec 32200345f8
use JsonNode.isNil rather than == nil to work around Nim issues (#167) 2023-07-12 17:34:34 +00:00
tersec 325dd4ec35
test Nim 2.0 in CI (#166) 2023-07-11 06:07:24 +00:00
Ivan Folgueira Bande 0bf2bcbe74
httpserver.nim: adding 'Content-Type: application/json' header to the response (#165) 2023-06-15 11:11:26 +02:00
Kim De Mey 4c31a8bd46
Remove nimble.lock file to be able to run nimble test (#161)
With the nimble.lock file it is not possible to run any nimble
commands from within a nimbus-build-system project env.

Co-authored-by: Jacek Sieka <jacek@status.im>
2023-06-07 10:57:37 +02:00
tersec f79be14c99
drop support for Nim v1.2/1.4 (#164) 2023-05-25 12:16:08 +03:00
Zahary Karadjov 172183e702
Allow the user to specify HttpClientFlags when creating a HTTP client 2023-05-05 02:25:36 +03:00
Shuu af12764436
Fix Nim 1.6 regressions (#160) 2023-03-06 17:00:35 +02:00
Zahary Karadjov 07e4705b1f
The ErrorResponse exception now preserves information about the HTTP status code and reason 2023-03-01 12:40:16 +02:00
jangko 38950a786d
reduce compiler warnings 2023-02-22 12:00:35 +07:00
Jacek Sieka c0ecb42613
normalise nimble, update ci, unittest2 (#158) 2022-12-02 13:17:27 +01:00
Tanguy 4e9cc184ca
Fix newRng usage (#157) 2022-11-24 12:10:08 +01:00
Jacek Sieka 3defa1719d
Update README.md 2022-11-24 12:09:06 +01:00
Jacek Sieka c3fa1a4f0f
update requirements/usage 2022-11-24 12:08:27 +01:00
Jacek Sieka b4aff8fec5
remove `news` support (#155)
`news` has several resource leaks and other security issues - replaced
by `nim-websock` which is actively maintained.
2022-11-08 14:39:29 +01:00
Jacek Sieka e6810af618
expose http server options (#154)
* expose http server options

These are needed to create a server that can handle larger POST requests

* add socket flag options
2022-10-25 18:48:44 +02:00
KonradStaniec 64dbf122d7
Add authhooks to proxy constructor (#153) 2022-09-22 10:58:19 +02:00
Jacek Sieka 5fa7071d5b
use `object` fromJson after creating `ref object` instance
otherwise, Option fields don't work as expected
2022-09-21 14:43:41 +02:00
Etan Kissling 446b18819d
do not disable TLS verification by default (#148)
Setting `NoVerifyHost`, `NoVerifyServerName` by default leads to
hard-to-debug bugs, it should always be explicit if wanted.
Note: This is also a workaround for https://github.com/status-im/nim-chronos/issues/313
2022-09-16 21:38:56 +02:00
Jacek Sieka 7c80b75856
fix enum parsing, work around potential `nil` dereference (#150)
* fix enum parsing, work around potential `nil` dereference

When the bizarre error handling in the http client fails, it may happen
that a nil is returned (maybe due to Nim bugs) - do it manually for now
2022-09-15 22:32:16 +03:00
jangko 184984a4fd
install openssl on macos for Nim devel 2022-09-05 22:56:42 +07:00
Etan Kissling c8cbe08de7 align `nim-websock` support with `news`
To allow switching between `news` and `nim-websock` in `nimbus-eth2`,
add support for the missing CORS and JWT authorization headers to the
`nim-websock` backend. Also transition from `StringTableRef` to
`HttpTable` to properly support multiple instances of same header name.
2022-09-05 22:44:06 +07:00
tersec 32ba2d16b9
update from deprecated to supported Ubuntu and macOS GitHub Actions CI images (#144) 2022-08-18 08:31:16 +00:00
jangko 5ccdaed0ad
add rng param to rpcWebsocketServer constructor 2022-07-27 09:46:36 +07:00
tersec 0ef05ae7f8
update to supported macOS GitHub CI image (#142) 2022-07-22 15:19:39 +00:00
jangko 92bb86edf6
update server transport section in README.md 2022-07-19 09:49:43 +07:00
jangko 0fee4be2cc
implement hook to handle CORS and JWT auth
- fixes #138
- fixes #126
- fixes #38
2022-07-17 23:06:08 +07:00
Ivan Yonchovski 12e921c2ea
Add setup files (#139) 2022-07-12 23:22:17 +03:00
Zahary Karadjov d618b555e7
Use news by default; websock has known issues 2022-06-28 18:12:51 +03:00
Miran f65218dd35
move `-d:nimRawSetjmp` to config.nims (#137)
* move `-d:nimRawSetjmp` to config.nims

Refs https://github.com/status-im/nimbus-build-system/issues/44

* not vcc

* use .cfg not .nims
2022-06-28 19:50:51 +07:00
Zahary Karadjov 335f292a58
Fix connection leaks in the HTTP client 2022-04-10 21:48:46 +03:00