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

browser: update since refactor #622

Merged
merged 2 commits into from
Nov 1, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion browser/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
3 changes: 1 addition & 2 deletions browser/src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}

Expand Down
16 changes: 1 addition & 15 deletions docs/Running-in-the-browser.md
Original file line number Diff line number Diff line change
@@ -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.