Constructor
new BlockMeta(hashopt, heightopt, timeopt)
Create block meta.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
hash |
Hash |
<optional> |
|
height |
Number |
<optional> |
|
time |
Number |
<optional> |
- Source:
Methods
(static) fromEntry(entry) → {BlockMeta}
Instantiate block meta from chain entry.
Parameters:
Name | Type | Description |
---|---|---|
entry |
ChainEntry |
- Source:
Returns:
- Type
- BlockMeta
(static) fromHashAndTime(data, height) → {BlockMeta}
Instantiate block meta from hash and time.
Parameters:
Name | Type | Description |
---|---|---|
data |
Buffer | |
height |
Number |
- Source:
Returns:
- Type
- BlockMeta
(private) fromEntry(entry)
Instantiate block meta from chain entry.
Parameters:
Name | Type | Description |
---|---|---|
entry |
ChainEntry |
- Source:
fromHashAndTime(data, height) → {BlockMeta}
Decode hash and time.
Parameters:
Name | Type | Description |
---|---|---|
data |
Buffer | |
height |
Number |
- Source:
Returns:
- Type
- BlockMeta
fromJSON(json)
Instantiate block meta from json object.
Parameters:
Name | Type | Description |
---|---|---|
json |
Object |
- Source:
getJSON() → {Object}
Convert the block meta to a more json-friendly object.
- Source:
Returns:
- Type
- Object
getSize() → {Number}
Calculate size.
- Source:
Returns:
- Type
- Number
inject(meta) → {this}
Clone the block.
Parameters:
Name | Type | Description |
---|---|---|
meta |
BlockMeta |
- Source:
Returns:
- Type
- this
read(br) → {this}
Instantiate block meta from serialized tip data.
Parameters:
Name | Type | Description |
---|---|---|
br |
bio.BufferReader |
- Source:
Returns:
- Type
- this
toHashAndTime() → {Buffer}
Encode hash and time.
- Source:
Returns:
- Type
- Buffer
write(bw) → {BufioWriter}
Serialize the block meta.
Parameters:
Name | Type | Description |
---|---|---|
bw |
BufioWriter |
- Source:
Returns:
- Type
- BufioWriter