Skip to content
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

UI: Implement Procedures and Interface #481

Merged
merged 78 commits into from
Oct 19, 2023
Merged

UI: Implement Procedures and Interface #481

merged 78 commits into from
Oct 19, 2023

Conversation

ScottyPoi
Copy link
Collaborator

@ScottyPoi ScottyPoi commented Oct 14, 2023

PortalNetwork Browser UI

**quickstart guide in packages/ui/README.md **

PR Changes:

**ALL tRPC CODE MOVED TO packages/ui/src/server **

  1. Implements trpc "procedures" to link the UI to a Portal Client.
  2. Develops UI to provide a view into Node info, routing table info, bootnode responses, content storage, and message logs.
  3. Develops interface to store and retrieve database content from browser.
  4. Develops interface to directly input parameters and make JSON-RPC calls in browser, and observe / interact with the results.
  5. Debugs technical issues with Websocket and tRPC Servers.
  6. Develops App state management
  7. Improves App layout and design
  8. Adds README.md with quickstart instructions

packages/portalnetwork/client/

  1. Adds event types for sentTalkReq and sentTalkResp
  2. Adds logEvents option to PortalNetwork constructor / create function
  3. logEvents option set to true will enable logs to the UI subscriptions (websockets)


portal.enableLog('*ultralight*, *LightClient*, -OFFER, -ACCEPT, *ultralight:RPC*')

await portal.start()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to make sure I understand what this is doing, this is just starting an Ultralight client and relaying the messages over WSS to the UI, right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes -- this part starts an Ultralight client inside of the server, where we can hook directly into the typescript, and utilize event listeners.

This is unique to the "HTTP" client mode, which communicates with a CLI node running independently

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ultimately i should probably decouple this, so that running the internal Ultralight instance is optional, or an entirely different script.

Copy link
Collaborator

@acolytec3 acolytec3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great as far as it goes. Should we consider moving the tRPC server instance over to the UI package so we have a clean separation of concerns between the cli true NodeJS client and then the one specifically designed to be paired with the UI?

@ScottyPoi
Copy link
Collaborator Author

This looks great as far as it goes. Should we consider moving the tRPC server instance over to the UI package so we have a clean separation of concerns between the cli true NodeJS client and then the one specifically designed to be paired with the UI?

👍

@ScottyPoi
Copy link
Collaborator Author

@acolytec3

I moved all of the UI related stuff into the UI package, and everything works fine.
I also made the websocket ultralight part default to off. it can be started manually in the UI instead.

This is in a good place to merge now. Some small code additions into the portalnetwork client code as described above, but everything else is contained to the UI package.

Copy link
Collaborator

@acolytec3 acolytec3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Taking it on faith.

@acolytec3 acolytec3 merged commit ce56032 into master Oct 19, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants