示例#1
0
def _sign():
    logger.debug(request)
    transaction_dict_str = request.json.get('transaction_dict')
    transaction_dict = json.loads(transaction_dict_str)
    try:
        tx = wallet.sign(transaction_dict)
    except Exception as e:  # todo: catch specific error
        logger.error(e)
        return construct_err_response(HTTPStatus.BAD_REQUEST, e)
    logger.info(f'Transaction signed - tx: {tx}')
    return construct_ok_response({'transaction_hash': tx})
示例#2
0
def _sign_and_send():
    logger.debug(request)
    transaction_dict_str = request.json.get('transaction_dict')
    transaction_dict = json.loads(transaction_dict_str)
    with threadLock:
        transaction_dict['nonce'] = nonce_manager.nonce
        try:
            tx = wallet.sign_and_send(transaction_dict)
        except Exception as e:  # todo: catch specific error
            logger.error(e)
            return construct_err_response(HTTPStatus.BAD_REQUEST, e)
        nonce_manager.increment()
        logger.info(
            f'Transaction sent - tx: {tx}, nonce: {transaction_dict["nonce"]}')
        return construct_ok_response({'transaction_hash': tx})
示例#3
0
def containers_core_status():
    logger.debug(request)
    containers_list = docker_utils.get_core_skale_containers(all=all, format=True)
    return construct_ok_response(containers_list)
示例#4
0
def _public_key():
    logger.debug(request)
    return construct_ok_response({'public_key': wallet.public_key})
示例#5
0
def _address():
    logger.debug(request)
    return construct_ok_response({'address': wallet.address})