This guide will walk you through how to run 0x Mesh directly in the browser and discuss some of the advantages and drawbacks of doing so.
Mesh is written in Go, but can be compiled to WebAssembly and run directly in the browser. This makes it possible for users to share orders and trade directly with one another without relying on any third-party server or database. This approach comes with a lot of advantages, but also has some drawbacks:
Little to no hosting costs
Ability to trade experimental/niche assets
Longer warm-up time
Increased risk of trade collisions
Consumes more end-user resources
For your convenience, we've published an NPM package called
To install the NPM package, simply run:
npm install --save @0x/mesh-browser
Or if you are using
yarn add @0x/mesh-browser
Documentation for the
@0x/mesh-browser package is available at 0x-org.gitbook.io/mesh/browser.
The examples/browser directory includes a bare-bones example of how to use the
@0x/mesh-browser and bundle everything together with Webpack.