#How to fund localnet account (with algokit)

7 messages · Page 1 of 1 (latest)

sick token
#

Check title

terse deltaBOT
#

Hi @sick token. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

To fund a LocalNet account using AlgoKit, you can utilize the getDispenserAccount function provided by AlgoKit Utils. This function automatically handles the process of funding accounts on LocalNet. Here's how you can do it:

  1. For TypeScript:
    AlgoKit Utils TypeScript - Dispenser provides the getDispenserAccount function:

    const dispenserAccount = await algokit.getDispenserAccount(algod, kmd)
    
  2. For Python:
    AlgoKit Utils Python - Dispenser offers a similar get_dispenser_account function:

    dispenser_account = algokit.get_dispenser_account(algod)
    

When running against LocalNet, these functions automatically determine the dispenser account using the Kmd API. The dispenser account can then be used to fund other accounts on the LocalNet.

It's worth noting that when using AlgoKit's LocalNet, accounts are typically automatically and idempotently generated and funded. As mentioned in the AlgoKit Smart Contract Deployment documentation:

"LocalNet accounts are by default automatically and idempotently generated against a named account by using a named wallet via Kmd and are automatically funded using the LocalNet faucet account (the private key for which is automatically retrieved using Kmd)."

#

This means that in many cases, you won't need to manually fund accounts when working with AlgoKit's LocalNet, as the system is designed to handle this automatically.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:

#

@sick token Kapa.ai is still learning and improving, please let me know how I did by reacting below.

sick token
#

And from command line?

#

Hello?