Skip to content

Commit

Permalink
refactor: more cleaning up, moving files, updating docs
Browse files Browse the repository at this point in the history
  • Loading branch information
arwer13 committed Oct 12, 2023
1 parent c860aeb commit fe1cf4d
Show file tree
Hide file tree
Showing 11 changed files with 15 additions and 492 deletions.
34 changes: 0 additions & 34 deletions dao-local-start-protocol.sh

This file was deleted.

32 changes: 12 additions & 20 deletions docs/scratch-deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,15 @@
## General info

The repo contains bash scripts for deployment of the DAO under multiple environments:
- local node (ganache, anvil, hardhat network) - `dao-local-deploy.sh`
- goerli testnet - `dao-goerli-deploy.sh`
- local node (ganache, anvil, hardhat network) `dao-local-deploy.sh`
- holesky testnet - `dao-holesky-deploy.sh`

The protocol has a bunch of parameters to configure for the scratch deployment. The default configuration is stored in files `deployed-<deploy env>-defaults.json`, where `<deploy env>` is the target environment. Currently there is single default configuration `deployed-testnet-defaults.json` suitable for testnet deployments. Compared to the mainnet configuration, it has lower vote durations, more frequent oracle report cycles, etc. Part of the parameters require further specification -- they are marked with `null` values.
During the deployment, the "default" configuration is copied to `deployed-<network name>.json`, where `<network name>` is the name of a network configuration defined in `hardhat.config.js`. The file `deployed-<network name>.json` gets populated with the contract addresses and transaction hashes during the deployment process.

These are the deployment setups, supported currently:
- local (basically any node at http://127.0.0.1:8545);
- Goerli.
- Holešky testnet.

Each is described in the details in the sections below.

Expand Down Expand Up @@ -65,7 +64,7 @@ The node must be configured with the default test accounts derived from mnemonic
1. Run `yarn install` (get sure repo dependencies are installed)
2. Run the node on default port 8545 (for the commands see subsections below)
3. Set test account private key `0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80` to `accounts.json` under `/eth/local` like `"local": ["<private key>"]` (see `accounts.sample.json` for example)
4. Run the deploy script `bash dao-local-deploy.sh` from root repo directory
4. Run the deploy script `bash scripts/scratch/dao-local-deploy.sh` from root repo directory
5. Check out the deploy artifacts in `deployed-local.json`

### Anvil
Expand All @@ -85,29 +84,23 @@ To run hardhat node execute:
yarn hardhat node
```

## Goerli deployment
## Holešky deployment

To do Goerli deployment, the following parameters must be set up via env variables:
To do Holešky deployment, the following parameters must be set up via env variables:

- `DEPLOYER`. The deployer address, you must have its private key. It must have enough ether.
- `RPC_URL`. Address of of the Ethereum RPC node to use. E.g. for Infura it is `https://goerli.infura.io/v3/<yourProjectId>`
- `RPC_URL`. Address of of the Ethereum RPC node to use. E.g. for Infura it is `https://holesky.infura.io/v3/<yourProjectId>`
- `GAS_PRIORITY_FEE`. Gas priority fee. By default set to `2`
- `GAS_MAX_FEE`. Gas max fee. By default set to `100`
- `GATE_SEAL_FACTORY`. Address of the [GateSeal Factory](https://github.com/lidofinance/gate-seals) contract. Must be deployed preliminary. Can be set to any `0x0000000000000000000000000000000000000000` to debug deployment.

Also you need to specify `DEPLOYER` private key in `accounts.json` under `/eth/goerli` like `"goerli": ["<key>"]`. See `accounts.sample.json` for an example.

To start the deployment, run (the env variables must already defined):
```shell
bash dao-goerli-deploy.sh
```
and checkout `deployed-goerli.json`.

## Holešky deployment
Also you need to specify `DEPLOYER` private key in `accounts.json` under `/eth/holesky` like `"holesky": ["<key>"]`. See `accounts.sample.json` for an example.

To start the deployment, run (the env variables must already defined) from root repo directory:
```shell
RPC_URL=<PUT-YOUR-VALUE> GATE_SEAL=<PUT-YOUR-VALUE> DEPLOYER=<PUT-YOUR-VALUE> bash dao-holesky-deploy.sh
bash scripts/scratch/dao-holesky-deploy.sh
```
Deploy artifacts information will be store in `deployed-holesky.json`.

## Publishing sources to Etherscan

Expand Down Expand Up @@ -163,10 +156,9 @@ NB, that part of the actions require preliminary granting of the required roles,
await stakingRouter.renounceRole(STAKING_MODULE_MANAGE_ROLE, agent.address, { from: agent.address })
```


## Protocol parameters

This section describes part of the parameters and their values used at the deployment. The values are specified in `deployed-testnet-defaults.json`. The subsections below describes values of the parameters.
This section describes part of the parameters and their values used at the deployment. The values are specified in `deployed-testnet-defaults.json`.

### OracleDaemonConfig

Expand Down Expand Up @@ -194,4 +186,4 @@ PREDICTION_DURATION_IN_SLOTS=50400 # 7 days
# Max period of delay for requests finalization in case of bunker due to negative rebase
# twice min governance response time - 3 days voting duration
FINALIZATION_MAX_NEGATIVE_REBASE_EPOCH_SHIFT=1350 # 6 days
```
```
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@
"deploy:app-staking-providers-registry": "APPS=staking-providers-registry yarn deploy:apps",
"apps:lido": "yarn --cwd ./apps/lido/app/ cli",
"apps:nos": "yarn --cwd ./apps/node-operators-registry/app/ cli",
"lido:apps": "concurrently \"yarn apps:lido\" \"yarn apps:oracle\" \"yarn apps:nos\" ",
"aragon:start": "node scripts/start-aragon.js",
"lido:start": "hardhat node& yarn deploy:all && yarn lido:apps& hardhat run --no-compile scripts/start-aragon.js"
"lido:apps": "concurrently \"yarn apps:lido\" \"yarn apps:oracle\" \"yarn apps:nos\" "
},
"devDependencies": {
"@aragon/apps-agent": "^2.0.0",
Expand Down
9 changes: 0 additions & 9 deletions scratch-acceptance-test-goerlidebug.sh

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ export CHAIN_ID=17000
export GAS_PRIORITY_FEE="${GAS_PRIORITY_FEE:=1}"
export GAS_MAX_FEE="${GAS_MAX_FEE:=100}"

bash dao-deploy.sh
bash scripts/scratch/dao-deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ export GAS_MAX_FEE=100
export NETWORK_STATE_FILE="deployed-${NETWORK}.json"
export NETWORK_STATE_DEFAULTS_FILE="deployed-testnet-defaults.json"

bash dao-deploy.sh
bash scripts/scratch/dao-deploy.sh
119 changes: 0 additions & 119 deletions scripts/start-aragon.js

This file was deleted.

106 changes: 0 additions & 106 deletions scripts/utils/31-start-protocol.js

This file was deleted.

Loading

0 comments on commit fe1cf4d

Please sign in to comment.