Skip to content

ubirch/ubirch-iota-service

Repository files navigation

ubirch-iota-service

This is a command line interface python service developed to anchor data on the IOTA Tangle.
Please check the IOTA testnet explorer to look for transactions or addresses.

Default address used in the service: 9E99GKDY9BYDQ9PGOHHMUWJLBDREMK9BVHUFRHVXCVUIFXLNTZMXRM9TDXJKZDAKIGZIMCJSH9Q9V9GKW
Click here to see all transactions made with this address.

To setup a new address, please run: generate_address.py and pass the address generated as argument in the CLI.

Help concerning the CLI can be found running:

python iota_service.py --help

Configuration

This projects uses python 3.6.
Please run in your virtual environment:

     pip install -r requirements.txt

This projects mainly uses pyota ,the official Python library for the IOTA Core.

How to use this service

  1. Please install Elasticmq and/or Kafka. Please respect the following folder structure:

     dependencies/
     ├── elasticMQServer
     │   ├── custom.conf
     │   └── elasticmq-server.jar
     └── kafka
         ├── bin
         │   ├── ...
         ├── config
         │   ├── ...
         ├── libs
         │   ├──...
         ├── LICENSE
         ├── NOTICE
         └── site-docs
             └── ...
    

And custom.conf should look like this:

    include classpath("application.conf")
    
    // What is the outside visible address of this ElasticMQ node
    // Used to create the queue URL (may be different from bind address!)
    node-address {
        protocol = http
        host = localhost
        port = 9324
        context-path = ""
    }
    
    rest-sqs {
        enabled = true
        bind-port = 9324
        bind-hostname = "0.0.0.0"
        // Possible values: relaxed, strict
        sqs-limits = strict
    }
    
    // Should the node-address be generated from the bind port/hostname
    // Set this to true e.g. when assigning port automatically by using port 0.
    generate-node-address = false
    
    queues {
    
      input_messages {
        defaultVisibilityTimeout = 10 seconds
        receiveMessageWait = 0 seconds
        deadLettersQueue {
            name = "queue1-dead-letters"
            maxReceiveCount = 10 // from 1 to 1000
        }
      }
    
        output_messages {
        defaultVisibilityTimeout = 10 seconds
        receiveMessageWait = 0 seconds
        deadLettersQueue {
            name = "queue2-dead-letters"
            maxReceiveCount = 10 // from 1 to 1000
        }
      }
    
        error_messages {
        defaultVisibilityTimeout = 10 seconds
        receiveMessageWait = 0 seconds
        deadLettersQueue {
            name = "error_queue-dead-letters"
            maxReceiveCount = 10 // from 1 to 1000
        }
      }
    
    }
  1. Useful scripts are in bin/
    a) In bin/elasticMQ/, to run the ElasticMQ server:

    ./start-elasticMQ.sh

    b) In bin/kafka/, to run the Kafka server and create the topics, execute successively:

       ./start_zookeeper.sh
       ./start-kafka.sh
       ./create-all-topics.sh
    
  2. Then, in a terminal, run successively in ubirch-iota-service/, the scripts sender.py then receiver.py and receiver_errors.py, with the flag --server='SQS' or --server='KAFKA'

  3. Finally, start the service.

    python iota_service.py --server='SQS'

    Or:

     python iota_service.py --server='KAFKA'

    Where:

    • --server='SQS' to use elasticMQ's SQS queuing service
    • --server='KAFKA' to use Apache's Kafka messaging service.

    You can run it multiple times to increase throughput.

Logs

Once the service is running, logs are recorded in iota_service.log

License

This project is publicized under the Apache License 2.0.

About

A small IOTA based anchoring service

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •