From d5b715c899529f6ca8d2420d387a8b771d528a92 Mon Sep 17 00:00:00 2001 From: Gautam Dhameja Date: Tue, 23 Jan 2018 15:48:30 +0100 Subject: [PATCH] - exposed websocket port; - added asset and metadata in websocket stream --- bigchaindb/web/websocket_server.py | 5 ++++- docker-compose.yml | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/bigchaindb/web/websocket_server.py b/bigchaindb/web/websocket_server.py index 930ebc94..250f136c 100644 --- a/bigchaindb/web/websocket_server.py +++ b/bigchaindb/web/websocket_server.py @@ -98,9 +98,12 @@ class Dispatcher: for tx in block['block']['transactions']: asset_id = tx['id'] if tx['operation'] == 'CREATE' else tx['asset']['id'] + asset = tx['asset'] if tx['operation'] == 'CREATE' else None data = {'block_id': block['id'], 'asset_id': asset_id, - 'transaction_id': tx['id']} + 'transaction_id': tx['id'], + 'asset': asset, + 'metadata': tx['metadata']} str_buffer.append(json.dumps(data)) for _, websocket in self.subscribers.items(): diff --git a/docker-compose.yml b/docker-compose.yml index cd6aa2aa..d5fbd3aa 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -29,5 +29,6 @@ services: BIGCHAINDB_SERVER_BIND: 0.0.0.0:9984 BIGCHAINDB_WSSERVER_HOST: 0.0.0.0 ports: - - "9984" + - 9984:9984 + - 9985:9985 command: bigchaindb start