Skip to content

Commit

Permalink
Merge pull request #104 from skycoin/v0.2_new_cxo
Browse files Browse the repository at this point in the history
v3.0
  • Loading branch information
Gopher Pigjin authored Sep 5, 2017
2 parents 5d1ff28 + f676109 commit 2bdeda9
Show file tree
Hide file tree
Showing 5,506 changed files with 642,714 additions and 14,807 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@ node_modules
/stage/
/prime/
/parts/
/pkg/build/
/pkg/build
/static/dist/
63 changes: 63 additions & 0 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 39 additions & 0 deletions Gopkg.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@

# Gopkg.toml example
#
# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md
# for detailed Gopkg.toml documentation.
#
# required = ["github.com/user/thing/cmd/thing"]
# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"]
#
# [[constraint]]
# name = "github.com/user/project"
# version = "1.0.0"
#
# [[constraint]]
# name = "github.com/user/project2"
# branch = "dev"
# source = "github.com/myfork/project2"
#
# [[override]]
# name = "github.com/x/y"
# version = "2.4.0"

required = ["github.com/disiqueira/gotree"]

[[constraint]]
name = "github.com/skycoin/cxo"
branch = "master"

[[constraint]]
name = "github.com/skycoin/skycoin"
version = "0.19.1"

[[constraint]]
name = "gopkg.in/urfave/cli.v1"
version = "1.20.0"

[[constraint]]
name = "github.com/disiqueira/gotree"
branch = "master"
94 changes: 19 additions & 75 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
# Skycoin BBS

[![Go Report Card](https://goreportcard.com/badge/github.com/skycoin/bbs)](https://goreportcard.com/report/github.com/skycoin/bbs)

Skycoin BBS is a next generation decentralised social network (BBS stands for [Bulletin Board System](https://en.wikipedia.org/wiki/Bulletin_board_system)).

Skycoin BBS uses the [Skycoin CX Object System](https://github.com/skycoin/cxo) (CXO) to store and synchronise data between nodes.
Skycoin BBS uses the [Skycoin CX Object System](https://github.com/skycoin/cxo) (CXO) to store and synchronise data between nodes.

[![Skycoin BBS Alpha Showcase - YouTube](https://img.youtube.com/vi/OBaaSB369TI/0.jpg)](https://youtu.be/OBaaSB369TI)
[![Skycoin BBS Showcase 4 - YouTube](https://i.ytimg.com/vi/Oue3WVkmGh4/0.jpg)](https://youtu.be/Oue3WVkmGh4)

## Building Skycoin BBS

Expand All @@ -30,95 +28,41 @@ Built binaries and static files will be located in `pkg/build/` folder.

## Running Skycoin BBS

By default (aka running `bbsnode` without specifying flags), a BBS Node will have the following characteristics:

* **Not in master mode -** This means that the node does not have the ability to create and host boards. However, it can subscribe to boards of other nodes it is connected to and interact with those.
Skycoin BBS Node is a single binary executable that can be ran with the following flags:

* **Saves configuration and cxo files -** Configuration files for boards, users and message queue will be stored in the `$HOME/.skybbs` directory. CXO files will be in `$HOME/.skybbs/cxo`.
* `-dev` (default: `false`) Serves GUI static files from Skycoin BBS location in `$GOPATH`.

* **Uses the following ports -** The CXO Daemon will listen on `8998` and `8997` (RPC). The BBS Node will host it's web interface and JSON API on `7410`.
* `-master` (default: `false`) Enables the node to host a port for submitting content to boards.

* **Serves static files in `./static/dist` -** If no static files are found, `bbsnode` will panic. However, you can specify flag `-web-gui-dir=""` and `bbsnode` will serve static files in `$GOPATH/src/github.com/skycoin/bbs/static/dist` (assuming that the `GOPATH` env has been set).
* `-memory` (default: `false`) Disables the node from saving to disk. By default; user files, cxo database, node connections and subscriptions are saved to disk.

* **Launches the browser -** After the `bbsnode` has successfully started, the browser will be launched to display the web interface.
* `-config-dir` (default: `""`) Sets the directory used to store configuration files of Skycoin BBS. Leave blank to use default location of `$HOME/.skybbs`.

### Examples
* `-cxo-port` (default: `8998`) Port that CXO listens on (self-replication database).

The following examples assume that you have `$GOPATH/bin` in your `$PATH`, and the above executables have been built.
* `-cxo-rpc` (default: `false`) Whether to enable CXO RPC Port (for admin control).

#### Show help dialog and exit
```bash
bbsnode --help
```
* `-cxo-rpc-port` (default: `8997`) Port used for CXO RPC (if enabled).

#### Run a node with static files in `$GOPATH/src/github.com/skycoin/bbs/static/dist`

First ensure that the `GOPATH` env is set and you have the Skycoin BBS module.

```bash
bbsnode -web-gui-dir=""
```

#### Run a node as master

Master nodes have the ability to create and host boards.

```bash
bbsnode \
-master=true \
-rpc-port=8234 \
-rpc-remote-address=34.215.131.150:8234 \
-cxo-port=8456 \
-web-gui-enable=false
```
Other nodes connect to the master node via it's CXO Port (specified with `cxo-port` flag). If the external IP address of the server of the above example is `34.215.131.150`, then other nodes can connect via the address `34.215.131.150:8456` (assuming that the port `8456` is shared).
* `-sub-port` (default: `6421`) Port used to receive content submission to hosted boards (if node is master).

Nodes that run as master will host a BBS RPC server. Other nodes add posts, threads and votes, on hosted boards via this RPC connection. Hence, a port needs to be specified of where the RPC connection is hosted, as well as the remote address of the connection. The flags `rpc-port` and `rpc-remote-address` are used to specify these.
* `-http-port` (default: `7410`) Port to serve JSON API and GUI.

If a graphical user interface is not needed for the node, setting `web-gui-enable` to false can disable it.
* `-http-gui` (default: `true`) Enables serving GUI.

#### Run a node in memory
* `-http-gui-dir` (default: `""`) Set's directory where static files are to be served from. Leave blank to use `./static/dist` (unless if `-dev` flag is set).

This mode is ideal for testing, or if you don't wish to save anything to disk.

```bash
bbsnode -memory-mode
```

The `save-config` flag determines whether or not to save the Skycoin BBS configuration files for boards, users and messages. Here, it is set as false.

When the `cxo-memory-mode` flag is set to true, instead of storing objects and configurations to file, the cxo client and server will store everything in memory. When the application exits, everything stored locally will be deleted.

#### Run a node in test mode

In test mode, the node generates a board, and creates threads, posts and votes as different users. It does this in intervals.

```bash
bbsnode \
-test-mode \
-test-mode-threads=4 \
-test-mode-users=50 \
-test-mode-min=1 \
-test-mode-max=5 \
-test-mode-timeout=10 \
-test-mode-post-cap=200
```
Test mode forces the node to be run as master. BBS configuration files will not be stored in test mode, and CXO files will be stored in `/tmp` and deleted after the node exits.

* `test-mode-threads` specifies how many threads are to be created on the test board.
* `test-mode-users` specifies how many simulated users are to be created.
* `test-mode-min` is the minimum interval in seconds between simulated activity.
* `test-mode-max` is the maximum interval in seconds between simulated activity.
* `test-mode-timeout` is the time in seconds before all simulated activity stops. This can be set as `-1` to disable the timeout.
* `test-most-post-cap` is the maximum number of posts that are allowed to be created. This can be set as `-1` to disable the cap.

## Using Skycoin BBS

There are currently two ways of interacting with Skycoin BBS.
* **Web interface -** By default, the flags `web-gui-enable` and `web-gui-open-browser` are enabled. Hence, when BBS is launched, the web gui will be opened via the system browser.
* **Web interface -** By default, the flag `-http-gui` is enabled. Hence, when BBS is launched, the web gui will be opened via the system browser.

* **Restful json api -** This is ideal for controlling nodes without a graphical user interface (in a server), or for building applications or administrator tools. Documentation for the api is provided as a [Postman](https://www.getpostman.com/) Collection located at [docfiles/postman_collection.json](https://raw.githubusercontent.com/skycoin/bbs/master/docfiles/postman_collection.json).

## Participate

* [Telegram](https://t.me/joinchat/B_ax-ERzBNAAQDuqgGgOUQ) (Skycoin BBS Development)
#### Telegram

* [Community Chat](https://t.me/skycoinbbs) - Get up to date with development and talk to the developers.
* [Board Hosting Channel](https://t.me/skycoinbbshosting) - Get a list of nodes to connect to and boards to subscribe to.
Loading

0 comments on commit 2bdeda9

Please sign in to comment.