Change server port to 9984

This commit is contained in:
vrde 2016-04-07 14:15:29 +02:00
parent ac3ce3b6fa
commit 06f45f1dc7
No known key found for this signature in database
GPG Key ID: 6581C7C39B3D397D
5 changed files with 33 additions and 8 deletions

View File

@ -1,9 +1,17 @@
import copy
# from functools import reduce
# PORT_NUMBER = reduce(lambda x, y: x * y, map(ord, 'BigchainDB')) % 2**16
# basically, the port number is 9984
config = {
'server': {
'bind': '0.0.0.0:5000',
# Note: this section supports all the Gunicorn settings:
# - http://docs.gunicorn.org/en/stable/settings.html
'bind': '0.0.0.0:9984',
'workers': None, # if none, the value will be cpu_count * 2 + 1
'threads': None, # if none, the value will be cpu_count * 2 + 1
},
'database': {
'host': 'localhost',
@ -20,7 +28,7 @@ config = {
'port': 8125,
'rate': 0.01,
},
'api_endpoint': 'http://localhost:8008/api/v1',
'api_endpoint': 'http://localhost:9984/api/v1',
'consensus_plugin': 'default',
}

View File

@ -76,6 +76,9 @@ def create_server(settings):
if not settings.get('workers'):
settings['workers'] = (multiprocessing.cpu_count() * 2) + 1
if not settings.get('threads'):
settings['threads'] = (multiprocessing.cpu_count() * 2) + 1
debug = settings.pop('debug', False)
app = create_app(debug)
standalone = StandaloneApplication(app, settings)

View File

@ -90,4 +90,7 @@ environ variable you need to use colon (`:`) as separator.
- BIGCHAINDB_STATSD_RATE
- BIGCHAINDB_API_ENDPOINT
- BIGCHAINDB_CONSENSUS_PLUGIN
- BIGCHAINDB_SERVER_BIND
- BIGCHAINDB_SERVER_WORKERS
- BIGCHAINDB_SERVER_THREADS
```

View File

@ -2,10 +2,15 @@
When you start Bigchaindb using `bigchaindb start`, an HTTP API is exposed at:
[http://localhost:5000/api/v1/](http://localhost:5000/api/v1/)
- [http://localhost:9984/api/v1/](http://localhost:9984/api/v1/)
Right now, that API can only be accessed from localhost (i.e. not remotely). In the future, we'll enable remote access and explain how that works. See [Issue #149](https://github.com/bigchaindb/bigchaindb/issues/149) on GitHub.
The HTTP API currently exposes two endpoints, one to get information about a specific transaction id, and one to push a transaction to the BigchainDB cluster. Those endpoints are documented at:
Please note that by default the server binds to `0.0.0.0:9984`, hence the API
is exposed to the world.
The HTTP API currently exposes two endpoints, one to get information about a
specific transaction id, and one to push a transaction to the BigchainDB
cluster. Those endpoints are documented at:
- [http://docs.bigchaindb.apiary.io/](http://docs.bigchaindb.apiary.io/)
[http://docs.bigchaindb.apiary.io/](http://docs.bigchaindb.apiary.io/)

View File

@ -94,10 +94,16 @@ $ rethinkdb
Then open a different terminal and run:
```text
$ bigchaindb start
$ bigchaindb init
```
During its first run, BigchainDB Server takes care of configuring a single node environment.
During its first run, the command takes care of configuring a single node environment.
After configuring the node, you can start it with:
```text
$ bigchaindb start
```
## Run BigchainDB with Docker