{"id":13723627,"url":"https://github.com/sile/erl_dist","last_synced_at":"2025-05-16T02:09:46.117Z","repository":{"id":14352974,"uuid":"76385272","full_name":"sile/erl_dist","owner":"sile","description":"Rust Implementation of Erlang Distribution Protocol","archived":false,"fork":false,"pushed_at":"2025-03-16T02:38:07.000Z","size":242,"stargazers_count":157,"open_issues_count":1,"forks_count":13,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-05-14T14:40:59.950Z","etag":null,"topics":["asynchronous","distributed","erlang","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sile.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-12-13T18:08:07.000Z","updated_at":"2025-05-01T19:19:55.000Z","dependencies_parsed_at":"2025-04-05T08:01:02.004Z","dependency_job_id":"9bdcf173-6c69-4199-bb82-6179ac34ccb8","html_url":"https://github.com/sile/erl_dist","commit_stats":{"total_commits":116,"total_committers":2,"mean_commits":58.0,"dds":0.008620689655172376,"last_synced_commit":"6076ded283ff10ecdf5f0f68d9a63063698d4350"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sile%2Ferl_dist","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sile%2Ferl_dist/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sile%2Ferl_dist/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sile%2Ferl_dist/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sile","download_url":"https://codeload.github.com/sile/erl_dist/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254453667,"owners_count":22073618,"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":["asynchronous","distributed","erlang","rust"],"created_at":"2024-08-03T01:01:43.567Z","updated_at":"2025-05-16T02:09:46.094Z","avatar_url":"https://github.com/sile.png","language":"Rust","funding_links":[],"categories":["Languages Integration"],"sub_categories":[],"readme":"erl_dist\n========\n\n[![erl_dist](https://img.shields.io/crates/v/erl_dist.svg)](https://crates.io/crates/erl_dist)\n[![Documentation](https://docs.rs/erl_dist/badge.svg)](https://docs.rs/erl_dist)\n[![Actions Status](https://github.com/sile/erl_dist/workflows/CI/badge.svg)](https://github.com/sile/erl_dist/actions)\n[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)\n\nRust Implementation of [Erlang Distribution Protocol](http://erlang.org/doc/apps/erts/erl_dist_protocol.html).\n\nThe distribution protocol is used to communicate with distributed erlang nodes.\n\nExamples\n---------\n\nGets a node entry from EPMD:\n```rust\nuse erl_dist::epmd::{DEFAULT_EPMD_PORT, EpmdClient};\n\n// Connect to the local EPMD.\nlet connection = TcpStream::connect((\"localhost\", DEFAULT_EPMD_PORT)).await?;\nlet client = EpmdClient::new(connection);\n\n// Get the information of a node.\nlet node_name = \"foo\";\nif let Some(node) = client.get_node(node_name).await? {\n    println!(\"Found: {:?}\", node);\n} else {\n    println!(\"Not found\");\n}\n```\n\nSends a message to an Erlang node:\n```rust\nuse erl_dist::LOWEST_DISTRIBUTION_PROTOCOL_VERSION;\nuse erl_dist::node::{Creation, LocalNode};\nuse erl_dist::handshake::ClientSideHandshake;\nuse erl_dist::term::{Atom, Pid};\nuse erl_dist::message::{channel, Message};\n\n// Connect to a peer node.\nlet peer_host = \"localhost\";\nlet peer_port = 7483;  // NOTE: Usually, port number is retrieved from EPMD.\nlet connection = TcpStream::connect((peer_host, peer_port)).await?;\n\n// Local node information.\nlet creation = Creation::random();\nlet local_node = LocalNode::new(\"foo@localhost\".parse()?, creation);\n\n// Do handshake.\nlet mut handshake = ClientSideHandshake::new(connection, local_node.clone(), \"cookie\");\nlet _status = handshake.execute_send_name(LOWEST_DISTRIBUTION_PROTOCOL_VERSION).await?;\nlet (connection, peer_node) = handshake.execute_rest(true).await?;\n\n// Create a channel.\nlet capability_flags = local_node.flags \u0026 peer_node.flags;\nlet (mut tx, _) = channel(connection, capability_flags);\n\n// Send a message.\nlet from_pid = Pid::new(local_node.name.to_string(), 0, 0, local_node.creation.get());\nlet to_name = Atom::from(\"bar\");\nlet msg = Message::reg_send(from_pid, to_name, Atom::from(\"hello\").into());\ntx.send(msg).await?;\n```\n\nExample commands:\n- EPMD Client Example: [epmd_cli.rs](examples/epmd_cli.rs)\n- Client Node Example: [send_msg.rs](examples/send_msg.rs)\n- Server Node Example: [recv_msg.rs](examples/recv_msg.rs)\n\nRelated Crates\n--------------\n\n- [erl_rpc](https://github.com/sile/erl_rpc): Erlang RPC client for Rust\n- [erldash](https://github.com/sile/erldash): Terminal-based Erlang dashboard\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsile%2Ferl_dist","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsile%2Ferl_dist","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsile%2Ferl_dist/lists"}