tools/setup/branded_token/register.js
function(transaction_hash) {
    const oThis = this
      , timeInterval = 5000
      , proposeSteps = {is_proposal_done: 0, is_registered_on_uc: 0, is_registered_on_vc: 0}
    ;

    return new Promise(function(onResolve, onReject){

      logger.step("** Monitoring BT proposal status");
      const statusObj = new getRegistrationStatus({transaction_hash: transaction_hash});
      var statusTimer = setInterval(async function () {
        var statusResponse = await statusObj.perform();
        if (statusResponse.isFailure()) {
          logger.error(statusResponse);
          clearInterval(statusTimer);
          process.exit(1);
        } else {
          var registrationStatus = statusResponse.data.registration_status;
          if (proposeSteps['is_proposal_done'] != registrationStatus['is_proposal_done']) {
            logger.info('* BT proposal done on utility chain. Waiting for registration utility and value chain.');
            proposeSteps['is_proposal_done'] = registrationStatus['is_proposal_done'];
          }
          if (proposeSteps['is_registered_on_uc'] != registrationStatus['is_registered_on_uc']) {
            logger.info('* BT registration done on utility chain. Waiting for registration on value chain.');
            proposeSteps['is_registered_on_uc'] = registrationStatus['is_registered_on_uc'];
          }
          if (proposeSteps['is_registered_on_vc'] != registrationStatus['is_registered_on_vc']) {
            logger.info('* BT registration done on value chain.');
            proposeSteps['is_registered_on_vc'] = registrationStatus['is_registered_on_vc'];

            clearInterval(statusTimer);
            return onResolve(statusResponse);
          }
        }
      }, timeInterval);

    });

  }
function(transaction_hash) {
    const oThis = this
      , timeInterval = 5000
      , proposeSteps = {is_proposal_done: 0, is_registered_on_uc: 0, is_registered_on_vc: 0}
    ;

    return new Promise(function(onResolve, onReject){

      logger.step("** Monitoring BT proposal status");
      const statusObj = new getRegistrationStatus({transaction_hash: transaction_hash});
      var statusTimer = setInterval(async function () {
        var statusResponse = await statusObj.perform();
        if (statusResponse.isFailure()) {
          logger.error(statusResponse);
          clearInterval(statusTimer);
          process.exit(1);
        } else {
          var registrationStatus = statusResponse.data.registration_status;
          if (proposeSteps['is_proposal_done'] != registrationStatus['is_proposal_done']) {
            logger.info('* BT proposal done on utility chain. Waiting for registration utility and value chain.');
            proposeSteps['is_proposal_done'] = registrationStatus['is_proposal_done'];
          }
          if (proposeSteps['is_registered_on_uc'] != registrationStatus['is_registered_on_uc']) {
            logger.info('* BT registration done on utility chain. Waiting for registration on value chain.');
            proposeSteps['is_registered_on_uc'] = registrationStatus['is_registered_on_uc'];
          }
          if (proposeSteps['is_registered_on_vc'] != registrationStatus['is_registered_on_vc']) {
            logger.info('* BT registration done on value chain.');
            proposeSteps['is_registered_on_vc'] = registrationStatus['is_registered_on_vc'];

            clearInterval(statusTimer);
            return onResolve(statusResponse);
          }
        }
      }, timeInterval);

    });

  }
function ( transaction_hash ) { const oThis = this , timeInterval = 5000 , proposeSteps = { is_proposal_done : 0 , is_registered_on_uc : 0 , is_registered_on_vc : 0 } ; return new Promise ( function ( onResolve , onReject ) { logger . step ( "** Monitoring BT proposal status" ) ; const statusObj = new getRegistrationStatus ( { transaction_hash : transaction_hash } ) ; var statusTimer = setInterval ( async function ( ) { var statusResponse = await statusObj . perform ( ) ; if ( statusResponse . isFailure ( ) ) { logger . error ( statusResponse ) ; clearInterval ( statusTimer ) ; process . exit ( 1 ) ; } else { var registrationStatus = statusResponse . data . registration_status ; if ( proposeSteps [ 'is_proposal_done' ] != registrationStatus [ 'is_proposal_done' ] ) { logger . info ( '* BT proposal done on utility chain. Waiting for registration utility and value chain.' ) ; proposeSteps [ 'is_proposal_done' ] = registrationStatus [ 'is_proposal_done' ] ; } if ( proposeSteps [ 'is_registered_on_uc' ] != registrationStatus [ 'is_registered_on_uc' ] ) { logger . info ( '* BT registration done on utility chain. Waiting for registration on value chain.' ) ; proposeSteps [ 'is_registered_on_uc' ] = registrationStatus [ 'is_registered_on_uc' ] ; } if ( proposeSteps [ 'is_registered_on_vc' ] != registrationStatus [ 'is_registered_on_vc' ] ) { logger . info ( '* BT registration done on value chain.' ) ; proposeSteps [ 'is_registered_on_vc' ] = registrationStatus [ 'is_registered_on_vc' ] ; clearInterval ( statusTimer ) ; return onResolve ( statusResponse ) ; } } } , timeInterval ) ; } ) ; }
Check propose status

@param {string} transaction_hash - BT proposal transaction hash
@return {promise<result>}
@private
Check propose status