Constructor Summary
Public Constructor | ||
public |
constructor(time: Time, peer: Peer, invRequestManager: InvRequestManager, targetSubscription: Subscription) |
Method Summary
Public Methods | ||
public |
getBlockProof(blockHashToProve: Hash, knownBlock: Block): Promise<Block> |
|
public |
getTransactionReceipts(address: Address): Promise<Array<TransactionReceipt>> |
|
public |
getTransactionsProof(block: Block, addresses: Array<Address>): Promise<Array<Transaction>> |
|
public |
knowsBlock(blockHash: Hash): boolean |
|
public |
|
|
public |
relayBlock(block: Block): boolean |
|
public |
relayTransaction(transaction: Transaction): boolean |
|
public |
removeTransaction(transaction: Transaction) |
|
public |
requestVector(vector: InvVector) |
|
public |
subscribe(subscription: Subscription) |
Protected Methods | ||
protected |
_doRequestData(vectors: Array<InvVector>): void |
|
protected abstract |
|
|
protected abstract |
_getRawBlock(hash: Hash, includeForks: boolean): PromiseUint8Array> |
|
protected abstract |
_getTransaction(hash: Hash): PromiseTransaction> |
|
protected |
_noMoreData(): void |
|
protected |
_onAllObjectsProcessed(): void |
|
protected |
_onAllObjectsReceived(): void |
|
protected |
async _onBlock(msg: BlockMessage): Promise<void> |
|
protected |
_onClose(): void |
|
protected |
async _onGetData(msg: GetDataMessage): Promise |
|
protected |
async _onGetHeader(msg: GetHeaderMessage): Promise |
|
protected |
async _onHeader(msg: HeaderMessage): Promise<void> |
|
protected |
async _onInv(msg: InvMessage): Promise<void> |
|
protected |
_onKnownBlockAnnounced(hash: Hash, block: Block): void |
|
protected |
_onKnownTransactionAnnounced(hash: Hash, transaction: Transaction): void |
|
protected |
_onNewBlockAnnounced(hash: Hash): void |
|
protected |
_onNewTransactionAnnounced(hash: Hash): void |
|
protected |
_onNoUnknownObjects(): void |
|
protected |
_onNotFound(msg: NotFoundMessage): void |
|
protected |
_onObjectProcessed(vector: InvVector): void |
|
protected |
_onObjectReceived(vector: InvVector): void |
|
protected |
_onSubscribe(msg: SubscribeMessage) |
|
protected |
|
|
protected |
async _processBlock(hash: Hash, block: Block): Promise<void> |
|
protected |
async _processHeader(hash: Hash, header: BlockHeader): Promise<void> |
|
protected |
async _processTransaction(hash: Hash, transaction: Transaction): Promise<void> |
|
protected |
_requestData(): void |
|
protected |
_shouldRequestData(vector: InvVector): boolean |
Inherited Summary
From class Observable | ||
public static get |
WILDCARD: string: string |
|
public |
bubble(observable: Observable, types: ...string) |
|
public |
fire(type: string, args: ...*): Promise | null |
|
public |
off(type: string, id: number) |
|
public |
on(type: string, callback: Function): number |
Public Constructors
public constructor(time: Time, peer: Peer, invRequestManager: InvRequestManager, targetSubscription: Subscription) source
Override:
Observable#constructorParams:
Name | Type | Attribute | Description |
time | Time | ||
peer | Peer | ||
invRequestManager | InvRequestManager | ||
targetSubscription | Subscription |
|
Public Methods
public getTransactionReceipts(address: Address): Promise<Array<TransactionReceipt>> source
Params:
Name | Type | Attribute | Description |
address | Address |
public getTransactionsProof(block: Block, addresses: Array<Address>): Promise<Array<Transaction>> source
public knowsBlock(blockHash: Hash): boolean source
Params:
Name | Type | Attribute | Description |
blockHash | Hash |
Return:
boolean |
public onHeadUpdated() source
public relayBlock(block: Block): boolean source
Params:
Name | Type | Attribute | Description |
block | Block |
Return:
boolean |
public relayTransaction(transaction: Transaction): boolean source
Params:
Name | Type | Attribute | Description |
transaction | Transaction |
Return:
boolean |
public removeTransaction(transaction: Transaction) source
Params:
Name | Type | Attribute | Description |
transaction | Transaction |
public requestVector(vector: InvVector) source
Params:
Name | Type | Attribute | Description |
vector | InvVector |
public subscribe(subscription: Subscription) source
Params:
Name | Type | Attribute | Description |
subscription | Subscription |
Protected Methods
protected _doRequestData(vectors: Array<InvVector>): void source
Params:
Name | Type | Attribute | Description |
vectors | Array<InvVector> |
Return:
void |
protected abstract _getBlock(hash: Hash, includeForks: boolean, includeBody: boolean): PromiseBlock> source
Params:
Name | Type | Attribute | Description |
hash | Hash | ||
includeForks | boolean |
|
|
includeBody | boolean |
|
protected abstract _getRawBlock(hash: Hash, includeForks: boolean): PromiseUint8Array> source
Params:
Name | Type | Attribute | Description |
hash | Hash | ||
includeForks | boolean |
|
Return:
PromiseUint8Array> |
protected abstract _getTransaction(hash: Hash): PromiseTransaction> source
Params:
Name | Type | Attribute | Description |
hash | Hash |
protected async _onBlock(msg: BlockMessage): Promise<void> source
Params:
Name | Type | Attribute | Description |
msg | BlockMessage |
Return:
Promise<void> |
protected async _onGetData(msg: GetDataMessage): Promise source
Params:
Name | Type | Attribute | Description |
msg | GetDataMessage |
Return:
Promise |
protected async _onGetHeader(msg: GetHeaderMessage): Promise source
Params:
Name | Type | Attribute | Description |
msg | GetHeaderMessage |
Return:
Promise |
protected async _onHeader(msg: HeaderMessage): Promise<void> source
Params:
Name | Type | Attribute | Description |
msg | HeaderMessage |
Return:
Promise<void> |
protected async _onInv(msg: InvMessage): Promise<void> source
Params:
Name | Type | Attribute | Description |
msg | InvMessage |
Return:
Promise<void> |
protected _onKnownTransactionAnnounced(hash: Hash, transaction: Transaction): void source
Params:
Name | Type | Attribute | Description |
hash | Hash | ||
transaction | Transaction |
Return:
void |
protected _onNewBlockAnnounced(hash: Hash): void source
Params:
Name | Type | Attribute | Description |
hash | Hash |
Return:
void |
protected _onNewTransactionAnnounced(hash: Hash): void source
Params:
Name | Type | Attribute | Description |
hash | Hash |
Return:
void |
protected _onNotFound(msg: NotFoundMessage): void source
Params:
Name | Type | Attribute | Description |
msg | NotFoundMessage |
Return:
void |
protected _onObjectProcessed(vector: InvVector): void source
Params:
Name | Type | Attribute | Description |
vector | InvVector |
Return:
void |
protected _onObjectReceived(vector: InvVector): void source
Params:
Name | Type | Attribute | Description |
vector | InvVector |
Return:
void |
protected _onSubscribe(msg: SubscribeMessage) source
Params:
Name | Type | Attribute | Description |
msg | SubscribeMessage |
protected async _onTx(msg: TxMessage): Promise source
Params:
Name | Type | Attribute | Description |
msg | TxMessage |
Return:
Promise |
protected async _processHeader(hash: Hash, header: BlockHeader): Promise<void> source
Params:
Name | Type | Attribute | Description |
hash | Hash | ||
header | BlockHeader |
Return:
Promise<void> |
protected async _processTransaction(hash: Hash, transaction: Transaction): Promise<void> source
Params:
Name | Type | Attribute | Description |
hash | Hash | ||
transaction | Transaction |
Return:
Promise<void> |