Skip to content

Commit

Permalink
Add a sushiswap stack with contract deployments
Browse files Browse the repository at this point in the history
  • Loading branch information
prathamesh0 committed Aug 7, 2023
1 parent 4227693 commit 4bce2fb
Show file tree
Hide file tree
Showing 11 changed files with 106 additions and 0 deletions.
14 changes: 14 additions & 0 deletions app/data/compose/docker-compose-watcher-sushiswap.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: '3.2'

services:
# Deploys the core (UniswapV3Factory) contract
sushiswap-v3-core:
image: cerc/sushiswap-v3-core:local
env_file:
- ../config/watcher-sushiswap/contract-deployment.env

# Deploys the periphery (NFPM, token, etc.) contracts
sushiswap-v3-periphery:
image: cerc/sushiswap-v3-periphery:local
env_file:
- ../config/watcher-sushiswap/contract-deployment.env
3 changes: 3 additions & 0 deletions app/data/config/watcher-sushiswap/contract-deployment.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ETH_RPC_ENDPOINT="http://lotus-node-1:1234/rpc/v1"
CHAIN_ID=31415926
ACCOUNT_PRIVATE_KEY="0xc05fd3613bcd62a4f25e5eba1f464d0b76d74c3f771a7c2f13e26ad6439444b3"
14 changes: 14 additions & 0 deletions app/data/container-build/cerc-sushiswap-v3-core/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM node:18.15.0-alpine3.16

RUN apk --update --no-cache add git python3 alpine-sdk bash
RUN curl -L https://unpkg.com/@pnpm/self-installer | node

WORKDIR /app

COPY . .

RUN echo "Installing dependencies..." && \
pnpm install

# Keep container running for commands to be executed
CMD ["tail", "-f"]
7 changes: 7 additions & 0 deletions app/data/container-build/cerc-sushiswap-v3-core/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

# Build cerc/sushiswap-v3-core
source ${CERC_CONTAINER_BASE_DIR}/build-base.sh
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )

docker build -t cerc/sushiswap-v3-core:local -f ${SCRIPT_DIR}/Dockerfile ${build_command_args} ${CERC_REPO_BASE_DIR}/sushiswap-v3-core
13 changes: 13 additions & 0 deletions app/data/container-build/cerc-sushiswap-v3-periphery/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM node:18.15.0-alpine3.16

RUN apk --update --no-cache add git python3 alpine-sdk bash

WORKDIR /app

COPY . .

RUN echo "Installing dependencies..." && \
yarn install

# Keep container running for commands to be executed
CMD ["tail", "-f"]
7 changes: 7 additions & 0 deletions app/data/container-build/cerc-sushiswap-v3-periphery/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

# Build cerc/sushiswap-v3-periphery
source ${CERC_CONTAINER_BASE_DIR}/build-base.sh
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )

docker build -t cerc/sushiswap-v3-periphery:local -f ${SCRIPT_DIR}/Dockerfile ${build_command_args} ${CERC_REPO_BASE_DIR}/sushiswap-v3-periphery
2 changes: 2 additions & 0 deletions app/data/container-image-list.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,5 @@ cerc/lotus
cerc/go-opera
cerc/lasso
cerc/reth
cerc/sushiswap-v3-core
cerc/sushiswap-v3-periphery
1 change: 1 addition & 0 deletions app/data/pod-list.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@ fixturenet-lotus
mainnet-go-opera
lasso
reth
watcher-sushiswap
2 changes: 2 additions & 0 deletions app/data/repository-list.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,5 @@ git.vdb.to/cerc-io/test-project
github.com/Fantom-foundation/go-opera
github.com/cerc-io/lasso
github.com/paradigmxyz/reth
github.com/cerc-io/sushiswap-v3-core
github.com/cerc-io/sushiswap-v3-periphery
25 changes: 25 additions & 0 deletions app/data/stacks/sushiswap/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# SushiSwap

## Setup

Clone required repositories:

```bash
laconic-so --stack sushiswap setup-repositories

# If this throws an error as a result of being already checked out to a branch/tag in a repo, remove the conflicting repositories and re-run the command
```

Build the container images:

```bash
laconic-so --stack sushiswap build-containers
```

## Deploy

Deploy the stack:

```bash
laconic-so --stack sushiswap deploy --cluster lotus up
```
18 changes: 18 additions & 0 deletions app/data/stacks/sushiswap/stack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
version: "1.0"
name: sushiswap
description: "End-to-end SushiSwap watcher stack"
repos:
## fixturenet-lotus repo
- github.com/filecoin-project/lotus
## sushiswap repos
- github.com/cerc-io/sushiswap-v3-core
- github.com/cerc-io/sushiswap-v3-periphery
containers:
## fixturenet-lotus image
- cerc/lotus
## sushiswap images
- cerc/sushiswap-v3-core
- cerc/sushiswap-v3-periphery
pods:
- fixturenet-lotus
- watcher-sushiswap

0 comments on commit 4bce2fb

Please sign in to comment.