# Brownie basics

To have brownie deploy the folder structure within a folder:

`brownie init`

### Deploy.py

This file will handle deployment logic. yyIn your deploy.py file, in scripts folder:

```python
# for blockchain deplyment
# brownie run <scriptname.py>

#brownie has an accounts package
from brownie import accounts 

#put all the deployment logic in one function:
def deploy_simple_storage():
    #local ganache accounts
    account = accounts[0]; print(account)

    #use own account for testnet
    #add account to brownie: brownie accounts new <acc_name:freecodecamp-account>


def main():
    deploy_simple_storage()
```

### Accounts management

Brownie has a package called accounts for handling accounts. In terminal:

```bash
brownie accounts new freecodecamp-account
```

Terminal will request for your private key:

![](https://1628544884-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTgomzlmn9NrxUY0OQ3cD%2Fuploads%2FXHh92ExrnXb2DtLeju6E%2Fimage.png?alt=media\&token=5fafd55c-7705-4286-97b1-05aed3d084d2)

Add 0x to the front of the private key before pasting it in. Brownie will password encrypt the private key.

#### accounts list

> &#x20;\> brownie accounts list

![](https://1628544884-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTgomzlmn9NrxUY0OQ3cD%2Fuploads%2FCk9nE07ddkGnSeYQtkXf%2Fimage.png?alt=media\&token=f5e9199c-4ff9-482b-b4b0-1d3585029e81)

this will list all the accounts user has added.

#### delete accounts&#x20;

&#x20;\> brownie accounts delete \<acc\_name>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://calnix.gitbook.io/eth-dev/archive/brownie-framework/brownie-basics.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
