browser: update script import (#622)

* browser: update since refactor

* docs: redirect browser to new guide
This commit is contained in:
Matthew Zipkin 2018-11-01 11:58:28 -07:00 committed by Buck Perley
parent fe340265c8
commit 78eeae6763
3 changed files with 3 additions and 18 deletions

View File

@ -75,7 +75,7 @@
overflow-y: scroll;
}
</style>
<script src="/app.js" defer></script>
<script src="app.js" defer></script>
</head>
<body>
<h1>Bcoin, the browser full node</h1>

View File

@ -95,8 +95,7 @@ function show(obj) {
floating.style.display = 'block';
return;
}
const json = obj && obj.toJSON ? obj.toJSON() : null;
floating.innerHTML = escape(JSON.stringify(json, null, 2));
floating.innerHTML = escape(JSON.stringify(obj, null, 2));
floating.style.display = 'block';
}

View File

@ -1,16 +1,2 @@
Because bcoin is written in node.js, it is capable of being browserified.
This page has been moved to [https://bcoin.io/guides/browser.html](https://bcoin.io/guides/browser.html)
## Running a full node in the browser
``` bash
$ cd ~/bcoin
$ make # Browserify bcoin
$ node browser/server.js 8080 # Start up a simple webserver and websocket->tcp bridge
$ chromium http://localhost:8080
```
You should see something like this: http://i.imgur.com/0pWySyZ.png
This is a simple proof-of-concept. It's not a pretty interface. I hope to see
others doing something far more interesting. A browser extension may be better:
the chrome extension API exposes raw TCP access.