All Projects → jgarzik → rpcsrv

jgarzik / rpcsrv

Licence: MIT License
JSON-RPC server based on C++11 and libevent

Programming Languages

M4
1887 projects
C++
36643 projects - #6 most used programming language

Projects that are alternatives of or similar to rpcsrv

JsonRpc.Standard
An asynchronous .NET Standard library for JSON RPC client & server implementation.
Stars: ✭ 27 (-3.57%)
Mutual labels:  json-rpc, json-rpc-server
jsonrpc2-zeromq-python
JSON-RPC 2.0 over ZeroMQ in Python
Stars: ✭ 52 (+85.71%)
Mutual labels:  json-rpc, json-rpc-server
Spooky
An HttpClient based Json RPC 2.0/XML-RPC client for .Net.
Stars: ✭ 16 (-42.86%)
Mutual labels:  json-rpc
scala-json-rpc
Let your servers and clients communicate over function calls! JSON-RPC 2.0 library for Scala and Scala.js
Stars: ✭ 38 (+35.71%)
Mutual labels:  json-rpc
server
Implement the JSON-RPC 2.0 server specification for @laravel.
Stars: ✭ 154 (+450%)
Mutual labels:  json-rpc
coreipc
WCF-like service model API for communication over named pipes and TCP. .NET and node.js clients.
Stars: ✭ 22 (-21.43%)
Mutual labels:  json-rpc
jsonrpcpp
C++ JSON-RPC 2.0 library
Stars: ✭ 97 (+246.43%)
Mutual labels:  json-rpc
webuntis
A API library that makes it easy to access the Webuntis JSON RPC 2.0 API
Stars: ✭ 22 (-21.43%)
Mutual labels:  json-rpc
aiohttp-rpc
A simple JSON-RPC for aiohttp
Stars: ✭ 22 (-21.43%)
Mutual labels:  json-rpc
jsonrpc-ts
A very flexible library for building JSON-RPC 2.0 endpoints
Stars: ✭ 19 (-32.14%)
Mutual labels:  json-rpc
laravel-bitcoinrpc
Bitcoin JSON-RPC Service Provider for Laravel.
Stars: ✭ 83 (+196.43%)
Mutual labels:  json-rpc
aiohttp-json-rpc
Implements JSON-RPC 2.0 using aiohttp
Stars: ✭ 54 (+92.86%)
Mutual labels:  json-rpc
moesif-ethereum-js-example
An example of a Dapp built on web3js/ethereum and using Moesif to monitor JSON-RPC calls.
Stars: ✭ 37 (+32.14%)
Mutual labels:  json-rpc
LightSocks-cxx
⚡️一个轻巧的网络混淆代理🌏
Stars: ✭ 22 (-21.43%)
Mutual labels:  libevent
libevent
<Libevent深入浅出>本书要求有一定的服务并发编程基础,了解select和epoll等多路I/O复用机制。
Stars: ✭ 363 (+1196.43%)
Mutual labels:  libevent
eth-rpc-errors
Ethereum RPC Errors
Stars: ✭ 78 (+178.57%)
Mutual labels:  json-rpc
instant api
Instantly create an HTTP API with automatic type conversions, JSON RPC, and a Swagger UI. Just add methods!
Stars: ✭ 115 (+310.71%)
Mutual labels:  json-rpc
web3j-scala
Lightweight and idiomatic Scala wrapper around Web3J for Ethereum.
Stars: ✭ 75 (+167.86%)
Mutual labels:  json-rpc
node-jsonrpc2
JSON-RPC 2.0 server and client library, with HTTP (with Websocket support) and TCP endpoints
Stars: ✭ 103 (+267.86%)
Mutual labels:  json-rpc
web3
⚡️ Web3 PHP is a supercharged PHP API client that allows you to interact with a generic Ethereum RPC.
Stars: ✭ 609 (+2075%)
Mutual labels:  json-rpc

rpcsrv

Introduction

A C++ JSON-RPC server skeleton, in straight C++11.

Currently implements two simple JSON-RPC methods, "ping" (always returns string "pong") and "echo" (echoes params back as the result), but sufficient code exists to support a wide range of RPC methods, inputs and outputs.

Building

Dependencies

rpcsrv requires C++11, libevent 2 and on MACOSX, argp-standalone.

Compiling from source

Building follows the familiar pattern:

git submodule update --init
./autogen.sh	# only if building from git repo
./configure
make
make install

Running the server

Run "./rpcsrvd --help" for a summary of server configuration options, and their default values. See example-config.json for the server JSON configuration file.

Examples

GET / -- Server reflection endpoint

This returns an array of all the JSON-RPC services at this HTTP endpoint.

We only have one service at this endpoint, "myapi":

$ curl http://localhost:12014/
[
  {
    "name": "myapi/1",
    "timestamp": 1550068729,
    "endpoint": "/rpc/1"
  }
]

GET /rpc/1 -- JSON-RPC reflection endpoint

This returns an array of all the JSON-RPC methods for this service.

We have two methods at this service, "ping" and "echo":

$ curl http://localhost:12014/rpc/1
[
  {
    "method": "ping"
  },
  {
    "method": "echo"
  }
]

POST /rpc/1 -- execute RPC calls with JSON-RPC protocol

We call the "echo" RPC, which echoes any parameters sent to it:

$ curl -X POST -d '{"jsonrpc":"2.0","method":"echo","params":[1,2,3,4], "id":1234}' http://localhost:12014/rpc/1
{
  "jsonrpc": "2.0",
  "result": [
    1,
    2,
    3,
    4
  ],
  "id": 1234
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].