Python 3 library and CLI application for SporeStack
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Teran McKinney 4ef1c6efe8 sporestack-python: 0.1.0 5 years ago
examples sporestack-python: 0.1.0 5 years ago
sporestack sporestack-python: 0.1.0 5 years ago
.gitignore sporestack-python: 0.1.0 5 years ago
LICENSE.txt sporestack-python: 0.1.0 5 years ago
README.md sporestack-python: 0.1.0 5 years ago
requirements.txt sporestack-python: 0.1.0 5 years ago
setup.cfg sporestack-python: 0.1.0 5 years ago
setup.py sporestack-python: 0.1.0 5 years ago
test.py sporestack-python: 0.1.0 5 years ago
test.sh sporestack-python: 0.1.0 5 years ago

README.md

Python library for http://sporestack.com/

Installation

  • pip install sporestack

Usage

Spawn one from your terminal.

import sporestack
from uuid import uuid4 as random_uuid

node_uuid = str(random_uuid())

ssh_key_path = '{}/.ssh/id_rsa.pub'.format(os.getenv('HOME'))

with open(ssh_key_path) as ssh_key_file:
    sshkey = ssh_key_file.read()

while True:
    node = sporestack.node(days=28,
                           sshkey=sshkey,
                           unique=node_uuid)
    if node.payment_status is False:
        amount = "{0:.8f}".format(node.satoshis *
                                  0.00000001)
        uri = 'bitcoin:{}?amount={}'.format(node.address, amount)
        qr = pyqrcode.create(uri)
        print(qr.terminal())
        print(uri)
        print('Pay with Bitcoin. Resize your terminal if QR code is unclear.')
    else:
        print('Node being built...')
    if node.creation_status is True:
        break
    sleep(5)

banner = '''

UUID: {}
IPv6: {}
IPv4: {}
End of Life: {}

May take a few more moments to come online.

'''.format(node_uuid,
           node.ip6,
           node.ip4,
           node.end_of_life)

print(banner)

Spawn one and SSH into it.

nodemeup

Examples

Licence

Unlicense/Public domain