Beispiel #1
0
    async def one_wallet_node_and_rpc(self):
        rmtree(get_pool_plot_dir(), ignore_errors=True)
        async for nodes in setup_simulators_and_wallets(1, 1, {}):
            full_nodes, wallets = nodes
            full_node_api = full_nodes[0]
            wallet_node_0, wallet_server_0 = wallets[0]

            wallet_0 = wallet_node_0.wallet_state_manager.main_wallet
            our_ph = await wallet_0.get_new_puzzlehash()
            await self.farm_blocks(full_node_api, our_ph, PREFARMED_BLOCKS)

            api_user = WalletRpcApi(wallet_node_0)
            config = bt.config
            hostname = config["self_hostname"]
            daemon_port = config["daemon_port"]
            test_rpc_port = uint16(21529)

            rpc_cleanup = await start_rpc_server(
                api_user,
                hostname,
                daemon_port,
                test_rpc_port,
                lambda x: None,
                bt.root_path,
                config,
                connect_to_daemon=False,
            )
            client = await WalletRpcClient.create(self_hostname, test_rpc_port, bt.root_path, config)

            yield client, wallet_node_0, full_node_api

            client.close()
            await client.await_closed()
            await rpc_cleanup()
Beispiel #2
0
async def wallet_nodes():
    async_gen = setup_simulators_and_wallets(1, 1, {"MEMPOOL_BLOCK_BUFFER": 1, "MAX_BLOCK_COST_CLVM": 11000000000})
    nodes, wallets = await async_gen.__anext__()
    full_node_1 = nodes[0]
    server_1 = full_node_1.full_node.server
    wallet_a = bt.get_pool_wallet_tool()
    wallet_receiver = WalletTool(full_node_1.full_node.constants)
    yield full_node_1, server_1, wallet_a, wallet_receiver

    async for _ in async_gen:
        yield _
    async def two_nodes(self):
        async_gen = setup_simulators_and_wallets(2, 1, {})
        nodes, _ = await async_gen.__anext__()
        full_node_1 = nodes[0]
        full_node_2 = nodes[1]
        server_1 = full_node_1.full_node.server
        server_2 = full_node_2.full_node.server
        yield full_node_1, full_node_2, server_1, server_2

        async for _ in async_gen:
            yield _
    async def one_wallet_node_and_rpc(self):
        rmtree(get_pool_plot_dir(), ignore_errors=True)
        async for nodes in setup_simulators_and_wallets(1, 1, {}):
            full_nodes, wallets = nodes
            full_node_api = full_nodes[0]
            full_node_server = full_node_api.server
            wallet_node_0, wallet_server_0 = wallets[0]
            await wallet_server_0.start_client(
                PeerInfo(self_hostname, uint16(full_node_server._port)), None)

            wallet_0 = wallet_node_0.wallet_state_manager.main_wallet
            our_ph = await wallet_0.get_new_puzzlehash()
            await self.farm_blocks(full_node_api, our_ph, 4)
            total_block_rewards = await self.get_total_block_rewards(4)

            await time_out_assert(10, wallet_0.get_confirmed_balance,
                                  total_block_rewards)
            api_user = WalletRpcApi(wallet_node_0)
            config = bt.config
            hostname = config["self_hostname"]
            daemon_port = config["daemon_port"]
            test_rpc_port = uint16(21529)

            rpc_cleanup = await start_rpc_server(
                api_user,
                hostname,
                daemon_port,
                test_rpc_port,
                lambda x: None,
                bt.root_path,
                config,
                connect_to_daemon=False,
            )
            client = await WalletRpcClient.create(self_hostname, test_rpc_port,
                                                  bt.root_path, config)

            yield client, wallet_node_0, full_node_api

            client.close()
            await client.await_closed()
            await rpc_cleanup()
Beispiel #5
0
 async def three_sim_two_wallets(self):
     async for _ in setup_simulators_and_wallets(3, 2, {}, True):
         yield _
Beispiel #6
0
 async def two_wallet_nodes_five_freeze(self):
     async for _ in setup_simulators_and_wallets(1, 2, {}, True):
         yield _
Beispiel #7
0
 async def wallet_node_100_pk(self):
     async for _ in setup_simulators_and_wallets(
             1, 1, {}, initial_num_public_keys=100):
         yield _
 async def three_sim_two_wallets(self):
     async for _ in setup_simulators_and_wallets(
         3, 2, {"COINBASE_FREEZE_PERIOD": 0}
     ):
         yield _
Beispiel #9
0
 async def three_wallet_nodes(self):
     async for _ in setup_simulators_and_wallets(
             1, 3, {"COINBASE_FREEZE_PERIOD": 0}):
         yield _
Beispiel #10
0
async def setup_two_nodes():
    async for _ in setup_simulators_and_wallets(2, 0, {}, starting_port=60000):
        yield _
 async def wallet_node_30_freeze(self):
     async for _ in setup_simulators_and_wallets(
             1, 1, {"INITIAL_FREEZE_END_TIMESTAMP": (time.time() + 60)}):
         yield _
 async def two_nodes(self):
     async for _ in setup_simulators_and_wallets(2, 0, {}):
         yield _
Beispiel #13
0
 async def wallet_node_30_freeze(self):
     async for _ in setup_simulators_and_wallets(
             1, 1, {"INITIAL_FREEZE_PERIOD": 30}):
         yield _
Beispiel #14
0
async def two_wallet_nodes():
    async for _ in setup_simulators_and_wallets(1, 2, {}):
        yield _
Beispiel #15
0
async def two_wallet_nodes():
    async for _ in setup_simulators_and_wallets(1, 2,
                                                {"COINBASE_FREEZE_PERIOD": 0}):
        yield _
 async def wallet_node_simulator(self):
     async for _ in setup_simulators_and_wallets(1, 1, {}):
         yield _
 async def three_nodes_two_wallets(self):
     async for _ in setup_simulators_and_wallets(3, 2, {}):
         yield _
 async def wallet_nodes(self):
     key_seed = bt.farmer_master_sk_entropy
     async for _ in setup_simulators_and_wallets(2,
                                                 1, {},
                                                 key_seed=key_seed):
         yield _
Beispiel #19
0
 async def three_wallet_nodes(self):
     async for _ in setup_simulators_and_wallets(1, 3, {}):
         yield _
 async def two_wallet_nodes_five_freeze(self):
     async for _ in setup_simulators_and_wallets(
         1, 2, {"COINBASE_FREEZE_PERIOD": 5}
     ):
         yield _
Beispiel #21
0
async def setup_two_nodes(db_version):
    async for _ in setup_simulators_and_wallets(2,
                                                0, {},
                                                starting_port=60000,
                                                db_version=db_version):
        yield _