Esempio n. 1
0
        oniontip.util.check_and_update_bitcoin_fields(relay_data)
        print "Downloaded details.json.  Re-run without --download option."
        exit()

    elif options.check or options.check_all:
        # Check recent bitcoin addresses for unspent outputs
        successful_transactions = oniontip.views.find_unsent_payments(
            check_all=options.check_all)
        if successful_transactions:
            print '{} transactions were successfully sent:'.format(
                len(successful_transactions))
            for tx in successful_transactions:
                print tx
        else:
            print "No unspent outputs were found for any recent addresses"
        exit()

    # Check details file exists
    if not os.path.exists(
            os.path.join(os.path.dirname(os.path.abspath(__file__)),
                         'oniontip/details.json')):
        sys.exit('Did not find details.json.  Re-run with --download.')

    if not app.config.get('BITCOIN_KEY_SEED'):
        sys.exit(
            'You must set an electrum style private seed in the BITCOIN_KEY_SEED enviromental variable'
        )

    db.create_all()
    app.run(host='0.0.0.0')
Esempio n. 2
0
if '__main__' == __name__:
    parser = create_option_parser()
    (options, args) = parser.parse_args()

    if options.download:
        relay_data = oniontip.util.download_details_file()
        oniontip.util.check_and_update_bitcoin_fields(relay_data)
        print "Downloaded details.json.  Re-run without --download option."
        exit()

    elif options.check:
        # Check recent bitcoin addresses for unspent outputs
        successful_transactions = oniontip.views.find_unsent_payments()
        if successful_transactions:
            print '{} transactions were successfully sent:'.format(len(successful_transactions))
            for tx in successful_transactions:
                print tx
        else:
            print "No unspent outputs were found for any recent addresses"
        exit()

    # Check details file exists
    if not os.path.exists(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'oniontip/details.json')):
        sys.exit('Did not find details.json.  Re-run with --download.')

    if not app.config.get('BITCOIN_KEY_SEED'):
        sys.exit('You must set and electrum style private seed in the BITCOIN_KEY_SEED enviromental variable')

    db.create_all()
    app.run()
Esempio n. 3
0
if '__main__' == __name__:
    parser = create_option_parser()
    (options, args) = parser.parse_args()

    if options.download:
        relay_data = oniontip.util.download_details_file()
        oniontip.util.check_and_update_bitcoin_fields(relay_data)
        print "Downloaded details.json.  Re-run without --download option."
        exit()

    elif options.check or options.check_all:
        # Check recent bitcoin addresses for unspent outputs
        successful_transactions = oniontip.views.find_unsent_payments(check_all=options.check_all)
        if successful_transactions:
            print '{} transactions were successfully sent:'.format(len(successful_transactions))
            for tx in successful_transactions:
                print tx
        else:
            print "No unspent outputs were found for any recent addresses"
        exit()

    # Check details file exists
    if not os.path.exists(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'oniontip/details.json')):
        sys.exit('Did not find details.json.  Re-run with --download.')

    if not app.config.get('BITCOIN_KEY_SEED'):
        sys.exit('You must set an electrum style private seed in the BITCOIN_KEY_SEED enviromental variable')

    db.create_all()
    app.run(host='0.0.0.0')