Skip to content

Commit

Permalink
feat(sepolia): add ci for sepolia & modify deployer
Browse files Browse the repository at this point in the history
  • Loading branch information
kwiss committed Jun 6, 2024
1 parent 6048d9e commit 4da914d
Show file tree
Hide file tree
Showing 6 changed files with 119 additions and 13 deletions.
100 changes: 100 additions & 0 deletions .github/workflows/arkproject-deploy-contracts-sepolia.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
name: ArkProject Deploy Contracts & Solis Mainnet

on: workflow_dispatch

jobs:
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.5.4

- 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_SEPOLIA: ${{ secrets.STARKNET_NODE_URL_SEPOLIA }}
SOLIS_NODE_URL_SEPOLIA: ${{ secrets.SOLIS_NODE_URL_SEPOLIA }}
STARKNET_ADMIN_ADDRESS_SEPOLIA: ${{ secrets.STARKNET_ADMIN_ADDRESS_SEPOLIA }}
STARKNET_ADMIN_PRIVATE_KEY_SEPOLIA: ${{ secrets.STARKNET_ADMIN_PRIVATE_KEY_SEPOLIA }}
STARKNET_ADMIN_PUBLIC_KEY_SEPOLIA: ${{ secrets.STARKNET_ADMIN_PUBLIC_KEY_SEPOLIA }}
STARKNET_SOLIS_ACCOUNT_ADDRESS_SEPOLIA: ${{ secrets.STARKNET_SOLIS_ACCOUNT_ADDRESS_SEPOLIA }}
STARKNET_SOLIS_ACCOUNT_PRIVATE_KEY_SEPOLIA: ${{ secrets.STARKNET_SOLIS_ACCOUNT_PRIVATE_KEY_SEPOLIA }}
STARKNET_SOLIS_ACCOUNT_PUBLIC_KEY_SEPOLIA: ${{ secrets.STARKNET_SOLIS_ACCOUNT_PUBLIC_KEY_SEPOLIA }}
run: |
pnpm run deploy:starknet -- --starknet sepolia
# deploy-orderbook:
# needs: deploy-starknet
# 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: "20"

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

# - 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_SEPOLIA: ${{ secrets.STARKNET_NODE_URL_SEPOLIA }}
# SOLIS_NODE_URL_SEPOLIA: ${{ secrets.SOLIS_NODE_URL_SEPOLIA }}
# STARKNET_ADMIN_ADDRESS_SEPOLIA: ${{ secrets.STARKNET_ADMIN_ADDRESS_SEPOLIA }}
# STARKNET_ADMIN_PRIVATE_KEY_SEPOLIA: ${{ secrets.STARKNET_ADMIN_PRIVATE_KEY_SEPOLIA }}
# STARKNET_ADMIN_PUBLIC_KEY_SEPOLIA: ${{ secrets.STARKNET_ADMIN_PUBLIC_KEY_SEPOLIA }}
# STARKNET_SOLIS_ACCOUNT_ADDRESS_SEPOLIA: ${{ secrets.STARKNET_SOLIS_ACCOUNT_ADDRESS_SEPOLIA }}
# STARKNET_SOLIS_ACCOUNT_PRIVATE_KEY_SEPOLIA: ${{ secrets.STARKNET_SOLIS_ACCOUNT_PRIVATE_KEY_SEPOLIA }}
# STARKNET_SOLIS_ACCOUNT_PUBLIC_KEY_SEPOLIA: ${{ secrets.STARKNET_SOLIS_ACCOUNT_PUBLIC_KEY_SEPOLIA }}
# SOLIS_ADMIN_ADDRESS_SEPOLIA: ${{ secrets.SOLIS_ADMIN_ADDRESS_SEPOLIA }}
# SOLIS_ADMIN_PRIVATE_KEY_SEPOLIA: ${{ secrets.SOLIS_ADMIN_PRIVATE_KEY_SEPOLIA }}
# SOLIS_ADMIN_PUBLIC_KEY_SEPOLIA: ${{ secrets.SOLIS_ADMIN_PUBLIC_KEY_SEPOLIA }}
# RPC_USER: ${{ secrets.RPC_USER }}
# RPC_PASSWORD: ${{ secrets.RPC_PASSWORD }}
# run: |
# pnpm run deploy:solis -- --solis sepolia --starknet sepolia
# - name: Commit and Push Generated contract file
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# run: |
# git config --global user.email "[email protected]"
# git config --global user.name "Solis Bot"
# git add contracts.json
# if ! git diff --cached --quiet; then
# git commit -m "feat: update contracts.json for sepolia deployment"
# git push https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository }}.git HEAD:${{ github.ref }}
# else
# echo "No changes to commit"
# fi
2 changes: 1 addition & 1 deletion packages/deployer/src/accounts/new.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export async function createNewAccounts(

const program = new Command();
program
.option("-n, --network <type>", "Network to use", "goerli")
.option("-n, --network <type>", "Network to use", "sepolia")
.option("-a, --accounts <number>", "Number of accounts to create", "1");

program.parse(process.argv);
Expand Down
4 changes: 2 additions & 2 deletions packages/deployer/src/providers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export function getStarknetProvider(starknetNetwork: string) {
starknetNodeUrl = process.env.STARKNET_NODE_URL_MAINNET || "";
break;
case "sepolia":
starknetNodeUrl = process.env.STARKNET_NODE_URL_GOERLI || "";
starknetNodeUrl = process.env.STARKNET_NODE_URL_SEPOLIA || "";
break;
default:
throw new Error(`Unsupported starknetNetwork: ${starknetNetwork}`);
Expand All @@ -32,7 +32,7 @@ export function getSolisProvider(solisNetwork?: string) {
solisNodeUrl = process.env.SOLIS_NODE_URL_MAINNET || "";
break;
case "sepolia":
solisNodeUrl = process.env.SOLIS_NODE_URL_GOERLI || "";
solisNodeUrl = process.env.SOLIS_NODE_URL_SEPOLIA || "";
break;
default:
throw new Error(`Unsupported solisNetwork: ${solisNetwork}`);
Expand Down
6 changes: 3 additions & 3 deletions packages/deployer/src/utils/solisAccounts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ export function getSolisAccounts(solisNetwork: ProviderNetwork) {
publicKey: process.env.SOLIS_ADMIN_PUBLIC_KEY_DEV || ""
},
{
address: process.env.SOLIS_ADMIN_ADDRESS_GOERLI || "",
privateKey: process.env.SOLIS_ADMIN_PRIVATE_KEY_GOERLI || "",
publicKey: process.env.SOLIS_ADMIN_PUBLIC_KEY_GOERLI || ""
address: process.env.SOLIS_ADMIN_ADDRESS_SEPOLIA || "",
privateKey: process.env.SOLIS_ADMIN_PRIVATE_KEY_SEPOLIA || "",
publicKey: process.env.SOLIS_ADMIN_PUBLIC_KEY_SEPOLIA || ""
},
{
address: process.env.SOLIS_ADMIN_ADDRESS_MAINNET || "",
Expand Down
12 changes: 6 additions & 6 deletions packages/deployer/src/utils/starknetAccounts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ export function getStarknetAccounts(starknetNetwork: ProviderNetwork) {
publicKey: process.env.STARKNET_ADMIN_PUBLIC_KEY_DEV || ""
},
{
address: process.env.STARKNET_ADMIN_ADDRESS_GOERLI || "",
privateKey: process.env.STARKNET_ADMIN_PRIVATE_KEY_GOERLI || "",
publicKey: process.env.STARKNET_ADMIN_PUBLIC_KEY_GOERLI || ""
address: process.env.STARKNET_ADMIN_ADDRESS_SEPOLIA || "",
privateKey: process.env.STARKNET_ADMIN_PRIVATE_KEY_SEPOLIA || "",
publicKey: process.env.STARKNET_ADMIN_PUBLIC_KEY_SEPOLIA || ""
},
{
address: process.env.STARKNET_ADMIN_ADDRESS_MAINNET || "",
Expand All @@ -32,9 +32,9 @@ export function getStarknetAccounts(starknetNetwork: ProviderNetwork) {
publicKey: process.env.STARKNET_SOLIS_ACCOUNT_PUBLIC_KEY_DEV || ""
},
{
address: process.env.STARKNET_SOLIS_ACCOUNT_ADDRESS_GOERLI || "",
privateKey: process.env.STARKNET_SOLIS_ACCOUNT_PRIVATE_KEY_GOERLI || "",
publicKey: process.env.STARKNET_SOLIS_ACCOUNT_PUBLIC_KEY_GOERLI || ""
address: process.env.STARKNET_SOLIS_ACCOUNT_ADDRESS_SEPOLIA || "",
privateKey: process.env.STARKNET_SOLIS_ACCOUNT_PRIVATE_KEY_SEPOLIA || "",
publicKey: process.env.STARKNET_SOLIS_ACCOUNT_PUBLIC_KEY_SEPOLIA || ""
},
{
address: process.env.STARKNET_SOLIS_ACCOUNT_ADDRESS_MAINNET || "",
Expand Down
8 changes: 7 additions & 1 deletion turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,12 @@
"STARKNET_NETWORK",
"STARKNET_NETWORK_ID",
"STARKNET_NFT_ADDRESS_DEV",
"STARKNET_RPC_URL"
"STARKNET_RPC_URL",
"SOLIS_ADMIN_PUBLIC_KEY_DEV",
"SOLIS_ADMIN_ADDRESS_SEPOLIA",
"SOLIS_ADMIN_PRIVATE_KEY_SEPOLIA",
"SOLIS_ADMIN_PUBLIC_KEY_SEPOLIA",
"SOLIS_ADMIN_PUBLIC_KEY_MAINNET",
"SOLIS_NODE_URL_SEPOLIA"
]
}

0 comments on commit 4da914d

Please sign in to comment.