bitcoin-sv / block-headers-client Goto Github PK
View Code? Open in Web Editor NEWA block headers client used for SPV and independent verification of proofs
License: Other
A block headers client used for SPV and independent verification of proofs
License: Other
The node starts a blockchain in what is called "Initial block download" mode. This does not send P2P notifications until a certain amount of work is accrued or something. HeaderSV appears to work inconsistently with regard to this mode.
For regtest development IBD is a continual nuisance in any software that has to deal with the node and it is very unlikely we can get the node to change. This should be looked into and HeaderSV should have the ability to work around it and provide a consistent and reliable experience IMO.
The instructions infer you should download gradle, but running gradlew downloads and runs gradle. It would be good if a note that gradle is downloaded and run automatically (even if only on windows) could prefix the reference to the gradle download.
C:\Data\Git\block-headers-client>gradlew clean build
Downloading https://services.gradle.org/distributions/gradle-6.5.1-bin.zip
.......
I had to use process explorer on Windows to locate where the headers were stored (something like AppData\Local\Temp\jcl
). It would be good to be able to specify the location the data goes, and this is probably already possible but would benefit from mentioning in the README, which makes it more easily deletable in the regtest cases.
Hi,
It would be nice to have websockets integrated so that external applications can subscribe and know ahead of time where the block header client is.
i.e. like zeromq for bitcoind - but just for the block-headers-client.
Not sure if this is planned.
Although it would be nice to be able to opt-in to subscribe to new block found, errors received, etc.
Best regards
Ian
See issue #18
It is not possible to determine the number of transactions in a block using SPV. To determine the number of transactions in a block using the existing P2P protocol, one would have to download the whole block. This would be inconsistent with the principles of SPV.
This field should not have been added to the result set. It will be removed. However, to do so would be a change in the API, so this change will only occur during the release of the next major version. This bug is in itself not enough to trigger the release of a new major version.
This ticket is a backlog item which should be implemented during the next major version update.
transactionCount is always 0, block-headers-client seems to be synced i.e latest block.
curl localhost:8080/api/v1/chain/header/byHeight?height=111 | jq
[
{
"hash": "000000004d6a6dd8b882deec7b54421949dddd2c166bd51ee7f62a52091a6c35",
"version": 1,
"prevBlockHash": "00000000a30e366158a1813a6fda9f913497000a68f1c008b9f935b866cee55b",
"merkleRoot": "e7a3e246c6f2d582b089d7d6c2f925e8aae46ef0c0ce97d3dd3afe3016a44e97",
"creationTimestamp": 1231669673,
"difficultyTarget": 486604799,
"nonce": 4076340484,
"transactionCount": 0,
"work": 4295032833
}
]
curl localhost:8080/api/v1/chain/header/byHeight?height=53632 | jq
[
{
"hash": "0000000007e3599bd68f98d157d3f20c2f7bfd20425e75e4f240601136721243",
"version": 1,
"prevBlockHash": "000000000a092c00132d96afc15c71f4d9b7102a22aff200e379652823bfd0c7",
"merkleRoot": "c5e25d3bdf874b3fb22a23e4f6a41b064dbc35cde523d7502e073e6258dd2f8e",
"creationTimestamp": 1272529571,
"difficultyTarget": 471225455,
"nonce": 205556418,
"transactionCount": 0,
"work": 49239612792
}
]
curl localhost:8080/api/v1/chain/tips | jq
[
{
"header": {
"hash": "000000000000000005a6f74c10a5475c91c83aa04315c0724c91a18337af3f42",
"version": 1073733632,
"prevBlockHash": "000000000000000009a58b63f26498fa69077d31385dc7b815d8ee9aeb5a6ec6",
"merkleRoot": "cf3272201f9d3af64593ad1b5b5d153e7f1fbb4633b490d60cfe74b96455f1d9",
"creationTimestamp": 1660569967,
"difficultyTarget": 403624649,
"nonce": 821452442,
"transactionCount": 0,
"work": 318575563526575900000
},
"state": "LONGEST_CHAIN",
"chainWork": 380740663188207560000000000,
"height": 752808,
"confirmations": 1
}
]
I've had two issues with block requests so far:
My only solution thus far is to completely wipe the image and re-install.
The instructions point you at some abstract documentation about installing java, it would be good if it instead had a link to an actual openjdk download link before the installation help link it currently has (it took me about 8 clicks to get to a jdk download link then I got an oracle login). This link is where ended up after a google: https://jdk.java.net/18/
I am trying to install headersSV client on Linux Mint but upon running
./gradlew clean build
i get the following notice:
FAILURE: Build failed with an exception.
Could not resolve all artifacts for configuration ':classpath'.
Could not download jib-gradle-plugin-3.1.4.jar (gradle.plugin.com.google.cloud.tools:jib-gradle-plugin:3.1.4)
> Could not get resource 'https://plugins.gradle.org/m2/gradle/plugin/com/google/cloud/tools/jib-gradle-plugin/3.1.4/jib-gradle-plugin-3.1.4.jar'.
> Could not GET 'https://plugins-artifacts.gradle.org/gradle.plugin.com.google.cloud.tools/jib-gradle-plugin/3.1.4/abc1dacd0d469fec7550f5497fe32aa0103e5d2a549683d3ef43c31fb2423732/jib-gradle-plugin-3.1.4.jar'.
> Remote host terminated the handshake
Could you please assist me with this? I would love to try it out.
Another thing, maybe not an issue, but i have installed the latest version of gradle on the system (7.4.2), then attempted to build, and it went to downloading an older version of gradle first (6.5.1) and failed several times, maybe due to a bad connection, so i downloaded that version manually, placed the zip in the corresponding directory and then the build process would actually start, but throwing the error described above.
Is it possible to add to every block the name of the miner i.e the hex in the block reward tx 0?
might be useful for statistics i.e which miners are getting orphaned and maybe as "security / trust" in the miner / block?
Hi,
I tried to follow the documentation using CORE. (here https://github.com/bitcoin-sv/block-headers-client/tree/master/core)
The JCLVersion is set to 2.0.0 then gradle gives an error that it's not there.
But 2.2.0 is i.e.
https://repo.maven.apache.org/maven2/io/bitcoinsv/jcl/jcl-store-keyValue/2.2.0/
Also, this is ALSO missing.
And there is no 2.2.2 - in fact the artifact seems to be missing altogether.
https://repo.maven.apache.org/maven2/io/bitcoinsv/headerSV/
Now using
gradle.settings
# JCL dependency:
JCLVersion=2.2.0
# headerSV dependency:
headerSVVersion=2.0.0
build.gradle ( using kotlin syntax)
val kotlinVersion=project.properties.get("kotlinVersion")
val bitcoinJVersion=project.properties.get("bitcoinJVersion")
val JCLVersion=project.properties.get("JCLVersion")
val headerSVVersion=project.properties.get("headerSVVersion")
repositories {
mavenCentral()
mavenLocal()
}
dependencies {
// Removed unimportant things for pasting here......
// bitcoinJ modules
implementation("io.bitcoinsv.bitcoinjsv:bitcoinj-base:${bitcoinJVersion}")
// jcl Modules
implementation("io.bitcoinsv.jcl:jcl-net:${JCLVersion}")
implementation("io.bitcoinsv.jcl:jcl-tools:${JCLVersion}")
implementation("io.bitcoinsv.jcl:jcl-store:${JCLVersion}")
implementation("io.bitcoinsv.jcl:jcl-store-keyValue:${JCLVersion}")
implementation("io.bitcoinsv.jcl:jcl-store-levelDB:${JCLVersion}")
// HeaderSV Modules
implementation("io.bitcoinsv.headerSV:headerSV-core:${headerSVVersion}")
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.