-
Notifications
You must be signed in to change notification settings - Fork 27
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
Demo-app-take2 #466
Demo-app-take2 #466
Conversation
Just to make sure I'm tracking here, this jettisons the idea of running a client in browser, right? This is more a web app that interacts with a server where the server is a client running locally? |
less a jettison of the browser client and more a new browser tool for interacting with a CLI client and/or local test network. |
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.
LGTM
First draft of new demo app built on trpc.
zero-frills react app. meant for testing and demonstration of content lookups.
underlying trpc structure will be reusable interface for future app development.
the react package itself does not require
portalnetwork
or@chainsafe
as dependencies, avoiding the need for webpack / browserify / etc.The diagram below shows the flow for two different setups.
events
Ultralight Browser app serving 2 local clients
tRPC Router contains the schema and logic for the tRPC endpoints.
The
tRPC Router
that is defined in the trpcserver.ts
script contains the actual logic for responding to queries/mutations/subscriptions from the trpc server. The router processes the tRPC calls from the App, and interacts with the Portal Client either directly, or using JSON-RPC.Another version of the same schema exists in the React code.
This is in place simply to inform the App Components of the input / output types for the methods. It contains no actual logic, and does not actually get accessed.
The
WebSocket
setup is currently baked into theserver.ts
scriptFrom
ultralight/packages/CLI
runnpm run server:dev
to start the client, wss, and trpc server.To also run with HTTP only clients -- start clients using the
npm run start
-- or by using the devnet script.At time of writing, the app is hardwired to expect an HTTP client at 8545 and a WSS client at 8546
User input of address/port has not been built
To start the APP:
from
ultralight/packages/client
runnpm run dev