Coder Social home page Coder Social logo

block-headers-client's Introduction

Bitcoin SV

What is Bitcoin SV?

Bitcoin SV (Satoshi Vision) is the original Bitcoin. It restores the original Bitcoin protocol, will keep it stable, and allow it to massively scale. Bitcoin SV will maintain the vision set out by Satoshi Nakamoto’s white paper in 2008. This Github repository provides open-source software to enable use of Bitcoin SV.

License

Bitcoin SV is released under the terms of the Open BSV license. See LICENSE for more information.

Security

Security is core to our values, and we value the input of security researchers acting in good faith to help us maintain high standards of security and privacy for our users and the Bitcoin SV blockchain.

To encourage ethical and responsible research into security vulnerabilities, the Bitcoin SV team, with support from Coingeek Mining, has instituted a Responsible Disclosure Policy.

Development Process

This Github repository contains the source code of releases.

At this early stage in Bitcoin SV's development, we are not accepting contributions to the project. We expect this to change in the future.

Contacting the Bitcoin SV Team

If you want to report a non-confidential issue with Bitcoin SV, please use the GitHub issue system.

If you want to report a security vulnerability, please review the Responsible Disclosure Policy and send e-mail to [email protected].

For any other questions or issues, please send e-mail to [email protected].

block-headers-client's People

Contributors

aaronqzhou avatar austecon avatar danconnolly avatar fletch153 avatar ilozanof avatar ivanjdev avatar jadwahab avatar markoatnchain avatar mickmight avatar mjose2019 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

block-headers-client's Issues

Dependencies published to Maven2 repo ?? They seem to be missing

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.

https://repo.maven.apache.org/maven2/io/bitcoinsv/jcl/jcl-store-keyValue/2.0.0/jcl-store-keyValue-2.0.0.pom

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.

https://repo.maven.apache.org/maven2/io/bitcoinsv/headerSV/headerSV-core/2.0.0/headerSV-core-2.0.0.pom

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}")

Would be nice to have websockets integrated

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

Client stuck on requesting block 556000

I've had two issues with block requests so far:

  • Client would sometimes get stuck on a recent block on BSV chain but won't progress (happens when system is offline for some time)
  • Client will fail to request blocks beyond 556000, likely due to it being a block involving a network fork

My only solution thus far is to completely wipe the image and re-install.

image

README could have a better Java download link (or links)

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/

README should document the header storage location and how to change it

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.

possible to add miner name for blocks

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?

README could use clarification about `application.yml`

This appears to be stale:

image

The resources/application.yml reference appears to be stale:

image

It appears to actually look for config/application.yml or a top-level application.yml:

image

It would be good if there were clear instructions (or just default files present in the correct location) on where these are.

README unnecessarily implies it gradle should be downloaded

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
.......

Node initial block download is a continually annoying pain point (regtest/dev)

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.

  1. If HeaderSV has existing data files, it will not sync until IBD is exited.
  2. If HeaderSV is started after the blocks (insufficient to exit IBD in the first case) are broadcast it appears to sync.

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.

Failed Installation

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.

  • What went wrong:
    A problem occurred configuring root project 'headerSV'.

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.

Responses should not contain transaction count field for block headers

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 0

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
}
]

Docker image improvements

  • Docker hub latest images are for arm platform, there is no corresponding amd version
  • There is no "latest" tagged version
  • There is no "v2" or "v2.0" tags

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.