changed ports

This commit is contained in:
AlbertA-Solicy 2023-09-06 12:09:16 +04:00
parent ec28829d2a
commit 7a58f97091
27 changed files with 44 additions and 44 deletions

View File

@ -19,6 +19,6 @@ ENV BIGCHAINDB_WSSERVER_HOST 0.0.0.0
ENV BIGCHAINDB_WSSERVER_SCHEME ws
ENV BIGCHAINDB_WSSERVER_ADVERTISED_HOST 0.0.0.0
ENV BIGCHAINDB_WSSERVER_ADVERTISED_SCHEME ws
ENV BIGCHAINDB_WSSERVER_ADVERTISED_PORT 9985
ENV BIGCHAINDB_WSSERVER_ADVERTISED_PORT 3333
ENTRYPOINT ["bigchaindb"]
CMD ["start"]

View File

@ -45,7 +45,7 @@ ENV BIGCHAINDB_TENDERMINT_PORT 26657
VOLUME /data/db /data/configdb /tendermint
EXPOSE 27017 28017 3333 9985 26656 26657 26658
EXPOSE 27017 28017 3333 3333 26656 26657 26658
WORKDIR $HOME
ENTRYPOINT ["/usr/src/app/pkg/scripts/all-in-one.bash"]

View File

@ -38,7 +38,7 @@ def test_stream():
BDB_ENDPOINT = os.environ.get('BIGCHAINDB_ENDPOINT')
# *That's pretty bad, but let's do like this for now.*
WS_ENDPOINT = 'ws://{}:9985/api/v1/streams/valid_transactions'.format(BDB_ENDPOINT.rsplit(':')[0])
WS_ENDPOINT = 'ws://{}:3333/api/v1/streams/valid_transactions'.format(BDB_ENDPOINT.rsplit(':')[0])
bdb = BigchainDB(BDB_ENDPOINT)

View File

@ -63,10 +63,10 @@ config = {
'wsserver': {
'scheme': 'ws',
'host': 'localhost',
'port': 9985,
'port': 3333,
'advertised_scheme': 'ws',
'advertised_host': 'localhost',
'advertised_port': 9985,
'advertised_port': 3333,
},
'tendermint': {
'host': 'localhost',

View File

@ -41,7 +41,7 @@ services:
BIGCHAINDB_TENDERMINT_PORT: 26657
ports:
- "3333:3333"
- "9985:9985"
- "3333:3333"
- "26658"
healthcheck:
test: ["CMD", ".ci/healthcheck.sh"]

View File

@ -7,7 +7,7 @@ Content-Type: application/json
"docs": "https://docs.bigchaindb.com/projects/server/en/v2.2.2/http-client-server-api.html",
"metadata": "/metadata/",
"outputs": "/outputs/",
"streams": "ws://localhost:9985/api/v1/streams/valid_transactions",
"streams": "ws://localhost:3333/api/v1/streams/valid_transactions",
"transactions": "/transactions/",
"validators": "/validators"
}

View File

@ -9,7 +9,7 @@ Content-Type: application/json
"docs": "https://docs.bigchaindb.com/projects/server/en/v2.2.2/http-client-server-api.html",
"metadata": "/api/v1/metadata/",
"outputs": "/api/v1/outputs/",
"streams": "ws://localhost:9985/api/v1/streams/valid_transactions",
"streams": "ws://localhost:3333/api/v1/streams/valid_transactions",
"transactions": "/api/v1/transactions/",
"validators": "/api/v1/validators"
}

View File

@ -12,7 +12,7 @@ The WebSocket Event Stream API
.. important::
The WebSocket Event Stream runs on a different port than the Web API. The
default port for the Web API is `3333`, while the one for the Event Stream
is `9985`.
is `3333`.
BigchainDB provides real-time event streams over the WebSocket protocol with
the Event Stream API.
@ -40,7 +40,7 @@ response contains a ``streams`` property:
{
...,
"streams": "ws://example.com:9985/api/v1/streams/valid_transactions",
"streams": "ws://example.com:3333/api/v1/streams/valid_transactions",
...
}

View File

@ -15,7 +15,7 @@ The following ports should expect unsolicited inbound traffic:
1. **Port 22** can expect inbound SSH (TCP) traffic from the node administrator (i.e. a small set of IP addresses).
1. **Port 3333** can expect inbound HTTP (TCP) traffic from BigchainDB clients sending transactions to the BigchainDB HTTP API.
1. **Port 9985** can expect inbound WebSocket traffic from BigchainDB clients.
1. **Port 3333** can expect inbound WebSocket traffic from BigchainDB clients.
1. **Port 26656** can expect inbound Tendermint P2P traffic from other Tendermint peers.
1. **Port 9986** can expect inbound HTTP (TCP) traffic from clients accessing the Public Key of a Tendermint instance.
@ -53,9 +53,9 @@ If Gunicorn and the reverse proxy are running on the same server, then you'll ha
You may want to have Gunicorn and the reverse proxy running on different servers, so that both can listen on port 3333. That would also help isolate the effects of a denial-of-service attack.
## Port 9985
## Port 3333
Port 9985 is the default port for the BigchainDB WebSocket Event Stream API.
Port 3333 is the default port for the BigchainDB WebSocket Event Stream API.
## Port 9986

View File

@ -693,7 +693,7 @@ To test the BigchainDB instance:
$ curl -X GET http://bdb-instance-0:26657/abci_info
$ wsc -er ws://bdb-instance-0:9985/api/v1/streams/valid_transactions
$ wsc -er ws://bdb-instance-0:3333/api/v1/streams/valid_transactions
To test the OpenResty instance:

View File

@ -39,7 +39,7 @@ $ docker run \
--detach \
--name bigchaindb \
--publish 3333:3333 \
--publish 9985:9985 \
--publish 3333:3333 \
--publish 27017:27017 \
--publish 26657:26657 \
--volume $HOME/bigchaindb_docker/mongodb/data/db:/data/db \
@ -54,7 +54,7 @@ Let's analyze that command:
* `--detach` run the container in the background
* `publish 3333:3333` map the host port `3333` to the container port `3333`
(the BigchainDB API server)
* `9985` BigchainDB Websocket server
* `3333` BigchainDB Websocket server
* `27017` Default port for MongoDB
* `26657` Tendermint RPC server
* `--volume "$HOME/bigchaindb_docker/mongodb:/data"` map the host directory

View File

@ -171,15 +171,15 @@ which is used to serve the
(but setting it to `"wss"` does *not* enable SSL/TLS).
`wsserver.host` is where to bind the aiohttp server socket and
`wsserver.port` is the corresponding port.
If you want to allow connections from anyone, on port 9985,
set `wsserver.host` to 0.0.0.0 and `wsserver.port` to 9985.
If you want to allow connections from anyone, on port 3333,
set `wsserver.host` to 0.0.0.0 and `wsserver.port` to 3333.
**Example using environment variables**
```text
export BIGCHAINDB_WSSERVER_SCHEME=ws
export BIGCHAINDB_WSSERVER_HOST=0.0.0.0
export BIGCHAINDB_WSSERVER_PORT=9985
export BIGCHAINDB_WSSERVER_PORT=3333
```
**Example config file snippet**
@ -198,7 +198,7 @@ export BIGCHAINDB_WSSERVER_PORT=9985
"wsserver": {
"scheme": "ws",
"host": "localhost",
"port": 9985
"port": 3333
}
```
@ -233,7 +233,7 @@ export BIGCHAINDB_WSSERVER_ADVERTISED_PORT=443
"wsserver": {
"advertised_scheme": "ws",
"advertised_host": "localhost",
"advertised_port": 9985
"advertised_port": 3333
}
```

View File

@ -203,7 +203,7 @@ Changes:
"v1": {
"docs": "https://docs.bigchaindb.com/projects/server/en/v0.11.0.dev/http-client-server-api.html",
"statuses": "/api/v1/statuses/",
"streams": "ws://example.com:9985/api/v1/streams/valid_transactions",
"streams": "ws://example.com:3333/api/v1/streams/valid_transactions",
"transactions": "/api/v1/transactions/",
"assets": "/api/v1/assets/",
"outputs": "/api/v1/outputs/"
@ -248,7 +248,7 @@ Changes:
"docs": "https://docs.bigchaindb.com/projects/server/en/v0.10.2/http-client-server-api.html",
"self": "http://example.com:3333/api/v1/",
"statuses": "http://example.com:3333/api/v1/statuses/",
"streams_v1": "ws://example.com:9985/api/v1/streams/valid_tx",
"streams_v1": "ws://example.com:3333/api/v1/streams/valid_tx",
"transactions": "http://example.com:3333/api/v1/transactions/"
}
}
@ -257,7 +257,7 @@ Changes:
{
"docs": "https://docs.bigchaindb.com/projects/server/en/v0.11.0.dev/http-client-server-api.html",
"statuses": "/api/v1/statuses/",
"streams": "ws://example.com:9985/api/v1/streams/valid_transactions",
"streams": "ws://example.com:3333/api/v1/streams/valid_transactions",
"transactions": "/api/v1/transactions/",
"assets": "/api/v1/assets/",
"outputs": "/api/v1/outputs/"

View File

@ -268,7 +268,7 @@ spec:
- containerPort: 3333
protocol: TCP
name: bdb-port
- containerPort: 9985
- containerPort: 3333
protocol: TCP
name: bdb-ws-port
- containerPort: 26658

View File

@ -18,8 +18,8 @@ spec:
targetPort: 3333
name: bdb-api-port
protocol: TCP
- port: 9985
targetPort: 9985
- port: 3333
targetPort: 3333
name: bdb-ws-port
protocol: TCP
- port: 26658

View File

@ -82,7 +82,7 @@ data:
# bigchaindb-ws-port and bigchaindb-ws-interface form the socket where
# BigchainDB binds for Websocket connections.
bigchaindb-ws-port: "9985"
bigchaindb-ws-port: "3333"
bigchaindb-ws-interface: "0.0.0.0"
# bigchaindb-database-name is the database collection used by BigchainDB with

View File

@ -18,8 +18,8 @@ spec:
targetPort: 3333
name: bdb-api-port
protocol: TCP
- port: 9985
targetPort: 9985
- port: 3333
targetPort: 3333
name: bdb-ws-port
protocol: TCP
type: ClusterIP
@ -59,7 +59,7 @@ spec:
- name: BIGCHAINDB_WSSERVER_HOST
value: "0.0.0.0"
- name: BIGCHAINDB_WSSERVER_PORT
value: "9985"
value: "3333"
- name: BIGCHAINDB_KEYPAIR_PUBLIC
value: "EEWUAhsk94ZUHhVw7qx9oZiXYDAWc9cRz93eMrsTG4kZ"
- name: BIGCHAINDB_KEYPAIR_PRIVATE
@ -75,8 +75,8 @@ spec:
hostPort: 3333
name: bdb-port
protocol: TCP
- containerPort: 9985
hostPort: 9985
- containerPort: 3333
hostPort: 3333
name: bdb-ws-port
protocol: TCP
resources:

View File

@ -65,7 +65,7 @@ spec:
- name: BIGCHAINDB_API_PORT
value: "3333"
- name: BIGCHAINDB_WS_PORT
value: "9985"
value: "3333"
ports:
- containerPort: 27017
protocol: TCP

View File

@ -86,7 +86,7 @@ spec:
- name: BIGCHAINDB_API_PORT
value: "3333"
- name: BIGCHAINDB_WS_PORT
value: "9985"
value: "3333"
ports:
- containerPort: 80
protocol: TCP

View File

@ -19,4 +19,4 @@ reflect any changes made to the container.
You can test the WebSocket server by using
[wsc](https://www.npmjs.com/package/wsc) tool with a command like:
`wsc -er ws://localhost:9985/api/v1/streams/valid_transactions`.
`wsc -er ws://localhost:3333/api/v1/streams/valid_transactions`.

View File

@ -62,7 +62,7 @@ http {
listen NODE_FRONTEND_PORT;
underscores_in_headers on;
# Forward websockets to backend BDB at 9985.
# Forward websockets to backend BDB at 3333.
location /api/v1/streams/valid_transactions {
proxy_pass http://$bdb_backend:BIGCHAINDB_WS_PORT;
proxy_read_timeout 600s;

View File

@ -19,4 +19,4 @@ reflect any changes made to the container.
You can test the WebSocket server by using
[wsc](https://www.npmjs.com/package/wsc) tool with a command like:
`wsc -er wss://localhost:9985/api/v1/streams/valid_transactions`.
`wsc -er wss://localhost:3333/api/v1/streams/valid_transactions`.

View File

@ -310,7 +310,7 @@ data:
# bigchaindb-ws-port and bigchaindb-ws-interface form the socket where
# BigchainDB binds for Websocket connections.
bigchaindb-ws-port: "9985"
bigchaindb-ws-port: "3333"
bigchaindb-ws-interface: "0.0.0.0"
# bigchaindb-database-name is the database collection used by BigchainDB with

View File

@ -67,7 +67,7 @@ http {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://localhost:9985;
proxy_pass http://localhost:3333;
proxy_read_timeout 600s;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;

View File

@ -42,7 +42,7 @@ bigchaindb_docker_name: "bigchaindb"
mongodb_docker_name: "mongodb"
tendermint_docker_name: "tendermint"
bigchaindb_default_server_port: 3333
bigchaindb_default_ws_port: 9985
bigchaindb_default_ws_port: 3333
bigchaindb_tendermint_port: 26657
tendermint_abci_port: 45558
bigchaindb_docker_net: "bigchaindb_docker_net"

View File

@ -39,7 +39,7 @@
BIGCHAINDB_DATABASE_PORT: "27017"
BIGCHAINDB_SERVER_BIND: "0.0.0.0:3333"
BIGCHAINDB_WSSERVER_HOST: "0.0.0.0"
BIGCHAINDB_WSSERVER_PORT: "9985"
BIGCHAINDB_WSSERVER_PORT: "3333"
BIGCHAINDB_TENDERMINT_HOST: "127.0.0.1"
BIGCHAINDB_TENDERMINT_PORT: "26657"
when: mdb_pchk.stdout| int != 0 and bdb_pchk.stdout| int == 0 and tm_pchk.stdout| int != 0

View File

@ -245,7 +245,7 @@ def test_autoconfigure_env_precedence(monkeypatch):
monkeypatch.setattr('bigchaindb.config_utils.file_config', lambda *args, **kwargs: file_config)
monkeypatch.setattr('os.environ', {'BIGCHAINDB_DATABASE_NAME': 'test-dbname',
'BIGCHAINDB_DATABASE_PORT': '4242',
'BIGCHAINDB_SERVER_BIND': 'localhost:9985'})
'BIGCHAINDB_SERVER_BIND': 'localhost:3333'})
import bigchaindb
from bigchaindb import config_utils
@ -255,7 +255,7 @@ def test_autoconfigure_env_precedence(monkeypatch):
assert bigchaindb.config['database']['host'] == 'test-host'
assert bigchaindb.config['database']['name'] == 'test-dbname'
assert bigchaindb.config['database']['port'] == 4242
assert bigchaindb.config['server']['bind'] == 'localhost:9985'
assert bigchaindb.config['server']['bind'] == 'localhost:3333'
def test_autoconfigure_explicit_file(monkeypatch):