在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):Tribler/kotlin-ipv8开源软件地址(OpenSource Url):https://github.com/Tribler/kotlin-ipv8开源编程语言(OpenSource Language):Kotlin 100.0%开源软件介绍(OpenSource Introduction):kotlin-ipv8What is IPv8?IPv8 is a P2P protocol providing authenticated communication. Peers in the network are identified by public keys, and physical IP addresses are abstracted away. The protocol comes with integrated NAT puncturing, allowing P2P communication without using any central server. The protocol is easily extensible with the concept of communities which represent services implemented on top of the protocol. If you want to deep dive into technical details of the protocol and understand how existing communities work, please check out the IPv8 Protocol Specification. You can also refer to the py-ipv8 documentation. Why Kotlin implementation?IPv8 has been originally implemented in Python more than a decade ago and continuously improved since then. However, smartphones have become the primary communication device, and there has been yet no library facilitating direct device to device communication. As there is no efficient way to run Python on Android, we have decided to re-implement the IPv8 protocol stack in Kotlin, and provide this missing library. Kotlin is a relatively new, but increasingly popular, modern, statically typed programming language. Compared to Java, it features null safety, type inference, coroutines, and is more expressive. Moreover, it is 100% interoperable with Java, so applications using this library can still be built in Java. CommunitiesThe protocol is built around the concept of communities. A community (or an overlay) represents a service in the IPv8 network. Every peer can choose which communities to join when starting the protocol stack. The following communities are implemented by the IPv8 core:
TutorialsProject structureThe project is a composed of several modules:
Building Kotlin-ipv8When building Building Kotlin-ipv8 as a library using GradleThe following list contains reminders and recommendations to help you import this project locally using Gradle, when using it as a library.
For an example of a project that uses this repository, refer to the Trustchain app. Sample appsAndroidCheck out TrustChain Super App to see a collection of distributed Android apps implemented on top of IPv8. JVMThe JVM app merely shows a list of connected peers in the CLI, to demonstrate the feasibility of running the stack without any Android dependencies. Run the app locally in JVM:
SLF4J with SimpleLogger is used for logging. You can configure the behavior of the logger by providing supported system properties as arguments. E.g., if you want to see debug logs:
Bootstrap serverIPv8 currently requires a trusted bootstrap server (a tracker) that introduces new peers to the rest of the network. The bootstrap server can be started with the following command, where a port can be specified in the
The tracker should be reachable on a public IP address and its address should be added in TestsWe strive for a high code coverage to keep the project maintainable and stable. All unit tests are currently able to run on JVM, there are no Android instrumented tests. Jacoco is used to report the code coverage. Run unit tests:
Generate code coverage report:
The generated report will be stored in Code styleKtlint is used to enforce a consistent code style across the whole project. Check code style:
Run code formatter:
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论