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.");
|
||||||
|
```
|
||||||
|
79
build.gradle
79
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,50 +27,51 @@ subprojects {
|
|||||||
archives javadocJar, sourcesJar
|
archives javadocJar, sourcesJar
|
||||||
}
|
}
|
||||||
|
|
||||||
// Note: to build the project, you'll either need to
|
signing {
|
||||||
if (hasProperty('signing.keyId')) {
|
required { isReleaseVersion && gradle.taskGraph.hasTask("uploadArchives") }
|
||||||
signing {
|
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) }
|
|
||||||
|
|
||||||
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
|
if (!hasProperty('ossrhUsername')) {
|
||||||
authentication(userName: ossrhUsername, password: ossrhPassword)
|
ext.ossrhUsername = 'dummy'
|
||||||
|
ext.ossrhPassword = 'dummy'
|
||||||
|
}
|
||||||
|
|
||||||
|
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
|
||||||
|
authentication(userName: ossrhUsername, password: ossrhPassword)
|
||||||
|
}
|
||||||
|
|
||||||
|
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
|
||||||
|
authentication(userName: ossrhUsername, password: ossrhPassword)
|
||||||
|
}
|
||||||
|
|
||||||
|
pom.project {
|
||||||
|
name 'Jabit'
|
||||||
|
packaging 'jar'
|
||||||
|
url 'https://github.com/Dissem/Jabit'
|
||||||
|
|
||||||
|
scm {
|
||||||
|
connection 'scm:git:https://github.com/Dissem/Jabit.git'
|
||||||
|
developerConnection 'scm:git:git@github.com:Dissem/Jabit.git'
|
||||||
|
url 'https://github.com/Dissem/Jabit.git'
|
||||||
}
|
}
|
||||||
|
|
||||||
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
|
licenses {
|
||||||
authentication(userName: ossrhUsername, password: ossrhPassword)
|
license {
|
||||||
|
name 'The Apache License, Version 2.0'
|
||||||
|
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pom.project {
|
developers {
|
||||||
name 'Jabit'
|
developer {
|
||||||
packaging 'jar'
|
name 'Christian Basler'
|
||||||
url 'https://github.com/Dissem/Jabit'
|
email 'chrigu.meyer@gmail.com'
|
||||||
|
|
||||||
scm {
|
|
||||||
connection 'scm:git:https://github.com/Dissem/Jabit.git'
|
|
||||||
developerConnection 'scm:git:git@github.com:Dissem/Jabit.git'
|
|
||||||
url 'https://github.com/Dissem/Jabit.git'
|
|
||||||
}
|
|
||||||
|
|
||||||
licenses {
|
|
||||||
license {
|
|
||||||
name 'The Apache License, Version 2.0'
|
|
||||||
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
developers {
|
|
||||||
developer {
|
|
||||||
name 'Christian Basler'
|
|
||||||
email 'chrigu.meyer@gmail.com'
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user