{"id":19674406,"url":"https://github.com/mirage/irmin-rpc","last_synced_at":"2025-07-04T19:04:30.928Z","repository":{"id":48360991,"uuid":"143216869","full_name":"mirage/irmin-rpc","owner":"mirage","description":"RPC client/server for Irmin","archived":false,"fork":false,"pushed_at":"2021-08-05T00:31:53.000Z","size":228,"stargazers_count":19,"open_issues_count":0,"forks_count":5,"subscribers_count":22,"default_branch":"master","last_synced_at":"2025-04-20T21:41:51.486Z","etag":null,"topics":["capnproto","irmin","rpc"],"latest_commit_sha":null,"homepage":"","language":"OCaml","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mirage.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-08-01T23:03:53.000Z","updated_at":"2024-11-05T00:17:08.000Z","dependencies_parsed_at":"2022-08-20T15:11:15.440Z","dependency_job_id":null,"html_url":"https://github.com/mirage/irmin-rpc","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mirage%2Firmin-rpc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mirage%2Firmin-rpc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mirage%2Firmin-rpc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mirage%2Firmin-rpc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mirage","download_url":"https://codeload.github.com/mirage/irmin-rpc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251415733,"owners_count":21585882,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["capnproto","irmin","rpc"],"created_at":"2024-11-11T17:18:13.312Z","updated_at":"2025-04-29T01:31:14.395Z","avatar_url":"https://github.com/mirage.png","language":"OCaml","funding_links":[],"categories":[],"sub_categories":[],"readme":"## irmin-rpc — Cap'N'Proto RPC server for Irmin\n\n[![OCaml-CI Build Status](https://img.shields.io/endpoint?url=https%3A%2F%2Fci.ocamllabs.io%2Fbadge%2Fmirage%2Firmin-rpc%2Fmaster\u0026logo=ocaml)](https://ci.ocamllabs.io/github/mirage/irmin-rpc)\n\n%%VERSION%%\n\n`irmin-rpc` is a Cap'N'Proto RPC server and client for Irmin. It allows for\nremote Irmin stores to be easily queried and modified using an API that is very\nsimilar to the native Irmin API.\n\n`irmin-rpc` is distributed under the ISC license.\n\nHomepage: https://github.com/mirage/irmin-rpc\n\n## Installation\n\n`irmin-rpc` can be installed with `opam`:\n\n```shell\n$ opam pin add irmin-rpc https://github.com/mirage/irmin-rpc.git\n$ opam install irmin-rpc\n```\n\nAfter that, you will most likely want to install `irmin-rpc-unix` (or\n`irmin-rpc-mirage`):\n\n```shell\n$ opam pin add irmin-rpc-unix https://github.com/mirage/irmin-rpc.git\n$ opam install irmin-rpc-unix\n```\n\nThis will also install a tool named `irmin-rpc` which can be used to run an RPC\nserver from the command line! All that's needed to get an RPC server running is:\n\n```shell\n$ irmin-rpc --root /path/to/irmin/store\n```\n\n## Example server\n\nThe example below will start a server on `127.0.0.1:9999` and run it until the\nprocess is killed. To run this example execute:\n\n```shell\n$ dune exec examples/server.exe --secret-key ./key.pem\n```\n\n```ocaml\nopen Lwt.Infix\n\nmodule Store = Irmin_mem.KV(Irmin.Contents.String)\nmodule Rpc = Irmin_rpc_unix.Make(Store)\n\nlet main =\n    Store.Repo.v (Irmin_mem.config ()) \u003e\u003e= fun repo -\u003e\n    Rpc.Server.create ~secret_key:`Ephemeral (`TCP (\"127.0.0.1\", 9999)) repo \u003e\u003e= fun server -\u003e\n    Printf.printf \"Serving on: %s\\n\" (Uri.to_string (Rpc.Server.uri server));\n    Rpc.Server.run server\n\nlet () = Lwt_main.run main\n```\n\n## Example client\n\nThis example shows how to connect to the server using the provided client. To\nrun this example execute:\n\n```shell\n$ dune exec examples/client.exe\n```\n\n```ocaml\nopen Lwt.Infix\n\nmodule Store = Irmin_mem.KV(Irmin.Contents.String)\nmodule Rpc = Irmin_rpc_unix.Make(Store)\n\n(* This was printed when running the server example above *)\nlet uri = \"capnp://sha-256:YIhQi5oAx0XAUJc7XnbhbNooKDds0LV9zbtsepd3X6A@127.0.0.1:9999/WUNVqiE4hrUdV6GvTvnKq6yg-8xVvJmILcLlwPUVldo\"\n\nlet main =\n    Rpc.Client.connect (Uri.of_string uri) \u003e\u003e= fun client -\u003e\n    Rpc.Client.set client [\"abc\"] \"123\" \u003e\u003e= fun _ -\u003e\n    Rpc.Client.get client [\"abc\"] \u003e|= function\n    | Ok res -\u003e assert (res = \"123\"); print_endline res\n    | Error _ -\u003e print_endline \"Error encountered\"\n\nlet () = Lwt_main.run main\n```\n\n## Documentation\n\nThe documentation and API reference is generated from the source interfaces. It\ncan be consulted [online][doc] or via `odig doc irmin-rpc`.\n\n[doc]: https://mirage.github.io/irmin-rpc/doc\n\n## Tests\n\nIn the distribution, sample programs and tests are located in the [`test`](test)\ndirectory. They can be built and run with:\n\n    dune runtest\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmirage%2Firmin-rpc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmirage%2Firmin-rpc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmirage%2Firmin-rpc/lists"}