This quick start will guide you through getting to a simple e2e transfer flow running between two peers running browser nodes that runs through an intermediary routing node.
The browser nodes will connect to an iframe which provides secure storage within the browser.
We assume you're starting with an existing JS application that runs in the browser.
You can install the browser-node into a React (or similar) application via npm:
View backend quickstart docs to spin up a trio stack. This gives you a router to interact with and non-router nodes to test transfers to and from, as well as local EVM chains and messaging services.
Somewhere in your page load code, you can instantiate the browser node using the connect call:
If you do not want/need to run a local blockchain/router/messaging service, you can skip the steps above and jump straight to Application Installation and Instantiation. The connect call will be the same, except it will use values corresponding to the router and chains you would like to connect to:
Once this is connected, the client has the interface documented in the node API docs. The steps to follow for basic operation are:
To run with two browser nodes, you will need to run two instances of the UI in separate browser profiles, otherwise they will connect to the same browser storage.
We have developed an internal test UI that we use to test the browser node. It has a UI for basic requests like setting up a channel, depositing, etc.
You can run the UI by running:
This will bring up a UI to test against. To test transfers, you will need a second instance running in a separate browser profile so that it can connect to its own secure iframe storage.