Can we do RPC connection to corda using NodeJs? - rpc

I know CordaRPCClient is there to do the RPC connection to the network.
Is there any possibility, can we do that happen in NodeJS so that I can write my middle ware in nodejs.
Is there something corda team is planning to build for client library for NodeJS implementation of RPCops.

Take a look at this Corda sample
The example demonstrates a node.js server which uses corda rpc-3.1 library running in GraalVM.
Also, take a look at Braid. Braid is a reactive rpc library for exposing your services and consuming them in Javascript

Related

chat application, peer-to-peer communication

I am in the process of developing a chat application using Javascript. When sending messages from one client to another client, do I have to send it through a server or can I send it directly from a peer-to-peer approach, using something like websockets ?
Welcome to the stage of life where you see the importance of design patterns.
You can start solutionizing with mediator pattern and proxy pattern with web sockets.
Wheater you need a server or not is up to your design.
Technology-wise there are multiple APIs that HTML5 offers you can go through them and make something on your own.
There is a bunch of APIs available with HTML5 and JS.
Start digging on WebSockets, Server-Sent Events, Web Workers.
The server will give you the flexibility of record-keeping while acting as a mediator. Alternatively, you can come up with a pure p2p design with a scheme where every node or user notify other users with their details(IP) for establishing communication. Remember for web socket to work the client need to know what address to connect to. Maybe it can have fixed master nodes. Then you can use observables for polling and other features. Take a look at the BitTorrent protocol for design inspiration.
Get creative and start designing.
There are many ways to do it. I recommend the scheme:
Peer <---> custom websocket server <---> Peer;
I recommend NodeJS with SocketIO.

Using nats with angular to discuss with Hemerajs microservices server

I need a piece of advice.
Indeed I am writing an Hemerajs (Hemerajs) server application couple with a NATS (NATS) messaging server.
Moreover I'd like to plug an Angular 6+ front application on this server through the NATS pub/sub system.
However I did not find any package or help for using nats with angular.
May I misunderstood pattern messaging behavior, perhaps the messaging system is only internally of microservices server and the communication between angular and node must be with REST API ?
Could you help me for finding the correct package or the correct way to implement this please ?
Thanks
Regards
At the time of writing there is no official Angular client and ts-nats was written for node.js aka server side.
There are
https://github.com/isobit/websocket-nats
and
https://github.com/isobit/ws-tcp-relay
But they had no updates for 3 years. I'm not sure if websocket-nats was written for nats v1 or v2.
The client protocol is documented here: https://docs.nats.io/nats-protocol/nats-protocol and the following page talks about implementing your own client.
So far nats seems to be for service to service communication only, since there are no official clients for browsers.

Using nodejs as a client to a Websocket server. Is it still event driven

I would like to code a performance test creating hundreds of concurrent websocket connections to a vendor's server, that will randomly send/receive messages and then hangup.
Can I use Websockets with nodejs to do this and will this be considered event driven?
To be clear, I am not building a websocket server. I basically want to use nodejs as a client to connect to an outside websocket server but create hundreds of concurrent connections that it will respond to.
Thanks.
Yes you can use node.js and yes it will be event driven. All network I/O in node.js is exclusively asynchronous and event-driven.
Be aware substack's rant in the hyperquest README about node.js core http module's connection pooling, which you will want to make sure you bypass. Presumably you'll be using a helper library such as socket.io or sock.js. Just check that they will create the number of connections you want to a single server without any pooling or throttling.

What client to use for load testing comet application irrespective of comet server

We are in process of developing an app and we started with:
Spring SockJs Java server with Servlet 3.0 container (Async support)
SockJs javascript client.
To test the load aspects, I had written a client using Bayeux API -this was for WebSockets and not for Polling.
Since Node makes strong case for async communication -so we want to evaluate its load capacity against Java server. From articles, I get a feel that Node scales -but we want to keep Java unless there is "significant" advantage going the Node.js way. And most important, we want to try it out for our specific use case rather than riding on popular opinion and hence we want to benchmark them on open connection handling over a period of time, My Question:
Is it possible to write a common client in JAVA -which can connect to both Java based server as well as NODE? Seems possible because at end its HTPP and does not matter what exposes it -but am not getting the right client. Even Bayeux does not work for NON websocket use case -Although I used same API to test "Websocket" connection for SockJs, CometD and Node server
What to do for Non Websocket , for example -Long Polling or streaming any client which can be run against a server "irrespective" whether its in CometD, SockJs or NODE?
SockJs cleint is a Java script client -we can emulate connections from browser -Is there a Java client for server?
Am new to javascript -so how a load test is written in javascript and how is it run (Socket one cannot be run from browser) -any sample code on github?

Connect node.js and signalr via sockets

Is there anyway to send data though sockets from Node.JS to SignalR? I have a Node.JS app that sends realtime information as JSON format. The other app it's an MVC C# app that uses SignalR to send the data to the client via socket. I want tosen data from de nodejs to signalr and signal send that info to the client.
You might consider better solution for internal communication between processes. SignalR is meant to be used between .Net server and client using different authentication, handshake, protocol and network layer methods, which is inefficient for internal server communication.
Take a look on ZeroMQ, is well simple and very easy to use tool, meant especially for such cases. It has bindings for most languages including .Net and node.js.
There is js client for browser to communicate with Signal R server.
http://www.nuget.org/packages/SignalR.Js
You probably can extract js file from it and run from Node.js.
And probably standard Socket.IO will just work, you need to subscribe to proper events and go.
If you want a node.js client for signalR that doesn't require jQuery I started this one. It intentionally only supports websockets.
https://npmjs.org/package/signalr-client

Resources