def create_fresh_ot_config(): pyopentxs.create_fresh_wallet() # create server contract and empty the client side data setup_data = setup(open('../test-data/sample-contracts/localhost.xml'), total_servers=2) p = subprocess.Popen(["opentxs-notary", "--only-init"], stdin=subprocess.PIPE) outs, errs = p.communicate(input=setup_data.getvalue(), timeout=20) # set cron interval to shorter than default config_data = config.read() config_data['cron']['ms_between_cron_beats'] = '2500' # in milliseconds config.write()
def notary_setup(pytestconfig): ver = pytestconfig.getoption("--notary-version") if ver == 1: # goatary from pyopentxs import goatary contract_dir = goatary.create_server_contract() pyopentxs.create_fresh_wallet() goatary.start_notary(contract_dir) goatary.add_server_contract(contract_dir) yield pyopentxs.cleanup() else: from pyopentxs import notary notary.fresh_setup() yield pyopentxs.cleanup()