Constructor
new VersionPacket(optionsopt)
Create a version packet.
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
<optional> |
Properties
|
Properties:
Name | Type | Description |
---|---|---|
version |
Number | Protocol version. |
services |
Number | Service bits. |
time |
Number | Timestamp of discovery. |
remote |
NetAddress | Their address. |
nonce |
Buffer | |
agent |
String | User agent string. |
height |
Number | Chain height. |
noRelay |
Boolean | Whether transactions should be relayed immediately. |
- Source:
Extends
- Packet
Members
version :Number
Type:
- Number
- Source:
Methods
fromOptions(options)
Inject properties from options.
Parameters:
Name | Type | Description |
---|---|---|
options |
Object |
- Source:
getSize() → {Number}
Get serialization size.
- Source:
Returns:
- Type
- Number
read(br) → {this}
Inject properties from buffer reader.
Parameters:
Name | Type | Description |
---|---|---|
br |
bio.BufferReader |
- Source:
Returns:
- Type
- this
write(bw) → {BufioWriter}
Write version packet to buffer writer.
Parameters:
Name | Type | Description |
---|---|---|
bw |
BufioWriter |
- Source:
Returns:
- Type
- BufioWriter