Esempio n. 1
0
 def __init__(self, logger):
     self.request = api.BaseHelixAPI()
     self.logger = logger
     self.node_http_endpoint = node_http_endpoint
Esempio n. 2
0
import argparse

from context import api


def _start_spamming(node_http_endpoint, spam_interval):
    response = API_CLIENT.start_spamming(node_http_endpoint, spam_interval)
    print(response)


if __name__ == '__main__':
    API_CLIENT = api.BaseHelixAPI()

    PARSER = argparse.ArgumentParser(description='Get info from a node.')
    PARSER.add_argument('-host',
                        metavar='host',
                        type=str,
                        default='79.193.43.206',
                        help='Public IP of the host')
    PARSER.add_argument('-port',
                        metavar='port',
                        type=str,
                        default='8085',
                        help='HTTP port of the host public IP')
    PARSER.add_argument('-ms',
                        metavar='port',
                        type=int,
                        default=1000,
                        help='Interval between spam in ms')
    PARSER.add_argument('-ssl',
                        metavar='http or https',
Esempio n. 3
0
            else:
                duration = (now - tx_hash_local_time[1])
                LOGGER.info('Tx confirmed {} after {} seconds.'.format(
                    tx_hash_local_time[0], duration.total_seconds()))
        time.sleep(5.0)


def _get_latest_milestone(api_client, node_http_endpoint):
    response = api_client.get_node_info(node_http_endpoint)
    latest_milestone = response['latestSolidSubtangleMilestone']
    return [latest_milestone]


if __name__ == '__main__':

    api_client = api.BaseHelixAPI()

    parser = argparse.ArgumentParser(
        description='Subscribe to a stream of data')

    parser.add_argument('-host',
                        metavar='host',
                        type=str,
                        default='zmq.hlxtest.net',
                        help='IP of host publisher')

    parser.add_argument('-port',
                        metavar='port',
                        type=str,
                        default='5556',
                        help='Port of the host publisher')