Skip to content

Commit

Permalink
merged upstream bitcoinj 0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Armstrong committed Jun 29, 2011
2 parents 6a1f7f7 + 1f752ee commit f9aaf27
Show file tree
Hide file tree
Showing 149 changed files with 38,510 additions and 50 deletions.
19 changes: 14 additions & 5 deletions README
Original file line number Original file line Diff line number Diff line change
@@ -1,12 +1,21 @@
To get started, ensure you have the latest JDK installed and then just run "ant". To get started, ensure you have the latest JDK installed, and download Maven from:


- A JAR will be placed in dist/ http://maven.apache.org/
- JavaDocs will be placed in docs/
- Unit tests will be run Then run "mvn clean package" to compile the software. You can also run "mvn site:site" to generate a website with
useful information like JavaDocs. The outputs are under the target/ directory.


Now ensure you're running a BitCoin node locally and run the example app: Now ensure you're running a BitCoin node locally and run the example app:


cd out cd out
java -classpath .:../lib/* com.google.bitcoin.examples.PingService java -classpath .:../lib/* com.google.bitcoin.examples.PingService


It will print a BitCoin address. If you send coins to it, you should get them back a few minutes later when a block is solved. It will download the block chain and eventually print a BitCoin address. If you send coins to it,
you should get them back a few minutes later when a block is solved.

Note that if you connect to a node that is itself downloading the block chain, you will see very slow progress (1
block per second or less). Find a node that isn't heavily loaded to connect to.

If you get a SocketDisconnectedException, the node you've connected to has its max send buffer set to low
(unfortunately the default is too low). Connect to a node that has a bigger send buffer,
settable by passing -maxsendbuffer=25600 to the Bitcoin C++ software.
14 changes: 8 additions & 6 deletions TODO
Original file line number Original file line Diff line number Diff line change
@@ -1,18 +1,20 @@
Here is a brief list of things that still need to be done. Here is a brief list of things that still need to be done.


More unit tests: More unit tests:
- Implement more unit tests for block chain functionality
- Create a MockNetworkConnection and use it to test the Peer. - Create a MockNetworkConnection and use it to test the Peer.


API:
- Reorganize the package layout to be more modular.
- Support multiple active wallets.
- Allow sorting of transactions by time.

Protocol: Protocol:
- Properly support multiple chains
- Start up faster - Start up faster
- Store a block locator in the wallet - Store a block locator in the persisted chain
- Parse the stored headers at startup, then download the rest - Use the getheaders command to speed up the initial chain download
- Provide a seed node list in the NetworkParameters.
- Implement tx fees. - Implement tx fees.
- Support import of private keys and then extracting its transactions from the block chain.
- Longer term potentially add a getmerklebranch protocol command so we can check 0-confirmation transactions. - Longer term potentially add a getmerklebranch protocol command so we can check 0-confirmation transactions.
- Support PeerGroups for holding open/using multiple connections at once.


Examples/documentation: Examples/documentation:
- Implement a simple Swing GUI payment app. - Implement a simple Swing GUI payment app.
Expand Down
301 changes: 286 additions & 15 deletions pom.xml
Original file line number Original file line Diff line number Diff line change
@@ -1,44 +1,194 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <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/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>com.google</groupId> <groupId>com.google</groupId>
<artifactId>bitcoinj</artifactId> <artifactId>bitcoinj</artifactId>
<version>0.0.1-SNAPSHOT</version> <version>0.2</version>

<name>BitCoinJ</name>
<description>A Java implementation of a Bitcoin client-only node</description>
<url>http://code.google.com/p/bitcoinj</url>
<!-- This POM has been tested with the following versions of Maven:
2.2.0, 2.2.1, 3.0.2
Use "mvn clean package" to build quickly without all the reports
Use "mvn clean verify" before submitting a patch
Use "mvn site:site" to generate a complete website under target/site
Use "mvn site:run" to run a local webserver localhost:8080/index.html
-->
<ciManagement>
<url>http://ci.bitcoinj.org/</url>
</ciManagement>
<licenses>
<license>
<name>Apache 2</name>
<url>http://www.apache.org/licenses/LICENSE-2.0</url>
<distribution>repo</distribution>
<comments>A business-friendly OSS license</comments>
</license>
</licenses>
<!-- Committers -->
<developers>
<!-- Information already public -->
<developer>
<name>Mike Hearn</name>
<email>hearn@google.com</email>
</developer>
<developer>
<name>Miron Cuperman</name>
<email>miron@google.com</email>
</developer>
<developer>
<name>Xiaofeng Guo</name>
<email>xiaofengguo@google.com</email>
</developer>
</developers>
<!-- Patchers and contributors -->
<contributors>
<!-- Information already public -->
<contributor>
<name>Thilo Planz</name>
<email>thilo@cpan.org</email>
</contributor>
<contributor>
<name>Micheal Swiggs</name>
<email>bobby.simpson87@gmail.com</email>
</contributor>
<contributor>
<name>Gary Rowe</name>
<email>g.rowe@froot.co.uk</email>
</contributor>
<contributor>
<name>Noa Resare</name>
<email>noa@resare.com</email>
</contributor>
<contributor>
<name>John Sample</name>
<email>jwsample@gmail.com</email>
</contributor>
</contributors>
<issueManagement>
<system>Google Code</system>
<url>http://code.google.com/p/bitcoinj/issues/list</url>
</issueManagement>
<mailingLists>
<mailingList>
<name>BitcoinJ Google Group</name>
<post>https://groups.google.com/forum/#!forum/bitcoinj</post>
</mailingList>
</mailingLists>
<scm>
<!-- Public read-only source -->
<url>http://bitcoinj.googlecode.com/svn/trunk/</url>
</scm>
<profiles>
<profile>
<id>maven-3</id>
<activation>
<file>
<!-- This relies on basedir is only recognized by Maven 3.x (see MNG-2363) -->
<exists>${basedir}</exists>
</file>
</activation>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.0-beta-3</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<artifactId>maven-site-plugin</artifactId>
<executions>
<execution>
<id>attach-descriptor</id>
<goals>
<goal>attach-descriptor</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<build> <build>
<sourceDirectory>src</sourceDirectory> <sourceDirectory>src</sourceDirectory>
<testSourceDirectory>tests</testSourceDirectory> <testSourceDirectory>tests</testSourceDirectory>

<plugins> <plugins>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version> <version>${maven-site-plugin.version}.2</version>
<configuration> <configuration>
<source>1.5</source> <source>1.5</source>
<target>1.5</target> <target>1.5</target>
</configuration> </configuration>
</plugin> </plugin>
<!-- Unit testing -->
<plugin> <plugin>
<groupId>org.codehaus.mojo</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>findbugs-maven-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>
<version>1.2</version> <version>${maven-surefire-plugin.version}</version>
<configuration> </plugin>
<findbugsXmlOutput>true</findbugsXmlOutput> <!-- Unit test reporting -->
<findbugsXmlWithMessages>true</findbugsXmlWithMessages> <plugin>
<xmlOutput>true</xmlOutput> <groupId>org.apache.maven.plugins</groupId>
</configuration> <artifactId>maven-surefire-report-plugin</artifactId>
<version>${maven-surefire-report-plugin.version}</version>
</plugin>
<!-- Generates a source code JAR during package -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>${maven-source-plugin.version}</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin> </plugin>
<!-- Execute FindBugs during verify phase
Will fail the build if it finds a bug
Enable when ready -->
<!--<plugin>-->
<!--<groupId>org.codehaus.mojo</groupId>-->
<!--<artifactId>findbugs-maven-plugin</artifactId>-->
<!--<version>${findbugs-maven-plugin.version}</version>-->
<!--<configuration>-->
<!--<xmlOutput>true</xmlOutput>-->
<!--<xmlOutputDirectory>target/site</xmlOutputDirectory>-->
<!--<findbugsXmlOutput>true</findbugsXmlOutput>-->
<!--<findbugsXmlOutputDirectory>target/site</findbugsXmlOutputDirectory>-->
<!--<effort>Max</effort>-->
<!--<threshold>Low</threshold>-->
<!--</configuration>-->
<!--<executions>-->
<!--<execution>-->
<!--<phase>verify</phase>-->
<!--<goals>-->
<!--<goal>check</goal>-->
<!--</goals>-->
<!--</execution>-->
<!--</executions>-->
<!--</plugin>-->
</plugins> </plugins>

</build> </build>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
<artifactId>junit</artifactId> <artifactId>junit</artifactId>
<version>4.8.2</version> <version>4.8.2</version>
<type>jar</type> <type>jar</type>
<scope>compile</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.slf4j</groupId> <groupId>org.slf4j</groupId>
Expand All @@ -55,4 +205,125 @@
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
</dependencies> </dependencies>
<!-- The reporting section is deprecated in Maven3,
but can be read by site plugin (see MNG-4162) -->
<reporting>
<outputDirectory>${basedir}/target/site</outputDirectory>
<plugins>
<!-- Generates Javadocs -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${maven-javadoc-plugin.version}</version>
<configuration>
<excludePackageNames>com.google.bitcoin.bouncycastle.*</excludePackageNames>
</configuration>
</plugin>
<!-- Generate a FindBugs report -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<version>${findbugs-maven-plugin.version}</version>
<configuration>
<!-- Findbugs takes about 2mins to complete -->
<skip>true</skip>
<xmlOutput>true</xmlOutput>
<xmlOutputDirectory>target/site</xmlOutputDirectory>
<findbugsXmlOutput>true</findbugsXmlOutput>
<findbugsXmlOutputDirectory>target/site</findbugsXmlOutputDirectory>
<effort>Max</effort>
<threshold>Low</threshold>
</configuration>
</plugin>
<!-- Generate a code coverage report -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>${cobertura-maven-plugin.version}</version>
<configuration>
<instrumentation>
<ignores>
<ignore>org.slf4j.*</ignore>
</ignores>
<excludes>
<exclude>com.google.bitcoin.bouncycastle.*</exclude>
</excludes>
</instrumentation>
<formats>
<format>html</format>
<format>xml</format>
</formats>
</configuration>
</plugin>
<!-- Generate an HTML report for unit tests -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-report-plugin</artifactId>
<version>${maven-surefire-report-plugin.version}</version>
</plugin>
<!-- Generate a mini-site for the project -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>${maven-site-plugin.version}</version>
</plugin>
<!-- Generate cross-referenced HTML source code listing -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jxr-plugin</artifactId>
<version>${maven-jxr-plugin.version}</version>
</plugin>
<!-- Execute Taglist to add TODOs, REFACTORs
and so on to the project site during verify
-->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>taglist-maven-plugin</artifactId>
<version>${taglist-maven-plugin.version}</version>
<configuration>
<tagListOptions>
<tagClasses>
<tagClass>
<displayName>Pre-release Project Development Work (Peer Review)</displayName>
<tags>
<tag>
<matchString>TODO</matchString>
<matchType>ignoreCase</matchType>
</tag>
<tag>
<matchString>FIXME</matchString>
<matchType>ignoreCase</matchType>
</tag>
</tags>
</tagClass>
<tagClass>
<displayName>Ongoing Refactoring and Maintenance Work (Technical Debt)</displayName>
<tags>
<tag>
<matchString>REFACTOR</matchString>
<matchType>ignoreCase</matchType>
</tag>
</tags>
</tagClass>
</tagClasses>
</tagListOptions>
</configuration>
</plugin>
</plugins>
</reporting>
<properties>
<!-- Source encoding -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<!-- Plugin versions -->
<!-- Require lower version for Maven3 compatibility -->
<maven-surefire-report-plugin.version>2.4.3</maven-surefire-report-plugin.version>
<maven-jxr-plugin.version>2.1</maven-jxr-plugin.version>
<maven-site-plugin.version>2.3</maven-site-plugin.version>
<maven-surefire-plugin.version>2.8.1</maven-surefire-plugin.version>
<maven-source-plugin.version>2.0.4</maven-source-plugin.version>
<maven-javadoc-plugin.version>2.6.1</maven-javadoc-plugin.version>
<findbugs-maven-plugin.version>2.3.1</findbugs-maven-plugin.version>
<taglist-maven-plugin.version>2.4</taglist-maven-plugin.version>
<cobertura-maven-plugin.version>2.3</cobertura-maven-plugin.version>
</properties>
</project> </project>
Loading

0 comments on commit f9aaf27

Please sign in to comment.