How to create an account on Brownie

Question:

I am looking to create accounts on Brownie for deploying contracts but I am not sure how to do this. I have looked online how to do this and I havent found it.

I am running python 3.7 and have brownie installed and working as intended. I have also run brownie using a gnache cli. Any help would be great!

Asked By: Jack Mcloughlin

||

Answers:

To create accounts on brownie use

brownie accounts new account-name

you can then add your private key as well as password encrypt.

You can check to see if this account was made correctly using

brownie accounts list
Answered By: Jack1999

I understand that you are trying to add accounts through the brownie ./scripts folder:

add.py

from brownie import accounts
def add_account():
    print(len(accounts)
    for i in range(10):
        accounts.add() #adds a random account with mnemonic & address to the network
    print(len(accounts))

def main():
    add_account()

You can then execute this in you shell:

brownie run .scriptsadd.py –network [network]

For further information look here:
https://eth-brownie.readthedocs.io/en/stable/core-accounts.html

Answered By: T4gmaster
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.