Skip to content
Permalink
Browse files

web socket api fix

  • Loading branch information...
dpitt committed Oct 9, 2018
1 parent e803f9e commit 18bf9e65c80053fd93aa895b4b6322b60d069363
Showing with 13 additions and 8 deletions.
  1. +1 −1 app/util.js
  2. +2 −1 runApiServer.sh
  3. +4 −1 ui/src/channel/block.js
  4. +3 −3 ui/src/channel/info.js
  5. +3 −2 ui/src/metrics/info.js
@@ -76,7 +76,7 @@ var connectChannel = function (channel_id) {
channelid = channel_id;
let channel_event_hub = channel.newChannelEventHub(peer);



add(channel_id,channel);
// keep the block_reg to unregister with later if needed
@@ -11,4 +11,5 @@ mkdir -p ~/.hfc-key-store
cp hfc-key-store/* ~/.hfc-key-store

# Run Node App
PORT=4001 node --inspect app
# DEBUG command: PORT=4001 node --inspect app
PORT=4001 node app
@@ -28,10 +28,13 @@ class Block extends Component {
super(props);
this.channelid = props.channelid;
this.state = { block: "" };
let self = this;

subscribeToBlocks(function(err, blocks) {
const numberOfBlocks = Number(blocks) - 1;
this.props.setNumberOfBlocks(numberOfBlocks);
self.props.setNumberOfBlocks(numberOfBlocks);
self.setState({block: numberOfBlocks });

});
}

@@ -24,11 +24,11 @@ class Info extends Component {
super(props);
this.state = { info: "", chaincodes: "" };

subscribeToBlocks((err, blocks) =>
subscribeToBlocks((err, blocks) => {
this.setState({
blocks
blocks: blocks
})
);
});
}

componentDidMount = async () => {
@@ -25,11 +25,12 @@ class Info extends Component {

this.state = { height: props.blocknumber, date: "" };

subscribeToBlocks((err, blocks: props.blocknumber) =>
subscribeToBlocks((err, blocks: props.blocknumber) => {

this.setState({
height: blocks
})
);
});
}

componentDidMount() {

0 comments on commit 18bf9e6

Please sign in to comment.
You can’t perform that action at this time.