import time
import os

from pybitcoin import BitcoinPrivateKey, BitcoindClient

from talosvc.talosclient.policycreation import BitcoinPolicyCreator


class BitcoinTestnetPrivateKey(BitcoinPrivateKey):
    _pubkeyhash_version_byte = 111


#private_key_hex = 'cQ9BsS11H7UaRTDz5cS8H7L2pV57zEjXe7aC2A7dRNatDhkhrEDb'
private_key_hex = 'cQ1HBRRvJ9DaV2UZsEf5w1uLAoXjSVpLYVH5dB5hZUWk5jeJ8KCL'
private_key = BitcoinTestnetPrivateKey(private_key_hex)
client = BitcoindClient("talos", "talos", port=18332, version_byte=111)

policy_client = BitcoinPolicyCreator(client, private_key)
"""
clinetA = "mm6T8ASEjVW7TeYLmNqwepzM5u35xkyTEX"
clinetB = "mpv24EBXgasKjBmuRHQp734oyC7vbTE1EA"
clinetC = "mx6naH8SFmefgMnWuCft979tLBufRyX528"
"""

clinetA = "mtuVSpDMrtZi5GfZgEJbdR5dSD3ULsQ81y"
clinetB = "muVo7RrtrAP8XPGvombhs7DxN1diBx3P5v"
clinetC = "mwNCMtCiaNi6NxnU6yK1uiCwP7vGZzAXjS"

timestamp = int(time.time())
interval = 86400
nonce = "asdfgcbfndhstdzf"
Exemplo n.º 2
0
    parser.add_argument('--vbyte',
                        type=int,
                        help='server',
                        default=111,
                        required=False)
    parser.add_argument('--rpcuser',
                        type=str,
                        help='rpcuser',
                        default='talos',
                        required=False)
    parser.add_argument('--rpcpw',
                        type=str,
                        help='rpcpw',
                        default='talos',
                        required=False)
    parser.add_argument('private_key', type=str)
    args = parser.parse_args()

    TESTNET = args.vbyte == 111

    private_key = BitcoinVersionedPrivateKey(args.private_key)
    client = BitcoindClient(args.rpcuser,
                            args.rpcpw,
                            server=args.server,
                            port=args.port,
                            version_byte=args.vbyte)
    pclient = BitcoinPolicyCreator(client, args.private_key)

    prompt = TalosPrompt(pclient)
    prompt.prompt = '> '
    prompt.cmdloop('Starting prompt...')