Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Skate-Org/AVS
https://github.com/Skate-Org/AVS
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/Skate-Org/AVS
- Owner: Skate-Org
- License: other
- Created: 2024-05-10T08:24:16.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-05-29T03:30:16.000Z (8 months ago)
- Last Synced: 2024-05-29T16:24:51.953Z (8 months ago)
- Language: Go
- Size: 37.8 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-avs - Repo
- awesome-avs - Repo
README
# Skate AVS services
Built with target:
+ eigenlayer-contracts [v0.2.3-mainnet-m2](https://github.com/Layr-Labs/eigenlayer-contracts/releases/tag/v0.2.3-mainnet-m2)
+ eigenlayer-middleware [v0.1.3-mainnet-m2+pragma-change](https://github.com/Layr-Labs/eigenlayer-middleware/releases/tag/v0.1.3-mainnet-m2%2Bpragma-change)
+ eigensdk-go [v0.1.6](https://github.com/Layr-Labs/eigensdk-go/tree/cff810715271da986a7e594f7967a86fc4299834)---
# Quick start for operators
## Hardware/Software requirements
| Specification | Details |
|------------------------------|----------------------|
| Operating System | Linux x86-64 |
| vCPUs | 2 |
| Memory | 8 GiB |
| Storage | 256 GB |
| AWS EC2 Equivalent | [m5.large](https://aws.amazon.com/ec2/instance-types/) |
| **Network requirements** | |
| + Download Bandwidth Usage | <20 Mbps |
| + Upload Bandwidth Usage | <20 Mbps |## Onchain asset
### Holesky testnet
| Strategy | Minimum staked |
|--------------------------|----------------------|
| [stETH](0x7D704507b76571a51d9caE8AdDAbBFd0ba0e63d3) | 0.01 ETH |## Key set up using CLI tool (Skate-KMS) [Optional]
_**NOTE**: If you already have a [geth compatible](https://geth.ethereum.org/docs/developers/dapp-developer/native-accounts) keystore file generated by any other methods, skip this part_
Skate Key Management Service (KMS) is an utility tool to create and store encrypted private keys on your local machine.
Packages: [https://github.com/orgs/Skate-Org/packages/container/package/skate-kms](https://github.com/orgs/Skate-Org/packages/container/package/skate-kms).
Pull using:
```bash
docker pull ghcr.io/skate-org/skate-kms:latest
```Images is built from source code at `./kms`, see tag for exact commit.
To run, run the docker process with desired keystore mounted to image's `/keystore`
```bash
docker run --rm -i -v [local_folder_of_keystore]:/keystore ghcr.io/skate-org/skate-kms:latest store \
-p [password to unlock keystore file] -k [hexstring of privatekey WITHOUT '0x' prefix] \
[OPTIONAL] [local_config_for_signer]:/configs/signer/[path_to_save] -s [path_to save]
```---
Example for wallet 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 with private key ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80```bash
docker run --rm -i -v ./keystore:/keystore -v ./configs/signer:/configs/signer \
ghcr.io/skate-org/skate-kms:latest store \
-p hello_world -k ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 \
-s operator/1
```__WARNING ⚠️ - NEVER LEAK THE FILES IN `./keystore`. Wallet provided below are known for public testing, don't use it public environments__
## Operator processes
Packages: [https://github.com/orgs/Skate-Org/packages/container/package/skate-operator](https://github.com/orgs/Skate-Org/packages/container/package/skate-operator).
Pull using:
```bash
docker pull ghcr.io/skate-org/skate-operator:latest
```Images is built from source code at `./operator`, see tag for exact commit.
### Set up
1. Prepare a `keystore` folder contains geth compatible keystore file using "StandardScryptN" and "StandardScryptP" for encryption.
Can be created by following this [guideline](https://geth.ethereum.org/docs/developers/dapp-developer/native-accounts) or using __skate-kms CLI tool__ (see above)2. Set up environment and signer: prepare a `configs` folder:
+ **IMPORTANT**: Copy the format of "./configs" folder in this repo (contains information for skate-testnet and directory structure for operator)
+ Create a __YAML__ config for signer following this format
```yaml
# configs/signer/operator/1.yaml
address: [your_operator_addres]
passphrase: [passphrase_to_unlock_keystore]
```### Run the processes
Once set up, run the docker image with __mounted `keystore` and `configs` folders__ using following format.
Ensure that `configs` folder includes specs for Skate-AVS under `configs/environment/*.yaml````bash
docker run --rm -i -v [your_local_keystore]:/keystore -v [your_local_configs]:/configs \
ghcr.io/skate-org/skate-operator:latest [operator_cmd] [...options]
```The following commands set `[your_local_keystore]="./keystore"` and `[your_local_configs]="./configs"` following the above set up (in step 1),
i.e. command is invoked in the same directory with keystore and configs folder.The signer is set to `configs/signer/operator/1.yaml` using format in the set up above.
_NOTE: for customization, change according to your set up_
#### 1. Register operator with Eigenlayer
Following Eigenlayer guideline [https://docs.eigenlayer.xyz/eigenlayer/operator-guides/operator-installation#operator-configuration-and-registration](https://docs.eigenlayer.xyz/eigenlayer/operator-guides/operator-installation#operator-configuration-and-registration).
Or using skate-operator image
```bash
docker run --rm -i -v ./keystore:/keystore -v ./configs:/configs \
ghcr.io/skate-org/skate-operator:latest register-el \
--signer-config 1
```_**NOTE**: This register an address to EigenLayer with no metadata, follow official guidelines to customize_
#### 2. Deposit stETH to EigenLayer Strategy manager
_**NOTE**: Skip this step if your wallet already have stETH restaked in EigenLayer_
1. Get stETH, e.g. by calling submit from [stETH contract](https://holesky.etherscan.io/token/0x3f1c547b21f65e10480de3ad8e19faac46c95034#writeProxyContract).
Minimum 0.01 stETH.2. Deposit with skate-operator image
```bash
docker run --rm -i -v ./keystore:/keystore -v ./configs:/configs \
ghcr.io/skate-org/skate-operator:latest deposit \
--signer-config 1
```#### 3. Register Operator with Skate-AVS
```bash
docker run --rm -i -v ./keystore:/keystore -v ./configs:/configs \
ghcr.io/skate-org/skate-operator:latest register-avs \
--signer-config 1
```_NOTE: Testnet - check the registration status by calling `isOperator` from [Skate AVS contract on Holesky](https://holesky.etherscan.io/address/0x5D592a255A4369982aA7Fb55C6CBc12c7103e5e4#readProxyContract)_
#### 4. Participate in monitoring tasks
```bash
docker run --rm -i -v ./keystore:/keystore -v ./configs:/configs \
ghcr.io/skate-org/skate-operator:latest monitor \
--signer-config 1
```This will run the operator process that:
1. Monitor all tasks that submitted to SkateApp
2. Encoded them using Skate standard
3. Sign the task
4. Send the signatures to our relayer at `relayer.skatechain.org`_NOTE: Detailed logic for signing and broadcasting at `operator/monitor/skateapp.go`_
---
# From sources
## CLI tools
All CLI tools come with help, if you are curious about how things work underneath. Try
`go run /main.go -h`
for example:
```bash
go run kms/main.go store -h
```**@For dev** - entry point for each service is invoked from `/cmd/cmd.go`, traceback logic from there
### I. Configuring accounts
Key management service (kms) is an utility tool following the [geth guideline](https://geth.ethereum.org/docs/developers/dapp-developer/native-accounts)
To run, start with:
```bash
go run kms/main.go store -p -k [OPTIONAL] -s
```Key information will be dumped in `./keystore` folders and used for subsequent services.
__WARNING ⚠️ - NEVER LEAK THE FILES IN `./keystore`__
### II. Register Operator to Skate AVS
Command for Operator onboarding
#### Step 1: Register with EigenLayer to become an operator
```bash
go run operator/main.go register-el -h
```see `./operator/cmd/register.go:registerAvsCmd(..)` for full logic and options.
Default run with:
+ environment: `configs/environment/testnet.yaml`
+ signer: `configs/signer/operator/1.yaml`populate signer config for auto account import, else manually specify `--signer-address` and `--passphrase`
#### Step 2: Deposit into token strategy
1. AVS required minimum shares/stakes allowance to opt-in. Skate AVS (holesky testnet) uses [stETH](https://holesky.etherscan.io/token/0x3f1c547b21f65e10480de3ad8e19faac46c95034)
as the underlying token strategy. Get stETH buy calling submit function (recommend amount: 0.01 ETH)2. Once stETH is obtained, deposit into EigenLayer StrategyManager.
```bash
go run operator/main.go deposit -h
```Default value from config is the minimum required to participate in Skate AVS
Follow the same step to customize environments as in step 1
#### Step 3: Register with Skate AVS
```bash
go run operator/main.go register-avs -h
```Default options is good, same environments configuration as in step 1.
_**NOTE**: Default Operator details don't include any metadata URI. Other initialize params specified in `operator/cmd/register.go:L126`_
### III. Running Operator services
Operator will monitor Skate App (on Nollie testnet) activity and sign confirmation message then publish to relayer.
Cache is maintained locally on operator environments, db config in `operator/db/**`.
By default an SQLite db will be created under `data/operator/skateapp.db`, files logs for schemas maintained in the same folder.To participate (sign and publish task), run:
```bash
go run operator/monitor.go
```_NOTE: Follow default signer configs. if no signer provided, run with watch only-mode (no sign and publish to relayer)_
### IV. Running Relayer services
Relayer will collect operator signatures, aggregates and send over to AVS for confirmation (see `SkateAVS.sol:submitData(...)`)
1. Retrieve operator signatures for a task and store in database
```bash
go run relayer/main.go retrieve
```2. Publish verified quorums to AVS and settle on Gateway contract
```bash
go run relayer/main.go publish
```_To start all relayer service (retrieve and publish)_
```bash
make start-relayer
```## Quick start
Make files `./Makefile` contains shortcut to bootstrap pilot avs services.
Please explore and config respective nodes using designated CLI tools__Prerequisites: 3 operator accounts registered with avs and 1 relayer__
1. Start all 3 operators:
```bash
make start-operators
```---
## Deployment info### Testnet
See `configs/environment/testnet.yaml`
+ Skate App: [0x37D191232D6655D82a7ae6159E8d9D55F303E6B2](https://nolliescan.skatechain.org/address/0x37D191232D6655D82a7ae6159E8d9D55F303E6B2)
+ Skate AVS: [0x5D592a255A4369982aA7Fb55C6CBc12c7103e5e4](https://holesky.etherscan.io/address/0x5D592a255A4369982aA7Fb55C6CBc12c7103e5e4)
+ Skate Arbitrum Gateway: [0xc1Eb0ffdb88c59A043ab5B4fBf200795Cd5Acd03](https://sepolia.arbiscan.io/address/0xc1Eb0ffdb88c59A043ab5B4fBf200795Cd5Acd03)
+ Skate Solana Gateway (DEVNET): [6WLn4dADBiEZ2DTwJwawyj9bti7Az3EATkgMzL8yE8dk](https://solana.fm/address/6WLn4dADBiEZ2DTwJwawyj9bti7Az3EATkgMzL8yE8dk)