# turn on tests
os.environ['BLOCKSTACK_FILE_CONFIG'] = os.path.join( os.path.dirname( os.environ['BLOCKSTACK_CLIENT_CONFIG'] ), 'blockstack-file.ini' )

import pybitcoin
import urllib2
import json
import time
import os

import testlib
import blockstack_client
import blockstack_profiles
import blockstack_gpg
import blockstack_file

log = blockstack_client.get_logger()

wallets = [
    testlib.Wallet( "5JesPiN68qt44Hc2nT8qmyZ1JDwHebfoh9KQ52Lazb1m1LaKNj9", 100000000000 ),
    testlib.Wallet( "5KHqsiU9qa77frZb6hQy9ocV7Sus9RWJcQGYYBJJBb2Efj1o77e", 100000000000 ),
    testlib.Wallet( "5Kg5kJbQHvk1B64rJniEmgbD83FpZpbw2RjdAZEzTefs9ihN3Bz", 100000000000 ),
    testlib.Wallet( "5JuVsoS9NauksSkqEjbUZxWwgGDQbMwPsEfoRBSpLpgDX1RtLX7", 100000000000 ),
    testlib.Wallet( "5KEpiSRr1BrT8vRD7LKGCEmudokTh1iMHbiThMQpLdwBwhDJB1T", 100000000000 ),
    testlib.Wallet( "5K5hDuynZ6EQrZ4efrchCwy6DLhdsEzuJtTDAf3hqdsCKbxfoeD", 100000000000 ),
    testlib.Wallet( "5J39aXEeHh9LwfQ4Gy5Vieo7sbqiUMBXkPH7SaMHixJhSSBpAqz", 100000000000 ),
    testlib.Wallet( "5K9LmMQskQ9jP1p7dyieLDAeB6vsAj4GK8dmGNJAXS1qHDqnWhP", 100000000000 ),
    testlib.Wallet( "5KcNen67ERBuvz2f649t9F2o1ddTjC5pVUEqcMtbxNgHqgxG2gZ", 100000000000 ),
    testlib.Wallet( "5KBf4DMDxzhhkgLzPwHwTLpB1qG7r6MYUyy8VB8wKzyQzJsnbLY", 100000000000 ),
    testlib.Wallet( "5K8SSBstH6zPzguDJoHzBQanadDTSLRAzygfNwzWkEVcUz3Dcq4", 100000000000 ),
    testlib.Wallet( "5JuUrxefza1SHG1U5oFzH6k9n4VzhNqXFS3Pdcv4NhiW9xUQKbr", 100000000000 ),
    testlib.Wallet( "5K6Sm6vSn5DPZoF39j1Xj4oHFag3nz1PYCE3NuLC92AMvyiJDgw", 100000000000 ),
    (at your option) any later version.

    Blockstack is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
    You should have received a copy of the GNU General Public License
    along with Blockstack. If not, see <http://www.gnu.org/licenses/>.
"""

import testlib
import pybitcoin
import json
import blockstack_client

log = blockstack_client.get_logger("blockstack-integration-tests")

wallets = [
    testlib.Wallet("5JesPiN68qt44Hc2nT8qmyZ1JDwHebfoh9KQ52Lazb1m1LaKNj9",
                   100000000000),
    testlib.Wallet("5KHqsiU9qa77frZb6hQy9ocV7Sus9RWJcQGYYBJJBb2Efj1o77e",
                   100000000000),
    testlib.Wallet("5Kg5kJbQHvk1B64rJniEmgbD83FpZpbw2RjdAZEzTefs9ihN3Bz",
                   100000000000),
    testlib.Wallet("5JuVsoS9NauksSkqEjbUZxWwgGDQbMwPsEfoRBSpLpgDX1RtLX7",
                   100000000000),
    testlib.Wallet("5KEpiSRr1BrT8vRD7LKGCEmudokTh1iMHbiThMQpLdwBwhDJB1T",
                   100000000000)
]

consensus = "17ac43c1d8549c3181b200f1bf97eb7d"
예제 #3
0
파일: gpg.py 프로젝트: vsund/blockstack-gpg
import shutil
import base64
import copy
import json
import re
from ConfigParser import SafeConfigParser

import blockstack_client
from blockstack_client import get_logger, get_config
from blockstack_client import BlockstackHandler
from blockstack_client import list_accounts, list_immutable_data, list_mutable_data
from blockstack_client import make_mutable_data_url, make_immutable_data_url

client = blockstack_client

log = get_logger("blockstack-gpg")

import urllib

DEFAULT_KEY_SERVER = 'pgp.mit.edu'


def get_config_dir(config_dir=None):
    """
    Get the default configuration directory.
    """
    if config_dir is None:
        config = get_config()
        config_dir = config['dir']

    return config_dir
예제 #4
0
"""

import os
import sys
import shutil
import tempfile
import zipfile
import base64

import blockstack_client
import blockstack_file

from blockstack_client import CONFIG_PATH
from .config import APP_CONFIG_PATH, CACHE_DIRNAME

log = blockstack_client.get_logger()

APP_NAME = "app"

def app_fq_data_name( data_name ):
    """
    Make a fully-qualified data name
    """
    return "%s:%s" % (APP_NAME, data_name)


def app_is_fq_data_name( data_name ):
    """
    Is this a fully-qualified data name?
    """
    return data_name.startswith("%s:" % APP_NAME)
    (at your option) any later version.

    Blockstack is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
    You should have received a copy of the GNU General Public License
    along with Blockstack. If not, see <http://www.gnu.org/licenses/>.
""" 

import testlib
import pybitcoin
import json
import blockstack_client

log = blockstack_client.get_logger("blockstack-integration-tests")

wallets = [
    testlib.Wallet( "5JesPiN68qt44Hc2nT8qmyZ1JDwHebfoh9KQ52Lazb1m1LaKNj9", 100000000000 ),
    testlib.Wallet( "5KHqsiU9qa77frZb6hQy9ocV7Sus9RWJcQGYYBJJBb2Efj1o77e", 100000000000 ),
    testlib.Wallet( "5Kg5kJbQHvk1B64rJniEmgbD83FpZpbw2RjdAZEzTefs9ihN3Bz", 100000000000 ),
    testlib.Wallet( "5JuVsoS9NauksSkqEjbUZxWwgGDQbMwPsEfoRBSpLpgDX1RtLX7", 100000000000 ),
    testlib.Wallet( "5KEpiSRr1BrT8vRD7LKGCEmudokTh1iMHbiThMQpLdwBwhDJB1T", 100000000000 )
]

consensus = "17ac43c1d8549c3181b200f1bf97eb7d"
wallet_keys = None

datasets = [
    {u"dataset_1": u"My first dataset!"},
    {u"dataset_2": {u"id": u"abcdef", u"desc": u"My second dataset!", u"data": [1, 2, 3, 4]}},
    (at your option) any later version.

    Blockstack is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
    You should have received a copy of the GNU General Public License
    along with Blockstack. If not, see <http://www.gnu.org/licenses/>.
""" 

import testlib
import pybitcoin
import blockstack_client 
import json

log = blockstack_client.get_logger("name_preorer_register_multi_snv")

wallets = [
    testlib.Wallet( "5JesPiN68qt44Hc2nT8qmyZ1JDwHebfoh9KQ52Lazb1m1LaKNj9", 100000000000 ),
    testlib.Wallet( "5KHqsiU9qa77frZb6hQy9ocV7Sus9RWJcQGYYBJJBb2Efj1o77e", 100000000000 ),
    testlib.Wallet( "5Kg5kJbQHvk1B64rJniEmgbD83FpZpbw2RjdAZEzTefs9ihN3Bz", 100000000000 ),
    testlib.Wallet( "5JuVsoS9NauksSkqEjbUZxWwgGDQbMwPsEfoRBSpLpgDX1RtLX7", 100000000000 ),
    testlib.Wallet( "5KEpiSRr1BrT8vRD7LKGCEmudokTh1iMHbiThMQpLdwBwhDJB1T", 100000000000 ),
    testlib.Wallet( "5K5hDuynZ6EQrZ4efrchCwy6DLhdsEzuJtTDAf3hqdsCKbxfoeD", 100000000000 ),
    testlib.Wallet( "5J39aXEeHh9LwfQ4Gy5Vieo7sbqiUMBXkPH7SaMHixJhSSBpAqz", 100000000000 ),
    testlib.Wallet( "5K9LmMQskQ9jP1p7dyieLDAeB6vsAj4GK8dmGNJAXS1qHDqnWhP", 100000000000 ),
    testlib.Wallet( "5KcNen67ERBuvz2f649t9F2o1ddTjC5pVUEqcMtbxNgHqgxG2gZ", 100000000000 ),
    testlib.Wallet( "5Jyq6RH7H42aPasyrvobvLvZGPDGYrq9m2Gq5qPEkAwDD7fqNHu", 100000000000 ),
    testlib.Wallet( "5KBc5xk9Rk3qmYg1PXPzsJ1kPfJkvzShK5ZGEn3q4Gzw4JWqMuy", 100000000000 ),
    testlib.Wallet( "5K6Nou64uUXg8YzuiVuRQswuGRfH1tdb9GUC9NBEV1xmKxWMJ54", 100000000000 )
]
예제 #7
0
    (at your option) any later version.

    Blockstack is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
    You should have received a copy of the GNU General Public License
    along with Blockstack. If not, see <http://www.gnu.org/licenses/>.
"""

import testlib
import pybitcoin
import blockstack_client
import json

log = blockstack_client.get_logger("name_preorer_register_multi_snv")

wallets = [
    testlib.Wallet("5JesPiN68qt44Hc2nT8qmyZ1JDwHebfoh9KQ52Lazb1m1LaKNj9",
                   100000000000),
    testlib.Wallet("5KHqsiU9qa77frZb6hQy9ocV7Sus9RWJcQGYYBJJBb2Efj1o77e",
                   100000000000),
    testlib.Wallet("5Kg5kJbQHvk1B64rJniEmgbD83FpZpbw2RjdAZEzTefs9ihN3Bz",
                   100000000000),
    testlib.Wallet("5JuVsoS9NauksSkqEjbUZxWwgGDQbMwPsEfoRBSpLpgDX1RtLX7",
                   100000000000),
    testlib.Wallet("5KEpiSRr1BrT8vRD7LKGCEmudokTh1iMHbiThMQpLdwBwhDJB1T",
                   100000000000),
    testlib.Wallet("5K5hDuynZ6EQrZ4efrchCwy6DLhdsEzuJtTDAf3hqdsCKbxfoeD",
                   100000000000),
    testlib.Wallet("5J39aXEeHh9LwfQ4Gy5Vieo7sbqiUMBXkPH7SaMHixJhSSBpAqz",
예제 #8
0
import os
import pwd
import re
import atexit
import time
import sys
import threading
import getopt

import blockstack_client

from .version import __version__

DEBUG = blockstack_client.constants.BLOCKSTACK_DEBUG

log = blockstack_client.get_logger('blockstack-tor')

TOR_CONTROL_PORT = 9051
BLOCKSTACK_TLDS = ['.id']  # TLDs we intercept


class BlockstackOnionResolver(threading.Thread):
    """
    Class to take a name that ends in a supported TLD
    and convert it into the appropriate .onion address.
    """
    def __init__(self, controller, stream, addr):
        threading.Thread.__init__(self)
        self.addr = addr
        self.stream = stream
        self.controller = controller
예제 #9
0
import copy
import json
import re
from ConfigParser import SafeConfigParser

import blockstack_client
from blockstack_client import get_logger, get_config
from blockstack_client import BlockstackHandler
from blockstack_client import list_immutable_data
from blockstack_client import make_mutable_data_url, make_immutable_data_url

import blockstack_profiles

client = blockstack_client

log = get_logger("blockstack-gpg")

import urllib

DEFAULT_KEY_SERVER = 'pgp.mit.edu'

def get_config_dir( config_dir=None ):
    """
    Get the default configuration directory.
    """
    if config_dir is None:
        config = get_config()
        config_dir = config['dir']

    return config_dir