{"id":18881355,"url":"https://github.com/leo-project/leo_rpc","last_synced_at":"2025-04-14T20:09:34.981Z","repository":{"id":8931946,"uuid":"10663059","full_name":"leo-project/leo_rpc","owner":"leo-project","description":"An original RPC library written in Erlang whose interface is similar to Erlang's buildin RPC.","archived":false,"fork":false,"pushed_at":"2020-05-31T09:23:15.000Z","size":683,"stargazers_count":9,"open_issues_count":2,"forks_count":7,"subscribers_count":4,"default_branch":"develop","last_synced_at":"2025-04-14T20:09:28.311Z","etag":null,"topics":["erlang","leofs","library","rpc"],"latest_commit_sha":null,"homepage":"http://leo-project.net/leofs","language":"Erlang","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/leo-project.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-06-13T09:34:03.000Z","updated_at":"2021-01-22T05:16:07.000Z","dependencies_parsed_at":"2022-09-04T15:13:06.187Z","dependency_job_id":null,"html_url":"https://github.com/leo-project/leo_rpc","commit_stats":null,"previous_names":[],"tags_count":40,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leo-project%2Fleo_rpc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leo-project%2Fleo_rpc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leo-project%2Fleo_rpc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leo-project%2Fleo_rpc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leo-project","download_url":"https://codeload.github.com/leo-project/leo_rpc/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248952349,"owners_count":21188426,"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":["erlang","leofs","library","rpc"],"created_at":"2024-11-08T06:48:55.154Z","updated_at":"2025-04-14T20:09:34.956Z","avatar_url":"https://github.com/leo-project.png","language":"Erlang","funding_links":[],"categories":[],"sub_categories":[],"readme":"# **leo_rpc**\n\n[![Build Status](https://travis-ci.org/leo-project/leo_rpc.svg?branch=develop)](https://travis-ci.org/leo-project/leo_rpc)\n\nAn original rpc library, interface of which is similar to Erlang's RPC. Aim to connect with over 100 nodes.\n\n## Usage\n\nFirst clone the leo_rpc repository and create a copy of it.\nThen, compile them with different 'listen_port' configurations.\n\n```bash\n$ git clone https://github.com/leo-project/leo_rpc leo_rpc_0\n$ cp -r leo_rpc_0 leo_rpc_1\n$ cp -r leo_rpc_0 leo_rpc_2\n$ cd leo_rpc_0\n$ make\n$ cd ../leo_rpc_1\n$ vi src/leo_rpc.app.src\n## Edit 'listen_port' from 13075 to 13076\n         {listen_port,    13076},\n$ make\n$ cd ../leo_rpc_2\n$ vi src/leo_rpc.app.src\n## Edit 'listen_port' from 13075 to 13077\n         {listen_port,    13077},\n$ make\n```\n\nThen, start Erlang shells.\n\n```erlang\n$ cd leo_rpc_1\n$ erl -pa ./ebin/ ./deps/*/ebin -name 'node_1@127.0.0.1'\nErlang R16B03-1 (erts-5.10.4) [source] [64-bit halfword] [smp:4:4] [async-threads:10] [kernel-poll:false]\n\nEshell V5.10.4  (abort with ^G)\n(node_1@127.0.0.1)1\u003e application:start(leo_rpc).\nok\n(node_1@127.0.0.1)2\u003e leo_rpc:node().\n'node_1@127.0.0.1'\n(node_1@127.0.0.1)3\u003e leo_rpc:nodes().\n[]\n(node_1@127.0.0.1)4\u003e leo_rpc:port().\n13076\n```\n\n```erlang\n$ cd leo_rpc_2\n$ erl -pa ./ebin/ ./deps/*/ebin -name 'node_2@127.0.0.1'\nErlang R16B03-1 (erts-5.10.4) [source] [64-bit halfword] [smp:4:4] [async-threads:10] [kernel-poll:false]\n\nEshell V5.10.4  (abort with ^G)\n(node_2@127.0.0.1)1\u003e application:start(leo_rpc).\nok\n(node_2@127.0.0.1)2\u003e leo_rpc:node().\n'node_2@127.0.0.1'\n(node_2@127.0.0.1)3\u003e leo_rpc:nodes().\n[]\n(node_2@127.0.0.1)4\u003e leo_rpc:port().\n13077\n```\n\n```erlang\n$ cd leo_rpc_0\n$ erl -pa ./ebin/ ./deps/*/ebin -name 'node_0@127.0.0.1'\nErlang R16B03-1 (erts-5.10.4) [source] [64-bit halfword] [smp:4:4] [async-threads:10] [kernel-poll:false]\n\nEshell V5.10.4  (abort with ^G)\n(node_0@127.0.0.1)1\u003e application:start(leo_rpc).\nok\n(node_0@127.0.0.1)2\u003e leo_rpc:node().\n'node_0@127.0.0.1'\n(node_0@127.0.0.1)3\u003e leo_rpc:nodes().\n[]\n(node_1@127.0.0.1)4\u003e leo_rpc:port().\n13075\n```\nThen, we can try various rpc commands as follow.\n\n```erlang\n%% Execute rpc-call to a remote-node\n(node_0@127.0.0.1)5\u003e leo_rpc:call('node_1@127.0.0.1:13076', leo_rpc, node, []).\n'node_1@127.0.0.1'\n(node_0@127.0.0.1)6\u003e leo_rpc:nodes().\n[node_1]\n(node_0@127.0.0.1)7\u003e leo_rpc:call('node_2@127.0.0.1:13077', leo_rpc, node, []).\n'node_2@127.0.0.1'\n\n%% Execute async rpc-call to a remote-node\n(node_0@127.0.0.1)8\u003e RPCKey = leo_rpc:async_call('node_1@127.0.0.1:13076', leo_rpc, node, []).\n\u003c0.252.0\u003e\n%% Get the value. (You have to type the following expression in 5 senconds after the above commands.)\n(node_0@127.0.0.1)9\u003e leo_rpc:nb_yield(RPCKey).\n{value,'node_1@127.0.0.1'}\n\n%% Execute multi-call to plural nodes\n(node_0@127.0.0.1)10\u003e leo_rpc:multicall(['node_0@127.0.0.1:13075', 'node_1@127.0.0.1:13076', 'node_2@127.0.0.1:13077'], 'leo_date', 'clock', []).\n{[1397709777556582,1397709777555220,1397709777555166],[]}\n\n(node_0@127.0.0.1)11\u003e leo_rpc:nodes().\n[node_0,node_1,node_2]\n(node_0@127.0.0.1)12\u003e leo_rpc:status().\n{ok,[{node_0,node_0,13075,4,4},\n     {node_1,node_1,13076,4,4},\n     {node_2,node_2,13077,4,4}]}\n```\n\n## License\n\nleo_rpc's license is \"Apache License Version 2.0\"\n\n## Sponsors\n\n* LeoProject/LeoFS was sponsored by [Rakuten, Inc.](https://global.rakuten.com/corp/) from 2012 to Dec of 2018.\n* LeoProject/LeoFS is sponsored by [Lions Data, Ltd.](https://lions-data.com/) from Jan of 2019.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleo-project%2Fleo_rpc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleo-project%2Fleo_rpc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleo-project%2Fleo_rpc/lists"}