Skip to content

Commit

Permalink
Bitcoin Verde v2.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
joshmg committed Mar 8, 2023
2 parents b2cf44a + f284a45 commit 02e3a71
Show file tree
Hide file tree
Showing 349 changed files with 15,715 additions and 7,249 deletions.
240 changes: 20 additions & 220 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,235 +1,35 @@
group 'com.softwareverde'
version '2.2.0'

apply plugin: 'java'
apply plugin: 'java-library'

sourceCompatibility = 1.8

sourceSets {
main {
java
resources
}
server {
java
resources

compileClasspath += sourceSets.main.output
runtimeClasspath += sourceSets.main.output
}
test {
java
resources

compileClasspath += sourceSets.server.output
runtimeClasspath += sourceSets.server.output
}
plugins {
id 'java'
id 'java-library'
id 'maven-publish'
}

configurations {
serverImplementation.extendsFrom implementation
serverRuntimeOnly.extendsFrom runtimeOnly

testImplementation.extendsFrom serverImplementation
}
group = 'com.softwareverde'
version = '2.4.0'

repositories {
mavenCentral()
maven { url "https://jitpack.io" }
compileJava {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_11
}

dependencies {
// implementation fileTree(dir: 'libs', include: ['*.jar'])

// SPV Library
api group: 'com.github.softwareverde', name: 'java-util', version: 'v2.7.3'
api group: 'com.github.softwareverde', name: 'java-concurrent', version: 'v1.0.1'
api group: 'com.github.softwareverde', name: 'java-cryptography', version: 'v3.2.1'
api group: 'com.github.softwareverde', name: 'json', version: 'v2.0.0'
api group: 'com.github.softwareverde', name: 'java-db', version: 'v3.3.0'

implementation group: 'com.github.softwareverde', name: 'java-logging', version: 'v2.3.0'

// Bitcoin Core RPC compatibility
api (group: 'com.github.softwareverde', name: 'java-http-client', version: 'v2.2.5', force: true)
api group: 'com.github.softwareverde', name: 'http-servlet', version: 'v3.2.0'
implementation group: 'org.zeromq', name: 'jeromq', version: '0.5.2'

implementation group: 'org.bouncycastle', name: 'bcprov-jdk15on', version: '1.68'
apply from: 'gradle/sources.gradle'
apply from: 'gradle/dependencies.gradle'
apply from: 'gradle/tasks.gradle'

// Server
serverImplementation group: 'com.github.softwareverde', name: 'java-db-mysql', version: 'v4.2.2'
serverImplementation group: 'com.github.softwareverde', name: 'java-db-mysql-embedded', version: 'v3.0.3'
serverImplementation group: 'org.mariadb.jdbc', name: 'mariadb-java-client', version: '2.7.3'

serverImplementation group: 'com.github.softwareverde', name: 'java-mariadb-osx', version: 'v10.5.9-p4'
serverImplementation group: 'com.github.softwareverde', name: 'java-mariadb-linux', version: 'v10.5.9-p1'
serverImplementation group: 'com.github.softwareverde', name: 'java-mariadb-windows', version: 'v10.5.9'
serverImplementation group: 'org.apache.commons', name: 'commons-dbcp2', version: '2.8.0'

serverImplementation group: 'org.jocl', name: 'jocl', version: '2.0.1'

// Testing
testImplementation group: 'junit', name: 'junit', version: '4.11'
}

// configurations.all {
// resolutionStrategy {
// failOnVersionConflict()
// }
// }

task makeFatJar(type: Jar) {
manifest {
attributes 'Implementation-Title': 'Bitcoin Server',
'Implementation-Version': archiveVersion,
'Main-Class': 'com.softwareverde.bitcoin.server.main.Main'
}

archiveBaseName = project.name + '-server-all'

from (configurations.serverCompileClasspath.collect { it.isDirectory() ? it : zipTree(it) }) {
exclude 'META-INF/MANIFEST.MF'
exclude 'META-INF/*.SF'
exclude 'META-INF/*.DSA'
exclude 'META-INF/*.RSA'
}

from sourceSets.main.output
from sourceSets.server.output

with jar
}

task makeLibJar(type: Jar) {
manifest {
attributes 'Implementation-Title': 'Bitcoin Verde Library',
'Implementation-Version': archiveVersion
}

archiveBaseName = project.name + '-lib'

duplicatesStrategy = DuplicatesStrategy.EXCLUDE

with jar
artifacts {
archives sourcesJar
archives javadocJar
}

task makeJar(type: Jar) {
manifest {
attributes 'Implementation-Title': 'Bitcoin Server',
'Implementation-Version': archiveVersion,
'Main-Class': 'com.softwareverde.bitcoin.server.main.Main',
'Class-Path': (project.configurations.serverCompileClasspath + configurations.serverRuntimeClasspath).collect { 'libs/' + it.getName() }.join(' ')
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}

archiveBaseName = project.name + '-server'

duplicatesStrategy = DuplicatesStrategy.EXCLUDE

from sourceSets.main.output
from sourceSets.server.output

with jar
}

task copyDependencies(type: Copy) {
from (configurations.serverCompileClasspath + configurations.serverRuntimeClasspath)
into "$buildDir/libs/libs"

duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}

test {
minHeapSize = "512m"
maxHeapSize = "2024m"
}

tasks.withType(Test) {
testLogging {
// set options for log level LIFECYCLE
events "passed", "skipped", "failed", "standardOut"
showExceptions true
exceptionFormat "full"
showCauses true
showStackTraces true
showStandardStreams false

// set options for log level DEBUG and INFO
debug {
events "started", "passed", "skipped", "failed", "standardOut", "standardError"
exceptionFormat "full"
}
info.events = debug.events
info.exceptionFormat = debug.exceptionFormat

afterSuite { desc, result ->
if (!desc.parent) { // will match the outermost suite
def output = "Results: ${result.resultType} (${result.testCount} tests, ${result.successfulTestCount} successes, ${result.failedTestCount} failures, ${result.skippedTestCount} skipped)"
def startItem = '| ', endItem = ' |'
def repeatLength = startItem.length() + output.length() + endItem.length()
println('\n' + ('-' * repeatLength) + '\n' + startItem + output + endItem + '\n' + ('-' * repeatLength))
}
}
}
}

tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}

task sourcesJar(type: Jar, dependsOn: classes) {
archiveClassifier = 'sources'
from sourceSets.main.allSource
}

task javadocJar(type: Jar, dependsOn: javadoc) {
archiveClassifier = 'javadoc'
from javadoc.destinationDir
}

artifacts {
archives sourcesJar
archives javadocJar
}

allprojects {
configurations {
umljavadoc
}

dependencies {
umljavadoc 'org.umlgraph:umlgraph:5.6'
}

// Requires "dot". `brew install graphviz`
task makeDocumentation(dependsOn: javadoc) {
setDescription('Generates Javadoc API documentation with UMLGraph diagrams')
setGroup(JavaBasePlugin.DOCUMENTATION_GROUP)

doLast {
def javaFilePath = file('src/main/java')
if (javaFilePath.exists()) {
ant.javadoc(classpath: (configurations.serverCompileClasspath).asPath,
sourcepath: file('src/main/java'),
packagenames: '*',
destdir: "${docsDir}/javadoc",
private: 'true',
docletpath: configurations.umljavadoc.asPath) {
doclet(name: 'org.umlgraph.doclet.UmlGraphDoc') {
param(name: '-inferrel')
param(name: '-inferdep')
param(name: '-qualify')
param(name: '-postfixpackage')
param(name: '-hide', value: 'java.*')
param(name: '-collpackages', value: 'java.util.*')
param(name: '-nodefontsize', value: '9')
param(name: '-nodefontpackagesize', value: '7')
param(name: '-link', value: 'http://java.sun.com/j2se/1.5.0/docs/guide/javadoc/doclet/spec')
param(name: '-link', value: 'http://java.sun.com/j2se/1.5/docs/api')
}
}
}
}
}
}
5 changes: 3 additions & 2 deletions conf/server.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
bitcoin.port = 8333
bitcoin.rpcPort = 8334
bitcoin.seedNodes = ["btc.softwareverde.com", "bitcoinverde.org", "165.227.101.23", "174.138.115.135", "143.198.68.1", "167.71.40.96", "128.199.111.18"]
bitcoin.seedNodes = ["btc.softwareverde.com", "bitcoinverde.org", "165.227.101.23", "174.138.115.135", "143.198.68.1", "128.199.111.18"]
bitcoin.dnsSeeds = ["seed.bchd.cash", "seed-bch.bitcoinforks.org", "btccash-seeder.bitcoinunlimited.info", "seed.flowee.cash"]
bitcoin.userAgentBlacklist = [".*Bitcoin ABC.*", ".*Bitcoin SV.*"]
bitcoin.nodeWhitelist = []
Expand All @@ -11,10 +11,11 @@ bitcoin.maxPeerCount = 24
bitcoin.prioritizeNewPeers = 0
bitcoin.enableBootstrap = 1
bitcoin.enableBlockPruning = 0
bitcoin.enableBlockchainCache = 1
bitcoin.enableFastSync = 0
bitcoin.fastSyncTimeoutSeconds = 14400
bitcoin.indexBlocks = 0
bitcoin.trustedBlockHeight = 635259
bitcoin.trustedBlockHeight = 710000
bitcoin.deletePendingBlocks = 1
bitcoin.maxThreadCount = 2
bitcoin.maxUtxoCacheByteCount = 1073741824
Expand Down
3 changes: 2 additions & 1 deletion explorer/www/documentation/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,8 @@ <h3>Security</h3>
<tr><td data-label="Module">bitcoin</td><td data-label="Property">seedNodes</td><td data-label="Default Value">["btc.softwareverde.com", "bitcoinverde.org"]</td><td data-label="Description">The seed nodes which are initially connected to on start. Currently at least one seed node is required since DNS seeding is not currently supported. Should not exceed maxPeerCount. May optionally contain a port (eg: "bitcoinverde.org:8333").</td></tr>
<tr><td data-label="Module">bitcoin</td><td data-label="Property">whitelistedNodes</td><td data-label="Default Value">[]</td><td data-label="Description">The list of nodes that are prevented from being banned under any circumstance.</td></tr>
<tr><td data-label="Module">bitcoin</td><td data-label="Property">enableBanFilter</td><td data-label="Default Value">1</td><td data-label="Description">If set to zero or false, then nodes will not be banned under any circumstances. Additionally, any previously banned nodes will be unbanned while disabled.</td></tr>
<tr><td data-label="Module">bitcoin</td><td data-label="Property">enableBlockPruning</td><td data-label="Default Value">0</td><td data-label="Description">If set to 1 or true, then node will only keep the most recent blocks on disk once they are processed, reducing disk footprint.</td></tr>
<tr><td data-label="Module">bitcoin</td><td data-label="Property">enableBlockPruning</td><td data-label="Default Value">0</td><td data-label="Description">If set to 1 or true, then the node will only keep the most recent blocks on disk once they are processed, reducing disk footprint.</td></tr>
<tr><td data-label="Module">bitcoin</td><td data-label="Property">enableBlockchainCache</td><td data-label="Default Value">1</td><td data-label="Description">If set to 1 or true, then the node will allocate enough memory to store all blockchain headers and metadata within the application (roughly 500mb), increasing block/header processing.</td></tr>
<tr><td data-label="Module">bitcoin</td><td data-label="Property">maxPeerCount</td><td data-label="Default Value">32</td><td data-label="Description">The maximum number of peers that the node will accept.</td></tr>
<tr><td data-label="Module">bitcoin</td><td data-label="Property">maxThreadCount</td><td data-label="Default Value">4</td><td data-label="Description">The max number of threads used to validate a block. Currently, the server will create max(maxPeerCount * 8, 256) threads for network communication; in the future this property will likely claim this label.</td></tr>
<tr><td data-label="Module">bitcoin</td><td data-label="Property">trustedBlockHeight</td><td data-label="Default Value">391180</td><td data-label="Description">Blocks prior to this height will not have their transactions validated.</td></tr>
Expand Down
6 changes: 6 additions & 0 deletions explorer/www/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,12 @@
<div class="type"><label>Type</label><span class="value">UNKNOWN</span></div>
<div class="script"><label>Operations</label><span class="value"></span></div>
</div>
<div class="cash-token">
<div class="category">-</div>
<div class="nft-capability">-</div>
<div class="commitment">-</div>
<div class="token-amount">-</div>
</div>
</div>

<div class="script-operation">
Expand Down
7 changes: 7 additions & 0 deletions explorer/www/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,13 @@ $(document).ready(function() {
blockLink.on("click", Ui._makeNavigateToBlockEvent(blockHeader.hash));
element.off("click");
}
else if (message.ping) {
const pongMessage = {
"pong": message.ping
};

webSocket.send(JSON.stringify(pongMessage));
}

if (container != null && element != null) {
const childrenElements = container.children();
Expand Down
48 changes: 48 additions & 0 deletions gradle/dependencies.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
repositories {
mavenCentral()
maven { url "https://jitpack.io" }
}

dependencies {
// implementation fileTree(dir: 'libs', include: ['*.jar'])

// SPV Library
api group: 'com.github.softwareverde', name: 'java-util', version: 'v2.7.5'
api group: 'com.github.softwareverde', name: 'java-concurrent', version: 'v1.0.1'
api group: 'com.github.softwareverde', name: 'java-cryptography', version: 'v3.2.1'
api group: 'com.github.softwareverde', name: 'json', version: 'v2.0.1'
api group: 'com.github.softwareverde', name: 'java-db', version: 'v3.3.0'

implementation group: 'com.github.softwareverde', name: 'java-logging', version: 'v2.3.0'

// Bitcoin Core RPC compatibility
api (group: 'com.github.softwareverde', name: 'java-http-client') { version { strictly 'v2.2.5' } }
api group: 'com.github.softwareverde', name: 'http-servlet', version: 'v3.3.0'
implementation group: 'org.zeromq', name: 'jeromq', version: '0.5.2'

implementation group: 'org.bouncycastle', name: 'bcprov-jdk15on', version: '1.70'

// Server
serverImplementation group: 'com.github.softwareverde', name: 'java-db-mysql', version: 'v4.2.2'
serverImplementation group: 'com.github.softwareverde', name: 'java-db-mysql-embedded', version: 'v3.2.1'
serverImplementation group: 'org.mariadb.jdbc', name: 'mariadb-java-client', version: '3.0.7'

serverImplementation group: 'com.github.softwareverde', name: 'java-mariadb-osx', version: 'v10.8.3'
serverImplementation group: 'com.github.softwareverde', name: 'java-mariadb-linux', version: 'v10.8.3-p1'
serverImplementation group: 'com.github.softwareverde', name: 'java-mariadb-windows', version: 'v10.5.9'

// Used for routing MariaDbConnectionPool logs...
serverImplementation group: 'com.github.softwareverde', name: 'java-logging-slf4j', version: 'v1.0.1'
serverImplementation group: 'org.slf4j', name: 'slf4j-api', version: '1.7.36'

serverImplementation group: 'org.jocl', name: 'jocl', version: '2.0.4'

// Testing
testImplementation group: 'junit', name: 'junit', version: '4.13.2'
}

// configurations.all {
// resolutionStrategy {
// failOnVersionConflict()
// }
// }
27 changes: 27 additions & 0 deletions gradle/sources.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
sourceSets {
main {
java
resources
}
server {
java
resources

compileClasspath += sourceSets.main.output
runtimeClasspath += sourceSets.main.output
}
test {
java
resources

compileClasspath += sourceSets.server.output
runtimeClasspath += sourceSets.server.output
}
}

configurations {
serverImplementation.extendsFrom implementation
serverRuntimeOnly.extendsFrom runtimeOnly

testImplementation.extendsFrom serverImplementation
}
Loading

0 comments on commit 02e3a71

Please sign in to comment.