PeerChannel
Extends:
Constructor Summary
Public Constructor | ||
public |
constructor(connection: NetworkConnection) |
Member Summary
Public Members | ||
public get |
closed: boolean |
|
public get |
|
|
public get |
id: number |
|
public get |
lastMessageReceivedAt: number |
|
public get |
|
|
public set |
|
|
public get |
|
|
public set |
|
|
public get |
protocol: number |
Method Summary
Public Methods | ||
public |
accountsProof(blockHash: Hash, proof: AccountsProof): boolean |
|
public |
accountsTreeChunk(blockHash: Hash, chunk: AccountsTreeChunk): boolean |
|
public |
addr(addresses: Array<PeerAddress>): boolean |
|
public |
|
|
public |
blockProof(proof: BlockChain): boolean |
|
public |
chainProof(proof: ChainProof): boolean |
|
public |
close(type: number, reason: string) |
|
public |
equals(o: PeerChannel): boolean |
|
public |
expectMessage(types: Message.Type | Array<Message.Type>, timeoutCallback: function(), msgTimeout: number, chunkTimeout: number) |
|
public |
getAccountsProof(blockHash: Hash, addresses: Array<Address>): boolean |
|
public |
getAccountsTreeChunk(blockHash: Hash, startPrefix: string): boolean |
|
public |
getAddr(protocolMask: number, serviceMask: number, maxResults: number): boolean |
|
public |
getBlockProof(blockHashToProve: Hash, knownBlockHash: Hash): boolean |
|
public |
getBlockProofAt(blockHeightToProve: number, knownBlockHash: Hash): boolean |
|
public |
|
|
public |
getChainProof(): boolean |
|
public |
|
|
public |
getHead(): boolean |
|
public |
|
|
public |
getTransactionReceipts(address: Address): boolean this method was deprecated.
|
|
public |
getTransactionReceiptsByAddress(address: Address): boolean |
|
public |
getTransactionReceiptsByHashes(hashes: Array<Hash>): boolean |
|
public |
getTransactionsProof(blockHash: Hash, addresses: Array<Address>): boolean this method was deprecated.
|
|
public |
getTransactionsProofByAddresses(blockHash: Hash, addresses: Array<Address>): boolean |
|
public |
getTransactionsProofByHashes(blockHash: Hash, hashes: Array<Hash>): boolean |
|
public |
hashCode(): string |
|
public |
head(header: BlockHeader): boolean |
|
public |
header(header: BlockHeader): boolean |
|
public |
|
|
public |
isExpectingMessage(type: Message.Type): boolean |
|
public |
mempool(): boolean |
|
public |
|
|
public |
ping(nonce: number): boolean |
|
public |
pong(nonce: number): boolean |
|
public |
rawBlock(block: Uint8Array): boolean |
|
public |
reject(messageType: Message.Type, code: RejectMessage.Code, reason: string, extraData: Uint8Array): boolean |
|
public |
signal(senderId: PeerId, recipientId: PeerId, nonce: number, ttl: number, flags: SignalMessage.Flag | number, payload: Uint8Array, senderPubKey: PublicKey, signature: Signature): boolean |
|
public |
subscribe(subscription: Subscription): boolean |
|
public |
toString(): string |
|
public |
transactionReceipts(transactionReceipts: Array<TransactionReceipt>): boolean |
|
public |
transactionsProof(blockHash: Hash, proof: TransactionsProof): boolean |
|
public |
tx(transaction: Transaction, accountsProof: AccountsProof): boolean |
|
public |
|
|
public |
version(peerAddress: PeerAddress, headHash: Hash, challengeNonce: Uint8Array, appAgent: string): boolean |
Inherited Summary
From class Observable | ||
public static get |
WILDCARD: string: string |
|
public |
bubble(observable: Observable, types: ...string) |
|
public |
fire(type: string, args: ...*): Promise |
|
public |
off(type: string, id: number) |
|
public |
on(type: string, callback: Function): number |
Public Constructors
public constructor(connection: NetworkConnection) source
Override:
Observable#constructorParams:
Name | Type | Attribute | Description |
connection | NetworkConnection |
Listen:
* |
NetworkConnection#message |
Public Members
public get closed: boolean source
public get connection: NetworkConnection source
public get id: number source
public get lastMessageReceivedAt: number source
public get netAddress: NetAddress source
public set netAddress: NetAddress source
public get peerAddress: PeerAddress source
public set peerAddress: PeerAddress source
public get protocol: number source
Public Methods
public accountsProof(blockHash: Hash, proof: AccountsProof): boolean source
Params:
Name | Type | Attribute | Description |
blockHash | Hash | ||
proof | AccountsProof |
|
Return:
boolean |
public accountsTreeChunk(blockHash: Hash, chunk: AccountsTreeChunk): boolean source
Params:
Name | Type | Attribute | Description |
blockHash | Hash | ||
chunk | AccountsTreeChunk |
|
Return:
boolean |
public addr(addresses: Array<PeerAddress>): boolean source
Params:
Name | Type | Attribute | Description |
addresses | Array<PeerAddress> |
Return:
boolean |
public block(block: Block): boolean source
Params:
Name | Type | Attribute | Description |
block | Block |
Return:
boolean |
public blockProof(proof: BlockChain): boolean source
Params:
Name | Type | Attribute | Description |
proof | BlockChain |
|
Return:
boolean |
public chainProof(proof: ChainProof): boolean source
Params:
Name | Type | Attribute | Description |
proof | ChainProof |
Return:
boolean |
public close(type: number, reason: string) source
Params:
Name | Type | Attribute | Description |
type | number |
|
|
reason | string |
|
public equals(o: PeerChannel): boolean source
Params:
Name | Type | Attribute | Description |
o | PeerChannel |
Return:
boolean |
public expectMessage(types: Message.Type | Array<Message.Type>, timeoutCallback: function(), msgTimeout: number, chunkTimeout: number) source
Params:
Name | Type | Attribute | Description |
types | Message.Type | Array<Message.Type> | ||
timeoutCallback | function() | ||
msgTimeout | number |
|
|
chunkTimeout | number |
|
public getAccountsTreeChunk(blockHash: Hash, startPrefix: string): boolean source
Params:
Name | Type | Attribute | Description |
blockHash | Hash | ||
startPrefix | string |
Return:
boolean |
public getAddr(protocolMask: number, serviceMask: number, maxResults: number): boolean source
Params:
Name | Type | Attribute | Description |
protocolMask | number | ||
serviceMask | number | ||
maxResults | number |
Return:
boolean |
public getBlockProofAt(blockHeightToProve: number, knownBlockHash: Hash): boolean source
Params:
Name | Type | Attribute | Description |
blockHeightToProve | number | ||
knownBlockHash | Hash |
Return:
boolean |
public getBlocks(locators: Array<Hash>, maxInvSize: number, ascending: boolean): boolean source
Params:
Name | Type | Attribute | Description |
locators | Array<Hash> | ||
maxInvSize | number | ||
ascending | boolean |
|
Return:
boolean |
public getData(vectors: Array<InvVector>): boolean source
Params:
Name | Type | Attribute | Description |
vectors | Array<InvVector> |
Return:
boolean |
public getHeader(vectors: Array<InvVector>): boolean source
Params:
Name | Type | Attribute | Description |
vectors | Array<InvVector> |
Return:
boolean |
public getTransactionReceipts(address: Address): boolean source
Params:
Name | Type | Attribute | Description |
address | Address |
Return:
boolean |
public getTransactionReceiptsByAddress(address: Address): boolean source
Params:
Name | Type | Attribute | Description |
address | Address |
Return:
boolean |
public getTransactionReceiptsByHashes(hashes: Array<Hash>): boolean source
Params:
Name | Type | Attribute | Description |
hashes | Array<Hash> |
Return:
boolean |
public getTransactionsProof(blockHash: Hash, addresses: Array<Address>): boolean source
Return:
boolean |
public getTransactionsProofByAddresses(blockHash: Hash, addresses: Array<Address>): boolean source
Return:
boolean |
public getTransactionsProofByHashes(blockHash: Hash, hashes: Array<Hash>): boolean source
Return:
boolean |
public head(header: BlockHeader): boolean source
Params:
Name | Type | Attribute | Description |
header | BlockHeader |
Return:
boolean |
public header(header: BlockHeader): boolean source
Params:
Name | Type | Attribute | Description |
header | BlockHeader |
Return:
boolean |
public inv(vectors: Array<InvVector>): boolean source
Params:
Name | Type | Attribute | Description |
vectors | Array<InvVector> |
Return:
boolean |
public isExpectingMessage(type: Message.Type): boolean source
Params:
Name | Type | Attribute | Description |
type | Message.Type |
Return:
boolean |
public notFound(vectors: Array<InvVector>): boolean source
Params:
Name | Type | Attribute | Description |
vectors | Array<InvVector> |
Return:
boolean |
public ping(nonce: number): boolean source
Params:
Name | Type | Attribute | Description |
nonce | number |
Return:
boolean |
public pong(nonce: number): boolean source
Params:
Name | Type | Attribute | Description |
nonce | number |
Return:
boolean |
public rawBlock(block: Uint8Array): boolean source
Params:
Name | Type | Attribute | Description |
block | Uint8Array |
Return:
boolean |
public reject(messageType: Message.Type, code: RejectMessage.Code, reason: string, extraData: Uint8Array): boolean source
Params:
Name | Type | Attribute | Description |
messageType | Message.Type | ||
code | RejectMessage.Code | ||
reason | string | ||
extraData | Uint8Array |
|
Return:
boolean |
public signal(senderId: PeerId, recipientId: PeerId, nonce: number, ttl: number, flags: SignalMessage.Flag | number, payload: Uint8Array, senderPubKey: PublicKey, signature: Signature): boolean source
Return:
boolean |
public subscribe(subscription: Subscription): boolean source
Params:
Name | Type | Attribute | Description |
subscription | Subscription |
Return:
boolean |
public transactionReceipts(transactionReceipts: Array<TransactionReceipt>): boolean source
Params:
Name | Type | Attribute | Description |
transactionReceipts | Array<TransactionReceipt> |
|
Return:
boolean |
public transactionsProof(blockHash: Hash, proof: TransactionsProof): boolean source
Params:
Name | Type | Attribute | Description |
blockHash | Hash | ||
proof | TransactionsProof |
|
Return:
boolean |
public tx(transaction: Transaction, accountsProof: AccountsProof): boolean source
Params:
Name | Type | Attribute | Description |
transaction | Transaction | ||
accountsProof | AccountsProof |
|
Return:
boolean |
public version(peerAddress: PeerAddress, headHash: Hash, challengeNonce: Uint8Array, appAgent: string): boolean source
Params:
Name | Type | Attribute | Description |
peerAddress | PeerAddress | ||
headHash | Hash | ||
challengeNonce | Uint8Array | ||
appAgent | string |
|
Return:
boolean |