Skip to content

Commit

Permalink
fix: 🧹 Deployments scripts update (#118)
Browse files Browse the repository at this point in the history
* fix(deployment_scripts): Moved deployments scripts to a sub-package

* fix(deployment_scripts): Moved done deployments at root

* fix(deployment_scripts): bump to pragma-sdk 2.0.0rc2

* fix(deployment_scripts): Scripts refactoring + CI fix

* fix(deployment_scripts): codespell

* fix(deployment_scripts): Code spell ignore list

* fix(deployment_scripts): Code speeeell

* fix(deployment_scripts): Codespelling

* fix(deployment_scripts): CI

* fix(deployment_scripts): Fixing stuff

* fix(deployment_scripts): Fixing stuff

* fix(deployment_scripts): Stuff

* fix(deployment_scripts): Constants

* fix(deployment_scripts):

* fix(deployment_scripts): Trying stuff

* fix(deployment_scripts): Fixed paths

* fix(deployment_scripts): Fixed path 💀

* fix(deployment_scripts): Path

* fix(deployment_scripts): cairo version

* fix(deployment_scripts): Lock version of Katana

* fix(deployment_scripts): Downgrading katanaaaa

* fix(deployment_scripts): Iddkkk

* fix(deployment_scripts): idk

* fix(deployment_scripts): idk

* fix(deployment_scripts): Progressing update to devnet RS

* fix(deployment_scripts): Fixed CI

* fix(deployment_scripts): Fixed starknet-devnet downloaded arch

* fix(deployment_scripts): Fixed CI

* fix(deployment_scripts): fixing stuff

* fix(deployment_scripts): Fixed error

* fix(deployment_scripts): Removing last bits of Katana

* fix(deployment_scripts): 🧹 Katana

* fix(deployment_scripts): Fixed env

* fix(deployment_scripts):
  • Loading branch information
akhercha authored Jul 24, 2024
1 parent 4a72f14 commit 8de754c
Show file tree
Hide file tree
Showing 37 changed files with 3,206 additions and 3,492 deletions.
11 changes: 4 additions & 7 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Github configuration
GITHUB_TOKEN=

# Network configuration
# Network used configuration
STARKNET_NETWORK=devnet

# All addresses are hex strings
Expand All @@ -11,16 +11,13 @@ MAINNET_PRIVATE_KEY=
SEPOLIA_ACCOUNT_ADDRESS=
SEPOLIA_PRIVATE_KEY=

DEVNET_ACCOUNT_ADDRESS=
DEVNET_PRIVATE_KEY=
# Account with --seed=1
DEVNET_ACCOUNT_ADDRESS=0x260a8311b4f1092db620b923e8d7d20e76dedcc615fb4b6fdf28315b81de201
DEVNET_PRIVATE_KEY=0xc10662b7b247c7cecf7e8a30726cff12

# These will be used if above variables are not set for the given network
ACCOUNT_ADDRESS=
PRIVATE_KEY=

# RPC URL used by deployment scripts
RPC_URL=

# Account with --seed=1
KATANA_ACCOUNT_ADDRESS=0x7b245927f60309cb2fdcbc3f7d37a21ce5bc05a4305104b43b72b91aa3f53e1
KATANA_PRIVATE_KEY=0x100801800000000310080180000000010030000000000005106801800206800
80 changes: 38 additions & 42 deletions .github/workflows/run_scripts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,46 +3,42 @@ name: Run scripts
on: pull_request

jobs:
run_scripts:
run_scripts:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3


- name: Install rust
run: |
curl https://sh.rustup.rs -sSf | sh -s -- -y
- name: Install dojoup
run: |
curl -L https://install.dojoengine.org | bash
- name: Install dojo
run: |-
/home/runner/.config/.dojo/bin/dojoup
sudo mv /home/runner/.config/.dojo/bin/katana /usr/local/bin/
- name: Make script executable
run: chmod +x scripts/katana.sh

# Set up Python and install Poetry
- name: Set up Python and install Poetry
uses: actions/setup-python@v2
with:
python-version: '3.9'
- run: pip3 install poetry

# Install Python dependencies with Poetry
- name: Install dependencies
run: poetry install

# Set up Scarb
- uses: software-mansion/setup-scarb@v1
- run: scarb build

# Run Katana and scripts
- name: Run Katana and scripts
env:
KATANA_ACCOUNT_ADDRESS: ${{ secrets.KATANA_ACCOUNT_ADDRESS }}
KATANA_PRIVATE_KEY: ${{ secrets.KATANA_PRIVATE_KEY }}
run: bash scripts/katana.sh
defaults:
run:
working-directory: pragma-deployer
steps:
- uses: actions/checkout@v3

- name: Install Starknet Devnet RS
run: |
wget https://github.com/0xSpaceShard/starknet-devnet-rs/releases/download/v0.1.2/starknet-devnet-x86_64-unknown-linux-gnu.tar.gz
tar -xvf starknet-devnet-x86_64-unknown-linux-gnu.tar.gz
chmod +x starknet-devnet
sudo mv starknet-devnet /usr/local/bin/
rm -f starknet-devnet-x86_64-unknown-linux-gnu.tar.gz
- name: Make script executable
run: chmod +x scripts/devnet.sh

- name: Set up Python and install Poetry
uses: actions/setup-python@v4
with:
python-version: '3.12'
- run: pip install poetry

- name: Install dependencies
run: poetry install

- name: Set up Scarb
uses: software-mansion/setup-scarb@v1

- name: Build with Scarb
run: scarb build

- name: Run Starknet Devnet and scripts
env:
DEVNET_ACCOUNT_ADDRESS: "0x260a8311b4f1092db620b923e8d7d20e76dedcc615fb4b6fdf28315b81de201"
DEVNET_PRIVATE_KEY: "0xc10662b7b247c7cecf7e8a30726cff12"
run: bash scripts/devnet.sh
1 change: 1 addition & 0 deletions .github/workflows/spell_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ jobs:
check_filenames: true
check_hidden: true
ignore_words_file: ./.codespellignore
exclude_file: pragma-deployer/poetry.lock
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,4 @@ target
# Python
scripts/__pycache__
scripts/venv
.venv
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Local Deployment

Prerequisites:
- [Scarb](https://docs.swmansion.com/scarb/)
- Python >= 3.9
- 3.9 <= Python < 3.13
- [Poetry](https://python-poetry.org/)

1. Install dependencies
Expand All @@ -80,15 +80,15 @@ scarb build

3. Deploy contracts & setup

Make sure your local devnet is running, see latest instructions [here](https://book.dojoengine.org/toolchain/katana/reference.html).
Make sure your local devnet is running, see latest instructions [here](https://0xspaceshard.github.io/starknet-devnet-rs/).

You can also specify a different network by setting `STARKNET_NETWORK` to a different value e.g `sepolia | testnet | mainnet`.

```bash

STARKNET_NETWORK=katana poetry run python3 scripts/deploy_pragma.py
STARKNET_NETWORK=katana poetry run python3 scripts/deploy_summary_stats.py
STARKNET_NETWORK=katana poetry run python3 scripts/register_publishers.py
STARKNET_NETWORK=devnet poetry run deploy-pragma
STARKNET_NETWORK=devnet poetry run deploy-summary-stats
STARKNET_NETWORK=devnet poetry run register-publishers

```

Expand Down
1 change: 0 additions & 1 deletion Scarb.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ casm-add-pythonic-hints = true
allowed-libfuncs-list.name = "audited"

[scripts]
gen-project = "sh scripts/generate_cairo_project.sh"
sierra = "cairo-compile . -r"
test-cairo = "cairo-test --starknet ."

File renamed without changes.
22 changes: 22 additions & 0 deletions deployments/devnet/deployments.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"pragma_PublisherRegistry": {
"address": "0x1cec1c1730cbaf00ad3775d452823dc65e42edc2911e7480b7572e1d7eb52f8",
"tx": "0x3b751868e7a76997486278e3c21bb6bdb2dca0fafabd59417b46f607c2a078d"
},
"pragma_Oracle": {
"address": "0x2976b4db4f12ec92bab78b8343d23ace1a41d494242aa14cf5659a6e5b83513",
"tx": "0x17cbb2bb267b4b120d4e220e95434c5b2f59977c47387408e2157f07aaf2d35"
},
"pragma_SummaryStats": {
"address": "0x55b4b0dcd59ceadd43878435ba0caa09ae46d8c9fed907e9282b718197a2306",
"tx": "0x7f1533989a213a9a193b6a38e2f3100885d6982fbc45069e68bae2515229ec8"
},
"pragma_Randomness": {
"address": "0x2338ff60eb57db3be741f067595d75cd51d384daf6c10e5d7dab59c4acab5e2",
"tx": "0xb41678d8d9c51192379dc03b3c03447ec50c9246cac5b51739d80b17f0729"
},
"pragma_ExampleRandomness": {
"address": "0x31ebe9abc10ab3ed81ec52bcd4365f50302e118fdd3c04777b1604465fbeb69",
"tx": "0x77a3bb0df8d8f4236019e4d11c3936733228045ded4564d91436049c3fb4895"
}
}
22 changes: 0 additions & 22 deletions deployments/katana/deployments.json

This file was deleted.

Loading

0 comments on commit 8de754c

Please sign in to comment.