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

README.md: markdown formatting #34

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
23 changes: 0 additions & 23 deletions README

This file was deleted.

43 changes: 43 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
## [bitcoin/libblkmaker](https://github.com/bitcoin/libblkmaker)

### Dependencies:

[Jansson 2.0](https://github.com/akheron/jansson/tree/v2.0) with 'long long' support

### Example dependencies:

[Jansson 2.1](https://github.com/akheron/jansson/tree/v2.1) (to read JSON from stdin)

[libgcrypt](https://github.com/gpg/libgcrypt) (for SHA256)

##### For usage, check out example.c.

**Run**: `make example` to build it.

**Note**:

You must assign `blkmk_sha256_impl` to a function pointer

```
bool mysha256(void *hash_out, const void *data, size_t datasz)
```

**`hash_out` must be able to overlap with data!**

Note that you should **NOT** roll ntime for data retrieved without explicitly
checking that it falls within the template's limitations (mintime, maxtime,
mintimeoff, and maxtimeoff).

**Read the [BIP 23](https://github.com/bitcoin/bips/blob/master/bip-0023.mediawiki) specification in detail to
understand how they work.**

It is usually best to simply get more data as often
as it is needed.

For `blkmk_get_mdata`, you may specify that you intend to roll
the ntime header exactly once per second past usetime - it will then set
[*out_expires](blkmaker.c) such that the expiration occurs before you roll beyond any ntime
limits.

If you are rolling ntime at any rate other than once per second, you should NOT specify `can_roll_ntime` to `blkmk_get_mdata`, and must check that your
usage falls within the explicit template limits yourself.