From 9007c313e390cbdb94f0a216e2726f042563eea8 Mon Sep 17 00:00:00 2001 From: khaeljy Date: Sun, 17 Sep 2023 21:39:48 +0000 Subject: [PATCH] feat: Improve devcontainer --- .devcontainer/devcontainer.json | 2 +- .devcontainer/postCreateCommand.sh | 14 ++++++++++++++ .env.example | 1 + .gitignore | 1 + Scarb.toml | 4 +++- scripts/katana_fork.sh | 5 +++++ 6 files changed, 25 insertions(+), 2 deletions(-) mode change 100644 => 100755 .devcontainer/devcontainer.json create mode 100755 .devcontainer/postCreateCommand.sh create mode 100644 .env.example create mode 100644 scripts/katana_fork.sh diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json old mode 100644 new mode 100755 index 6ed75ae..29f86fc --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -12,7 +12,7 @@ // "forwardPorts": [], // Use 'postCreateCommand' to run commands after the container is created. - "postCreateCommand": "curl --proto '=https' --tlsv1.2 -sSf https://docs.swmansion.com/scarb/install.sh | sh && curl https://get.starkli.sh | sh && ~/.starkli/bin/starkliup", + "postCreateCommand": "chmod +x .devcontainer/postCreateCommand.sh && .devcontainer/postCreateCommand.sh", // Configure tool-specific properties. "customizations": { diff --git a/.devcontainer/postCreateCommand.sh b/.devcontainer/postCreateCommand.sh new file mode 100755 index 0000000..0f16299 --- /dev/null +++ b/.devcontainer/postCreateCommand.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +# Install scarb +curl --proto '=https' --tlsv1.2 -sSf https://docs.swmansion.com/scarb/install.sh | sh + +# Install starkli +curl https://get.starkli.sh | sh +# Update starkli +~/.starkli/bin/starkliup + +# Install Dojo +curl -L https://install.dojoengine.org | bash +# Update Dojo +~/.dojo/bin/dojoup \ No newline at end of file diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..33b2d92 --- /dev/null +++ b/.env.example @@ -0,0 +1 @@ +KATANA_FORK_RPC=https://starknet-mainnet.public.blastapi.io \ No newline at end of file diff --git a/.gitignore b/.gitignore index eb5a316..796603f 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ target +.env \ No newline at end of file diff --git a/Scarb.toml b/Scarb.toml index 90687c5..ef1101e 100644 --- a/Scarb.toml +++ b/Scarb.toml @@ -10,4 +10,6 @@ starknet = ">=2.2.0" [[target.starknet-contract]] [scripts] -test = "scarb fmt && scarb cairo-test" \ No newline at end of file +test = "scarb fmt && scarb cairo-test" +katana = "katana" +katana-fork = "/bin/bash scripts/katana_fork.sh" \ No newline at end of file diff --git a/scripts/katana_fork.sh b/scripts/katana_fork.sh new file mode 100644 index 0000000..75c84bd --- /dev/null +++ b/scripts/katana_fork.sh @@ -0,0 +1,5 @@ +# Load env +source .env + +# Run katana fork +katana --rpc-url $KATANA_FORK_RPC \ No newline at end of file