-
Notifications
You must be signed in to change notification settings - Fork 757
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WebSockets #1251
base: develop
Are you sure you want to change the base?
WebSockets #1251
Conversation
…Heads working fine
__tests__/WebSocketChannel.test.ts
Outdated
|
||
// websocket | ||
const webSocketChannel = new WebSocketChannel({ | ||
nodeUrl: 'wss://toni.spaceshard.io/rpc/v0_8', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
flagging this to not forget to change later :D
__tests__/WebSocketChannel.test.ts
Outdated
|
||
describe('websocket regular endpoints - pathfinder test', () => { | ||
const webSocketChannel = new WebSocketChannel({ | ||
nodeUrl: 'wss://toni.spaceshard.io/rpc/v0_8', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
flagging here as well for later, also maybe to extract into constant
reject(Error(`error on ${method}, ${message.error}`)); | ||
} | ||
} | ||
// console.log(`data from ${method} response`, data); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
leftover?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still need it for testing as this PR can't be 100% complete before RPC 0.8 final release, Pathfinder WS Release and Devnet WS Release.
This is more like PrePR all working and can be checked but will be updated later.
* ``` | ||
*/ | ||
public async waitForUnsubscription(forSubscriptionId?: number) { | ||
// unsubscribe |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can this comment be removed?
} | ||
|
||
/** | ||
* subscribe to pending transactions (mempool) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
todo add params on this and rest that are missing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is auto add on doccs ? @penovicp
src/channel/ws_0_8.ts
Outdated
|
||
private onMessageProxy(event: MessageEvent<any>) { | ||
const message: WebSocketEvent = JSON.parse(event.data); | ||
// console.log('onMessage:', data); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
leftover?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the ws
dependency get used? It looks like only isows
does.
The approach looks good to me.
Co-authored-by: Ivan Pavičić <[email protected]>
Co-authored-by: Ivan Pavičić <[email protected]>
Co-authored-by: Ivan Pavičić <[email protected]>
isows use ws, at least it should use installed one. |
Motivation and Resolution
Blocked by:
TBD
RPC version (if applicable)
0.8
Usage related changes
Development related changes
Checklist: