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

feat/deploy contracts #237

Merged
merged 51 commits into from
Jan 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
5c48eb8
ci: remove solis trigger
kwiss Jan 2, 2024
6f74794
fix: deployer
kwiss Jan 2, 2024
fd82fc1
fix: update deployer for goerli
kwiss Jan 3, 2024
09951a3
fix: deployer update deployer
kwiss Jan 4, 2024
29a619b
fix(deployer): update deployer, fix contract bug for executed
kwiss Jan 4, 2024
370ec11
fix: deployer
kwiss Jan 4, 2024
4410b78
fix: deployer acccount appchain
kwiss Jan 4, 2024
77995e6
fix: contract & fees
kwiss Jan 4, 2024
1e756b7
fix: comment app messaging
kwiss Jan 4, 2024
7ecebc8
feat: update deployer with cmd
kwiss Jan 6, 2024
604fddc
docs: update deployer readme
kwiss Jan 6, 2024
1c1ea9b
docs: update deployer readme with args
kwiss Jan 6, 2024
dee6ee9
fix: deployer fix for update
kwiss Jan 6, 2024
5939e2e
fix: ci
kwiss Jan 6, 2024
1cbf05c
fix: fmt
kwiss Jan 6, 2024
3776108
fix: remove target from dockerignore
kwiss Jan 6, 2024
3cefad3
fix: ci add missing load
kwiss Jan 6, 2024
6710551
feat(solis-deploy-ci): add solis deploy test
kwiss Jan 7, 2024
c0f43f2
feat(solis-deploy-ci): add solis deploy test
kwiss Jan 7, 2024
7294f26
fix: pnpm install
kwiss Jan 7, 2024
b57a578
fix: node version
kwiss Jan 7, 2024
6e918d9
fix: package install
kwiss Jan 7, 2024
aaddec5
fix: test deploy
kwiss Jan 7, 2024
da3fdd5
fix: test deploy
kwiss Jan 7, 2024
efd321c
fix: test deploy
kwiss Jan 7, 2024
58273ed
fix: package install
kwiss Jan 7, 2024
ed06fa0
fix: ci
kwiss Jan 7, 2024
2d226ad
fix: ci
kwiss Jan 7, 2024
22d5c6f
fix: ci
kwiss Jan 7, 2024
cbf1e93
fix: ci order
kwiss Jan 7, 2024
a144a16
fix: ci file name
kwiss Jan 7, 2024
b9e7b50
fix: ci file name
kwiss Jan 7, 2024
e2757da
fix: add aws login
kwiss Jan 7, 2024
3041324
fix: add aws login
kwiss Jan 7, 2024
ece3ba9
fix: add missing envs
kwiss Jan 7, 2024
4ca16dc
fix: add missing envs
kwiss Jan 7, 2024
319bbb7
fix: add docker build in deploy
kwiss Jan 7, 2024
46cae1e
fix: add depends
kwiss Jan 7, 2024
61cd9a9
fix: add depends
kwiss Jan 7, 2024
0f71a6d
fix: scarb build
kwiss Jan 7, 2024
a37f7d4
fix: update vpc & comment build for test
kwiss Jan 7, 2024
9d6be2d
remove needs
kwiss Jan 7, 2024
c7e26ae
fix: node url
kwiss Jan 7, 2024
f44e603
feat(ci): add ci for orderbook deploy & fix env
kwiss Jan 8, 2024
fa2daa4
feat(ci): fix typo
kwiss Jan 8, 2024
17533b1
fix: ci, update deploy ci for solis & orderbook
kwiss Jan 8, 2024
9834384
fix: ci, deps install
kwiss Jan 8, 2024
9e95f53
fix: update contract addresses
kwiss Jan 8, 2024
d21328f
ci(starknet): add starknet contracts deploy
kwiss Jan 8, 2024
cdcd462
ci(solis): add build back
kwiss Jan 8, 2024
7efa222
ci: remove pr trigger
kwiss Jan 8, 2024
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
1 change: 0 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ packages
contracts
aws
skip_examples
target
78 changes: 51 additions & 27 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,27 +1,51 @@
# Starknet accounts
STARKNET_ACCOUNT1_ADDRESS=0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973
STARKNET_ACCOUNT1_PRIVATE_KEY=0x1800000000300000180000000000030000000000003006001800006600
STARKNET_ACCOUNT1_PUBLIC_KEY=0x2b191c2f3ecf685a91af7cf72a43e7b90e2e41220175de5c4f7498981b10053

STARKNET_ACCOUNT2_ADDRESS=0x5686a647a9cdd63ade617e0baf3b364856b813b508f03903eb58a7e622d5855
STARKNET_ACCOUNT2_PRIVATE_KEY=0x33003003001800009900180300d206308b0070db00121318d17b5e6262150b
STARKNET_ACCOUNT2_PUBLIC_KEY=0x4c0f884b8e5b4f00d97a3aad26b2e5de0c0c76a555060c837da2e287403c01d

# Solis accounts
SOLIS_ACCOUNT1_ADDRESS=0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973
SOLIS_ACCOUNT1_PRIVATE_KEY=0x1800000000300000180000000000030000000000003006001800006600
SOLIS_ACCOUNT1_PUBLIC_KEY=0x2b191c2f3ecf685a91af7cf72a43e7b90e2e41220175de5c4f7498981b10053

SOLIS_ACCOUNT2_ADDRESS=0x5686a647a9cdd63ade617e0baf3b364856b813b508f03903eb58a7e622d5855
SOLIS_ACCOUNT2_PRIVATE_KEY=0x33003003001800009900180300d206308b0070db00121318d17b5e6262150b
SOLIS_ACCOUNT2_PUBLIC_KEY=0x4c0f884b8e5b4f00d97a3aad26b2e5de0c0c76a555060c837da2e287403c01d

# Starknet RPC URL
STARKNET_RPC_URL=http://0.0.0.0:5050
# Solis RPC URL
ARKCHAIN_RPC_URL=http://0.0.0.0:7777

# Starknet network
STARKNET_NETWORK_ID=local
# Solis network
SOLIS_NETWORK_ID=local
# Starknet account dev
STARKNET_ADMIN_ADDRESS_DEV=0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973
STARKNET_ADMIN_PRIVATE_KEY_DEV=0x1800000000300000180000000000030000000000003006001800006600
STARKNET_ADMIN_PUBLIC_KEY_DEV=0x2b191c2f3ecf685a91af7cf72a43e7b90e2e41220175de5c4f7498981b10053

STARKNET_SOLIS_ACCOUNT_ADDRESS_DEV=0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973
STARKNET_SOLIS_ACCOUNT_PRIVATE_KEY_DEV=0x1800000000300000180000000000030000000000003006001800006600
STARKNET_SOLIS_ACCOUNT_PUBLIC_KEY_DEV=0x2b191c2f3ecf685a91af7cf72a43e7b90e2e41220175de5c4f7498981b10053

# Starknet account goerli
STARKNET_ADMIN_ADDRESS_GOERLI=0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973
STARKNET_ADMIN_PRIVATE_KEY_GOERLI=0x1800000000300000180000000000030000000000003006001800006600
STARKNET_ADMIN_PUBLIC_KEY_GOERLI=0x2b191c2f3ecf685a91af7cf72a43e7b90e2e41220175de5c4f7498981b10053

STARKNET_SOLIS_ACCOUNT_ADDRESS_GOERLI=
STARKNET_SOLIS_ACCOUNT_PRIVATE_KEY_GOERLI=
STARKNET_SOLIS_ACCOUNT_PUBLIC_KEY_GOERLI=

# Starknet account mainnet
STARKNET_ADMIN_ADDRESS_MAINNET=0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973
STARKNET_ADMIN_PRIVATE_KEY_MAINNET=0x1800000000300000180000000000030000000000003006001800006600
STARKNET_ADMIN_PUBLIC_KEY_MAINNET=0x2b191c2f3ecf685a91af7cf72a43e7b90e2e41220175de5c4f7498981b10053

STARKNET_SOLIS_ACCOUNT_ADDRESS_MAINNET=
STARKNET_SOLIS_ACCOUNT_PRIVATE_KEY_MAINNET=
STARKNET_SOLIS_ACCOUNT_PUBLIC_KEY_MAINNET=

# Solis accounts dev
SOLIS_ADMIN_ADDRESS_DEV=0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973
SOLIS_ADMIN_PRIVATE_KEY_DEV=0x1800000000300000180000000000030000000000003006001800006600
SOLIS_ADMIN_PUBLIC_KEY_DEV=0x2b191c2f3ecf685a91af7cf72a43e7b90e2e41220175de5c4f7498981b10053

# Solis accounts goerli
SOLIS_ADMIN_ADDRESS_GOERLI=0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973
SOLIS_ADMIN_PRIVATE_KEY_GOERLI=0x1800000000300000180000000000030000000000003006001800006600
SOLIS_ADMIN_PUBLIC_KEY_GOERLI=0x2b191c2f3ecf685a91af7cf72a43e7b90e2e41220175de5c4f7498981b10053

# Solis accounts mainnet
SOLIS_ADMIN_ADDRESS_MAINNET=0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973
SOLIS_ADMIN_PRIVATE_KEY_MAINNET=0x1800000000300000180000000000030000000000003006001800006600
SOLIS_ADMIN_PUBLIC_KEY_MAINNET=0x2b191c2f3ecf685a91af7cf72a43e7b90e2e41220175de5c4f7498981b10053

# Starknet RPC
STARKNET_NODE_URL_DEV=http://0.0.0.0:5050
STARKNET_NODE_URL_GOERLI=https://starknet-testnet.public.blastapi.io
STARKNET_NODE_URL_MAINNET=https://starknet-mainnet.public.blastapi.io

# Solis RPC
SOLIS_NODE_URL_DEV=http://0.0.0.0:7777
SOLIS_NODE_URL_GOERLI=staging.solis.arkproject.dev
SOLIS_NODE_URL_MAINNET=https://solis.arkproject.dev
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: ArkProject contracts CI
name: ArkProject contracts ci

on:
push:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Bump version
name: ArkProject github release
on:
push:
branches:
Expand All @@ -12,4 +12,4 @@ jobs:
id: tag_version
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
github_token: ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: ArkProject crate CI
name: ArkProject rs CI

on:
push:
Expand Down
33 changes: 0 additions & 33 deletions .github/workflows/build-solis.yml

This file was deleted.

42 changes: 0 additions & 42 deletions .github/workflows/deploy-solis-stack.yml

This file was deleted.

172 changes: 172 additions & 0 deletions .github/workflows/solis-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
name: Solis Deploy

on:
push:
branches:
- main

jobs:
build-and-push-solis-image:
name: Build and push Solis image to Amazon ECR
runs-on: ubuntu-latest # This specifies the runner environment
steps:
- name: Check out repository
uses: actions/checkout@v2

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
with:
mask-password: true
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }}
AWS_REGION: ${{ secrets.AWS_REGION }}

- name: Build Solis, tag, and push image to Amazon ECR
run: |
docker buildx create --use --name ecr-deploy-builder-solis
docker buildx build --tag ${{ secrets.ECR_URL }}:solis-latest --file ./Dockerfile . --load
docker push ${{ secrets.ECR_URL }}:solis-latest

deploy-starknet:
runs-on: ubuntu-latest
name: Build & Deploy starknet contracts
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: "18"

- name: Setup Scarb
uses: software-mansion/setup-scarb@v1
with:
scarb-version: 2.3.1

- name: Build contracts
run: |
cd contracts
scarb build --workspace

- name: Install pnpm & dependencies
run: |
npm install -g pnpm
pnpm install

- name: Deploy orderbook contracts
env:
STARKNET_NODE_URL_GOERLI: ${{ secrets.STARKNET_NODE_URL_GOERLI }}
SOLIS_NODE_URL_GOERLI: ${{ secrets.SOLIS_NODE_URL_GOERLI }}
STARKNET_ADMIN_ADDRESS_GOERLI: ${{ secrets.STARKNET_ADMIN_ADDRESS_GOERLI }}
STARKNET_ADMIN_PRIVATE_KEY_GOERLI: ${{ secrets.STARKNET_ADMIN_PRIVATE_KEY_GOERLI }}
STARKNET_ADMIN_PUBLIC_KEY_GOERLI: ${{ secrets.STARKNET_ADMIN_PUBLIC_KEY_GOERLI }}
STARKNET_SOLIS_ACCOUNT_ADDRESS_GOERLI: ${{ secrets.STARKNET_SOLIS_ACCOUNT_ADDRESS_GOERLI }}
STARKNET_SOLIS_ACCOUNT_PRIVATE_KEY_GOERLI: ${{ secrets.STARKNET_SOLIS_ACCOUNT_PRIVATE_KEY_GOERLI }}
STARKNET_SOLIS_ACCOUNT_PUBLIC_KEY_GOERLI: ${{ secrets.STARKNET_SOLIS_ACCOUNT_PUBLIC_KEY_GOERLI }}
run: |
pnpm run deploy:starknet -- --starknet goerli
pnpm run deploy:starknet:tokens -- --starknet goerli

deploy-solis:
# needs: build-and-push-solis-image
name: Deploy Solis latest image to Amazon ECS
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: "18"

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
with:
mask-password: true
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }}
AWS_REGION: ${{ secrets.AWS_REGION }}

- name: Install pnpm
run: |
npm install -g pnpm
npm install -g aws-cdk
pnpm install

- name: Read environment variables from file
id: vars
run: |
content=`cat contracts.json`
STARKNET_APPCHAIN_MESSAGING_ADDRESS_GOERLI=$(echo $content | jq -r '.goerli.messaging')
echo "STARKNET_APPCHAIN_MESSAGING_ADDRESS_GOERLI=$STARKNET_APPCHAIN_MESSAGING_ADDRESS_GOERLI" >> $GITHUB_ENV

- name: Install dependencies
run: |
cd aws/cdk-solis-ecs
pnpm install

- name: Deploy CDK Stack Goerli
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }}
AWS_REGION: ${{ secrets.AWS_REGION }}
STARKNET_NODE_URL: ${{ secrets.STARKNET_NODE_URL_GOERLI }}
STARKNET_APPCHAIN_MESSAGING_ADDRESS: ${{ env.STARKNET_APPCHAIN_MESSAGING_ADDRESS_GOERLI }}
STARKNET_SOLIS_ACCOUNT_ADDRESS: ${{ secrets.STARKNET_SOLIS_ACCOUNT_ADDRESS_GOERLI }}
STARKNET_SOLIS_ACCOUNT_PRIVATE_KEY: ${{ secrets.STARKNET_SOLIS_ACCOUNT_PRIVATE_KEY_GOERLI }}
run: |
cd aws/cdk-solis-ecs
pnpm cdk deploy --all --require-approval never

deploy-orderbook:
needs: deploy-solis
runs-on: ubuntu-latest
name: Build & Deploy orderbook contract
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: "18"

- name: Setup Scarb
uses: software-mansion/setup-scarb@v1
with:
scarb-version: 2.3.1

- name: Build contracts
run: |
cd contracts
scarb build --workspace

- name: Install pnpm & dependencies
run: |
npm install -g pnpm
pnpm install

- name: Deploy orderbook contracts
env:
STARKNET_NODE_URL_GOERLI: ${{ secrets.STARKNET_NODE_URL_GOERLI }}
SOLIS_NODE_URL_GOERLI: ${{ secrets.SOLIS_NODE_URL_GOERLI }}
STARKNET_ADMIN_ADDRESS_GOERLI: ${{ secrets.STARKNET_ADMIN_ADDRESS_GOERLI }}
STARKNET_ADMIN_PRIVATE_KEY_GOERLI: ${{ secrets.STARKNET_ADMIN_PRIVATE_KEY_GOERLI }}
STARKNET_ADMIN_PUBLIC_KEY_GOERLI: ${{ secrets.STARKNET_ADMIN_PUBLIC_KEY_GOERLI }}
STARKNET_SOLIS_ACCOUNT_ADDRESS_GOERLI: ${{ secrets.STARKNET_SOLIS_ACCOUNT_ADDRESS_GOERLI }}
STARKNET_SOLIS_ACCOUNT_PRIVATE_KEY_GOERLI: ${{ secrets.STARKNET_SOLIS_ACCOUNT_PRIVATE_KEY_GOERLI }}
STARKNET_SOLIS_ACCOUNT_PUBLIC_KEY_GOERLI: ${{ secrets.STARKNET_SOLIS_ACCOUNT_PUBLIC_KEY_GOERLI }}
SOLIS_ADMIN_ADDRESS_GOERLI: ${{ secrets.SOLIS_ADMIN_ADDRESS_GOERLI }}
SOLIS_ADMIN_PRIVATE_KEY_GOERLI: ${{ secrets.SOLIS_ADMIN_PRIVATE_KEY_GOERLI }}
SOLIS_ADMIN_PUBLIC_KEY_GOERLI: ${{ secrets.SOLIS_ADMIN_PUBLIC_KEY_GOERLI }}
run: |
pnpm run deploy:solis -- --solis goerli --starknet goerli
Loading
Loading