All Projects → mirage → irmin-rpc

mirage / irmin-rpc

Licence: ISC license
RPC client/server for Irmin

Programming Languages

ocaml
1615 projects
Cap'n Proto
48 projects

Projects that are alternatives of or similar to irmin-rpc

my-rpc
自己编写RPC(动态代理+反射+zookeeper+netty通信),并结合Spring
Stars: ✭ 31 (+55%)
Mutual labels:  rpc
yar-c
Yar C Framework
Stars: ✭ 107 (+435%)
Mutual labels:  rpc
PyDFS
Tiny distributed file system like HDFS (and of-course GFS)
Stars: ✭ 68 (+240%)
Mutual labels:  rpc
MyRPC
Distributed Discord RPC for @ everyone!
Stars: ✭ 14 (-30%)
Mutual labels:  rpc
rpc
Go stdlib net/rpc with context.Context support
Stars: ✭ 28 (+40%)
Mutual labels:  rpc
cannon
Lightning fast data serialization and RPC for Crystal
Stars: ✭ 56 (+180%)
Mutual labels:  rpc
JsonRpc.Standard
An asynchronous .NET Standard library for JSON RPC client & server implementation.
Stars: ✭ 27 (+35%)
Mutual labels:  rpc
hprose-as3
Hprose for ActionScript 3.0
Stars: ✭ 18 (-10%)
Mutual labels:  rpc
Discord-Netflix
A updated and improved version from the original Discord-Netflix from Nirewen.
Stars: ✭ 26 (+30%)
Mutual labels:  rpc
wsapix
Next generation Websocket framework for nodejs
Stars: ✭ 17 (-15%)
Mutual labels:  rpc
ws-promise
A tiny, Promise-based WebSocket protocol allowing request-response usage in ECMAScript
Stars: ✭ 20 (+0%)
Mutual labels:  rpc
CoreRemoting
RPC library with classic .NET Remoting flavour
Stars: ✭ 23 (+15%)
Mutual labels:  rpc
rpc ts
Remote Procedure Calls in TypeScript made simple 🤞
Stars: ✭ 71 (+255%)
Mutual labels:  rpc
go interview
Interview Questions & Answers For Experienced Go Developers | 互联网 GO 工程师面经交流,学习
Stars: ✭ 522 (+2510%)
Mutual labels:  rpc
twjitm-core
采用Netty信息加载实现长连接实时通讯系统,客户端可以值任何场景,支持实时http通讯、webSocket通讯、tcp协议通讯、和udp协议通讯、广播协议等 通过http协议,rpc协议。 采用自定义网络数据包结构, 实现自定义网络栈。
Stars: ✭ 98 (+390%)
Mutual labels:  rpc
entries.pub
WIP IndieWeb blog engine
Stars: ✭ 13 (-35%)
Mutual labels:  irmin
impress-cli
Impress Application Server Command line interface
Stars: ✭ 25 (+25%)
Mutual labels:  rpc
InterProcessCommunication
Inter-process Communication
Stars: ✭ 11 (-45%)
Mutual labels:  rpc
bifrost
Communications library & daemon for Go. Modular transports, links, pubsub (NATS), quic-over-websocket, libp2p, RPC, encryption, testing, and more.
Stars: ✭ 63 (+215%)
Mutual labels:  rpc
server
Implement the JSON-RPC 2.0 server specification for @laravel.
Stars: ✭ 154 (+670%)
Mutual labels:  rpc

irmin-rpc — Cap'N'Proto RPC server for Irmin

OCaml-CI Build Status

%%VERSION%%

irmin-rpc is a Cap'N'Proto RPC server and client for Irmin. It allows for remote Irmin stores to be easily queried and modified using an API that is very similar to the native Irmin API.

irmin-rpc is distributed under the ISC license.

Homepage: https://github.com/mirage/irmin-rpc

Installation

irmin-rpc can be installed with opam:

$ opam pin add irmin-rpc https://github.com/mirage/irmin-rpc.git
$ opam install irmin-rpc

After that, you will most likely want to install irmin-rpc-unix (or irmin-rpc-mirage):

$ opam pin add irmin-rpc-unix https://github.com/mirage/irmin-rpc.git
$ opam install irmin-rpc-unix

This will also install a tool named irmin-rpc which can be used to run an RPC server from the command line! All that's needed to get an RPC server running is:

$ irmin-rpc --root /path/to/irmin/store

Example server

The example below will start a server on 127.0.0.1:9999 and run it until the process is killed. To run this example execute:

$ dune exec examples/server.exe --secret-key ./key.pem
open Lwt.Infix

module Store = Irmin_mem.KV(Irmin.Contents.String)
module Rpc = Irmin_rpc_unix.Make(Store)

let main =
    Store.Repo.v (Irmin_mem.config ()) >>= fun repo ->
    Rpc.Server.create ~secret_key:`Ephemeral (`TCP ("127.0.0.1", 9999)) repo >>= fun server ->
    Printf.printf "Serving on: %s\n" (Uri.to_string (Rpc.Server.uri server));
    Rpc.Server.run server

let () = Lwt_main.run main

Example client

This example shows how to connect to the server using the provided client. To run this example execute:

$ dune exec examples/client.exe
open Lwt.Infix

module Store = Irmin_mem.KV(Irmin.Contents.String)
module Rpc = Irmin_rpc_unix.Make(Store)

(* This was printed when running the server example above *)
let uri = "capnp://sha-256:[email protected]:9999/WUNVqiE4hrUdV6GvTvnKq6yg-8xVvJmILcLlwPUVldo"

let main =
    Rpc.Client.connect (Uri.of_string uri) >>= fun client ->
    Rpc.Client.set client ["abc"] "123" >>= fun _ ->
    Rpc.Client.get client ["abc"] >|= function
    | Ok res -> assert (res = "123"); print_endline res
    | Error _ -> print_endline "Error encountered"

let () = Lwt_main.run main

Documentation

The documentation and API reference is generated from the source interfaces. It can be consulted online or via odig doc irmin-rpc.

Tests

In the distribution, sample programs and tests are located in the test directory. They can be built and run with:

dune runtest
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].