Decentralized staking and asset management
Casimir is a complete platform that allows users to monitor, move, and stake their assets while holding their own keys. With Casimir staking, users can easily and securely move funds in and out of decentralized staking pools that are operated by high-performing validators.
Get started contributing to Casimir's codebase.
Configure the following prerequisite global dependency versions:
-
π© GitHub submodule support: You also need to make sure to have at least one SSH authentication key on your GitHub account (for the git cloning of submodules within submodules). See Adding a new SSH key to your GitHub account.
-
π© Using NVM: Install NVM and run
nvm install --lts && nvm alias default lts/*
to set the default version to the latest LTS. You will need to rerun this command whenever the latest LTS changes. -
π© Consensus Networks team only: Create an AWS profile named
consensus-networks-dev
.
Clone the repository and checkout a new branch from develop:
git clone https://github.com/consensusnetworks/casimir.git
cd casimir
git checkout -b <"feature || bug || enhancement">/<"your-branch-name" develop
We are using npm workspaces to simplify monorepo development workflows while keeping project-wide resources accessible. The core commands are below.
Install all repository dependencies and build necessary types:
npm install
Clean all repository dependencies and reinstall:
npm run clean
Install a dev dependency to the root:
npm install -D some-dev-dependency
Install a dependency or dev dependency to a specific workspace:
# dependency
npm install some-dependency --workspace @casimir/<"workspace-name">
# dev dependency
npm install -D some-dev-dependency --workspace @casimir/<"workspace-name">
Customize and override the development environment configuration by creating a .env file in the root directory.
If you are on the Consensus Networks organization, make sure your AWS CLI and profile are configured correctly. By default, the scripts look for the consensus-networks-dev
named profile, but you can override the AWS_PROFILE
name to be used in the .env file. Optionally, override the AWS_PROFILE
name in your .env file:
# From the root directory
echo "AWS_PROFILE=<"your-aws-profile-name">" > .env
If you are outside of the Consensus Networks organization, set USE_SECRETS
to false
in your .env file:
# From the root directory
echo "USE_SECRETS=false" > .env
Name | Description | Default |
---|---|---|
USE_SECRETS |
Whether to use AWS secrets (set false for external access) | true |
AWS_PROFILE |
AWS profile name for accessing secrets | consensus-networks-dev |
PROJECT |
Project name | casimir |
STAGE |
Environment stage name (`prod | |
ETHEREUM_FORK_BLOCK |
Starting block number for local fork network | (current block) |
ETHEREUM_RPC_URL |
Ethereum RPC network URL | http://127.0.0.1:8545 |
NETWORK |
Network name (`mainnet | |
FORK |
Fork network name (`mainnet | |
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 |
BUILD_PREVIEW |
Whether to preview web app production build | false |
The apps packages provide a UI to end-users.
Run the main web app with an integrated development environment, including local contracts and services:
# From the root directory
npm run dev
See the @casimir/app README.md for detailed documentation.
Run the landing page app:
# From the root directory
npm run dev:www
See the @casimir/www README.md for detailed documentation.
The contracts packages provide the smart contracts for the project.
Test the Ethereum contracts:
# From the root directory
npm run test --workspace @casimir/ethereum
See the @casimir/ethereum README.md for detailed documentation.
The common packages provide shared code for the project:
- @casimir/aws: AWS helpers
- @casimir/data: data schemas and operational workflows
- @casimir/ssv: SSV helpers
- @casimir/types: shared types
- @casimir/uniswap: Uniswap helpers
- @casimir/wallets: wallet helpers
Check for a README.md file in each common package directory for detailed usage instructions.
The infrastructure packages provide the infrastructure as code for the project.
Test the CDK infrastructure:
# From the root directory
npm run test:cdk
See the @casimir/cdk README.md for detailed documentation.
The services packages provide the backend services for the project:
- @casimir/crawler: analytics crawler
- @casimir/functions: Chainlink Functions source code
- [@casimir/nodes]: relevant node configurations
- @casimir/oracle: DAO oracle
- @casimir/users: users server and database
Code is organized into work directories (apps, common, contracts, infrastructure, services, scripts, and more listed below).
βββ .github/ (workflows and issue templates)
| βββ workflows/ (gh actions workflows)
βββ apps/ (frontend apps)
| |ββ www/ (landing page app)
| βββ app/ (main web app)
βββ common/ (shared code)
| βββ data/ (data schemas and operational workflows)
| βββ helpers/ (general utilities)
βββ contracts/ (blockchain contracts)
| βββ ethereum/ (ethereum contracts)
βββ infrastructure/ (deployment resources)
| βββ cdk/ (aws stacks)
βββ scripts/ (devops and build scripts)
| βββ ethereum/ (ethereum test and dev scripts)
| βββ root/ (root install and dev scripts)
βββ services/ (backend services)
| βββ oracle/ (oracle service)
| βββ users/ (users service)
βββ package.json (project-wide npm dependencies and scripts)
This respository is available as open source under the terms of the Apache License.