def scenario(wallets, **kw):

    # save the wallet
    wallet = testlib.blockstack_client_initialize_wallet("0123456789abcdef",
                                                         wallets[2].privkey,
                                                         wallets[3].privkey,
                                                         wallets[4].privkey,
                                                         start_rpc=False)
    if 'error' in wallet:
        print 'failed to set wallet: {}'.format(wallet)
        return False

    testlib.blockstack_namespace_preorder("id", wallets[1].addr,
                                          wallets[0].privkey)
    testlib.next_block(**kw)

    testlib.blockstack_namespace_reveal(
        "id", wallets[1].addr, 52595, 250, 4,
        [6, 5, 4, 3, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], 10, 10,
        wallets[0].privkey)
    testlib.next_block(**kw)

    testlib.blockstack_namespace_ready("id", wallets[1].privkey)
    testlib.next_block(**kw)

    testlib.blockstack_name_preorder("foo.id", wallets[2].privkey,
                                     wallets[3].addr)
    testlib.next_block(**kw)

    testlib.blockstack_name_register("foo.id", wallets[2].privkey,
                                     wallets[3].addr)
    testlib.next_block(**kw)

    # start api server
    res = testlib.start_api("0123456789abcdef")
    if 'error' in res:
        print 'failed to start API server: {}'.format(res)
        return False

    # set up node environment
    nodedir = testlib.nodejs_setup()

    # run 'core-test' test on blockstack (tests authentication from blockstack.js to Core API)
    testlib.nodejs_copy_package(nodedir, "blockstack")
    # testlib.nodejs_link_package(nodedir, 'blockstack')
    testlib.nodejs_run_test(nodedir, "integration-test-auth")
    testlib.nodejs_cleanup(nodedir)
def scenario( wallets, **kw ):

    # save the wallet 
    wallet = testlib.blockstack_client_initialize_wallet( "0123456789abcdef", wallets[2].privkey, wallets[3].privkey, wallets[4].privkey, start_rpc=False )
    if 'error' in wallet:
        print 'failed to set wallet: {}'.format(wallet)
        return False

    testlib.blockstack_namespace_preorder( "id", wallets[1].addr, wallets[0].privkey )
    testlib.next_block( **kw )

    testlib.blockstack_namespace_reveal( "id", wallets[1].addr, 52595, 250, 4, [6,5,4,3,2,1,0,0,0,0,0,0,0,0,0,0], 10, 10, wallets[0].privkey )
    testlib.next_block( **kw )

    testlib.blockstack_namespace_ready( "id", wallets[1].privkey )
    testlib.next_block( **kw )

    testlib.blockstack_name_preorder( "foo.id", wallets[2].privkey, wallets[3].addr )
    testlib.next_block( **kw )

    testlib.blockstack_name_register( "foo.id", wallets[2].privkey, wallets[3].addr )
    testlib.next_block( **kw )

    # start api server 
    res = testlib.start_api("0123456789abcdef")
    if 'error' in res:
        print 'failed to start API server: {}'.format(res)
        return False

    # set up node environment 
    nodedir = testlib.nodejs_setup()

    # run 'core-test' test on blockstack (tests authentication from blockstack.js to Core API)
    testlib.nodejs_copy_package(nodedir, "blockstack")
    testlib.nodejs_copy_package(nodedir, "blockstack-storage")
    testlib.nodejs_run_test(nodedir, "integration-test-storage")
    testlib.nodejs_cleanup(nodedir)