kbyte
GitHub
  • kbyte
  • Getting started
  • Full node API
    • Get witnesses
    • Get peers
    • Get joint
    • Get last MCI
    • Catchup
    • Get hash tree
    • Subscribe
  • Light node API
    • Get history
    • Get light props
    • Get attestation
    • Get attestations
    • Pick divisible coins for amount
  • Hub API
    • Get bots
    • Get asset metadata
  • Utils
    • Generate random seed
    • Is seed valid?
  • Subscribe
  • Just saying
  • Promises
Powered by GitBook
On this page
  1. Full node API

Subscribe

PreviousGet hash treeNextLight node API

Last updated 6 years ago

Request the node to notify you of new joints from a specific main chain index.

const params = {
  subscription_id: '1',
  last_mci: 2870575
};

client.request('subscribe', params, function(err, result) {
  console.log(result);
});
subscribed

You need to subscribe to WebSocket notifications to see messages sent to you. Here is an example of a notification:

[
  'justsaying',
  {
    subject: 'joint',
    body: {
      unit: [Object]
    }
  }
]

see here