- exposed websocket port;
- added asset and metadata in websocket stream
This commit is contained in:
parent
44328d7626
commit
d5b715c899
|
@ -98,9 +98,12 @@ class Dispatcher:
|
||||||
|
|
||||||
for tx in block['block']['transactions']:
|
for tx in block['block']['transactions']:
|
||||||
asset_id = tx['id'] if tx['operation'] == 'CREATE' else tx['asset']['id']
|
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'],
|
data = {'block_id': block['id'],
|
||||||
'asset_id': asset_id,
|
'asset_id': asset_id,
|
||||||
'transaction_id': tx['id']}
|
'transaction_id': tx['id'],
|
||||||
|
'asset': asset,
|
||||||
|
'metadata': tx['metadata']}
|
||||||
str_buffer.append(json.dumps(data))
|
str_buffer.append(json.dumps(data))
|
||||||
|
|
||||||
for _, websocket in self.subscribers.items():
|
for _, websocket in self.subscribers.items():
|
||||||
|
|
|
@ -29,5 +29,6 @@ services:
|
||||||
BIGCHAINDB_SERVER_BIND: 0.0.0.0:9984
|
BIGCHAINDB_SERVER_BIND: 0.0.0.0:9984
|
||||||
BIGCHAINDB_WSSERVER_HOST: 0.0.0.0
|
BIGCHAINDB_WSSERVER_HOST: 0.0.0.0
|
||||||
ports:
|
ports:
|
||||||
- "9984"
|
- 9984:9984
|
||||||
|
- 9985:9985
|
||||||
command: bigchaindb start
|
command: bigchaindb start
|
||||||
|
|
Loading…
Reference in New Issue