Code Monkey home page Code Monkey logo

libp2p's Introduction

libp2p

libp2p is a p2p network SDK implemented in java language. The functional modules that have been implemented so far include node discovery, connection management, and so on. Subsequent versions will implement more functions.

Build

Building libp2p requires git and Oracle JDK 1.8 to be installed, other JDK versions are not supported yet. Make sure you operate on Linux and MacOS operating systems.

Clone the repo and switch to the main branch

$ git clone https://github.com/tronprotocol/libp2p.git
$ cd libp2p
$ git checkout -t origin/main

Then, run the following command to build libp2p, the libp2p.jar file can be found in libp2p/build/libs/ after being built successfully.

$ ./gradlew clean build -x test

Usage

libp2p can run independently or be imported into other projects.

Run independently

Running libp2p requires Oracle JDK 1.8 to be installed, other JDK versions are not supported yet. Make sure you operate on Linux and MacOS operating systems. then run the following command to start the node:

$ nohup java -jar libp2p.jar [options] >> start.log 2>&1 &

See the manual for details on options

How to include the dependency

Gradle Setting

Add repo setting:

repositories {
    ...
    maven { url 'https://jitpack.io' }
}

Then add the required packages as dependencies. Please add dependencies locally.

dependencies {
	implementation 'com.github.tronprotocol:libp2p:release-v0.1.0'
}

Or if you are using the jar files as your dependencies:

dependencies {
    implementation fileTree(dir:'your path', include: '*.jar')
}

Maven Setting

<repositories>
	<repository>
		<id>jitpack.io</id>
		<url>https://jitpack.io</url>
	</repository>
</repositories>

<dependency>
	<groupId>com.github.tronprotocol</groupId>
	<artifactId>libp2p</artifactId>
	<version>release-v0.1.0</version>
</dependency>

Example

For some examples please check our example package.

libp2p's People

Contributors

317787106 avatar jakevsky avatar jwrct avatar ss334452 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.