-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
1,577 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
The following people provided their time and effort to building this website (in first name alphabetical order): | ||
|
||
Gary Rowe | ||
Jim Burton |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,72 @@ | ||
brit-server | ||
=========== | ||
## MultiBit BRIT Server | ||
|
||
A Dropwizard implementation of a BRIT server | ||
This repo contains the source for the MultiBit BRIT server. | ||
|
||
From a technical point of view this project uses | ||
|
||
* Java - Primary language of the app | ||
* [Maven](http://maven.apache.org/) - Build system | ||
* [Dropwizard](http://dropwizard.io) - Self-contained web server | ||
|
||
## Branches | ||
|
||
We follow the ["master-develop" branching strategy](http://nvie.com/posts/a-successful-git-branching-model/). | ||
|
||
This means that the latest release is on the "master" branch (the default) and the latest release candidate is on the "develop" branch. | ||
Any issues are addressed in feature branches from "develop" and merged in as required. | ||
|
||
#### Verify you have Maven 3+ | ||
|
||
Most IDEs (such as [Intellij Community Edition](http://www.jetbrains.com/idea/download/)) come with support for Maven built in, | ||
but if not then you may need to [install it manually](http://maven.apache.org/download.cgi). | ||
|
||
IDEs such as Eclipse may require the [m2eclipse plugin](http://www.sonatype.org/m2eclipse) to be configured. | ||
|
||
To quickly check that you have Maven 3+ installed check on the command line: | ||
``` | ||
$ mvn --version | ||
``` | ||
|
||
#### Manually build and install MultiBit HD BRIT | ||
|
||
At present it is necessary to checkout [multibit-hd](https://github.com/bitcoin-solutions/multibit-hd/) and build it manually. You will need to | ||
use the HEAD of the `develop` branch. | ||
``` | ||
$ mvn clean install | ||
``` | ||
|
||
### Inside an IDE | ||
|
||
Import the project as a Maven project in the usual manner. | ||
|
||
To start the project you just need to execute `BritService.main()` as a Java application. You'll need a runtime configuration | ||
that passes in `server brit-config.yml` as the Program Arguments. | ||
|
||
On startup you will need to provide the passphrase for the Matcher key store. It is not persisted anywhere. | ||
|
||
Open a browser to [http://localhost:9090/brit/public-key](http://localhost:9090/brit/public-key) and you should see the BRIT server | ||
public key. | ||
|
||
### Outside of an IDE | ||
|
||
Assuming that you've got Java and Maven installed you'll find it very straightforward to get the BRIT server running. Just clone | ||
from GitHub and do the following: | ||
|
||
``` | ||
cd <project root> | ||
mvn clean install | ||
java -jar target/site-<version>.jar server brit-config.yml | ||
``` | ||
|
||
where `<project root>` is the root directory of the project as checked out through git and `<version>` is the version | ||
as found in `pom.xml` (e.g. "3.0.0") but you'll see a `.jar` in the `target` directory so it'll be obvious. | ||
|
||
All commands will work on *nix without modification, use \ instead of / for Windows. | ||
|
||
Open a browser to [http://localhost:9090/brit/public-key](http://localhost:9090/brit/public-key) and you should see the BRIT server | ||
public key. | ||
|
||
### Where does the ASCII art come from? | ||
|
||
The ASCII art for the startup banner was created using the online tool available at | ||
[TAAG](http://patorjk.com/software/taag/#p=display&f=Slant&t=BRIT%20Server) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# ################################## Dropwizard specific settings ################################## | ||
|
||
# Define the HTTP settings | ||
http: | ||
port: 9090 | ||
adminPort: 9091 | ||
|
||
logging: | ||
|
||
level: WARN | ||
|
||
# Logger-specific levels. | ||
loggers: | ||
|
||
# Set specific levels | ||
#"com.sun.jersey.api.client": DEBUG | ||
"com.yammer": INFO # See the banner | ||
"org.multibit.hd": DEBUG | ||
|
||
# ... | ||
# Settings for logging to stdout. | ||
console: | ||
|
||
# If true, write log statements to stdout. | ||
enabled: true | ||
|
||
# Do not display log statements below this threshold to stdout. | ||
threshold: ALL | ||
|
||
# Settings for logging to a file. | ||
file: | ||
|
||
# If true, write log statements to a file. | ||
enabled: false | ||
|
||
# Do not write log statements below this threshold to the file. | ||
threshold: ALL | ||
|
||
# The file to which current statements will be logged. | ||
currentLogFilename: /var/log/brit/developer.log | ||
|
||
# When the log file rotates, the archived log will be renamed to this and gzipped. The | ||
# %d is replaced with the previous day (yyyy-MM-dd). Custom rolling windows can be created | ||
# by passing a SimpleDateFormat-compatible format as an argument: "%d{yyyy-MM-dd-hh}". | ||
archivedLogFilenamePattern: /var/log/brit/developer-%d.log.gz | ||
|
||
# The number of archived files to keep. | ||
archivedFileCount: 5 | ||
|
||
# The timezone used to format dates. HINT: USE THE DEFAULT, UTC. | ||
timeZone: UTC |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
|
||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>org.multibit.hd</groupId> | ||
<artifactId>brit-server</artifactId> | ||
|
||
<!-- Only change this on a master or release branch --> | ||
<version>develop-SNAPSHOT</version> | ||
|
||
<url>http://localhost:9090</url> | ||
|
||
<name>MultiBit BRIT Server</name> | ||
<description>A BRIT server using Dropwizard</description> | ||
<inceptionYear>2014</inceptionYear> | ||
|
||
<!-- Set the version levels for linked dependencies --> | ||
<properties> | ||
<dropwizard.version>0.6.2</dropwizard.version> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> | ||
</properties> | ||
|
||
<build> | ||
|
||
<plugins> | ||
|
||
<!-- All compilation is done under Java7 --> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>2.3</version> | ||
<configuration> | ||
<source>1.7</source> | ||
<target>1.7</target> | ||
<debug>true</debug> | ||
</configuration> | ||
</plugin> | ||
|
||
<!-- Shade plugin is required to make a "slim" JAR --> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-shade-plugin</artifactId> | ||
<version>1.6</version> | ||
<configuration> | ||
<createDependencyReducedPom>true</createDependencyReducedPom> | ||
<filters> | ||
<filter> | ||
<artifact>*:*</artifact> | ||
<excludes> | ||
<exclude>META-INF/*.SF</exclude> | ||
<exclude>META-INF/*.DSA</exclude> | ||
<exclude>META-INF/*.RSA</exclude> | ||
<exclude>META-INF/*.less</exclude> | ||
</excludes> | ||
</filter> | ||
</filters> | ||
</configuration> | ||
<executions> | ||
<execution> | ||
<phase>package</phase> | ||
<goals> | ||
<goal>shade</goal> | ||
</goals> | ||
<configuration> | ||
<transformers> | ||
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/> | ||
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> | ||
<mainClass>org.multibit.hd.brit.BritService</mainClass> | ||
</transformer> | ||
</transformers> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
<dependencies> | ||
|
||
<!-- Dropwizard framework --> | ||
<!-- Core functionality --> | ||
<dependency> | ||
<groupId>com.yammer.dropwizard</groupId> | ||
<artifactId>dropwizard-core</artifactId> | ||
<version>${dropwizard.version}</version> | ||
</dependency> | ||
<!-- HTML Freemarker views support --> | ||
<dependency> | ||
<groupId>com.yammer.dropwizard</groupId> | ||
<artifactId>dropwizard-views</artifactId> | ||
<version>${dropwizard.version}</version> | ||
</dependency> | ||
|
||
<!-- Guava support library --> | ||
<dependency> | ||
<groupId>com.google.guava</groupId> | ||
<artifactId>guava</artifactId> | ||
<version>14.0.1</version> | ||
</dependency> | ||
|
||
<!-- BRIT support --> | ||
<dependency> | ||
<groupId>org.multibit.hd</groupId> | ||
<artifactId>mbhd-brit</artifactId> | ||
<version>0.0.1-SNAPSHOT</version> | ||
</dependency> | ||
|
||
<!-- Test libraries --> | ||
|
||
<!-- Dropwizard resource testing support (includes JUnit, FEST etc) --> | ||
<dependency> | ||
<groupId>com.yammer.dropwizard</groupId> | ||
<artifactId>dropwizard-testing</artifactId> | ||
<version>${dropwizard.version}</version> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
</dependencies> | ||
|
||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package org.multibit.site; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.yammer.dropwizard.config.Configuration; | ||
import org.hibernate.validator.constraints.NotEmpty; | ||
|
||
/** | ||
* <p>DropWizard Configuration to provide the following to application:</p> | ||
* <ul> | ||
* <li>Initialisation code</li> | ||
* </ul> | ||
* | ||
* @since 0.0.1 | ||
* | ||
*/ | ||
public class BritConfiguration extends Configuration { | ||
|
||
@NotEmpty | ||
@JsonProperty | ||
private String matcherStoreDirectory ="/var/matcher"; | ||
|
||
public String getMatcherStoreDirectory() { | ||
return matcherStoreDirectory; | ||
} | ||
|
||
|
||
} |
Oops, something went wrong.