{"id":28763257,"url":"https://github.com/crolang-p2p/examples-java-crolang-p2p-node-jvm","last_synced_at":"2025-06-17T09:08:01.539Z","repository":{"id":299050085,"uuid":"1000339603","full_name":"crolang-p2p/examples-java-crolang-p2p-node-jvm","owner":"crolang-p2p","description":"Examples on how to use the CrolangP2P library in a JVM (Java) environment for the CrolangP2P project","archived":false,"fork":false,"pushed_at":"2025-06-14T10:32:28.000Z","size":756,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-14T11:29:52.699Z","etag":null,"topics":["cross-platform","distributed-systems","framework","java","jvm","kotlin","p2p","websocket"],"latest_commit_sha":null,"homepage":"https://github.com/crolang-p2p","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/crolang-p2p.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null}},"created_at":"2025-06-11T16:15:43.000Z","updated_at":"2025-06-14T11:03:12.000Z","dependencies_parsed_at":"2025-06-14T11:40:01.992Z","dependency_job_id":null,"html_url":"https://github.com/crolang-p2p/examples-java-crolang-p2p-node-jvm","commit_stats":null,"previous_names":["crolang-p2p/examples-java-crolang-p2p-node-jvm"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/crolang-p2p/examples-java-crolang-p2p-node-jvm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crolang-p2p%2Fexamples-java-crolang-p2p-node-jvm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crolang-p2p%2Fexamples-java-crolang-p2p-node-jvm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crolang-p2p%2Fexamples-java-crolang-p2p-node-jvm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crolang-p2p%2Fexamples-java-crolang-p2p-node-jvm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/crolang-p2p","download_url":"https://codeload.github.com/crolang-p2p/examples-java-crolang-p2p-node-jvm/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crolang-p2p%2Fexamples-java-crolang-p2p-node-jvm/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260326741,"owners_count":22992385,"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":["cross-platform","distributed-systems","framework","java","jvm","kotlin","p2p","websocket"],"created_at":"2025-06-17T09:08:00.290Z","updated_at":"2025-06-17T09:08:01.511Z","avatar_url":"https://github.com/crolang-p2p.png","language":"Java","readme":"# examples-java-crolang-p2p-node-jvm\nRepository containing examples on how to use the [CrolangP2P library in a JVM (Java) environment](https://github.com/crolang-p2p/crolang-p2p-node-jvm) for the [CrolangP2P project](https://github.com/crolang-p2p).\n\n## Table of Contents\n- [Java Examples Introduction](#java-examples-introduction)\n- [Examples Cross-language Interoperability](#examples-cross-language-interoperability)\n- [Java Examples List](#java-examples-list)\n- [Adding the Library to Your Project](#adding-the-library-to-your-project)\n- [Starting the CrolangP2P Broker](#starting-the-crolangp2p-broker)\n\n## Java Examples Introduction\nThis repository contains a collection of practical examples demonstrating how to use the [CrolangP2P](https://github.com/crolang-p2p) library in a JVM (Java) environment. The official Java/JVM implementation is available here: [crolang-p2p-node-jvm](https://github.com/crolang-p2p/crolang-p2p-node-jvm).\n\nEach example is designed to illustrate a specific use case, ranging from basic node communication to advanced features such as authentication, connection management, and large data transfers.\n\n\u003e The main entry point for the CrolangP2P documentation is available at [https://github.com/crolang-p2p](https://github.com/crolang-p2p).\n\n## Examples Cross-language Interoperability\n[CrolangP2P](https://github.com/crolang-p2p) is a cross-language library, available for multiple programming languages. Each implementation has a dedicated repository with the same set of examples, allowing you to mix and match nodes written in different languages. For instance, you can run the Alice node from Example 1 in Java and the Bob node from Example 1 in JavaScript, and they will interoperate seamlessly.\n\nYou can find the complete list of example repositories for all supported languages here: [CrolangP2P Examples List](https://github.com/crolang-p2p#usage-examples)\n\n## Java Examples List\nThe examples are organized in numbered folders, each with its own source code and a dedicated README explaining the context and execution instructions.\n\n1. [Communication among Nodes with CrolangP2P](src/main/java/examples/ex_1/README.md)\n2. [Connecting to the CrolangP2P Broker](src/main/java/examples/ex_2/README.md)\n3. [Enabling/disabling incoming P2P connections](src/main/java/examples/ex_3/README.md)\n4. [Different ways of establish P2P connections](src/main/java/examples/ex_4/README.md)\n5. [Checking if other Nodes are connected to the Broker](src/main/java/examples/ex_5/README.md)\n6. [Retrieving nodes currently connected to your local nodes](src/main/java/examples/ex_6/README.md)\n7. [Disconnecting from the Broker](src/main/java/examples/ex_7/README.md)\n8. [Sending messages via WebSocket](src/main/java/examples/ex_8/README.md)\n9. [Nodes allowing incoming connections and initiating new connections simultaneously](src/main/java/examples/ex_9/README.md)\n10. [Sending large amount of data over P2P](src/main/java/examples/ex_10/README.md)\n11. [Customizing Local Node Behavior with BrokerConnectionAdditionalParameters](src/main/java/examples/ex_11/README.md)\n12. [Authenticating to the Broker](src/main/java/examples/ex_12/README.md)\n\n## Adding the Library to Your Project\n\nTo use the Java/JVM implementation of CrolangP2P in your project, simply add the dependency to your build configuration. \nThe library is available on Maven Central and can be integrated with Gradle (Kotlin or Groovy DSL) or Maven.\n\nRefer to the [library's Maven Central page](https://central.sonatype.com/artifact/io.github.crolang-p2p/crolang-p2p-node-jvm/overview) for the latest version.\n\n## Starting the CrolangP2P Broker\nTo run the examples, you need to have a [CrolangP2P Broker](https://github.com/crolang-p2p/crolang-p2p-broker) running. \nThe Broker is a central component that facilitates the discovery and connection of nodes in the CrolangP2P network.\n\nRun the CrolangP2P Broker, either by:  \n- [Using Docker](#starting-the-crolangp2p-broker-using-docker)  \n- [Using NodeJs](#starting-the-crolangp2p-broker-using-nodejs)\n\n---\n\n### Starting the CrolangP2P Broker using Docker\n\n```sh\ndocker run --rm --name CrolangP2PBroker -p 8080:8080 crolangp2p/broker\n```\n\nThis will start the Broker on port 8080 (which is the default expected by the example nodes) using the official \n[CrolangP2P Broker Docker image](https://hub.docker.com/r/crolangp2p/broker).\n\n---\n\n### Starting the CrolangP2P Broker using NodeJs\n\n1. Clone the [broker repository](https://github.com/crolang-p2p/crolang-p2p-broker):\n   ```sh\n   git clone https://github.com/crolang-p2p/crolang-p2p-broker.git\n   cd crolang-p2p-broker\n   ```\n2. Install dependencies:\n   ```sh\n   npm install\n   ```\n3. Build the project:\n   ```sh\n   npm run build\n   ```\n4. Start the broker:\n   ```sh\n   npm start\n   ```\n\nThe Broker will be available on port 8080 by default.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrolang-p2p%2Fexamples-java-crolang-p2p-node-jvm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrolang-p2p%2Fexamples-java-crolang-p2p-node-jvm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrolang-p2p%2Fexamples-java-crolang-p2p-node-jvm/lists"}