Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Oct 21, 2024
1 parent 6c1f1ec commit 18da807
Show file tree
Hide file tree
Showing 26 changed files with 174 additions and 17 deletions.
Binary file modified latest/.doctrees/commands/networks.doctree
Binary file not shown.
Binary file modified latest/.doctrees/environment.pickle
Binary file not shown.
Binary file modified latest/.doctrees/methoddocs/ape.doctree
Binary file not shown.
Binary file modified latest/.doctrees/methoddocs/ape_accounts.doctree
Binary file not shown.
Binary file modified latest/.doctrees/methoddocs/ape_compile.doctree
Binary file not shown.
Binary file modified latest/.doctrees/methoddocs/ape_ethereum.doctree
Binary file not shown.
Binary file modified latest/.doctrees/methoddocs/ape_node.doctree
Binary file not shown.
Binary file modified latest/.doctrees/methoddocs/ape_pm.doctree
Binary file not shown.
Binary file modified latest/.doctrees/methoddocs/ape_test.doctree
Binary file not shown.
Binary file modified latest/.doctrees/methoddocs/api.doctree
Binary file not shown.
Binary file modified latest/.doctrees/methoddocs/cli.doctree
Binary file not shown.
Binary file modified latest/.doctrees/methoddocs/contracts.doctree
Binary file not shown.
Binary file modified latest/.doctrees/methoddocs/exceptions.doctree
Binary file not shown.
Binary file modified latest/.doctrees/methoddocs/managers.doctree
Binary file not shown.
Binary file modified latest/.doctrees/methoddocs/plugins.doctree
Binary file not shown.
Binary file modified latest/.doctrees/methoddocs/types.doctree
Binary file not shown.
Binary file modified latest/.doctrees/methoddocs/utils.doctree
Binary file not shown.
Binary file modified latest/.doctrees/userguides/config.doctree
Binary file not shown.
83 changes: 80 additions & 3 deletions latest/_sources/userguides/config.md.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Configure Ape

You can configure Ape using configuration files with the name `ape-config.yaml`.
There are two locations you can place an `ape-config.yaml` file.
You can configure Ape using a `pyproject.toml` file and the prefix `tool.ape` or any configuration file named `ape-config.[yaml|yml|json]`.
There are two locations you can place config files.

1. In the root of your project
2. In your `$HOME/.ape` directory (global)
Expand All @@ -23,6 +23,13 @@ However, here is a list of common-use cases requiring the `ape-config.yaml` file
**Environment Variables**: `ape-config.yaml` files support environment-variable expansion.
Simply include environment variables (with the `$` prefix) in your config file and Ape will automatically expand them.

```toml
[tool.ape.plugin]
secret_rpc = "$MY_SECRET_RPC"
```

Or the equivalent YAML:

```yaml
plugin:
secret_rpc: $MY_SECRET_RPC
Expand All @@ -44,6 +51,13 @@ project

In this case, you want to configure Ape like:

```toml
[tool.ape]
base_path = "src"
```

Or the equivalent YAML:

```yaml
base_path: src
```
Expand All @@ -56,6 +70,13 @@ Some dependencies, such as python-based ones like `snekmate`, use this structure
Specify a different path to your `contracts/` directory.
This is useful when using a different naming convention, such as `src/` rather than `contracts/`.

```toml
[tool.ape]
contracts_folder = "src"
```

Or the equivalent YAML:

```yaml
contracts_folder: src
```
Expand All @@ -71,6 +92,13 @@ contracts_folder: "~/GlobalContracts"

You can change the default ecosystem by including the following:

```toml
[tool.ape]
default_ecosystem = "fantom"
```

Or the equivalent YAML:

```yaml
default_ecosystem: fantom
```
Expand All @@ -84,9 +112,18 @@ To learn more about dependencies, see [this guide](./dependencies.html).

A simple example of configuring dependencies looks like this:

```toml
[[tool.ape.dependencies]]
name = "openzeppelin"
github = "OpenZeppelin/openzeppelin-contracts"
version = "4.4.2"
```

Or the equivalent YAML:

```yaml
dependencies:
- name: OpenZeppelin
- name: openzeppelin
github: OpenZeppelin/openzeppelin-contracts
version: 4.4.2
```
Expand All @@ -98,6 +135,18 @@ Set deployments that were made outside of Ape in your `ape-config.yaml` to creat

Config example:

```toml
[[tool.ape.deployments.ethereum.mainnet]]
contract_type = "MyContract"
address = "0x5FbDB2315678afecb367f032d93F642f64180aa3"

[[tool.ape.deployments.ethereum.sepolia]]
contract_type = "MyContract"
address = "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512"
```

Or the equivalent YAML:

```yaml
deployments:
ethereum:
Expand Down Expand Up @@ -126,6 +175,13 @@ Ape does not add or edit deployments in your `ape-config.yaml` file.
When using the `node` provider, you can customize its settings.
For example, to change the URI for an Ethereum network, do:

```toml
[tool.ape.node.ethereum.mainnet]
uri = "http://localhost:5030"
```

Or the equivalent YAML:

```yaml
node:
ethereum:
Expand All @@ -145,6 +201,16 @@ For more information on networking as a whole, see [this guide](./networks.html)

Set default network and network providers:

```toml
[tool.ape.ethereum]
default_network = "mainnet-fork"

[tool.ape.ethereum.mainnet_fork]
default_provider = "hardhat"
```

Or the equivalent YAML:

```yaml
ethereum:
default_network: mainnet-fork
Expand Down Expand Up @@ -188,6 +254,17 @@ Set which `ape` plugins you want to always use.
The `ape-` prefix is not needed and shouldn't be included here.
```

```toml
[[tool.ape.plugins]]
name = "solidity"
version = "0.1.0b2"

[[tool.ape.plugins]]
name = "ens"
```

Or the equivalent YAML:

```yaml
plugins:
- name: solidity # ape-solidity plugin
Expand Down
12 changes: 4 additions & 8 deletions latest/commands/networks.html
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,7 @@ <h2>list<a class="headerlink" href="#networks-list" title="Link to this heading"
<dd><p>Filter the results by ecosystem</p>
<dl class="field-list simple">
<dt class="field-odd">Options<span class="colon">:</span></dt>
<dd class="field-odd"><p>ethereum</p>
</dd>
<dd class="field-odd"><p></p></dd>
</dl>
</dd></dl>

Expand All @@ -204,8 +203,7 @@ <h2>list<a class="headerlink" href="#networks-list" title="Link to this heading"
<dd><p>Filter the results by network</p>
<dl class="field-list simple">
<dt class="field-odd">Options<span class="colon">:</span></dt>
<dd class="field-odd"><p>mainnet | mainnet-fork | sepolia | sepolia-fork | local | holesky-fork | holesky</p>
</dd>
<dd class="field-odd"><p></p></dd>
</dl>
</dd></dl>

Expand All @@ -215,8 +213,7 @@ <h2>list<a class="headerlink" href="#networks-list" title="Link to this heading"
<dd><p>Filter the results by provider</p>
<dl class="field-list simple">
<dt class="field-odd">Options<span class="colon">:</span></dt>
<dd class="field-odd"><p>test | node</p>
</dd>
<dd class="field-odd"><p></p></dd>
</dl>
</dd></dl>

Expand All @@ -241,8 +238,7 @@ <h2>run<a class="headerlink" href="#networks-run" title="Link to this heading">
<dd><p>Override the default network and provider. (see <cite>ape networks list</cite> for options)</p>
<dl class="field-list simple">
<dt class="field-odd">Options<span class="colon">:</span></dt>
<dd class="field-odd"><p>:mainnet:node | ethereum:mainnet:node | :mainnet | ethereum:mainnet | :sepolia:node | ethereum:sepolia:node | :sepolia | ethereum:sepolia | :holesky:node | ethereum:holesky:node | :holesky | ethereum:holesky | ::node | :local:node | ethereum::node | ethereum:local:node | ::test | :local:test | ethereum::test | ethereum:local:test | :local | ethereum:local | ethereum</p>
</dd>
<dd class="field-odd"><p></p></dd>
</dl>
</dd></dl>

Expand Down
2 changes: 2 additions & 0 deletions latest/genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -4047,6 +4047,8 @@ <h2 id="U">U</h2>
<h2 id="V">V</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="methoddocs/api.html#ape.api.config.ApeConfig.validate_file">validate_file() (ape.api.config.ApeConfig class method)</a>
</li>
<li><a href="methoddocs/api.html#ape.api.providers.BlockAPI.validate_size">validate_size() (ape.api.providers.BlockAPI class method)</a>
</li>
<li><a href="methoddocs/utils.html#ape.utils.TraceStyles.VALUE">VALUE (ape.utils.TraceStyles attribute)</a>
Expand Down
Loading

0 comments on commit 18da807

Please sign in to comment.