An open API service indexing awesome lists of open source software.

https://github.com/flowchain/flowchain-sim

The flowchain debug tool
https://github.com/flowchain/flowchain-sim

Last synced: 2 months ago
JSON representation

The flowchain debug tool

Awesome Lists containing this project

README

          

The `flowchain-sim` tool.

# Introduction

`flowchain-sim` (Flowchain Simulator) is a simple tool to watch the p2p network of Flowchain IoT nodes.

# Install

```
$ git clone https://github.com/flowchain/flowchain-sim.git
$ cd flowchain-sim
$ npm i
```

# How to Use

1. Please open a terminal and start the debug server:

```
$ export HOST=192.168.124.4
$ export PORT=9009
$ node index.js
WoT/WebSocket server is listening at ws://192.168.124.4:9009
```

The environment variables:

* `HOST`: the listening host
* `PORT`: the listening port

2. After starting the debug server, please modify `dist/index.html` by placing the debug server IP address and port number:

```
var client = new WebSocket( 'ws://192.168.124.4:9009/node/00000000/viewer' );
```

3. Start a web server locally:

```
$ http-server dist/ -p 3000
Starting up http-server, serving dist/
Available on:
http://127.0.0.1:3000
http://192.168.124.4:3000
Hit CTRL-C to stop the server
```

You can install `http-server` by executing `npm i http-server -g`.

4. Open the debug application with your browser by the the url `http://127.0.0.1:3000`.

![](screenshot/app.png)

# License

flowchain-sim is released under the [MIT License](http://www.opensource.org/licenses/MIT). See [LICENSE.md](LICENSE.md).