Skip to content

Commit

Permalink
docs: Update to use keystore wallets
Browse files Browse the repository at this point in the history
  • Loading branch information
pmerkleplant committed Jun 27, 2024
1 parent 800d60d commit 629dd56
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 33 deletions.
3 changes: 2 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Wallet Management
export PRIVATE_KEY=
export KEYSTORE=
export KEYSTORE_PASSWORD=""

# RPC URL
export RPC_URL=
Expand Down
9 changes: 6 additions & 3 deletions docs/Deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ This document describes how to deploy `Scribe` and `ScribeOptimistic` instance v
The following environment variables must be set:

- `RPC_URL`: The RPC URL of an EVM node
- `PRIVATE_KEY`: The private key to use
- `KEYSTORE`: The path to the keystore file containing the encrypted private key
- Note that password can either be entered on request or set via the `KEYSTORE_PASSWORD` environment variable
- `KEYSTORE_PASSWORD`: The password for the keystore file
- `ETHERSCAN_API_URL`: The Etherscan API URL for the Etherscan's chain instance
- Note that the API endpoint varies per Etherscan chain instance
- Note to point to actual API endpoint (e.g. `/api`) and not just host
Expand All @@ -24,7 +26,7 @@ Note that an `.env.example` file is provided in the project root. To set all env
To easily check the environment variables, run:

```bash
$ env | grep -e "RPC_URL" -e "PRIVATE_KEY" -e "ETHERSCAN_API_URL" -e "ETHERSCAN_API_KEY" -e "GREENHOUSE" -e "SALT" -e "INITIAL_AUTHED"
$ env | grep -e "RPC_URL" -e "KEYSTORE" -e "KEYSTORE_PASSWORD" -e "ETHERSCAN_API_URL" -e "ETHERSCAN_API_KEY" -e "GREENHOUSE" -e "SALT" -e "INITIAL_AUTHED"
```

## Code Adjustments
Expand All @@ -43,7 +45,8 @@ Deployment:
```bash
$ SALT_BYTES32=$(cast format-bytes32-string $SALT) && \
forge script \
--private-key "$PRIVATE_KEY" \
--keystore "$KEYSTORE" \
--password "$KEYSTORE_PASSWORD" \
--broadcast \
--rpc-url "$RPC_URL" \
--sig "$(cast calldata "deploy(address,bytes32,address)" "$GREENHOUSE" "$SALT_BYTES32" "$INITIAL_AUTHED")" \
Expand Down
68 changes: 39 additions & 29 deletions docs/Management.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,16 @@ This document describes how to manage deployed `SelfKisser` instances.
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
- `KEYSTORE`: The path to the keystore file containing the encrypted private key
- `KEYSTORE_PASSWORD`: The password of the keystore file
- `SELF_KISSER`: The `SelfKisser` instance to manage

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`.

To easily check the environment variables, run:

```bash
$ env | grep -e "RPC_URL" -e "PRIVATE_KEY" -e "SELF_KISSER"
$ env | grep -e "RPC_URL" -e "KEYSTORE" -e "KEYSTORE_PASSWORD" -e "SELF_KISSER"
```

## Functions
Expand All @@ -44,10 +45,11 @@ Run:

```bash
$ forge script \
--private-key $PRIVATE_KEY \
--keystore "$KEYSTORE" \
--password "$KEYSTORE_PASSWORD" \
--broadcast \
--rpc-url $RPC_URL \
--sig $(cast calldata "selfKiss(address,address)" $SELF_KISSER $ORACLE) \
--rpc-url "$RPC_URL" \
--sig $(cast calldata "selfKiss(address,address)" "$SELF_KISSER" "$ORACLE") \
-vvv \
script/SelfKisser.s.sol:SelfKisserScript
```
Expand All @@ -63,10 +65,11 @@ Run:

```bash
$ forge script \
--private-key $PRIVATE_KEY \
--keystore "$KEYSTORE" \
--password "$KEYSTORE_PASSWORD" \
--broadcast \
--rpc-url $RPC_URL \
--sig $(cast calldata "selfKiss(address,address,address)" $SELF_KISSER $ORACLE $WHO) \
--rpc-url "$RPC_URL" \
--sig $(cast calldata "selfKiss(address,address,address)" "$SELF_KISSER" "$ORACLE" "$WHO") \
-vvv \
script/SelfKisser.s.sol:SelfKisserScript
```
Expand All @@ -81,10 +84,11 @@ Run:

```bash
$ forge script \
--private-key $PRIVATE_KEY \
--keystore "$KEYSTORE" \
--password "$KEYSTORE_PASSWORD" \
--broadcast \
--rpc-url $RPC_URL \
--sig $(cast calldata "support(address,address)" $SELF_KISSER $ORACLE) \
--rpc-url "$RPC_URL" \
--sig $(cast calldata "support(address,address)" "$SELF_KISSER" "$ORACLE") \
-vvv \
script/SelfKisser.s.sol:SelfKisserScript
```
Expand All @@ -99,10 +103,11 @@ Run:

```bash
$ forge script \
--private-key $PRIVATE_KEY \
--keystore "$KEYSTORE" \
--password "$KEYSTORE_PASSWORD" \
--broadcast \
--rpc-url $RPC_URL \
--sig $(cast calldata "unsupport(address,address)" $SELF_KISSER $ORACLE) \
--rpc-url "$RPC_URL" \
--sig $(cast calldata "unsupport(address,address)" "$SELF_KISSER" "$ORACLE") \
-vvv \
script/SelfKisser.s.sol:SelfKisserScript
```
Expand All @@ -117,10 +122,11 @@ Run:

```bash
$ forge script \
--private-key $PRIVATE_KEY \
--keystore "$KEYSTORE" \
--password "$KEYSTORE_PASSWORD" \
--broadcast \
--rpc-url $RPC_URL \
--sig $(cast calldata "kill(address)" $SELF_KISSER) \
--rpc-url "$RPC_URL" \
--sig $(cast calldata "kill(address)" "$SELF_KISSER") \
-vvv \
script/SelfKisser.s.sol:SelfKisserScript
```
Expand All @@ -135,10 +141,11 @@ Run:

```bash
$ forge script \
--private-key $PRIVATE_KEY \
--keystore "$KEYSTORE" \
--password "$KEYSTORE_PASSWORD" \
--broadcast \
--rpc-url $RPC_URL \
--sig $(cast calldata "rely(address,address)" $SELF_KISSER $WHO) \
--rpc-url "$RPC_URL" \
--sig $(cast calldata "rely(address,address)" "$SELF_KISSER" "$WHO") \
-vvv \
script/SelfKisser.s.sol:SelfKisserScript
```
Expand All @@ -153,10 +160,11 @@ Run:

```bash
$ forge script \
--private-key $PRIVATE_KEY \
--keystore "$KEYSTORE" \
--password "$KEYSTORE_PASSWORD" \
--broadcast \
--rpc-url $RPC_URL \
--sig $(cast calldata "deny(address,address)" $SELF_KISSER $WHO) \
--rpc-url "$RPC_URL" \
--sig $(cast calldata "deny(address,address)" "$SELF_KISSER" "$WHO") \
-vvv \
script/SelfKisser.s.sol:SelfKisserScript
```
Expand All @@ -171,10 +179,11 @@ Run:

```bash
$ forge script \
--private-key $PRIVATE_KEY \
--keystore "$KEYSTORE" \
--password "$KEYSTORE_PASSWORD" \
--broadcast \
--rpc-url $RPC_URL \
--sig $(cast calldata "kiss(address,address)" $SELF_KISSER $WHO) \
--rpc-url "$RPC_URL" \
--sig $(cast calldata "kiss(address,address)" "$SELF_KISSER" "$WHO") \
-vvv \
script/SelfKisser.s.sol:SelfKisserScript
```
Expand All @@ -189,10 +198,11 @@ Run:

```bash
$ forge script \
--private-key $PRIVATE_KEY \
--keystore "$KEYSTORE" \
--password "$KEYSTORE_PASSWORD" \
--broadcast \
--rpc-url $RPC_URL \
--sig $(cast calldata "diss(address,address)" $SELF_KISSER $WHO) \
--rpc-url "$RPC_URL" \
--sig $(cast calldata "diss(address,address)" "$SELF_KISSER" "$WHO") \
-vvv \
script/SelfKisser.s.sol:SelfKisserScript
```

0 comments on commit 629dd56

Please sign in to comment.