- exposed websocket port;

- added asset and metadata in websocket stream
This commit is contained in:
Gautam Dhameja 2018-01-23 15:48:30 +01:00
parent 44328d7626
commit d5b715c899
2 changed files with 6 additions and 2 deletions

View File

@ -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():

View File

@ -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