├── .gitignore ├── README.md ├── ab.cfg ├── abc.json ├── autobazaar.py ├── manager.py ├── ob_template.cfg ├── openbazaar.conf ├── password.py └── thanks.md /.gitignore: -------------------------------------------------------------------------------- 1 | project.todo 2 | *.pyc 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | NB. Windows users: this may or may not work from Windows. I've not been able to test that it works. If you manage to get it to work, please let me know. I will try to test it on Windows soon. I'm happy to set your server up for you if you give me your Digital Ocean API token. 2 | 3 | # autobazaar 4 | 5 | A tool to install the OpenBazaar Server in the cloud ([Digital Ocean](https://m.do.co/c/ae523dc7d5e4) for starters). This tool lets you bypass the installation tedium and allows you to run a number of permanently online stores on Digital Ocean's cheapest droplet at $5 a month. The installation process should take somewhere between 8 and 11 minutes. The tool creates the droplet for you, logs on and installs and runs the OpenBazaar servers. It also creates upstart scripts which will lauch the servers if your computer reboots or your servers crash for whatever reason. 6 | 7 | Right now there is a bug which prevents you from switching between multiple OpenBazaar servers running on the same machine so the number of stores this tool creates is set to a default of 1 until this bug is resolved. 8 | 9 | *authored by* Daniel Murrell of [duosear.ch](https://duosear.ch) 10 | 11 | ## usage instructions 12 | 13 | Follow the numbered steps below. If you encounter any errors see the 'potential blocks' section below. If your problem is not found there shoot me an email at `dsmurrell at gmail dot com`. 14 | 15 | 1. If you do not already have a [Digital Ocean](https://m.do.co/c/ae523dc7d5e4) account, you can create one with my referral [link](https://m.do.co/c/ae523dc7d5e4) which will give you a free $10 credit equivalent to 2 months of free store hosting. 16 | 17 | 2. Clone this GitHub repo to any destination on your computer. In the terminal type: 18 | ``` 19 | git clone https://github.com/dsmurrell/autobazaar.git 20 | cd autobazaar 21 | ``` 22 | 23 | 3. Edit the `ab.cfg` file and set up 2 mandatory inputs for autobazaar. 24 | - Your write access enabled Digital Ocean API token which can be generated from [Digital Ocean](https://cloud.digitalocean.com/settings/api/tokens) 25 | - Your public ssh key. If it already exists, you can find it using `cat ~/.ssh/id_rsa.pub`. If it does not exist, you can generate an ssh key pair using the following command: `ssh-keygen -t rsa` 26 | 27 | 4. Install python-pip and run autobazaar by typing the following line in the terminal, this example shows how you install python-pip on linux: 28 | ``` 29 | sudo apt-get install python-pip 30 | python autobazaar.py -n num_stores -u username 31 | ``` 32 | Where `num_stores` is the number of OpenBazaar stores you want to run (5 or less - however switching between multiple store from the same client doesn't work for now) and `username` is the username that you use to log into them. The `autobazaar.py` script should run for between 8 and 11 minutes and when it's done, it will print out the IP address, usernames and passwords to configure the new server connections. 33 | 34 | 5. Set up new server configurations. If you don't have OpenBazaar you can obtain it from www.openbazaar.org. Once OpenBazaar is installed, add new server configurations by navigating (top right of screen) menu > default > + New Server and entering the IP address, usernames and passwords obtained in the previous step. 35 | 36 | any questions? email me at `dsmurrell at gmail dot com`. 37 | 38 | ## potential blocks 39 | 40 | - `Permission denied` error message while running `pip install -r requirements.txt` 41 | Either use `pip install -r requirements.txt --user` or prepend with `sudo`, or use a python environment manangement system like virtualenv or anaconda so that your python libaries install into a location you have write access to. 42 | - `digitalocean.baseapi.DataReadError: Unable to authenticate you.` 43 | This means that you've not set your Digital Ocean API token in `ab.cfg` correctly. 44 | - `digitalocean.baseapi.DataReadError: The image you specified is not available in the selected region, you can transfer it to this region from the images pages.` 45 | This means that the image for the smallest Ubuntu instance is not available in the region that you selected in the optional section of the `ab.cfg` file. 46 | 47 | block doesn't exist? email me at `dsmurrell at gmail dot com`. 48 | 49 | -------------------------------------------------------------------------------- /ab.cfg: -------------------------------------------------------------------------------- 1 | [MANDATORY] 2 | 3 | digital_ocean_api_token: 879b490b8d78149cc4e544c6f867b04d763613113e87610336556bc0092a4e9f 4 | 5 | ssh_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDhKVEdS4C9pHEraPKbbb8YVsF/rnXwF2I7E0PwFZqKANNbYGiBEusHMgN9BiWtoH2S9XV+kNwiEyq39VUY9Vu44vLV90cp94elE3Ei3yR2gd+l81EtDXtHtiiaYCocbj48icH8DIoUVcttau+A+q8a3/ufD4VYjyjXw6v3PUeQ7NMlOwuuwkgPLNkUpzer+43pNkk/41N+m8X41q3jOxpvV32POBVsMXUx1gKCN+22W7GTuoGmWIQTLyutmmkPxvlgM5wfL/bAWwzMq0omhT/U00VGxMSixMhm1t9LGhTbEsHhdEEmIPQsCsbRaxKAYaKwNI0TY7P8V4Sxtste+ZtOa4GxxbJNVm5cqwJd0Fk8yq2kMCJ26qek6D3lnZKnX951QZ1C66ahNzunWbbcxC8y11+UThrUB909ws3IQZQ8rSKd5JAUgLL/6Mv0T7iqRU0iVevYpp7yLzkY9HDG3VwytNJdiRzOzUt7XwKQ8uXS6NKnWVzUMHpKABGM6A34tCUILJJHnazxniOadG+QhXB4peO7WriX7BGvK130PltkeU64Gwm2YC91sBJFVtXsEPCDkBHOLEPzoGEwoBLuxdM9L+MAdHrOlVN4L+wCbD0VdMUiCNJ8oS/fdwUs0vCRJ2OMqmC/JAQXZZSLUHvIe1+fBDDSI9tFzKCfSSXHwUHIZQ== label 6 | 7 | username: daniel 8 | 9 | [OPTIONAL] 10 | 11 | droplet_name: openbazaar 12 | 13 | droplet_region: ams3 14 | -------------------------------------------------------------------------------- /abc.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /autobazaar.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import pip 3 | import json 4 | import time 5 | import datetime 6 | import argparse 7 | 8 | pip.main(['install', 'python-digitalocean']) 9 | pip.main(['install', 'fabric']) 10 | pip.main(['install', 'configparser']) 11 | pip.main(['install', 'ConfigParser']) 12 | 13 | import digitalocean 14 | from fabric.api import * 15 | import configparser 16 | from password import generate_password 17 | 18 | # exit if python version 3 19 | python_version = sys.version_info.major 20 | if python_version == 3: 21 | import configparser 22 | else: 23 | import ConfigParser 24 | 25 | 26 | def create_digital_ocean_droplet(digital_ocean_api_token, ssh_key, droplet_name, droplet_region, output_filename): 27 | root_droplet_name = droplet_name 28 | manager = digitalocean.Manager(token=digital_ocean_api_token) 29 | 30 | def already_a_droplet_by_name(): 31 | droplets = manager.get_all_droplets() 32 | for droplet in droplets: 33 | if droplet.name == droplet_name: 34 | return True 35 | return False 36 | 37 | count = 1 38 | while already_a_droplet_by_name(): 39 | droplet_name = root_droplet_name + '-' + str(count) 40 | count += 1 41 | 42 | droplet = digitalocean.Droplet(token=digital_ocean_api_token, 43 | name=droplet_name, 44 | region=droplet_region, 45 | ssh_keys=[ssh_key], 46 | image='ubuntu-14-04-x64', 47 | #image='ubuntu-16-04-x64', 48 | size_slug='512mb', 49 | backups=False) 50 | 51 | print('Creating OpenBazaar-Server droplet on Digital Ocean.') 52 | droplet.create() 53 | 54 | # check on the status of the droplet and wait for it to become available 55 | status = 'in-progress' 56 | sys.stdout.write('Waiting for droplet to be created .') 57 | while True: 58 | sys.stdout.write('.'); sys.stdout.flush() 59 | actions = droplet.get_actions() 60 | for action in actions: 61 | action.load() 62 | status = action.status 63 | if status == 'completed': 64 | droplet.load() 65 | sys.stdout.write('\nWaiting for network services to become available .') 66 | for i in range(30): 67 | time.sleep(1) 68 | sys.stdout.write('.'); sys.stdout.flush() 69 | print('') 70 | break 71 | print('OpenBazaar-Server droplet created with IP: ' + droplet.ip_address) 72 | return droplet.ip_address 73 | 74 | def install_openbazaar(ip): 75 | print('Installing OpenBazaar-Server and dependencies') 76 | with settings(host_string=ip, user = 'root'): 77 | 78 | # ubuntu 14-04 79 | run('sudo add-apt-repository -y ppa:chris-lea/libsodium') 80 | run('sudo apt-get update') 81 | run('sudo DEBIAN_FRONTEND=noninteractive apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" dist-upgrade') 82 | run('sudo apt-get install -y git build-essential libssl-dev libffi-dev python-dev openssl python-pip autoconf pkg-config libtool libzmq3-dev libsodium-dev') 83 | run('sudo pip install cryptography') 84 | run('git clone https://github.com/zeromq/libzmq') 85 | with cd('~/libzmq'): 86 | run('./autogen.sh && ./configure && make -j 4') 87 | run('make check && make install && sudo ldconfig') 88 | run('git clone https://github.com/OpenBazaar/OpenBazaar-Server.git') 89 | with cd('~/OpenBazaar-Server'): 90 | run('sudo pip install -r requirements.txt') 91 | run('sudo pip install fabric') 92 | 93 | # ubuntu 16-04 94 | # run('sudo apt-get update -y && sudo apt-get upgrade -y') 95 | # run('sudo apt-get install -y git build-essential libssl-dev libffi-dev python-dev openssl python-pip libsodium-dev autoconf libzmq-dev pkg-config libtool') 96 | # run('sudo apt-get install -y libzmq3-dev') 97 | # run('pip install --upgrade pip') 98 | # run('sudo pip install cryptography') 99 | # run('sudo git clone https://github.com/OpenBazaar/OpenBazaar-Server.git') 100 | # run('sudo pip install fabric') 101 | # with cd('~/OpenBazaar-Server'): 102 | # run('sudo pip install -r requirements.txt') 103 | 104 | sys.stdout.write('\nWaiting again for network services .') 105 | for i in range(10): 106 | time.sleep(1) 107 | sys.stdout.write('.'); sys.stdout.flush() 108 | print('') 109 | 110 | def copy_autobazaar_files(ip): 111 | local('scp -q -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -r manager.py root@%s:~/OpenBazaar-Server/' % ip) 112 | local('scp -q -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -r ob_template.cfg root@%s:~/OpenBazaar-Server/' % ip) 113 | local('scp -q -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -r abc.json root@%s:~/OpenBazaar-Server/' % ip) 114 | local('scp -q -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -r openbazaar.conf root@%s:/etc/init/' % ip) 115 | with settings(host_string=ip, user = 'root', warn_only=True): 116 | with cd('~'): 117 | run('mkdir logs') 118 | with cd('/etc/init'): 119 | run('sudo chmod 644 openbazaar.conf') 120 | 121 | def copy_autobazaar_files_without_config_dict(ip): 122 | local('scp -q -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -r manager.py root@%s:~/OpenBazaar-Server/' % ip) 123 | local('scp -q -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -r ob_template.cfg root@%s:~/OpenBazaar-Server/' % ip) 124 | local('scp -q -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -r openbazaar.conf root@%s:/etc/init/' % ip) 125 | with settings(host_string=ip, user = 'root', warn_only=True): 126 | with cd('~'): 127 | run('mkdir logs') 128 | with cd('/etc/init'): 129 | run('sudo chmod 644 openbazaar.conf') 130 | 131 | def add_store(ip, storename, username, password): 132 | with settings(host_string=ip, user = 'root'): 133 | with cd('~/OpenBazaar-Server'): 134 | run('python manager.py add %s %s %s' % (storename, username, password)) 135 | 136 | def remove_store(ip, storename): 137 | with settings(host_string=ip, user = 'root'): 138 | with cd('~/OpenBazaar-Server'): 139 | run('python manager.py remove %s' % storename) 140 | 141 | def remove_all_stores(ip): 142 | stop_all_stores(ip) 143 | with settings(host_string=ip, user = 'root'): 144 | with cd('~/OpenBazaar-Server'): 145 | run('python manager.py remove_all') 146 | 147 | def restart_store(ip, storename): 148 | with settings(host_string=ip, user = 'root'): 149 | with cd('~/OpenBazaar-Server'): 150 | run('python manager.py restart %s' % storename) 151 | 152 | def restart_all_stores(ip): 153 | with settings(host_string=ip, user = 'root'): 154 | with cd('~/OpenBazaar-Server'): 155 | run('python manager.py restart_all') 156 | 157 | def stop_store(ip, storename): 158 | with settings(host_string=ip, user = 'root'): 159 | with cd('~/OpenBazaar-Server'): 160 | run('python manager.py stop %s' % storename) 161 | 162 | def stop_all_stores(ip): 163 | with settings(host_string=ip, user = 'root'): 164 | with cd('~/OpenBazaar-Server'): 165 | run('python manager.py stop_all') 166 | 167 | def delete_all_logs(ip): 168 | with settings(host_string=ip, user = 'root'): 169 | with cd('~/OpenBazaar-Server'): 170 | run('python manager.py delete_all_logs') 171 | 172 | def spawn_manage(ip): 173 | with settings(host_string=ip, user = 'root'): 174 | with cd('~/OpenBazaar-Server'): 175 | run('python manager.py spawn_manage') 176 | 177 | def setup_server(ip, username, num_stores, output_filename): 178 | install_openbazaar(ip) 179 | copy_autobazaar_files(ip) 180 | passwords = [] 181 | for i in range(1, args.num_stores+1): 182 | passwords.append(generate_password(32)) 183 | add_store(ip, 'store_%d' % i, args.username, passwords[i-1]) 184 | spawn_manage(ip) 185 | 186 | # create and write output file 187 | data = {} 188 | data['ip'] = ip 189 | data['username'] = username 190 | for i in range(args.num_stores): 191 | num = i+1 192 | data[num] = {} 193 | data[num]['password'] = passwords[i] 194 | data[num]['rest'] = str(num) + '8469' 195 | data[num]['websocket'] = str(num) + '8466' 196 | data[num]['heartbeat'] = str(num) + '8470' 197 | with open(output_filename, 'w') as f: 198 | json.dump(data, f) 199 | 200 | print('Oh Yeah! Finished installing and running your OpenBazaar stores.') 201 | print('If you restart your droplet all your stores will respawn.') 202 | print('Now you can connect OpenBazaar (found at www.openbazaar.org) to your stores in the cloud by adding new server configurations as follows:') 203 | print('In the OpenBazaar program go to menu (top right of screen) -> default -> + New Server\n') 204 | for i in range(args.num_stores): 205 | num = i+1 206 | print('For store #%d, please use the following configurations options:' % num) 207 | hap = str(num) + '8469' 208 | wap = str(num) + '8466' 209 | hsp = str(num) + '8470' 210 | print('\tServer IP: %s\n\tUsername: %s\n\tPassword: %s\n\tRest API Port: %s\n\tWebsocket API port: %s\n\tHeartbeat socket port: %s\n' % (ip, username, passwords[i], hap, wap, hsp)) 211 | print('If you need to access your droplet to make any changes manually, you can ssh in using \'ssh root@%s\'' % ip) 212 | 213 | def setup_digital_ocean_droplet(digital_ocean_api_token, ssh_key, droplet_name, droplet_region, username, num_stores, output_filename): 214 | print('Creating %d stores on a Digital Ocean droplet.' % num_stores) 215 | ip = create_digital_ocean_droplet(digital_ocean_api_token, ssh_key, droplet_name, droplet_region, output_filename) 216 | if ip: 217 | setup_server(ip, username, num_stores, output_filename) 218 | 219 | # get hold of the arguments 220 | parser = argparse.ArgumentParser() 221 | parser.add_argument('-u', '--username', default='user') 222 | parser.add_argument('-n', '--num-stores', type=int, default=1, choices=range(1, 6)) 223 | parser.add_argument('-hs', '--hosting-service', default='DigitalOcean', choices=['None', 'DigitalOcean']) 224 | parser.add_argument('-ip', '--ip-address', default='None') 225 | parser.add_argument('-o', '--output-filename', default='output.json') 226 | parser.add_argument('-t', '--api-token', default='None') 227 | parser.add_argument('-spk', '--ssh-public-key', default='None') 228 | args = parser.parse_args() 229 | 230 | if args.hosting_service == 'None': 231 | setup_server(args.ip_address, args.username, args.num_stores) 232 | 233 | elif args.hosting_service == 'DigitalOcean': 234 | Config = configparser.ConfigParser() 235 | Config.read('ab.cfg') 236 | if args.api_token == 'None': 237 | digital_ocean_api_token = Config.get('MANDATORY', 'digital_ocean_api_token') 238 | else: 239 | digital_ocean_api_token = args.api_token 240 | if args.ssh_public_key == 'None': 241 | ssh_key = Config.get('MANDATORY', 'ssh_key') 242 | else: 243 | ssh_key = args.ssh_public_key 244 | droplet_name = Config.get('OPTIONAL', 'droplet_name') 245 | droplet_region = Config.get('OPTIONAL', 'droplet_region') 246 | setup_digital_ocean_droplet(digital_ocean_api_token, ssh_key, droplet_name, droplet_region, args.username, args.num_stores, args.output_filename) 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | -------------------------------------------------------------------------------- /manager.py: -------------------------------------------------------------------------------- 1 | from fabric.api import * 2 | import sys 3 | import time 4 | from tempfile import mkstemp 5 | from shutil import move 6 | from os import remove, close 7 | import json 8 | import twisted.internet 9 | from twisted.internet import reactor, task 10 | from subprocess import check_output 11 | 12 | def save_config(config_dict): 13 | with open('/root/OpenBazaar-Server/abc.json', 'w') as f: 14 | json.dump(config_dict, f) 15 | 16 | def load_config(): 17 | with open('/root/OpenBazaar-Server/abc.json', 'r') as f: 18 | try: 19 | config_dict = json.load(f) 20 | except: 21 | config_dict = {} 22 | return config_dict 23 | 24 | def replace(path, pattern, subst): 25 | fh, temp_path = mkstemp() 26 | with open(temp_path,'w') as temp_file: 27 | with open(path) as file: 28 | for line in file: 29 | temp_file.write(line.replace(pattern, subst)) 30 | close(fh) 31 | remove(path) 32 | move(temp_path, path) 33 | 34 | def add_store(storename, username, password): 35 | c = load_config() 36 | store_numbers = [] 37 | store_names = [] 38 | for sn, (storenumber, un, pwd) in c.iteritems(): 39 | store_numbers.append(storenumber) 40 | store_names.append(sn) 41 | for n in range(1, 6): # max 5 stores per droplet (the port range goes out of bounds with 6) 42 | if n not in store_numbers and storename not in store_names: 43 | c[storename] = (n, username, password) 44 | save_config(c) 45 | return True 46 | return False 47 | 48 | def remove_store(storename): 49 | c = load_config() 50 | removed = c.pop(storename, None) 51 | if removed: 52 | save_config(c) 53 | return removed 54 | 55 | def remove_all_stores(): 56 | abc = load_config() 57 | for storename, (storenumber, username, password) in abc.iteritems(): 58 | remove_store(storename) 59 | 60 | def restart_store(storename): 61 | print 'Restarting store %s.' % storename 62 | abc = load_config() 63 | storenumber, username, password = abc[storename] 64 | with cd('~/OpenBazaar-Server'): 65 | local('cp ob_template.cfg ob.cfg') 66 | replace('ob.cfg', '#USERNAME = username', 'USERNAME = %s' % username) 67 | replace('ob.cfg', '#PASSWORD = password', 'PASSWORD = %s' % password) 68 | replace('ob.cfg', '#DATA_FOLDER = /path/to/OpenBazaar/', 'DATA_FOLDER = /root/stores/%s/' % storename) 69 | try: 70 | local("screen -S %s -X stuff $'\003'" % storename) 71 | time.sleep(10) 72 | except: 73 | pass 74 | local('echo \'logfile /root/logs/%s.log\' > /root/.screenrc' % storename) 75 | local('screen -d -m -S %s -L python openbazaard.py start -p 1111%d -r %d8469 -w %d8466 -b %d8470 --pidfile %s.pid -a 0.0.0.0; sleep 1' % (storename, storenumber, storenumber, storenumber, storenumber, storename)) 76 | 77 | def restart_all_stores(): 78 | with cd('~/OpenBazaar-Server'): 79 | local('git pull') 80 | local('pip install -r requirements.txt --upgrade') 81 | abc = load_config() 82 | for storename, (storenumber, username, password) in abc.iteritems(): 83 | restart_store(storename) 84 | 85 | def stop_store(storename): 86 | abc = load_config() 87 | storenumber, username, password = abc[storename] 88 | try: 89 | local("screen -S %s -X stuff $'\003'" % storename) 90 | time.sleep(10) 91 | except: 92 | pass 93 | 94 | def stop_all_stores(): 95 | abc = load_config() 96 | for storename, (storenumber, username, password) in abc.iteritems(): 97 | stop_store(storename) 98 | 99 | def delete_all_logs(): 100 | abc = load_config() 101 | for storename, (storenumber, username, password) in abc.iteritems(): 102 | with settings(warn_only=True): 103 | with cd('~/logs'): 104 | local('rm %s.log' % storename) 105 | 106 | def screen_running(name): 107 | var = check_output(["screen -ls; true"],shell=True) 108 | if "."+name+"\t(" in var: 109 | return True 110 | else: 111 | return False 112 | 113 | def maintain(): 114 | abc = load_config() 115 | for storename in abc.keys(): 116 | if not screen_running(storename): 117 | print 'Store %s went down... restarting...' % storename 118 | restart_store(storename) 119 | 120 | def loop_restart_store(storename, interval): 121 | print 'loop restart store: %s, %s' % (storename, interval) 122 | task.LoopingCall(restart_store, storename).start(interval) 123 | 124 | def loop_maintain(interval): 125 | task.LoopingCall(maintain).start(interval) 126 | 127 | def manage(): 128 | print 'Started manager... restarting all stores.' 129 | restart_all_stores() 130 | 131 | # handle the restarting of stores 132 | abc = load_config() 133 | interval = 4*3600 # 4 hour in seconds 134 | int_frac = interval / len(abc) 135 | for i, storename in enumerate(abc.keys()): 136 | reactor.callLater((i * int_frac) + int_frac, loop_restart_store, storename, interval) 137 | 138 | # restart stores that have gone down 139 | reactor.callLater(60, loop_maintain, 5) 140 | twisted.internet.reactor.run() 141 | 142 | # do something based on the command line arguments 143 | if sys.argv[1] == 'spawn_manage': 144 | with settings(warn_only=True): 145 | with cd('~/OpenBazaar-Server'): 146 | local('screen -X -S manage quit') 147 | local('echo \'logfile /root/logs/manage.log\' > /root/.screenrc') 148 | local('screen -d -m -S manage -L python manager.py manage; sleep 1') 149 | if sys.argv[1] == 'manage': 150 | manage() 151 | elif sys.argv[1] == 'add': 152 | add_store(sys.argv[2], sys.argv[3], sys.argv[4]) 153 | elif sys.argv[1] == 'remove': 154 | remove_store(sys.argv[2]) 155 | elif sys.argv[1] == 'restart': 156 | restart_store(sys.argv[2]) 157 | elif sys.argv[1] == 'stop': 158 | stop_store(sys.argv[2]) 159 | elif sys.argv[1] == 'restart_all': 160 | restart_all_stores() 161 | elif sys.argv[1] == 'stop_all': 162 | stop_all_stores() 163 | elif sys.argv[1] == 'delete_all_logs': 164 | delete_all_logs() 165 | elif sys.argv[1] == 'remove_all': 166 | remove_all_stores() 167 | 168 | 169 | 170 | 171 | 172 | -------------------------------------------------------------------------------- /ob_template.cfg: -------------------------------------------------------------------------------- 1 | [CONSTANTS] 2 | #DATA_FOLDER = /path/to/OpenBazaar/ 3 | 4 | KSIZE = 20 5 | ALPHA = 3 6 | 7 | TRANSACTION_FEE = 20400 8 | 9 | RESOLVER = https://resolver.onename.com/ 10 | 11 | [LIBBITCOIN_SERVERS] 12 | mainnet_server1 = tcp://libbitcoin1.openbazaar.org:9091 13 | mainnet_server3 = tcp://libbitcoin3.openbazaar.org:9091 14 | mainnet_server5 = tcp://obelisk.airbitz.co:9091 15 | 16 | [LIBBITCOIN_SERVERS_TESTNET] 17 | testnet_server2 = tcp://libbitcoin2.openbazaar.org:9091,baihZB[vT(dcVCwkhYLAzah{3@k?+>T&^3 18 | testnet_server4 = tcp://libbitcoin4.openbazaar.org:9091,