Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(WIP) Add namecoinj-daemon. #40

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions bitcoinj-daemon/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,13 @@ idea {
}
}

jar {
baseName = 'bitcoinj-daemon-lib'
enabled = true
}

dependencies {
compile project(':bitcoinj-params')
compile project(':bitcoinj-server')
compile "org.springframework.boot:spring-boot-starter-web"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,15 @@
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

import com.msgilligan.bitcoinj.daemon.config.BitcoinConfig;
import com.msgilligan.bitcoinj.params.config.BitcoinParamsConfig;

/**
* Spring Boot application container for **bitcoinj daemon**
*/
@Configuration
@EnableAutoConfiguration
@ComponentScan(basePackages="com.msgilligan.bitcoinj.daemon")
@ComponentScan(basePackageClasses={BitcoinParamsConfig.class, BitcoinConfig.class})
public class Application {

public static void main(String[] args) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@
*/
@Configuration
public class BitcoinConfig {
@Bean
public NetworkParameters networkParameters() {
return MainNetParams.get();
}

@Bean
public PeerDiscovery peerDiscovery(NetworkParameters params) throws FileNotFoundException {
PeerDiscovery pd;
Expand Down
25 changes: 25 additions & 0 deletions bitcoinj-params/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
buildscript {
repositories {
jcenter()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
}

apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'

jar {
baseName = 'bitcoinj-params'
enabled = true
}

bootJar {
enabled = false
}

dependencies {
compile "org.bitcoinj:bitcoinj-core:${bitcoinjVersion}"
compile "org.springframework.boot:spring-boot-starter-web"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.msgilligan.bitcoinj.params.config;

import org.bitcoinj.core.NetworkParameters;
import org.bitcoinj.params.MainNetParams;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
* Spring configuration for Bitcoin Mainnet params
*/
@Configuration
public class BitcoinParamsConfig {
@Bean
public NetworkParameters networkParameters() {
return MainNetParams.get();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/**
* Spring configuration objects for the bitcoinj Daemon
*/
package com.msgilligan.bitcoinj.params.config;
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/**
* BitcoinJ network parameters for Bitcoin Mainnet.
*/
package com.msgilligan.bitcoinj.params;
29 changes: 29 additions & 0 deletions libdohj-params/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
buildscript {
repositories {
jcenter()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
}

apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'

repositories {
mavenLocal()
}

jar {
baseName = 'libdohj-params'
enabled = true
}

bootJar {
enabled = false
}

dependencies {
compile "org.libdohj:libdohj-core:0.14-SNAPSHOT"
compile "org.springframework.boot:spring-boot-starter-web"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.msgilligan.namecoinj.params.config;

import org.bitcoinj.core.NetworkParameters;
import org.libdohj.params.NamecoinMainNetParams;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
* Spring configuration for Namecoin Mainnet params
*/
@Configuration
public class NamecoinParamsConfig {
@Bean
public NetworkParameters networkParameters() {
return NamecoinMainNetParams.get();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/**
* BitcoinJ network parameters for Namecoin Mainnet.
*/
package com.msgilligan.namecoinj.params.config;
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/**
* BitcoinJ network parameters for Namecoin Mainnet.
*/
package com.msgilligan.namecoinj.params;
60 changes: 60 additions & 0 deletions namecoinj-daemon/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
buildscript {
repositories {
jcenter()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
}

apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'

archivesBaseName = 'namecoinj-daemon'

idea {
module {
jdkName = '1.8'
// languageLevel = '1.8'
}
}

repositories {
mavenLocal()
}

dependencies {
compile project(':libdohj-params')
compile project(':bitcoinj-server')
compile project(':bitcoinj-daemon')
compile "org.springframework.boot:spring-boot-starter-web"
}

springBoot {
mainClassName = "com.msgilligan.namecoinj.daemon.Application"
}

bintrayUpload.dependsOn bootJar

// See: http://docs.spring.io/spring-boot/docs/1.3.0.M4/reference/htmlsingle/#build-tool-plugins-gradle-publishing-artifacts-to-a-maven-repository-import
uploadArchives {
repositories {
mavenDeployer {
pom {
project {
dependencyManagement {
dependencies {
dependency {
groupId "org.springframework.boot"
artifactId "spring-boot-dependencies"
version springBootVersion
type "pom"
scope "import"
}
}
}
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package com.msgilligan.namecoinj.daemon;

import org.springframework.boot.Banner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

import com.msgilligan.bitcoinj.daemon.config.BitcoinConfig;
import com.msgilligan.namecoinj.params.config.NamecoinParamsConfig;

/**
* Spring Boot application container for **bitcoinj daemon**
*/
@Configuration
@EnableAutoConfiguration
@ComponentScan(basePackageClasses={NamecoinParamsConfig.class, BitcoinConfig.class})
public class Application {

public static void main(String[] args) {
SpringApplication app = new SpringApplication(Application.class);
app.setBannerMode(Banner.Mode.OFF);
app.run(args);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/**
* A Bitcoin JSON-RPC server (daemon) that aims to replicate `bitcoind`
*/
package com.msgilligan.namecoinj.daemon;
6 changes: 4 additions & 2 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ include 'consensusj-jsonrpc', // JSONRPC
'cjbtc-jsonrpc-gvy',
'bitcoinj-json', // JSON <-> Java Object mapping
'bitcoinj-cli', 'bitcoinj-rpcclient', // Client
'bitcoinj-server', 'bitcoinj-daemon', 'bitcoinj-peerserver', // Server lib + 2 server apps
'bitcoinj-params', 'bitcoinj-server', 'bitcoinj-daemon', 'bitcoinj-peerserver', // Server lib + 2 server apps
'bitcoinj-dsl', 'bitcoinj-spock', // DSL/Testing
'bitcoinj-money', // JavaMoney (JSR-354) support
'bitcoinj-dsljs',
'bitcoinj-proxy'
'bitcoinj-proxy',
'libdohj-params',
'namecoinj-daemon'