Chatangle-Backend
所属分类:聊天室
开发工具:JavaScript
文件大小:0KB
下载次数:0
上传日期:2022-04-28 17:14:09
上 传 者:
sh-1993
说明: Chatangle的后端;一个自由、去中心化、全球聊天室,由IOTA纠结提供支持。
(The backend for Chatangle; a free, decentralized, global chatroom, powered by the IOTA tangle.)
文件列表:
.circleci/ (0, 2018-08-19)
.circleci/config.yml (881, 2018-08-19)
LICENSE (1074, 2018-08-19)
app.js (1522, 2018-08-19)
bin/ (0, 2018-08-19)
bin/www (2517, 2018-08-19)
lib/ (0, 2018-08-19)
lib/RecentMessageCache.js (410, 2018-08-19)
lib/TransactionStreamSubscriberFilter.js (5501, 2018-08-19)
package-lock.json (2685, 2018-08-19)
package.json (794, 2018-08-19)
package.sh (59, 2018-08-19)
routes/ (0, 2018-08-19)
routes/chatangleWebSocketServer.js (3359, 2018-08-19)
serverNotes.txt (160, 2018-08-19)
# Chatangle Backend
[![Greenkeeper badge](https://badges.greenkeeper.io/pRizz/Chatangle-Backend.svg)](https://greenkeeper.io/)
The backend for [Chatangle](https://github.com/pRizz/Chatangle); a free, decentralized, global chatroom, powered by the IOTA tangle.
# Installation Instructions
## General Installation
For global installation:
```bash
npm install -g chatangle-backend
```
This will make Chatangle Backend available as the command `chatangle-backend`.
### Installation Errors
If you get errors during install about bad permissions, your `npm` was probably installed as the root user. It is recommended to install `npm` as non-root, like with `nvm`. A workaround is to install with the `--unsafe-perm` flag like so:
```bash
npm install -g --unsafe-perm chatangle-backend
```
# Usage
You must have a working [IOTA Transaction Stream](https://github.com/pRizz/IOTA-Transaction-Stream).
If globally installed, example:
```bash
chatangle-backend --iotaTransactionStreamIP 123.45.67.890 --iotaTransactionStreamPort 8008 --isIotaTransactionStreamSecured false --webSocketServerPort 8008
```
If installed locally or running from an IDE:
```bash
npm run start -- --iotaTransactionStreamIP 123.45.67.890 --iotaTransactionStreamPort 8008 --isIotaTransactionStreamSecured false --webSocketServerPort 8008
```
Running in the background, example:
```bash
nohup --iotaTransactionStreamIP 123.45.67.890 --iotaTransactionStreamPort 8008 --isIotaTransactionStreamSecured false --webSocketServerPort 8008 >> output.log &
```
Then tail the logs with
```bash
tail -f output.log
```
If `PORT` is specified in the environment, this will override `webSocketServerPort`
### Hooking Into The Backend
These lines of Javascript can be copy-pasted into the Chrome console after starting the server locally to test if the backend is working:
```Javascript
let ws = new WebSocket('ws://chatangleBackendIP:8008')
ws.addEventListener('message', message => {console.log('message', message)})
ws.addEventListener('error', message => {console.error('error', message)})
ws.addEventListener('open', message => {console.log('open', message)})
```
近期下载者:
相关文件:
收藏者: