mirror of
https://github.com/ChristopherA/Learning-Bitcoin-from-the-Command-Line.git
synced 2025-06-07 16:06:26 +00:00
Update 15_1_Accessing_Bitcoind_with_C.md
This commit is contained in:
parent
4c6a21d1ed
commit
f5d35a1b10
@ -275,7 +275,7 @@ Successfully connected to server!
|
|||||||
```
|
```
|
||||||
## Appendix II: Getting Mining Info
|
## Appendix II: Getting Mining Info
|
||||||
|
|
||||||
Here's the complete code for the `getmininginfo` command, with organized variable initiatialization, error checking, and variable cleanup. For this example we use a regtest network and show it's output.
|
Here's the complete code for the `getmininginfo` command, with organized variable initiatialization, error checking, and variable cleanup. For this example we use a testnet network and show it's output.
|
||||||
```
|
```
|
||||||
file: getmininginfo.c
|
file: getmininginfo.c
|
||||||
|
|
||||||
@ -359,25 +359,25 @@ $ cc getmininginfo.c -lbitcoinrpc -ljansson -o getmininginfo
|
|||||||
$ ./getmininginfo
|
$ ./getmininginfo
|
||||||
Full Response: {
|
Full Response: {
|
||||||
"result": {
|
"result": {
|
||||||
"blocks": 1100,
|
"blocks": 1773353,
|
||||||
"difficulty": 4.6565423739069252e-10,
|
"difficulty": 10178811.406987719,
|
||||||
"networkhashps": 0.01006838108822419,
|
"networkhashps": 129510207940932.2,
|
||||||
"pooledtx": 1,
|
"pooledtx": 9,
|
||||||
"chain": "regtest",
|
"chain": "test",
|
||||||
"warnings": ""
|
"warnings": "Warning: unknown new rules activated (versionbit 28)"
|
||||||
},
|
},
|
||||||
"error": null,
|
"error": null,
|
||||||
"id": "d07a55cc-000a-469e-ad7f-c8cef46644da"
|
"id": "6e502927-b065-486a-8182-bc1acd843bae"
|
||||||
}
|
}
|
||||||
|
|
||||||
Just the Result: {
|
Just the Result: {
|
||||||
"blocks": 1100,
|
"blocks": 1773353,
|
||||||
"difficulty": 4.6565423739069252e-10,
|
"difficulty": 10178811.406987719,
|
||||||
"networkhashps": 0.01006838108822419,
|
"networkhashps": 129510207940932.2,
|
||||||
"pooledtx": 1,
|
"pooledtx": 9,
|
||||||
"chain": "regtest",
|
"chain": "test",
|
||||||
"warnings": ""
|
"warnings": "Warning: unknown new rules activated (versionbit 28)"
|
||||||
}
|
}
|
||||||
|
|
||||||
Block Count: 1100
|
Block Count: 1773353
|
||||||
```
|
```
|
||||||
|
Loading…
x
Reference in New Issue
Block a user