Version: | 0.1-2 |
Date: | 2024-09-27 |
Title: | Extraction and Analysis of Data from the Bitcoin Cash (BCH) Blockchain |
Author: | Rucknium |
Maintainer: | Rucknium <Rucknium@protonmail.com> |
Description: | Issues RPC-JSON calls to 'bitcoind', the daemon of Bitcoin Cash (BCH), to extract transaction data from the blockchain. BCH is a fork of Bitcoin that permits a greater number of transactions per second. A BCH daemon is available under an MIT license from the Bitcoin Unlimited website https://www.bitcoinunlimited.info. |
License: | GPL-3 |
URL: | https://github.com/Rucknium/rbch, https://www.bitcoinunlimited.info |
BugReports: | https://github.com/Rucknium/rbch/issues |
SystemRequirements: | BCHunlimited (>= 1.9.2) |
Depends: | R (≥ 3.4.0) |
Imports: | gmp, httr, methods, openssl, rjson |
NeedsCompilation: | no |
RoxygenNote: | 7.3.2 |
Packaged: | 2024-09-27 18:44:23 UTC; test |
Repository: | CRAN |
Date/Publication: | 2024-09-27 21:40:02 UTC |
The ANSRPC class
Description
This class definition is employed to cast the JSON-objects returned by API-calls to bitcoind.
Slots
rpcname
character
the name of the API.result
ANY
the output/result of the API.ecode
NullOrInteger
the error code, in case of no errorNULL
.emessage
NullOrIntegerCharacter
the error message, in case of no errorNULL
.id
character
identifier to API-call.
See Also
Other bitcoind functions:
CONRPC-class
,
NullOrCharacter-class
,
NullOrInteger-class
,
conrpc()
,
rpcpost()
,
startbch()
,
startbtc()
,
stopbch()
,
stopbtc()
S4 class BCHADR
Description
S4-class for BCH addresses
Slots
pubkey
character
, the 512-bit public key.pubhash
character
, the hashed public key.bchadr
character
, the BCH address.mainnet
logical
, whether mainnet or testnet.
Author(s)
Bernhard Pfaff
References
https://en.bitcoin.it/wiki/Address
See Also
Other BchAdresses:
BTCADR-class
,
PubHash2BchAdr()
,
PubKey2PubHash()
,
base58CheckDecode()
,
base58CheckEncode()
,
concatHex()
,
decodeHex()
,
hash160()
,
hash256()
,
validBchAdr()
,
validBtcAdr()
S4 class BTCADR (BTC alias)
Description
S4-class for BTC addresses
Slots
pubkey
character
, the 512-bit public key.pubhash
character
, the hashed public key.btcadr
character
, the BTC address.mainnet
logical
, whether mainnet or testnet.
Author(s)
Bernhard Pfaff
References
https://en.bitcoin.it/wiki/Address
See Also
Other BchAdresses:
BCHADR-class
,
PubHash2BchAdr()
,
PubKey2PubHash()
,
base58CheckDecode()
,
base58CheckEncode()
,
concatHex()
,
decodeHex()
,
hash160()
,
hash256()
,
validBchAdr()
,
validBtcAdr()
The CONRPC class
Description
S4-class for curl connections to RPC-JSON.
Details
The slots rpcuse
and rpcpwd
are required in the call
to curl
. Furthermore, the fully qualified path to
bitcoin.conf
(slot config
) is required for starting
and stopping bitcoind
as daemon.
See Also
Other bitcoind functions:
ANSRPC-class
,
NullOrCharacter-class
,
NullOrInteger-class
,
conrpc()
,
rpcpost()
,
startbch()
,
startbtc()
,
stopbch()
,
stopbtc()
The ECPARAM class
Description
S4-class for elliptic curve parameters.
Objects of this class do contain the big integer parameters of
elliptic curves. Instances of this class are ordinarily created
by a call to exparam
Slots
p
bigz
, curve dimension.a
bigz
, parameter.b
bigz
, parameter.
Author(s)
Bernhard Pfaff
References
https://en.bitcoin.it/wiki/Secp256k1
See Also
Other EllipticCurve:
ECPOINT-class
,
EcparamOrNull-class
,
containsPoint()
,
ecoperators
,
ecparam()
,
ecpoint()
,
isNull()
S4 Class ECPOINT
Description
S4-class for a point on an elliptic curve.
Ordinarily, objects are created by calling
ecpoint
.
Slots
ecparam
ECPARAM
x
bigz
y
bigz
r
bigz
Author(s)
Bernhard Pfaff
References
https://en.bitcoin.it/wiki/Secp256k1
See Also
Other EllipticCurve:
ECPARAM-class
,
EcparamOrNull-class
,
containsPoint()
,
ecoperators
,
ecparam()
,
ecpoint()
,
isNull()
S4 Class Union ECPARAM or NULL
Description
S4-class union of NULL
or ECPARAM
.
Author(s)
Bernhard Pfaff
References
https://en.bitcoin.it/wiki/Secp256k1
See Also
Other EllipticCurve:
ECPARAM-class
,
ECPOINT-class
,
containsPoint()
,
ecoperators
,
ecparam()
,
ecpoint()
,
isNull()
S4 Class Union NULL or character
Description
S4-class union of NULL
or character
.
See Also
Other bitcoind functions:
ANSRPC-class
,
CONRPC-class
,
NullOrInteger-class
,
conrpc()
,
rpcpost()
,
startbch()
,
startbtc()
,
stopbch()
,
stopbtc()
S4 Class Union NULL or integer
Description
S4-class union of NULL
or integer
.
See Also
Other bitcoind functions:
ANSRPC-class
,
CONRPC-class
,
NullOrCharacter-class
,
conrpc()
,
rpcpost()
,
startbch()
,
startbtc()
,
stopbch()
,
stopbtc()
Create BCH address from public key hash
Description
This function returns the corresponding BCH address from a hashed public key.
Usage
PubHash2BchAdr(pubhash)
Arguments
pubhash |
|
Value
character
, the BCH address
Author(s)
Bernhard Pfaff
References
https://en.bitcoin.it/wiki/Address
See Also
Other BchAdresses:
BCHADR-class
,
BTCADR-class
,
PubKey2PubHash()
,
base58CheckDecode()
,
base58CheckEncode()
,
concatHex()
,
decodeHex()
,
hash160()
,
hash256()
,
validBchAdr()
,
validBtcAdr()
Create BCH address from public key hash (BTC alias)
Description
This function returns the corresponding BTC address from a hashed public key.
Usage
PubHash2BtcAdr(pubhash)
Arguments
pubhash |
|
Value
character
, the BTC address
Author(s)
Bernhard Pfaff
References
https://en.bitcoin.it/wiki/Address
Create public key hash from 512-bit public key
Description
This function returns the associated public key hash
from a 512-bit public key by using the hash160()
function.
Usage
PubKey2PubHash(pubkey, mainnet = TRUE)
Arguments
pubkey |
|
mainnet |
|
Value
character
, the hash of a public key
Author(s)
Bernhard Pfaff
References
https://en.bitcoin.it/wiki/Address
See Also
Other BchAdresses:
BCHADR-class
,
BTCADR-class
,
PubHash2BchAdr()
,
base58CheckDecode()
,
base58CheckEncode()
,
concatHex()
,
decodeHex()
,
hash160()
,
hash256()
,
validBchAdr()
,
validBtcAdr()
RPC-JSON API: addnode
Description
Attempts to add or remove a node from the addnode list. Or try a connection to a node once.
Usage
addnode(con, node, command = c("add", "remove", "onetry"))
Arguments
con |
object of class |
node |
|
command |
|
Value
A S4-object of class ANSRPC
.
Author(s)
Bernhard Pfaff
References
https://bitcoin.org/en/developer-reference#addnode, https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs
See Also
Other Network RPCs:
clearbanned()
,
disconnectnode()
,
getaddednodeinfo()
,
getconnectioncount()
,
getnettotals()
,
getnetworkinfo()
,
getpeerinfo()
,
listbanned()
,
ping()
Base 58 binary-to-text-decoding
Description
This is a modified binary-to-text decoding used for decoding Bitcoin addresses, aka Base58Check. If this is applied to a WIF address and the first and last four bytes are dropped, the result is the corresponding private key.
Usage
base58CheckDecode(x)
Arguments
x |
|
Value
list
, the decoded elements of the string.
Author(s)
Bernhard Pfaff
References
https://en.bitcoin.it/wiki/Wallet_import_format,
https://en.bitcoin.it/wiki/Address,
https://en.bitcoin.it/wiki/Base58Check_encoding
See Also
Other BchAdresses:
BCHADR-class
,
BTCADR-class
,
PubHash2BchAdr()
,
PubKey2PubHash()
,
base58CheckEncode()
,
concatHex()
,
decodeHex()
,
hash160()
,
hash256()
,
validBchAdr()
,
validBtcAdr()
Base 58 binary-to-text-encoding
Description
This is a modified binary-to-text encoding used for encoding Bitcoin addresses, aka Base58Check. If this is applied to an extended private key with its trailing check sum, then the result is the Wallet Import Format, (WIF).
Usage
base58CheckEncode(x)
Arguments
x |
|
Value
character
, the encoded string.
Author(s)
Bernhard Pfaff
References
https://en.bitcoin.it/wiki/Wallet_import_format,
https://en.bitcoin.it/wiki/Address,
https://en.bitcoin.it/wiki/Base58Check_encoding
See Also
Other BchAdresses:
BCHADR-class
,
BTCADR-class
,
PubHash2BchAdr()
,
PubKey2PubHash()
,
base58CheckDecode()
,
concatHex()
,
decodeHex()
,
hash160()
,
hash256()
,
validBchAdr()
,
validBtcAdr()
Compute fee in a block
Description
This function returns the fee of the coinbase transaction. Hereby, the mining reward has been deducted. Initially, the mining reward was 50 BCH and is halved every 210,000 blocks.
Usage
bkfee(con, height)
Arguments
con |
|
height |
|
Value
numeric
Author(s)
Bernhard Pfaff
See Also
Other UtilityFuncs:
blockattime()
,
blockstats()
,
date2int()
,
int2date()
,
intMaxDay()
,
intMinDay()
,
intRangeDay()
,
intRangePeriod()
,
timeofblock()
,
txfee()
,
txids()
,
txinids()
,
txstats()
,
utxoage()
,
utxotype()
,
utxovalue()
Block height at time
Description
This function returns the block heights closest to a provided date/time (time zone is GMT).
Usage
blockattime(con, targetdate)
Arguments
con |
|
targetdate |
|
Value
data.frame
: the heights, the times and
the time differences (in minutes) to the provided date/time.
Author(s)
Bernhard Pfaff
See Also
Other UtilityFuncs:
bkfee()
,
blockstats()
,
date2int()
,
int2date()
,
intMaxDay()
,
intMinDay()
,
intRangeDay()
,
intRangePeriod()
,
timeofblock()
,
txfee()
,
txids()
,
txinids()
,
txstats()
,
utxoage()
,
utxotype()
,
utxovalue()
Obtaining statistics of a block
Description
This function returns key statistics of a block's content, such as the time, the count of transactions, and summary statistics of the UTXOs.
Usage
blockstats(con, height, excoinbase = TRUE)
Arguments
con |
|
height |
|
excoinbase |
|
Value
An object of class data.frame
Author(s)
Bernhard Pfaff
See Also
Other UtilityFuncs:
bkfee()
,
blockattime()
,
date2int()
,
int2date()
,
intMaxDay()
,
intMinDay()
,
intRangeDay()
,
intRangePeriod()
,
timeofblock()
,
txfee()
,
txids()
,
txinids()
,
txstats()
,
utxoage()
,
utxotype()
,
utxovalue()
RPC-JSON API: clearbanned
Description
Clear all banned IPs.
Usage
clearbanned(con)
Arguments
con |
object of class |
Value
A S4-object of class ANSRPC
.
Author(s)
Bernhard Pfaff
References
https://bitcoin.org/en/developer-reference#clearbanned, https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs
See Also
Other Network RPCs:
addnode()
,
disconnectnode()
,
getaddednodeinfo()
,
getconnectioncount()
,
getnettotals()
,
getnetworkinfo()
,
getpeerinfo()
,
listbanned()
,
ping()
Concatenate two hex strings
Description
This function concatenates two hex strings, provided without the 0x
prefix,
and returns a list
object of the associated
integers.
Usage
concatHex(hex1, hex2)
Arguments
hex1 |
|
hex2 |
|
Value
list
Author(s)
Bernhard Pfaff
References
https://en.bitcoin.it/wiki/Wallet_import_format,
https://en.bitcoin.it/wiki/Address
See Also
Other BchAdresses:
BCHADR-class
,
BTCADR-class
,
PubHash2BchAdr()
,
PubKey2PubHash()
,
base58CheckDecode()
,
base58CheckEncode()
,
decodeHex()
,
hash160()
,
hash256()
,
validBchAdr()
,
validBtcAdr()
Extracting Configuration Settings
Description
This function extracts information from the configuration
file bitcoin.conf
with respect to the options rpcuser
and rpcpassword
.
Usage
conrpc(conf.file)
Arguments
conf.file |
|
Value
An S4-object of class CONRPC
.
Author(s)
Bernhard Pfaff
See Also
Other bitcoind functions:
ANSRPC-class
,
CONRPC-class
,
NullOrCharacter-class
,
NullOrInteger-class
,
rpcpost()
,
startbch()
,
startbtc()
,
stopbch()
,
stopbtc()
containsPoint-methods
Description
Checks whether a point is on a defined ellipctic curve.
Usage
containsPoint(curve, x, y)
## S4 method for signature 'ECPARAM,bigz,bigz'
containsPoint(curve, x, y)
## S4 method for signature 'ECPARAM,integer,integer'
containsPoint(curve, x, y)
## S4 method for signature 'ECPARAM,character,character'
containsPoint(curve, x, y)
Arguments
curve |
an S4-object of class |
x |
an S4-object of class |
y |
an S4-object of class |
Value
logical
Author(s)
Bernhard Pfaff
References
https://en.bitcoin.it/wiki/Secp256k1
See Also
Other EllipticCurve:
ECPARAM-class
,
ECPOINT-class
,
EcparamOrNull-class
,
ecoperators
,
ecparam()
,
ecpoint()
,
isNull()
Examples
p <- "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F"
b <- "0x0000000000000000000000000000000000000000000000000000000000000007"
a <- "0x0000000000000000000000000000000000000000000000000000000000000000"
curve256 <- ecparam(p, a, b)
Gx <- "0x79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798"
Gy <- "0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8"
containsPoint(curve256, Gx, Gy)
Convert date/time to integer
Description
This function returns the associated integer
time
for a given date/time object (coercible as POSIXct
object.
Usage
date2int(x)
Arguments
x |
|
Value
integer
Author(s)
Bernhard Pfaff
See Also
Other UtilityFuncs:
bkfee()
,
blockattime()
,
blockstats()
,
int2date()
,
intMaxDay()
,
intMinDay()
,
intRangeDay()
,
intRangePeriod()
,
timeofblock()
,
txfee()
,
txids()
,
txinids()
,
txstats()
,
utxoage()
,
utxotype()
,
utxovalue()
Examples
d <- "2017-03-15"
date2int(d)
Decoding of a hex string
Description
This function converts a hex string,, whereby the string must not
contain the 0x
prefix, to a list
object with the associated
integers as its elements.
Usage
decodeHex(s)
Arguments
s |
|
Value
list
Author(s)
Bernhard Pfaff
References
https://en.bitcoin.it/wiki/Wallet_import_format,
https://en.bitcoin.it/wiki/Address
See Also
Other BchAdresses:
BCHADR-class
,
BTCADR-class
,
PubHash2BchAdr()
,
PubKey2PubHash()
,
base58CheckDecode()
,
base58CheckEncode()
,
concatHex()
,
hash160()
,
hash256()
,
validBchAdr()
,
validBtcAdr()
RPC-JSON API: decoderawtransaction
Description
Return a JSON object representing the serialized, hex-encoded transaction.
Usage
decoderawtransaction(con, hexstring)
Arguments
con |
object of class |
hexstring |
|
Value
A S4-object of class ANSRPC
.
Author(s)
Bernhard Pfaff
References
https://bitcoin.org/en/developer-reference#getblock, https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs
See Also
Other RawTransactions RPCs:
getrawtransaction()
RPC-JSON API: decodescript
Description
The decodescript RPC decodes a hex-encoded P2SH redeem script.
Usage
decodescript(con, redeem)
Arguments
con |
object of class |
redeem |
|
Value
A S4-object of class ANSRPC
.
Author(s)
Bernhard Pfaff
References
https://bitcoin.org/en/developer-reference#decodescript, https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs
See Also
Other Blockchain RPCs:
getbestblockhash()
,
getblock()
,
getblockchaininfo()
,
getblockcount()
,
getblockhash()
,
getblockheader()
,
getchaintips()
,
getchaintxstats()
,
getdifficulty()
,
getmempoolancestors()
,
getmempooldescendants()
,
getmempoolentry()
,
getmempoolinfo()
,
getrawmempool()
,
gettxout()
,
gettxoutproof()
,
gettxoutsetinfo()
,
pruneblockchain()
,
verifychain()
,
verifytxoutproof()
RPC-JSON API: disconnectnode
Description
Immediately disconnects from the specified peer node.
Strictly one out of address
and nodeid
can be
provided to identify the node.
Usage
disconnectnode(con, address = NULL, nodeid = NULL)
Arguments
con |
object of class |
address |
|
nodeid |
|
Value
A S4-object of class ANSRPC
.
Author(s)
Bernhard Pfaff
References
https://bitcoin.org/en/developer-reference#disconnectnode, https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs
See Also
Other Network RPCs:
addnode()
,
clearbanned()
,
getaddednodeinfo()
,
getconnectioncount()
,
getnettotals()
,
getnetworkinfo()
,
getpeerinfo()
,
listbanned()
,
ping()
Elliptic curve operators
Description
The following operations for EC points are available:
doubleUp multiplying a point by itself
+ point addition
leftmostBit highest bit value of an integer
AND logical and-operator for two integers
* multiplication of an integer scalar with an EC point
Usage
doubleUp(ecp)
## S4 method for signature 'ECPOINT'
doubleUp(ecp)
## S4 method for signature 'ECPOINT,ECPOINT'
e1 + e2
leftmostBit(x)
## S4 method for signature 'bigz'
leftmostBit(x)
AND(x, y)
## S4 method for signature 'bigz,bigz'
AND(x, y)
## S4 method for signature 'ECPOINT,bigz'
e1 * e2
## S4 method for signature 'bigz,ECPOINT'
e1 * e2
Arguments
ecp |
point on elliptic curve |
e1 |
point on elliptic curve, or integer |
e2 |
point on elliptic curve, or integer |
x |
integer |
y |
integer |
Author(s)
Bernhard Pfaff
References
https://en.bitcoin.it/wiki/Secp256k1
See Also
Other EllipticCurve:
ECPARAM-class
,
ECPOINT-class
,
EcparamOrNull-class
,
containsPoint()
,
ecparam()
,
ecpoint()
,
isNull()
Creating objects of class ECPARAM
Description
This function returns an object of S4-class ECPARAM
,
that does contain the parametrization of an elliptic curve.
Usage
ecparam(p, a, b)
Arguments
p |
|
a |
|
b |
|
Value
An object of S4-class ECPARAM
Author(s)
Bernhard Pfaff
References
https://en.bitcoin.it/wiki/Secp256k1
See Also
Other EllipticCurve:
ECPARAM-class
,
ECPOINT-class
,
EcparamOrNull-class
,
containsPoint()
,
ecoperators
,
ecpoint()
,
isNull()
Examples
p <- "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F"
b <- "0x0000000000000000000000000000000000000000000000000000000000000007"
a <- "0x0000000000000000000000000000000000000000000000000000000000000000"
curve256 <- ecparam(p, a, b)
curve256
Creating objects of class ECPOINT
Description
This function returns an object of S4-class ECPOINT
,
that does represent a point on an elliptic curve.
Usage
ecpoint(ecparam = NULL, x, y, r = NULL)
Arguments
ecparam |
|
x |
x-coordinate, to be coercible to |
y |
y-coordinate, to be coercible to |
r |
the order of the base point. |
Value
An object of S4-class ECPOINT
Author(s)
Bernhard Pfaff
References
https://en.bitcoin.it/wiki/Secp256k1
See Also
Other EllipticCurve:
ECPARAM-class
,
ECPOINT-class
,
EcparamOrNull-class
,
containsPoint()
,
ecoperators
,
ecparam()
,
isNull()
Examples
p <- "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F"
b <- "0x0000000000000000000000000000000000000000000000000000000000000007"
a <- "0x0000000000000000000000000000000000000000000000000000000000000000"
r <- "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141"
x <- "0x79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798"
y <- "0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8"
curve256 <- ecparam(p, a, b)
ecp <- ecpoint(curve256, x, y, r)
ecp
RPC-JSON API: getaddednodeinfo
Description
Returns information about the given added node, or all added nodes (note that onetry addnodes are not listed here)
Usage
getaddednodeinfo(con, node = NULL, dns = FALSE)
Arguments
con |
object of class |
node |
|
dns |
|
Value
A S4-object of class ANSRPC
.
Author(s)
Bernhard Pfaff
References
https://bitcoin.org/en/developer-reference#getaddednodeinfo, https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs
See Also
Other Network RPCs:
addnode()
,
clearbanned()
,
disconnectnode()
,
getconnectioncount()
,
getnettotals()
,
getnetworkinfo()
,
getpeerinfo()
,
listbanned()
,
ping()
RPC-JSON API: getbestblockhash
Description
Returns the hash of the best (tip) block in the longest blockchain.
Usage
getbestblockhash(con)
Arguments
con |
object of class |
Value
A S4-object of class ANSRPC
.
Author(s)
Bernhard Pfaff
References
https://bitcoin.org/en/developer-reference#getbestblockhash, https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs
See Also
Other Blockchain RPCs:
decodescript()
,
getblock()
,
getblockchaininfo()
,
getblockcount()
,
getblockhash()
,
getblockheader()
,
getchaintips()
,
getchaintxstats()
,
getdifficulty()
,
getmempoolancestors()
,
getmempooldescendants()
,
getmempoolentry()
,
getmempoolinfo()
,
getrawmempool()
,
gettxout()
,
gettxoutproof()
,
gettxoutsetinfo()
,
pruneblockchain()
,
verifychain()
,
verifytxoutproof()
RPC-JSON API: getblock
Description
If verbosity is 'l0', returns a string that is serialized, hex-encoded data for block 'hash'. If verbosity is 'l1' (the default), returns an object with information about block <hash>. If verbosity is 'l2', returns an object with information about block <hash> and information about each transaction.
Usage
getblock(con, blockhash, verbosity = c("l1", "l0", "l2"))
Arguments
con |
object of class |
blockhash |
|
verbosity |
|
Details
Returns information of a block hash. The returned level of details depends on the
argument verbosity
.
Value
A S4-object of class ANSRPC
.
Author(s)
Bernhard Pfaff
References
https://bitcoin.org/en/developer-reference#getblock, https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs
See Also
Other Blockchain RPCs:
decodescript()
,
getbestblockhash()
,
getblockchaininfo()
,
getblockcount()
,
getblockhash()
,
getblockheader()
,
getchaintips()
,
getchaintxstats()
,
getdifficulty()
,
getmempoolancestors()
,
getmempooldescendants()
,
getmempoolentry()
,
getmempoolinfo()
,
getrawmempool()
,
gettxout()
,
gettxoutproof()
,
gettxoutsetinfo()
,
pruneblockchain()
,
verifychain()
,
verifytxoutproof()
RPC-JSON API: getblockchaininfo
Description
Returns an object containing various state info regarding blockchain processing.
Usage
getblockchaininfo(con)
Arguments
con |
object of class |
Value
A S4-object of class ANSRPC
.
Author(s)
Bernhard Pfaff
References
https://bitcoin.org/en/developer-reference#getblockchaininfo, https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs
See Also
Other Blockchain RPCs:
decodescript()
,
getbestblockhash()
,
getblock()
,
getblockcount()
,
getblockhash()
,
getblockheader()
,
getchaintips()
,
getchaintxstats()
,
getdifficulty()
,
getmempoolancestors()
,
getmempooldescendants()
,
getmempoolentry()
,
getmempoolinfo()
,
getrawmempool()
,
gettxout()
,
gettxoutproof()
,
gettxoutsetinfo()
,
pruneblockchain()
,
verifychain()
,
verifytxoutproof()
RPC-JSON API: getblockcount
Description
Returns the number of blocks in the longest blockchain.
Usage
getblockcount(con)
Arguments
con |
object of class |
Value
A S4-object of class ANSRPC
.
Author(s)
Bernhard Pfaff
References
https://bitcoin.org/en/developer-reference#getblockcount, https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs
See Also
Other Blockchain RPCs:
decodescript()
,
getbestblockhash()
,
getblock()
,
getblockchaininfo()
,
getblockhash()
,
getblockheader()
,
getchaintips()
,
getchaintxstats()
,
getdifficulty()
,
getmempoolancestors()
,
getmempooldescendants()
,
getmempoolentry()
,
getmempoolinfo()
,
getrawmempool()
,
gettxout()
,
gettxoutproof()
,
gettxoutsetinfo()
,
pruneblockchain()
,
verifychain()
,
verifytxoutproof()
RPC-JSON API: getblockhash
Description
Returns hash of block in best-block-chain at height provided.
Usage
getblockhash(con, height)
Arguments
con |
object of class |
height |
|
Value
A S4-object of class ANSRPC
.
Author(s)
Bernhard Pfaff
References
https://bitcoin.org/en/developer-reference#getblockhash, https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs
See Also
Other Blockchain RPCs:
decodescript()
,
getbestblockhash()
,
getblock()
,
getblockchaininfo()
,
getblockcount()
,
getblockheader()
,
getchaintips()
,
getchaintxstats()
,
getdifficulty()
,
getmempoolancestors()
,
getmempooldescendants()
,
getmempoolentry()
,
getmempoolinfo()
,
getrawmempool()
,
gettxout()
,
gettxoutproof()
,
gettxoutsetinfo()
,
pruneblockchain()
,
verifychain()
,
verifytxoutproof()
RPC-JSON API: getblockheader
Description
Returns the block header for a given hash string.
Usage
getblockheader(con, hash, verbose = TRUE)
Arguments
con |
object of class |
hash |
|
verbose |
|
Value
A S4-object of class ANSRPC
.
Details
If verbose is false, returns a string that is serialized, hex-encoded data for blockheader 'hash'. If verbose is true, returns an Object with information about blockheader <hash>.
Author(s)
Bernhard Pfaff
References
https://bitcoin.org/en/developer-reference#getblockheader, https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs
See Also
Other Blockchain RPCs:
decodescript()
,
getbestblockhash()
,
getblock()
,
getblockchaininfo()
,
getblockcount()
,
getblockhash()
,
getchaintips()
,
getchaintxstats()
,
getdifficulty()
,
getmempoolancestors()
,
getmempooldescendants()
,
getmempoolentry()
,
getmempoolinfo()
,
getrawmempool()
,
gettxout()
,
gettxoutproof()
,
gettxoutsetinfo()
,
pruneblockchain()
,
verifychain()
,
verifytxoutproof()
RPC-JSON API: getchaintips
Description
Return information about all known tips in the block tree, including the main chain as well as orphaned branches.
Usage
getchaintips(con)
Arguments
con |
object of class |
Value
A S4-object of class ANSRPC
.
Author(s)
Bernhard Pfaff
References
https://bitcoin.org/en/developer-reference#getchaintips, https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs
See Also
Other Blockchain RPCs:
decodescript()
,
getbestblockhash()
,
getblock()
,
getblockchaininfo()
,
getblockcount()
,
getblockhash()
,
getblockheader()
,
getchaintxstats()
,
getdifficulty()
,
getmempoolancestors()
,
getmempooldescendants()
,
getmempoolentry()
,
getmempoolinfo()
,
getrawmempool()
,
gettxout()
,
gettxoutproof()
,
gettxoutsetinfo()
,
pruneblockchain()
,
verifychain()
,
verifytxoutproof()
RPC-JSON API: getchaintxstats
Description
Compute statistics about the total number and rate of transactions in the chain.
Usage
getchaintxstats(con, nblocks = NULL, blockhash = NULL)
Arguments
con |
object of class |
nblocks |
|
blockhash |
|
Value
A S4-object of class ANSRPC
.
Author(s)
Bernhard Pfaff
References
https://bitcoin.org/en/developer-reference#getchaintxstats, https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs
See Also
Other Blockchain RPCs:
decodescript()
,
getbestblockhash()
,
getblock()
,
getblockchaininfo()
,
getblockcount()
,
getblockhash()
,
getblockheader()
,
getchaintips()
,
getdifficulty()
,
getmempoolancestors()
,
getmempooldescendants()
,
getmempoolentry()
,
getmempoolinfo()
,
getrawmempool()
,
gettxout()
,
gettxoutproof()
,
gettxoutsetinfo()
,
pruneblockchain()
,
verifychain()
,
verifytxoutproof()
RPC-JSON API: getconnectioncount
Description
Returns the number of connections to other nodes.
Usage
getconnectioncount(con)
Arguments
con |
object of class |
Value
A S4-object of class ANSRPC
.
Author(s)
Bernhard Pfaff
References
https://bitcoin.org/en/developer-reference#getconnectioncount, https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs
See Also
Other Network RPCs:
addnode()
,
clearbanned()
,
disconnectnode()
,
getaddednodeinfo()
,
getnettotals()
,
getnetworkinfo()
,
getpeerinfo()
,
listbanned()
,
ping()
RPC-JSON API: getdifficulty
Description
Returns the proof-of-work difficulty as a multiple of the minimum difficulty.
Usage
getdifficulty(con)
Arguments
con |
object of class |
Value
A S4-object of class ANSRPC
.
Author(s)
Bernhard Pfaff
References
https://bitcoin.org/en/developer-reference#getdifficulty, https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs
See Also
Other Blockchain RPCs:
decodescript()
,
getbestblockhash()
,
getblock()
,
getblockchaininfo()
,
getblockcount()
,
getblockhash()
,
getblockheader()
,
getchaintips()
,
getchaintxstats()
,
getmempoolancestors()
,
getmempooldescendants()
,
getmempoolentry()
,
getmempoolinfo()
,
getrawmempool()
,
gettxout()
,
gettxoutproof()
,
gettxoutsetinfo()
,
pruneblockchain()
,
verifychain()
,
verifytxoutproof()
RPC-JSON API: Help
Description
Returning information about RPC functions.
Usage
gethelp(con, rpc = "")
Arguments
con |
object of class |
rpc |
|
Value
A S4-object of class ANSRPC
.
Author(s)
Bernhard Pfaff
References
https://bitcoin.org/en/developer-reference#help, https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs
See Also
Other Control RPCs:
getinfo()
,
getwalletinfo()
RPC-JSON API: getinfo
Description
Returning information about bitcoin configuration and settings.
Usage
getinfo(con)
Arguments
con |
object of class |
Details
WARNING: getinfo is deprecated and will be fully removed in 0.16. Projects should transition to using getblockchaininfo, getnetworkinfo, and getwalletinfo before upgrading to 0.16.
Value
A S4-object of class ANSRPC
.
Author(s)
Bernhard Pfaff
References
https://bitcoin.org/en/developer-reference#getinfo, https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs
See Also
Other Control RPCs:
gethelp()
,
getwalletinfo()
RPC-JSON API: getmempoolancestors
Description
If txid is in the mempool, returns all in-mempool ancestors.
Usage
getmempoolancestors(con, txid, verbose = FALSE)
Arguments
con |
object of class |
txid |
|
verbose |
|
Value
A S4-object of class ANSRPC
.
Author(s)
Bernhard Pfaff
References
https://bitcoin.org/en/developer-reference#getmempoolancestors, https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs
See Also
Other Blockchain RPCs:
decodescript()
,
getbestblockhash()
,
getblock()
,
getblockchaininfo()
,
getblockcount()
,
getblockhash()
,
getblockheader()
,
getchaintips()
,
getchaintxstats()
,
getdifficulty()
,
getmempooldescendants()
,
getmempoolentry()
,
getmempoolinfo()
,
getrawmempool()
,
gettxout()
,
gettxoutproof()
,
gettxoutsetinfo()
,
pruneblockchain()
,
verifychain()
,
verifytxoutproof()
RPC-JSON API: getmempooldescendants
Description
If txid is in the mempool, returns all in-mempool descendants.
Usage
getmempooldescendants(con, txid, verbose = FALSE)
Arguments
con |
object of class |
txid |
|
verbose |
|
Value
A S4-object of class ANSRPC
.
Author(s)
Bernhard Pfaff
References
https://bitcoin.org/en/developer-reference#getmempooldescendants, https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs
See Also
Other Blockchain RPCs:
decodescript()
,
getbestblockhash()
,
getblock()
,
getblockchaininfo()
,
getblockcount()
,
getblockhash()
,
getblockheader()
,
getchaintips()
,
getchaintxstats()
,
getdifficulty()
,
getmempoolancestors()
,
getmempoolentry()
,
getmempoolinfo()
,
getrawmempool()
,
gettxout()
,
gettxoutproof()
,
gettxoutsetinfo()
,
pruneblockchain()
,
verifychain()
,
verifytxoutproof()
RPC-JSON API: getmempoolentry
Description
Returns mempool data for given transaction.
Usage
getmempoolentry(con, txid)
Arguments
con |
object of class |
txid |
|
Value
A S4-object of class ANSRPC
.
Author(s)
Bernhard Pfaff
References
https://bitcoin.org/en/developer-reference#getmempoolentry, https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs
See Also
Other Blockchain RPCs:
decodescript()
,
getbestblockhash()
,
getblock()
,
getblockchaininfo()
,
getblockcount()
,
getblockhash()
,
getblockheader()
,
getchaintips()
,
getchaintxstats()
,
getdifficulty()
,
getmempoolancestors()
,
getmempooldescendants()
,
getmempoolinfo()
,
getrawmempool()
,
gettxout()
,
gettxoutproof()
,
gettxoutsetinfo()
,
pruneblockchain()
,
verifychain()
,
verifytxoutproof()
RPC-JSON API: getmempoolinfo
Description
Returns details on the active state of the TX memory pool.
Usage
getmempoolinfo(con)
Arguments
con |
object of class |
Value
A S4-object of class ANSRPC
.
Author(s)
Bernhard Pfaff
References
https://bitcoin.org/en/developer-reference#getmempoolinfo, https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs
See Also
Other Blockchain RPCs:
decodescript()
,
getbestblockhash()
,
getblock()
,
getblockchaininfo()
,
getblockcount()
,
getblockhash()
,
getblockheader()
,
getchaintips()
,
getchaintxstats()
,
getdifficulty()
,
getmempoolancestors()
,
getmempooldescendants()
,
getmempoolentry()
,
getrawmempool()
,
gettxout()
,
gettxoutproof()
,
gettxoutsetinfo()
,
pruneblockchain()
,
verifychain()
,
verifytxoutproof()
RPC-JSON API: getnettotals
Description
Returns information about network traffic, including bytes in, bytes out, and current time.
Usage
getnettotals(con)
Arguments
con |
object of class |
Value
A S4-object of class ANSRPC
.
Author(s)
Bernhard Pfaff
References
https://bitcoin.org/en/developer-reference#getnettotals, https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs
See Also
Other Network RPCs:
addnode()
,
clearbanned()
,
disconnectnode()
,
getaddednodeinfo()
,
getconnectioncount()
,
getnetworkinfo()
,
getpeerinfo()
,
listbanned()
,
ping()
RPC-JSON API: getnetworkinfo
Description
Returns an object containing various state info regarding P2P networking.
Usage
getnetworkinfo(con)
Arguments
con |
object of class |
Value
A S4-object of class ANSRPC
.
Author(s)
Bernhard Pfaff
References
https://bitcoin.org/en/developer-reference#getnetworkinfo, https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs
See Also
Other Network RPCs:
addnode()
,
clearbanned()
,
disconnectnode()
,
getaddednodeinfo()
,
getconnectioncount()
,
getnettotals()
,
getpeerinfo()
,
listbanned()
,
ping()
RPC-JSON API: getpeerinfo
Description
Returns data about each connected network node as a json array of objects.
Usage
getpeerinfo(con)
Arguments
con |
object of class |
Value
A S4-object of class ANSRPC
.
Author(s)
Bernhard Pfaff
References
https://bitcoin.org/en/developer-reference#getpeerinfo, https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs
See Also
Other Network RPCs:
addnode()
,
clearbanned()
,
disconnectnode()
,
getaddednodeinfo()
,
getconnectioncount()
,
getnettotals()
,
getnetworkinfo()
,
listbanned()
,
ping()
RPC-JSON API: getrawmempool
Description
Returns all transaction ids in memory pool as a json array of string transaction ids. Hint: use getmempoolentry to fetch a specific transaction from the mempool.
Usage
getrawmempool(con, verbose = TRUE)
Arguments
con |
object of class |
verbose |
|
Value
A S4-object of class ANSRPC
.
Author(s)
Bernhard Pfaff
References
https://bitcoin.org/en/developer-reference#getrawmempool, https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs
See Also
Other Blockchain RPCs:
decodescript()
,
getbestblockhash()
,
getblock()
,
getblockchaininfo()
,
getblockcount()
,
getblockhash()
,
getblockheader()
,
getchaintips()
,
getchaintxstats()
,
getdifficulty()
,
getmempoolancestors()
,
getmempooldescendants()
,
getmempoolentry()
,
getmempoolinfo()
,
gettxout()
,
gettxoutproof()
,
gettxoutsetinfo()
,
pruneblockchain()
,
verifychain()
,
verifytxoutproof()
RPC-JSON API: getrawtransaction
Description
By default this function only works for mempool transactions. If the -txindex option is enabled, it also works for blockchain transactions. DEPRECATED: for now, it also works for transactions with unspent outputs. If verbose is 'true', returns an object with information about 'txid'. If verbose is 'false' or omitted, returns a string that is serialized, hex-encoded data for 'txid'.
Usage
getrawtransaction(con, txid, verbose = FALSE)
Arguments
con |
object of class |
txid |
|
verbose |
|
Details
Returns the raw transaction data.
Value
A S4-object of class ANSRPC
.
Author(s)
Bernhard Pfaff
References
https://bitcoin.org/en/developer-reference#getblock, https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs
See Also
Other RawTransactions RPCs:
decoderawtransaction()
RPC-JSON API: gettxout
Description
Returns details about an unspent transaction output.
Usage
gettxout(con, txid, n, incmempool = TRUE)
Arguments
con |
object of class |
txid |
|
n |
|
incmempool |
|
Details
Note that an unspent output that is spent in the mempool won't appear.
Value
A S4-object of class ANSRPC
.
Author(s)
Bernhard Pfaff
References
https://bitcoin.org/en/developer-reference#gettxout, https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs
See Also
Other Blockchain RPCs:
decodescript()
,
getbestblockhash()
,
getblock()
,
getblockchaininfo()
,
getblockcount()
,
getblockhash()
,
getblockheader()
,
getchaintips()
,
getchaintxstats()
,
getdifficulty()
,
getmempoolancestors()
,
getmempooldescendants()
,
getmempoolentry()
,
getmempoolinfo()
,
getrawmempool()
,
gettxoutproof()
,
gettxoutsetinfo()
,
pruneblockchain()
,
verifychain()
,
verifytxoutproof()
RPC-JSON API: gettxoutproof
Description
Returns a hex-encoded proof that "txid" was included in a block.
Usage
gettxoutproof(con, txids, blockhash = NULL)
Arguments
con |
object of class |
txids |
|
blockhash |
|
Details
NOTE: By default this function only works sometimes. This is when there is an unspent output in the utxo for this transaction. To make it always work, you need to maintain a transaction index, using the -txindex command line option or specify the block in which the transaction is included manually (by blockhash).
Value
A S4-object of class ANSRPC
.
Author(s)
Bernhard Pfaff
References
https://bitcoin.org/en/developer-reference#gettxoutproof, https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs
See Also
Other Blockchain RPCs:
decodescript()
,
getbestblockhash()
,
getblock()
,
getblockchaininfo()
,
getblockcount()
,
getblockhash()
,
getblockheader()
,
getchaintips()
,
getchaintxstats()
,
getdifficulty()
,
getmempoolancestors()
,
getmempooldescendants()
,
getmempoolentry()
,
getmempoolinfo()
,
getrawmempool()
,
gettxout()
,
gettxoutsetinfo()
,
pruneblockchain()
,
verifychain()
,
verifytxoutproof()
RPC-JSON API: gettxoutsetinfo
Description
Returns statistics about the unspent transaction output set. Note this call may take some time.
Usage
gettxoutsetinfo(con)
Arguments
con |
object of class |
Value
A S4-object of class ANSRPC
.
Author(s)
Bernhard Pfaff
References
https://bitcoin.org/en/developer-reference#gettxoutsetinfo, https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs
See Also
Other Blockchain RPCs:
decodescript()
,
getbestblockhash()
,
getblock()
,
getblockchaininfo()
,
getblockcount()
,
getblockhash()
,
getblockheader()
,
getchaintips()
,
getchaintxstats()
,
getdifficulty()
,
getmempoolancestors()
,
getmempooldescendants()
,
getmempoolentry()
,
getmempoolinfo()
,
getrawmempool()
,
gettxout()
,
gettxoutproof()
,
pruneblockchain()
,
verifychain()
,
verifytxoutproof()
RPC-JSON API: getwalletinfo
Description
Returning information about bitcoin wallet.
Usage
getwalletinfo(con)
Arguments
con |
object of class |
Value
A S4-object of class ANSRPC
.
Author(s)
Bernhard Pfaff
References
https://bitcoin.org/en/developer-reference#getwalletinfo, https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs
See Also
Other Control RPCs:
gethelp()
,
getinfo()
BCH hash160
Description
This function returns the hash by applying the sha256
hashing
first and then to the resulting hash the ripemd160
algorithm.
Usage
hash160(d)
Arguments
d |
|
Value
character
, the value of d
hashed with
sha256
and ripemd160
.
Author(s)
Bernhard Pfaff
References
https://en.bitcoin.it/wiki/Address
See Also
Other BchAdresses:
BCHADR-class
,
BTCADR-class
,
PubHash2BchAdr()
,
PubKey2PubHash()
,
base58CheckDecode()
,
base58CheckEncode()
,
concatHex()
,
decodeHex()
,
hash256()
,
validBchAdr()
,
validBtcAdr()
BCH hash256
Description
This function returns the hash by applying the sha256
hashing
algorithm twice to a raw
object.
Usage
hash256(d)
Arguments
d |
|
Value
character
, the value of d
hashed twice.
Author(s)
Bernhard Pfaff
References
https://en.bitcoin.it/wiki/Address
See Also
Other BchAdresses:
BCHADR-class
,
BTCADR-class
,
PubHash2BchAdr()
,
PubKey2PubHash()
,
base58CheckDecode()
,
base58CheckEncode()
,
concatHex()
,
decodeHex()
,
hash160()
,
validBchAdr()
,
validBtcAdr()
Convert time stamp to POSIX
Description
This function returns the associated POSIXct
time
to the time stamp integer in a block header.
Usage
int2date(x)
Arguments
x |
|
Value
An object of class POSIXct, POSIXt
Author(s)
Bernhard Pfaff
References
https://en.bitcoin.it/wiki/Block_timestamp
See Also
Other UtilityFuncs:
bkfee()
,
blockattime()
,
blockstats()
,
date2int()
,
intMaxDay()
,
intMinDay()
,
intRangeDay()
,
intRangePeriod()
,
timeofblock()
,
txfee()
,
txids()
,
txinids()
,
txstats()
,
utxoage()
,
utxotype()
,
utxovalue()
Examples
ts <- 1532954868
int2date(ts)
Integer representation of a day-end
Description
This function returns the associated integer
time
for the end of a specific day (i.e., 23:59:59
time).
Usage
intMaxDay(x)
Arguments
x |
|
Value
integer
Author(s)
Bernhard Pfaff
See Also
Other UtilityFuncs:
bkfee()
,
blockattime()
,
blockstats()
,
date2int()
,
int2date()
,
intMinDay()
,
intRangeDay()
,
intRangePeriod()
,
timeofblock()
,
txfee()
,
txids()
,
txinids()
,
txstats()
,
utxoage()
,
utxotype()
,
utxovalue()
Examples
d1 <- "2017-03-15"
d1 <- intMaxDay(d1)
d2 <- "2017-03-15 23:59:59"
d2 <- intMaxDay(d2)
identical(d1,d2)
Integer representation of a day-begin
Description
This function returns the associated integer
time
for the start of a specific day (i.e., 00:00:00
time).
Usage
intMinDay(x)
Arguments
x |
|
Value
integer
Author(s)
Bernhard Pfaff
See Also
Other UtilityFuncs:
bkfee()
,
blockattime()
,
blockstats()
,
date2int()
,
int2date()
,
intMaxDay()
,
intRangeDay()
,
intRangePeriod()
,
timeofblock()
,
txfee()
,
txids()
,
txinids()
,
txstats()
,
utxoage()
,
utxotype()
,
utxovalue()
Examples
d1 <- "2017-03-15"
d1 <- intMinDay(d1)
d2 <- "2017-03-15 00:00:00"
d2 <- intMinDay(d2)
identical(d1,d2)
Integer range within a day
Description
This function returns the associated integer
times
for the start and end of a specific day.
Usage
intRangeDay(x)
Arguments
x |
|
Value
integer
Author(s)
Bernhard Pfaff
See Also
Other UtilityFuncs:
bkfee()
,
blockattime()
,
blockstats()
,
date2int()
,
int2date()
,
intMaxDay()
,
intMinDay()
,
intRangePeriod()
,
timeofblock()
,
txfee()
,
txids()
,
txinids()
,
txstats()
,
utxoage()
,
utxotype()
,
utxovalue()
Examples
d1 <- "2017-03-15"
intRangeDay(d1)
intMinDay(d1)
intMaxDay(d1)
Integer range between two dates
Description
This function returns the associated integer
times
for the start of date d1
and the end of date d2
.
Usage
intRangePeriod(d1, d2)
Arguments
d1 |
|
d2 |
|
Value
integer
Author(s)
Bernhard Pfaff
See Also
Other UtilityFuncs:
bkfee()
,
blockattime()
,
blockstats()
,
date2int()
,
int2date()
,
intMaxDay()
,
intMinDay()
,
intRangeDay()
,
timeofblock()
,
txfee()
,
txids()
,
txinids()
,
txstats()
,
utxoage()
,
utxotype()
,
utxovalue()
Examples
d1 <- "2017-03-15"
d2 <- "2017-04-15"
intRangePeriod(d1, d2)
intMinDay(d1)
intMaxDay(d2)
Test for empty EC point
Description
Checks whether an EC point does exist.
Usage
isNull(x)
## S4 method for signature 'ECPOINT'
isNull(x)
Arguments
x |
object |
Value
logical
Author(s)
Bernhard Pfaff
References
https://en.bitcoin.it/wiki/Secp256k1
See Also
Other EllipticCurve:
ECPARAM-class
,
ECPOINT-class
,
EcparamOrNull-class
,
containsPoint()
,
ecoperators
,
ecparam()
,
ecpoint()
RPC-JSON API: listbanned
Description
List all banned IPs/Subnets.
Usage
listbanned(con)
Arguments
con |
object of class |
Value
A S4-object of class ANSRPC
.
Author(s)
Bernhard Pfaff
References
https://bitcoin.org/en/developer-reference#listbanned, https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs
See Also
Other Network RPCs:
addnode()
,
clearbanned()
,
disconnectnode()
,
getaddednodeinfo()
,
getconnectioncount()
,
getnettotals()
,
getnetworkinfo()
,
getpeerinfo()
,
ping()
RPC-JSON API: ping
Description
Requests that a ping be sent to all other nodes, to measure ping time. Results provided in getpeerinfo, pingtime and pingwait fields are decimal seconds. Ping command is handled in queue with all other commands, so it measures processing backlog, not just network ping.
Usage
ping(con)
Arguments
con |
object of class |
Value
A S4-object of class ANSRPC
.
Author(s)
Bernhard Pfaff
References
https://bitcoin.org/en/developer-reference#ping, https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs
See Also
Other Network RPCs:
addnode()
,
clearbanned()
,
disconnectnode()
,
getaddednodeinfo()
,
getconnectioncount()
,
getnettotals()
,
getnetworkinfo()
,
getpeerinfo()
,
listbanned()
RPC-JSON API: pruneblockchain
Description
Pruning of blockchain.
Usage
pruneblockchain(con, height)
Arguments
con |
object of class |
height |
|
Value
A S4-object of class ANSRPC
.
Details
May be set to a discrete height, or a unix timestamp to prune blocks whose block time is at least 2 hours older than the provided timestamp.
Author(s)
Bernhard Pfaff
References
https://bitcoin.org/en/developer-reference#pruneblockchain, https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs
See Also
Other Blockchain RPCs:
decodescript()
,
getbestblockhash()
,
getblock()
,
getblockchaininfo()
,
getblockcount()
,
getblockhash()
,
getblockheader()
,
getchaintips()
,
getchaintxstats()
,
getdifficulty()
,
getmempoolancestors()
,
getmempooldescendants()
,
getmempoolentry()
,
getmempoolinfo()
,
getrawmempool()
,
gettxout()
,
gettxoutproof()
,
gettxoutsetinfo()
,
verifychain()
,
verifytxoutproof()
HTTP post of RPC-JSON
Description
This function executes an RPC-JSON post.
Usage
rpcpost(con, api, plist = list())
Arguments
con |
|
api |
|
plist |
|
Value
A list
object, coerced JSON answer from RPC.
Author(s)
Bernhard Pfaff
See Also
Other bitcoind functions:
ANSRPC-class
,
CONRPC-class
,
NullOrCharacter-class
,
NullOrInteger-class
,
conrpc()
,
startbch()
,
startbtc()
,
stopbch()
,
stopbtc()
show-methods
Description
Defined show
-methods for S4-classes.
Usage
## S4 method for signature 'ANSRPC'
show(object)
## S4 method for signature 'BCHADR'
show(object)
## S4 method for signature 'BTCADR'
show(object)
## S4 method for signature 'ECPARAM'
show(object)
Arguments
object |
a S4-class object. |
Start bitcoind server process
Description
This function does start the bitcoind-server process. It should only be called when no suitable RPC-JSON process is running
Usage
startbch(confbch)
Arguments
confbch |
|
Details
The process is started by calling system()
.
Hereby, the options: rpcuser
, rpcpassword
and
conf
are used in the call to bitcoind
.
Value
NULL
Author(s)
Bernhard Pfaff
See Also
Other bitcoind functions:
ANSRPC-class
,
CONRPC-class
,
NullOrCharacter-class
,
NullOrInteger-class
,
conrpc()
,
rpcpost()
,
startbtc()
,
stopbch()
,
stopbtc()
Start bitcoind server process (BTC alias)
Description
This function is an alias of startbch
Usage
startbtc(confbtc)
Arguments
confbtc |
|
Details
The process is started by calling system()
.
Hereby, the options: rpcuser
, rpcpassword
and
conf
are used in the call to bitcoind
.
Value
NULL
Author(s)
Bernhard Pfaff
See Also
Other bitcoind functions:
ANSRPC-class
,
CONRPC-class
,
NullOrCharacter-class
,
NullOrInteger-class
,
conrpc()
,
rpcpost()
,
startbch()
,
stopbch()
,
stopbtc()
Stop bitcoind server process
Description
This function stops a running bitcoind process.
It calls bitcoin-cli stop
via the
R function system()
.
Usage
stopbch(confbch)
Arguments
confbch |
|
Author(s)
Bernhard Pfaff
See Also
Other bitcoind functions:
ANSRPC-class
,
CONRPC-class
,
NullOrCharacter-class
,
NullOrInteger-class
,
conrpc()
,
rpcpost()
,
startbch()
,
startbtc()
,
stopbtc()
Stop bitcoind server process (BTC alias)
Description
This function stops a running bitcoind process.
It calls bitcoin-cli stop
via the
R function system()
.
Usage
stopbtc(confbtc)
Arguments
confbtc |
|
Author(s)
Bernhard Pfaff
See Also
Other bitcoind functions:
ANSRPC-class
,
CONRPC-class
,
NullOrCharacter-class
,
NullOrInteger-class
,
conrpc()
,
rpcpost()
,
startbch()
,
startbtc()
,
stopbch()
Time of a block
Description
This function returns the time of a block in GMT.
Usage
timeofblock(con, height)
Arguments
con |
|
height |
|
Value
POSIXct
Author(s)
Bernhard Pfaff
See Also
Other UtilityFuncs:
bkfee()
,
blockattime()
,
blockstats()
,
date2int()
,
int2date()
,
intMaxDay()
,
intMinDay()
,
intRangeDay()
,
intRangePeriod()
,
txfee()
,
txids()
,
txinids()
,
txstats()
,
utxoage()
,
utxotype()
,
utxovalue()
Compute fee of a transaction
Description
This function returns the implicit fee of a transaction, by computing the difference between the sum of its inputs and the sum of its outputs.
Usage
txfee(con, txid)
Arguments
con |
|
txid |
|
Value
numeric
Author(s)
Bernhard Pfaff
See Also
Other UtilityFuncs:
bkfee()
,
blockattime()
,
blockstats()
,
date2int()
,
int2date()
,
intMaxDay()
,
intMinDay()
,
intRangeDay()
,
intRangePeriod()
,
timeofblock()
,
txids()
,
txinids()
,
txstats()
,
utxoage()
,
utxotype()
,
utxovalue()
Retrieve TX Ids in block
Description
This function retrieves the transaction IDs in a block.
Usage
txids(con, height, excoinbase = TRUE)
Arguments
con |
|
height |
|
excoinbase |
|
Value
character
Author(s)
Bernhard Pfaff
See Also
Other UtilityFuncs:
bkfee()
,
blockattime()
,
blockstats()
,
date2int()
,
int2date()
,
intMaxDay()
,
intMinDay()
,
intRangeDay()
,
intRangePeriod()
,
timeofblock()
,
txfee()
,
txinids()
,
txstats()
,
utxoage()
,
utxotype()
,
utxovalue()
Retrieving the input transaction IDs
Description
This function returns the transaction IDs of the inputs for a given transaction.
Usage
txinids(con, txid)
Arguments
con |
|
txid |
|
Value
data.frame
, the transaction ID(s) and
the position(s) of the previous UTXO(s).
Author(s)
Bernhard Pfaff
See Also
Other UtilityFuncs:
bkfee()
,
blockattime()
,
blockstats()
,
date2int()
,
int2date()
,
intMaxDay()
,
intMinDay()
,
intRangeDay()
,
intRangePeriod()
,
timeofblock()
,
txfee()
,
txids()
,
txstats()
,
utxoage()
,
utxotype()
,
utxovalue()
Statistics of a transaction
Description
This function returns key statistics/characteristics of a transaction.
Usage
txstats(con, txid)
Arguments
con |
|
txid |
|
Value
data.frame
Author(s)
Bernhard Pfaff
See Also
Other UtilityFuncs:
bkfee()
,
blockattime()
,
blockstats()
,
date2int()
,
int2date()
,
intMaxDay()
,
intMinDay()
,
intRangeDay()
,
intRangePeriod()
,
timeofblock()
,
txfee()
,
txids()
,
txinids()
,
utxoage()
,
utxotype()
,
utxovalue()
Age of UTXOs
Description
This function returns a difftime
object measuring the elapsed time(s)
between the UTXO(s) in a transaction and its input(s) (previous UTXO(s)).
Usage
utxoage(con, txid, units = c("auto", "secs", "mins", "hours", "days", "weeks"))
Arguments
con |
|
txid |
|
units |
|
Value
difftime
Author(s)
Bernhard Pfaff
See Also
Other UtilityFuncs:
bkfee()
,
blockattime()
,
blockstats()
,
date2int()
,
int2date()
,
intMaxDay()
,
intMinDay()
,
intRangeDay()
,
intRangePeriod()
,
timeofblock()
,
txfee()
,
txids()
,
txinids()
,
txstats()
,
utxotype()
,
utxovalue()
Retrieving types of UTXOs
Description
This function returns the types of the UTXO(s) in a transaction.
Usage
utxotype(con, txid)
Arguments
con |
|
txid |
|
Value
character
Author(s)
Bernhard Pfaff
See Also
Other UtilityFuncs:
bkfee()
,
blockattime()
,
blockstats()
,
date2int()
,
int2date()
,
intMaxDay()
,
intMinDay()
,
intRangeDay()
,
intRangePeriod()
,
timeofblock()
,
txfee()
,
txids()
,
txinids()
,
txstats()
,
utxoage()
,
utxovalue()
Retrieving values of UTXOs
Description
This function returns the values of UTXO(s) in a transaction.
Usage
utxovalue(con, txid)
Arguments
con |
|
txid |
|
Value
numeric
Author(s)
Bernhard Pfaff
See Also
Other UtilityFuncs:
bkfee()
,
blockattime()
,
blockstats()
,
date2int()
,
int2date()
,
intMaxDay()
,
intMinDay()
,
intRangeDay()
,
intRangePeriod()
,
timeofblock()
,
txfee()
,
txids()
,
txinids()
,
txstats()
,
utxoage()
,
utxotype()
Validate S4-class BCHADR
Description
This function validates objects of S4-class
BCHADR
. Hereby, checks are conducted
with respect to the first character of the addresses;
their consistency with the net version and
the correspondence of the checksums.
Usage
validBchAdr(object)
Arguments
object |
|
Author(s)
Bernhard Pfaff
References
https://en.bitcoin.it/wiki/Address
See Also
Other BchAdresses:
BCHADR-class
,
BTCADR-class
,
PubHash2BchAdr()
,
PubKey2PubHash()
,
base58CheckDecode()
,
base58CheckEncode()
,
concatHex()
,
decodeHex()
,
hash160()
,
hash256()
,
validBtcAdr()
Validate S4-class BTCADR (BTC alias)
Description
This function validates objects of S4-class
BTCADR
. Hereby, checks are conducted
with respect to the first character of the addresses;
their consistency with the net version and
the correspondence of the checksums.
Usage
validBtcAdr(object)
Arguments
object |
|
Author(s)
Bernhard Pfaff
References
https://en.bitcoin.it/wiki/Address
See Also
Other BchAdresses:
BCHADR-class
,
BTCADR-class
,
PubHash2BchAdr()
,
PubKey2PubHash()
,
base58CheckDecode()
,
base58CheckEncode()
,
concatHex()
,
decodeHex()
,
hash160()
,
hash256()
,
validBchAdr()
RPC-JSON API: verifychain
Description
Verifies blockchain database.
Usage
verifychain(con, checklevel = NULL, nblocks = NULL)
Arguments
con |
object of class |
checklevel |
|
nblocks |
|
Value
A S4-object of class ANSRPC
.
Author(s)
Bernhard Pfaff
References
https://bitcoin.org/en/developer-reference#verifychain, https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs
See Also
Other Blockchain RPCs:
decodescript()
,
getbestblockhash()
,
getblock()
,
getblockchaininfo()
,
getblockcount()
,
getblockhash()
,
getblockheader()
,
getchaintips()
,
getchaintxstats()
,
getdifficulty()
,
getmempoolancestors()
,
getmempooldescendants()
,
getmempoolentry()
,
getmempoolinfo()
,
getrawmempool()
,
gettxout()
,
gettxoutproof()
,
gettxoutsetinfo()
,
pruneblockchain()
,
verifytxoutproof()
RPC-JSON API: verifytxoutproof
Description
Verifies that a proof points to a transaction in a block, returning the transaction it commits to and throwing an RPC error if the block is not in our best chain.
Usage
verifytxoutproof(con, proof)
Arguments
con |
object of class |
proof |
|
Value
A S4-object of class ANSRPC
.
Author(s)
Bernhard Pfaff
References
https://bitcoin.org/en/developer-reference#verifytxoutproof, https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs
See Also
Other Blockchain RPCs:
decodescript()
,
getbestblockhash()
,
getblock()
,
getblockchaininfo()
,
getblockcount()
,
getblockhash()
,
getblockheader()
,
getchaintips()
,
getchaintxstats()
,
getdifficulty()
,
getmempoolancestors()
,
getmempooldescendants()
,
getmempoolentry()
,
getmempoolinfo()
,
getrawmempool()
,
gettxout()
,
gettxoutproof()
,
gettxoutsetinfo()
,
pruneblockchain()
,
verifychain()