Localnet

Note

This module has the exact same funtionality as beaker.sandbox, which will eventually be deprecated. They are currently interchangeable.

Beaker provides helper methods to work with an algokit localnet or with a local sandbox network.

Local Accounts

class beaker.localnet.LocalAccount[source]

LocalAccount is a simple dataclass to hold a localnet account details

__init__(*, address: str, private_key: str) None
address: str

The address of a localnet account

private_key: str

The base64 encoded private key of the account

localnet.get_accounts(kmd_token: str = 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', wallet_name: str = 'unencrypted-default-wallet', wallet_password: str = '') list[beaker.localnet.kmd.LocalAccount]

gets all the accounts in the localnet kmd, defaults to the unencrypted-default-wallet created on private networks automatically

localnet.add_account(kmd_address: str = 'http://localhost:4002', kmd_token: str = 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', wallet_name: str = 'unencrypted-default-wallet', wallet_password: str = '') str

Adds a new account to the localnet kmd

Algod Client

localnet.get_algod_client(token: str = 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') AlgodClient

creates a new algod client using the default localnet parameters

Indexer Client

localnet.get_indexer_client(token: str = 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') IndexerClient

creates a new indexer client using the default localnet parameters