Skip to content

Commit

Permalink
docs: Adds docs dir for deployment and management
Browse files Browse the repository at this point in the history
  • Loading branch information
pmerkleplant committed Aug 8, 2023
1 parent 512ddf0 commit 4501bf6
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 27 deletions.
15 changes: 15 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Wallet Management
export PRIVATE_KEY=

# RPC URL
export RPC_URL=

# Etherscan Verification
export ETHERSCAN_API_KEY=

# Deployment Configuration
export INITIAL_AUTHED=

# Management Configurations
export GREENHOUSE=
export WHO=
30 changes: 30 additions & 0 deletions docs/Deployment.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Deployment

This document describes how to deploy a new `Greenhouse` instance.

## Environment Variables

The following environment variables must be set:

- `RPC_URL`: The RPC URL of an EVM node
- `PRIVATE_KEY`: The private key to use
- `ETHERSCAN_API_KEY`: The Etherscan API key for the Etherscan's chain instance
- `INITIAL_AUTHED`: The address being auth'ed on the newly deployed `Scribe` instance

Note that an `.env.example` file is provided in the project root. To set all environment variables at once, create a copy of the file and rename the copy to `.env`, adjust the variable's values', and run `source .env`.

## Execution

Run:

```bash
$ forge script \
--private-key $PRIVATE_KEY \
--broadcast \
--rpc-url $RPC_URL \
--etherscan-api-key $ETHERSCAN_API_KEY \
--verify \
--sig $(cast calldata "deploy(address)" $INITIAL_AUTHED) \
-vvv \
script/Greenhouse.s.sol:GreenhouseScript
```
53 changes: 26 additions & 27 deletions script/GreenhouseScript.md → docs/Management.md
Original file line number Diff line number Diff line change
@@ -1,45 +1,38 @@
# Greenhouse Script
# Management

This document describes how to deploy and manage `Greenhouse` instances via the `Greenhouse.s.sol`'s `GreenhouseScript`.
This document describes how to manage deployed `Greenhouse` instances.

The following environment variables are necessary for all commands:
## Table of Contents

- `RPC_URL`: The RPC URL of an EVM node
- `PRIVATE_KEY`: The private key to use

Note that foundry offers different wallet options, for more info see `$ forge script -h`.
- [Management](#management)
- [Table of Contents](#table-of-contents)
- [Environment Variables](#environment-variables)
- [Functions](#functions)
- [`IAuth::rely`](#iauthrely)
- [`IAuth::deny`](#iauthdeny)
- [`IToll::kiss`](#itollkiss)
- [`IToll::diss`](#itolldiss)

## Deployment
## Environment Variables

Set the following environment variables:
- `ETHERSCAN_API_KEY`: The Etherscan API key for the Etherscan's chain instance
- `INITIAL_AUTHED`: The address being auth'ed on the newly deployed `Greenhouse` instance

Run:
```bash
$ forge script \
--private-key $PRIVATE_KEY \
--broadcast \
--rpc-url $RPC_URL \
--etherscan-api-key $ETHERSCAN_API_KEY \
--verify \
--sig $(cast calldata "deploy(address)" $INITIAL_AUTHED) \
-vvv \
script/Greenhouse.s.sol:GreenhouseScript
```
The following environment variables must be set for all commands:

- `RPC_URL`: The RPC URL of an EVM node
- `PRIVATE_KEY`: The private key to use
- `GREENHOUSE`: The `Greenhouse` instance to manage

## Management
Note that an `.env.example` file is provided in the project root. To set all environment variables at once, create a copy of the file and rename the copy to `.env`, adjust the variable's values', and run `source .env`.

The following environment variables are necessary for all management commands:
- `GREENHOUSE`: The `Greenhouse` instance's address
## Functions

### `IAuth::rely`

Set the following environment variables:

- `WHO`: The address to grant auth to

Run:

```bash
$ forge script \
--private-key $PRIVATE_KEY \
Expand All @@ -53,9 +46,11 @@ $ forge script \
### `IAuth::deny`

Set the following environment variables:

- `WHO`: The address renounce auth from

Run:

```bash
$ forge script \
--private-key $PRIVATE_KEY \
Expand All @@ -69,9 +64,11 @@ $ forge script \
### `IToll::kiss`

Set the following environment variables:

- `WHO`: The address grant toll to

Run:

```bash
$ forge script \
--private-key $PRIVATE_KEY \
Expand All @@ -85,9 +82,11 @@ $ forge script \
### `IToll::diss`

Set the following environment variables:

- `WHO`: The address renounce toll from

Run:

```bash
$ forge script \
--private-key $PRIVATE_KEY \
Expand Down
File renamed without changes.

0 comments on commit 4501bf6

Please sign in to comment.