Version 0.2.0 bump
This commit is contained in:
parent
6fbb3f850d
commit
c1ca1d856d
59
README.md
59
README.md
@ -1,7 +1,7 @@
|
|||||||
Jabit [![Build Status](https://travis-ci.org/Dissem/Jabit.svg?branch=master)](https://travis-ci.org/Dissem/Jabit)
|
Jabit [![Build Status](https://travis-ci.org/Dissem/Jabit.svg?branch=master)](https://travis-ci.org/Dissem/Jabit)
|
||||||
=====
|
=====
|
||||||
|
|
||||||
A Java implementation for the Bitmessage protocol. To build, use command `gradle build`. Note that for some tests to run, a standard Bitmessage client needs to run on the same system, using port 8444 (the default port).
|
A Java implementation for the Bitmessage protocol. To build, use command `gradle build` or `./gradlew build`.
|
||||||
|
|
||||||
Please note that development is still heavily in progress, and I will break the database a lot until it's ready for prime time.
|
Please note that development is still heavily in progress, and I will break the database a lot until it's ready for prime time.
|
||||||
|
|
||||||
@ -12,6 +12,7 @@ There are most probably some security issues, me programming this thing all by m
|
|||||||
|
|
||||||
Project Status
|
Project Status
|
||||||
--------------
|
--------------
|
||||||
|
|
||||||
Basically, everything needed for a working Bitmessage client is there:
|
Basically, everything needed for a working Bitmessage client is there:
|
||||||
* Creating new identities (private addresses)
|
* Creating new identities (private addresses)
|
||||||
* Adding contracts and subscriptions
|
* Adding contracts and subscriptions
|
||||||
@ -22,3 +23,59 @@ Basically, everything needed for a working Bitmessage client is there:
|
|||||||
* Initialise and manage a registry of Bitmessage network nodes
|
* Initialise and manage a registry of Bitmessage network nodes
|
||||||
* An easy to use API
|
* An easy to use API
|
||||||
* A command line demo application built using the API
|
* A command line demo application built using the API
|
||||||
|
|
||||||
|
Setup
|
||||||
|
-----
|
||||||
|
|
||||||
|
Add Jabit as Gradle dependency:
|
||||||
|
```Gradle
|
||||||
|
compile 'ch.dissem.jabit:jabit-domain:0.2.0'
|
||||||
|
```
|
||||||
|
Unless you want to implement your own, also add the following:
|
||||||
|
```Gradle
|
||||||
|
compile 'ch.dissem.jabit:jabit-networking:0.2.0'
|
||||||
|
compile 'ch.dissem.jabit:jabit-repositories:0.2.0'
|
||||||
|
```
|
||||||
|
And if you want to import from or export to the Wallet Import Format (used by PyBitmessage) you might also want to add:
|
||||||
|
```Gradle
|
||||||
|
compile 'ch.dissem.jabit:jabit-wif:0.2.0'
|
||||||
|
```
|
||||||
|
|
||||||
|
Usage
|
||||||
|
-----
|
||||||
|
|
||||||
|
First, you'll need to create a `BitmessageContext`:
|
||||||
|
```Java
|
||||||
|
JdbcConfig jdbcConfig = new JdbcConfig();
|
||||||
|
BitmessageContext ctx = new BitmessageContext.Builder()
|
||||||
|
.addressRepo(new JdbcAddressRepository(jdbcConfig))
|
||||||
|
.inventory(new JdbcInventory(jdbcConfig))
|
||||||
|
.messageRepo(new JdbcMessageRepository(jdbcConfig))
|
||||||
|
.nodeRegistry(new MemoryNodeRegistry())
|
||||||
|
.networkHandler(new NetworkNode())
|
||||||
|
.build();
|
||||||
|
```
|
||||||
|
This creates a simple context using a H2 database that will be created in the user's home directory. Next you'll need to
|
||||||
|
start the context and decide what happens if a message arrives:
|
||||||
|
```Java
|
||||||
|
ctx.startup(new BitmessageContext.Listener() {
|
||||||
|
@Override
|
||||||
|
public void receive(Plaintext plaintext) {
|
||||||
|
// TODO: Notify the user
|
||||||
|
}
|
||||||
|
});
|
||||||
|
```
|
||||||
|
Then you might want to create an identity
|
||||||
|
```Java
|
||||||
|
BitmessageAddress identity = ctx.createIdentity(false, Pubkey.Feature.DOES_ACK);
|
||||||
|
```
|
||||||
|
or add some contacts
|
||||||
|
```Java
|
||||||
|
BitmessageAddress contact = new BitmessageAddress("BM-2cTarrmjMdRicKZ4qQ8A13JhoR3Uq6Zh5j");
|
||||||
|
address.setAlias("Chris");
|
||||||
|
ctx.addContact(contact);
|
||||||
|
```
|
||||||
|
to which you can send some messages
|
||||||
|
```Java
|
||||||
|
ctx.send(identity, contact, "Test", "Hello Chris, this is a message.");
|
||||||
|
```
|
||||||
|
15
build.gradle
15
build.gradle
@ -5,7 +5,9 @@ subprojects {
|
|||||||
|
|
||||||
sourceCompatibility = 1.7
|
sourceCompatibility = 1.7
|
||||||
group = 'ch.dissem.jabit'
|
group = 'ch.dissem.jabit'
|
||||||
version = '0.1.3-SNAPSHOT'
|
version = '0.2.0'
|
||||||
|
|
||||||
|
ext.isReleaseVersion = !version.endsWith("SNAPSHOT")
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
@ -25,19 +27,21 @@ subprojects {
|
|||||||
archives javadocJar, sourcesJar
|
archives javadocJar, sourcesJar
|
||||||
}
|
}
|
||||||
|
|
||||||
// Note: to build the project, you'll either need to
|
|
||||||
if (hasProperty('signing.keyId')) {
|
|
||||||
signing {
|
signing {
|
||||||
|
required { isReleaseVersion && gradle.taskGraph.hasTask("uploadArchives") }
|
||||||
sign configurations.archives
|
sign configurations.archives
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (hasProperty('ossrhUsername')) {
|
|
||||||
uploadArchives {
|
uploadArchives {
|
||||||
repositories {
|
repositories {
|
||||||
mavenDeployer {
|
mavenDeployer {
|
||||||
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
|
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
|
||||||
|
|
||||||
|
if (!hasProperty('ossrhUsername')) {
|
||||||
|
ext.ossrhUsername = 'dummy'
|
||||||
|
ext.ossrhPassword = 'dummy'
|
||||||
|
}
|
||||||
|
|
||||||
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
|
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
|
||||||
authentication(userName: ossrhUsername, password: ossrhPassword)
|
authentication(userName: ossrhUsername, password: ossrhPassword)
|
||||||
}
|
}
|
||||||
@ -74,5 +78,4 @@ subprojects {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user