-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from hollygrimm/sepolia
int for tokens instead of wei; deploy contracts to sepolia
- Loading branch information
Showing
44 changed files
with
6,553 additions
and
171 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
# Testnet Deployment | ||
|
||
|
||
## Installation | ||
|
||
First, install the required Node.js modules and generate a local `.env` file containing private keys for various services. Run the following commands: | ||
|
||
```bash | ||
(cd hardhat && yarn install) | ||
./stack print-env > .env | ||
``` | ||
|
||
## Booting the Stack | ||
|
||
### 1 - Bacalhau | ||
|
||
To run a Bacalhau node on the same machine as the resource provider, follow these steps: | ||
|
||
```bash | ||
# install the latest bacalhau which works with GPUs (https://github.com/bacalhau-project/bacalhau/issues/2858) | ||
wget https://github.com/bacalhau-project/bacalhau/releases/download/v1.0.3/bacalhau_v1.0.3_linux_amd64.tar.gz | ||
tar xfv bacalhau_v1.0.3_linux_amd64.tar.gz | ||
mv bacalhau /usr/local/bin | ||
# configure this to where you want the ipfs data to be stored | ||
export BACALHAU_SERVE_IPFS_PATH=/tmp/lilypad/data/ipfs | ||
# run bacalhau as both compute node and requester node | ||
./stack bacalhau-serve | ||
``` | ||
|
||
## Create Seven New Accounts | ||
|
||
Follow the `README.md` in the `generate_accts` directory to create seven new accounts. | ||
|
||
Copy `hardhat/.env.sample` to `.env` and update the following environment variables: | ||
``` | ||
ADDRESS_ADMIN= | ||
PRIVATE_KEY_ADMIN= | ||
ADDRESS_FAUCET= | ||
PRIVATE_KEY_FAUCET= | ||
ADDRESS_SOLVER= | ||
PRIVATE_KEY_SOLVER= | ||
ADDRESS_MEDIATOR= | ||
PRIVATE_KEY_MEDIATOR= | ||
ADDRESS_RESOURCE_PROVIDER= | ||
PRIVATE_KEY_RESOURCE_PROVIDER= | ||
ADDRESS_JOB_CREATOR= | ||
PRIVATE_KEY_JOB_CREATOR= | ||
ADDRESS_DIRECTORY= | ||
PRIVATE_KEY_DIRECTORY= | ||
``` | ||
|
||
## Create a new Infura Project | ||
|
||
Create a new Infura project and update the following environment variable in `hardhat/.env`: | ||
``` | ||
INFURA_KEY= | ||
``` | ||
|
||
Also add the infura key to the `.env` file: | ||
``` | ||
export INFURA_KEY= | ||
``` | ||
|
||
## Setup Hardhat | ||
|
||
set defaultNetwork to `sepolia` in `hardhat.config.js` | ||
|
||
Update the following values in the `.env` file. Replace `<INFURA_KEY>` with the Infura key from above: | ||
``` | ||
export NETWORK=sepolia | ||
export WEB3_RPC_URL=wss://sepolia.infura.io/ws/v3/<INFURA_KEY> | ||
export WEB3_CHAIN_ID=11155111 | ||
``` | ||
|
||
## Fund the Seven New Accounts | ||
|
||
Fund the `admin` acccount with .7 ETH. | ||
|
||
Fund the remaining six accounts with .1 ETH each. | ||
|
||
```bash | ||
./stack fund-services-ether | ||
``` | ||
|
||
Check the balances | ||
|
||
```bash | ||
./stack balances | ||
``` | ||
|
||
## Compile Contracts | ||
|
||
```bash | ||
./stack compile-contracts | ||
``` | ||
|
||
## Deploy Contracts | ||
|
||
```bash | ||
./stack deploy-contracts | ||
``` | ||
|
||
## Fund Services Tokens | ||
|
||
```bash | ||
./stack fund-services-tokens | ||
``` | ||
|
||
### Run Services | ||
|
||
Run the following commands in separate terminals: | ||
|
||
```bash | ||
./stack solver | ||
``` | ||
|
||
```bash | ||
./stack mediator | ||
``` | ||
|
||
```bash | ||
./stack resource-provider | ||
``` | ||
|
||
```bash | ||
./stack run cowsay:v0.0.1 -i Message="moo" | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
INFURA_KEY= | ||
ETHERSCAN_API_KEY= | ||
|
||
ADDRESS_ADMIN= | ||
PRIVATE_KEY_ADMIN= | ||
ADDRESS_FAUCET= | ||
PRIVATE_KEY_FAUCET= | ||
ADDRESS_SOLVER= | ||
PRIVATE_KEY_SOLVER= | ||
ADDRESS_MEDIATOR= | ||
PRIVATE_KEY_MEDIATOR= | ||
ADDRESS_RESOURCE_PROVIDER= | ||
PRIVATE_KEY_RESOURCE_PROVIDER= | ||
ADDRESS_JOB_CREATOR= | ||
PRIVATE_KEY_JOB_CREATOR= | ||
ADDRESS_DIRECTORY= | ||
PRIVATE_KEY_DIRECTORY= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
11155111 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"deployToken": 1698866546, | ||
"deployPayments": 1698866582, | ||
"deployStorage": 1698866604, | ||
"deployUsers": 1698866631, | ||
"deployMediation": 1698866654, | ||
"deployJobCreator": 1698866729, | ||
"deployController": 1698866787 | ||
} |
Oops, something went wrong.