Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to SSV version of DKG #432

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@
"quotes": ["error", "single"]
},
"ignorePatterns": [
"contracts/**/scripts/resources",
"scripts/**/resources",
"lib",
"cdk.out",
"*.js"
]
Expand Down
15 changes: 8 additions & 7 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
[submodule "contracts/ethereum/scripts/resources/ssv-network"]
path = contracts/ethereum/scripts/resources/ssv-network
url = https://github.com/bloxapp/ssv-network.git
branch = jato-v2
[submodule "contracts/ethereum/lib/forge-std"]
path = contracts/ethereum/lib/forge-std
url = https://github.com/foundry-rs/forge-std
[submodule "services/oracle/scripts/resources/rockx-dkg-cli"]
path = services/oracle/scripts/resources/rockx-dkg-cli
url = https://github.com/consensusnetworks/rockx-dkg-cli.git
[submodule "contracts/ethereum/lib/ssv-network"]
path = contracts/ethereum/lib/ssv-network
url = https://github.com/bloxapp/ssv-network.git
branch = jato-v2
[submodule "services/oracle/lib/dkg"]
path = services/oracle/lib/dkg
url = https://github.com/consensusnetworks/ssv-dkg.git
branch = feature/operator-env
1 change: 0 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,5 @@
"typescript"
],
"css.lint.unknownAtRules": "ignore",
"jupyter.notebookFileRoot": "${fileDirname}",
"volar.inlayHints.eventArgumentInInlineHandlers": false
}
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,7 @@ echo "USE_SECRETS=false" > .env
| `ETHEREUM_RPC_URL` | Ethereum RPC network URL | `http://127.0.0.1:8545` |
| `NETWORK` | Network name (`mainnet || testnet || hardhat || localhost`) | `localhost` |
| `FORK` | Fork network name (`mainnet || testnet || hardhat`) | `testnet` |
| `MANAGER_ADDRESS` | Manager contract address | (predicted manager address) |
| `VIEWS_ADDRESS` | Views contract address | (predicted views address) |
| `FACTORY_ADDRESS` | Base factory contract address | (predicted factory address) |
| `CRYPTO_COMPARE_API_KEY` | CryptoCompare API key | `` |
| `TUNNEL` | Whether to tunnel local network RPC URLs (for remote wallets) | `false` |
| `MOCK_SERVICES` | Whether to mock backend services | `true` |
Expand Down
12 changes: 3 additions & 9 deletions apps/web/src/composables/environment.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
export default function useEnvironment() {
const domain = window.location.host
const origin = window.location.origin
const managerAddress = import.meta.env.PUBLIC_MANAGER_ADDRESS
if (!managerAddress) throw new Error('No manager address provided')
const viewsAddress = import.meta.env.PUBLIC_VIEWS_ADDRESS
if (!viewsAddress) throw new Error('No views address provided')
const registryAddress = import.meta.env.PUBLIC_REGISTRY_ADDRESS
if (!registryAddress) throw new Error('No registry address provided')
const factoryAddress = import.meta.env.PUBLIC_FACTORY_ADDRESS
if (!factoryAddress) throw new Error('No factory address provided')
const usersUrl = import.meta.env.PUBLIC_USERS_URL || 'http://localhost:4000'
const ethereumUrl = import.meta.env.PUBLIC_ETHEREUM_RPC_URL || 'http://127.0.0.1:8545'
const ledgerType = import.meta.env.PUBLIC_SPECULOS_URL ? 'speculos' : 'usb'
Expand All @@ -22,13 +18,11 @@ export default function useEnvironment() {
ethereumUrl,
origin,
ledgerType,
managerAddress,
registryAddress,
factoryAddress,
speculosUrl,
ssvNetworkAddress,
ssvViewsAddress,
usersUrl,
viewsAddress,
walletConnectProjectId
}
}
8 changes: 4 additions & 4 deletions apps/web/src/composables/operators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,11 @@ export default function useOperators() {
]

for (const poolId of poolIds) {
const poolDetails = await views.getPool(poolId)
const poolConfig = await views.getPoolConfig(poolId)
const pool = {
...poolDetails,
operatorIds: poolDetails.operatorIds.map(id => id.toNumber()),
reshares: poolDetails.reshares.toNumber()
...poolConfig,
operatorIds: poolConfig.operatorIds.map(id => id.toNumber()),
reshares: poolConfig.reshares.toNumber()
}
if (pool.operatorIds.includes(operatorId)) {
pools.push(pool)
Expand Down
40 changes: 1 addition & 39 deletions common/data/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Casimir Data

Casimir schemas, databases, and notebooks for data modeling, exploration, and analytics
Casimir database JSON schemas

## Schemas

Expand All @@ -15,41 +15,3 @@ Find the core JSON schemas in [src/schemas](src/schemas). These are the source o
| Users (Postgres) | `nonces` | [nonce.schema.json](src/schemas/nonce.schema.json) | User auth nonces |
| Users (Postgres) | `users` | [user.schema.json](src/schemas/user.schema.json) | User profiles |
| Users (Postgres) | `user_accounts` | [user_account.schema.json](src/schemas/user_account.schema.json) | User account relations |

## Notebooks

The Jupyter Notebooks in [notebooks/](notebooks/) are a supplement for data work, including a documented Athena query sandbox, system diagrams, and flowcharts.

### Prerequisites

Make sure your development environment has these prerequisites.

1. [Python (v3.x)](https://www.python.org/downloads/) – we use [pyenv](https://github.com/pyenv/pyenv#installation) to manage Python versions.

2. [Poetry](https://python-poetry.org/docs/#installation) – this manages and packages Python dependencies.

3. [AWS CLI (v2.x)](https://aws.amazon.com/cli/) – create an [AWS profile](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) named `consensus-networks-dev`.

4. [Jupyter VSCode Extension](https://marketplace.visualstudio.com/items?itemName=ms-toolsai.jupyter) – this gives us a complete Jupyter Notebook environment in VSCode.

### Setup

With the Poetry and the Jupyter VSCode Extension, we have a one-time setup.

1. Install dependencies and create a Jupyter kernel.

```zsh
cd common/data
poetry install
poetry run ipython kernel install --user --name=casimir-data
```

> 🚩 If you have node and npm already set up for this repo, you can run `npm run configure:python --workspace @casimir/data` from the root directory instead.

2. Restart VSCode (Jupyter needs this to see your new kernel).

3. Open one of the notebooks in `notebooks/` and select the kernel dropdown in the top right – choose the option with casimir-data in the name.

Now you can run cells in the notebooks upon returning to this workspace in VSCode.

> 🚩 To change Python dependencies for the notebook environment, change into this directory (`cd common/data`) and use the poetry CLI `poetry add <package>` or `poetry remove <package>`.
Loading