{"id":18333285,"url":"https://github.com/ceppelli/solana-gossip-tui","last_synced_at":"2025-04-13T05:42:09.641Z","repository":{"id":216756809,"uuid":"624962234","full_name":"ceppelli/solana-gossip-tui","owner":"ceppelli","description":"An attempt to reverse engineer the Solana Gossip protocol","archived":false,"fork":false,"pushed_at":"2023-04-17T17:49:09.000Z","size":3106,"stargazers_count":18,"open_issues_count":1,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-13T05:41:45.529Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/ceppelli.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}},"created_at":"2023-04-07T17:43:53.000Z","updated_at":"2025-03-19T14:32:44.000Z","dependencies_parsed_at":"2024-01-12T16:16:37.802Z","dependency_job_id":"71646ea0-e589-4229-a42e-15309a369268","html_url":"https://github.com/ceppelli/solana-gossip-tui","commit_stats":null,"previous_names":["ceppelli/solana-gossip-tui"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ceppelli%2Fsolana-gossip-tui","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ceppelli%2Fsolana-gossip-tui/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ceppelli%2Fsolana-gossip-tui/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ceppelli%2Fsolana-gossip-tui/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ceppelli","download_url":"https://codeload.github.com/ceppelli/solana-gossip-tui/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248670518,"owners_count":21142901,"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":[],"created_at":"2024-11-05T19:41:47.985Z","updated_at":"2025-04-13T05:42:09.578Z","avatar_url":"https://github.com/ceppelli.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SOLANA Goggip TUI\n[![License: MIT](https://img.shields.io/badge/license-MIT-blue)](#license)\n[![rustc](https://img.shields.io/badge/rustc-1.65+-blue?style=flat-square\u0026logo=rust)](https://www.rust-lang.org)\n[![build status](https://github.com/ceppelli/solana-gossip-tui/actions/workflows/rust.yml/badge.svg)](https://github.com/ceppelli/solana-gossip-tui/actions/workflows/rust.yml)\n[![codecov](https://codecov.io/gh/ceppelli/solana-gossip-tui/branch/main/graph/badge.svg?token=YMVE0GDCNO)](https://codecov.io/gh/ceppelli/solana-gossip-tui)\n\n\n![Rust By Ceppelli Logo](assets/rust-by-ceppelli-128x128.png)\n\n\n### TUI client for the Solana Gossip Service implemented in Rust\n\nAn attempt to reverse engineer the Solana Gossip protocol.\n\n![Rust By Ceppelli Logo](assets/solana-gossip-tui.gif)\n\n## ⚠️ This project is still under fluid development and must be considered as alpha version ⚠️\n\n---\n\n## Forewords\n\nThe [Solana Blockchain](https://solana.com) is one of the most popular blockchains in the world. Its success is mainly due to its speed, with approximately 3,400 transactions per second, compared to 15 transactions per second for Ethereum, making Solana one of the fastest blockchain networks currently available.\n\nThe Gossip Service is the base-ground of the entire network. Every tenth of a second each network’s Node share signed data objects among themselves in order to manage a cluster.  The validator's services listener configuration, contract information, ledger height and vote are some example of exchanged data.\n\n---\n\n## Motivation\n\nEven though the Solana is a large project, the lack of technical documentation on the protocol specifications as [this issue](https://github.com/solana-foundation/specs/issues/9) on the GitHub Solana Foundation repo shows, is quite disarming.\n\nFor this reason, driven by my curiosity, I'm trying to reverse engineer the **Gossip Service Protocol** in order to understand how it work.\n\n---\n\n## Design\n\nThe architecture of this attempt is very simple as the diagram depicts. Although the application is multithreaded for obvious reason it tries to use as fewer threads as possible. The communication between threads is done only through message passing  avoiding contention on shared data.\n\nAll the protocol business logic is execute inside the **logic_t** thread, where the **udp_recever_t** and **udp_sender_t** threads are responsible only for sending and receiving network packets.\nFinally the **main_t** thread takes care of handling the user input and displaying the collected data.\n\n![Design](assets/design.png)\n\nOne of the goals is to use the fewest external libraries as possible.\n\nOf the original Solana code, only the one relating to the generation of cryptographic keys and related hash functions is used.\n\n---\n\n## Protocol\n\n| Message            | Status |\n| :---               | :---:  |\n| PullRequest        | ✅ |\n| PullResponse       | ✅ |\n| PushMessage        | 🔬 |\n| PruneMessage       | 🔬 |\n| PingMessage        | ✅ |\n| PongMessage        | ✅ |\n\n\n\n| CrdsData                  | Status |\n| :---                      | :---:  |\n| LegacyContactInfo         | ✅ |\n| Vote                      | ✅ |\n| LowestSlot                | ✅ |\n| SnapshotHashes            | ✅ |\n| AccountsHashes            | ✅ |\n| EpochSlots                | ✅ |\n| LegacyVersion             | ✅ |\n| Version                   | ✅ |\n| NodeInstance              | ✅ |\n| DuplicateShred            | 🔬 |\n| IncrementalSnapshotHashes | ✅ |\n| ContactInfo               | 🔬 |\n\n\n* ✅ - completed\n* 📐 - design\n* 🔮 - planed\n* 🔬 - investigation\n\n---\n\n## Building from Source\nsolana-gossip-tui is written entirely in Rust and building it from source is dead simple. All you have to do is download source, install rust and build with cargo.\n\n1) Installing rust. Head to [Rust installation](https://www.rust-lang.org/tools/install). It is basically doing\n```\ncurl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh\n```\n2) Get the source code. You can [download from the archives]() or use git clone:\n```\ngit clone https://github.com/ceppelli/solana-gossip-tui.git\n```\n\n3) `cd` into source root and do:\n```\ncargo build --all --release\n```\n\n4) The compiled binary is located in `target/release/` directory. Copy the `solana_gossip_tui` binary and place it somewhere where it is easy to run. Preferrably under `$PATH`.\n\n5) solana-gossip-tui is now ready to fire. [Head over to usage](#usage)\n\n---\n\n## Usage\n\nsolana-gossip-tui is single binary so it shouldn't be difficult to run.\n\n### Run solana-gossip-tui\n```\nsolana_gossip_tui\n```\n\nAfter the executable has been started the **Entrypoints Selection View** will be displayed.\n\n![Entrypoints Selection View](assets/solana-gossip-tui-3.png)\n\nSelect an entrypoint using the `Up/Down` arrow keys and press `Enter` and the **Home View** will be displayed.\n\n![Home View](assets/solana-gossip-tui-4.png)\n\n## ⚠️ At that moment only the Solana Devnet is answering. We recommend using either the first entrypoint or the IP addresses listed below which are always nodes of the Devnet but less congested. ⚠️\n\n\nNow press the `c` key and the client will open a local socket on port **8000** and connect to the selected entrypoint.\n\n![Entrypoints Selection View](assets/solana-gossip-tui-7.png)\n\nPressing the `d` key the communication will be interrupt.\n\nPressing the `q` key the application will be terminate.\n\n### Show help message\nAt any time inside the running binary press the `?` key and a contextual help view will be displayed.\n\n--\n\n## Async Client\n\nThe **solana_gossip_async** crate implements an async version of the library.\n\nTo test it run the **solana-gossip-async** single binary.\n\n### Run solana-gossip-async\n```\nsolana_gossip_async\n```\n\nIt is also possible to specify the entrypoint address as parameter\n\n### Run solana-gossip-async\n```\nsolana_gossip_async --entrypoint entrypoint.devnet.solana.com:8001\n```\n\nThe client tries to connect to the Solana Gossip Validator entrypoint and affer the initial handshake has been completed, it will process the incoming messages until the first **pull response legacy contact info** is received.\n\n\n![Entrypoints Selection View](assets/solana-gossip-async.png)\n--\n\n## License\n\nCopyright 2023 Luca Ceppelli\n\nLicensed under the MIT license\n\u003cLICENSE-MIT or [https://opensource.org/licenses/MIT](https://opensource.org/licenses/MIT)\u003e. Files in the project may not be\ncopied, modified, or distributed except according to those terms.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fceppelli%2Fsolana-gossip-tui","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fceppelli%2Fsolana-gossip-tui","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fceppelli%2Fsolana-gossip-tui/lists"}