getBlock: getBlock

Description Usage Arguments Details Value Author(s) References Examples

Description

Full block information can be retrieved by either block height or hash.

Usage

1
2
getBlock(height, hash, ip = getOption("monerod.ip", "127.0.0.1"),
  port = getOption("monerod.port", 18081))

Arguments

height

int; the block's height.

hash

chr; the block's hash.

ip

daemon ip address

port

daemon port

Details

Provide either the height parameter or hash parameter, but not both.

Value

Author(s)

Garrett See

References

https://getmonero.org/knowledge-base/developer-guides/daemon-rpc#getblock

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
# Look up by height:
# In the following example, block 912345 is looked up by its height.
# Note that block 912345 does not have any non-coinbase transactions.
# (See the next example for a block with extra transactions):
## Not run: 
getBlock(912345)

## End(Not run)

# Look up by hash:
# In the following example, block 993056 is looked up by its hash. Note that
# block 993056 has 3 non-coinbase transactions:
## Not run: 
 getBlock(hash="510ee3c4e14330a7b96e883c323a60ebd1b5556ac1262d0bc03c24a3b785516f")

## End(Not run)

dv-trading/moneRo documentation built on May 5, 2019, 1:37 p.m.