| 
1 |  | -include::1.0.0@docs-common-content:ROOT:partial$partial_environment_setup.adoc[]  | 
 | 1 | +[id="setup"]  | 
 | 2 | += Setting up your environment  | 
 | 3 | + | 
 | 4 | +In order to interact with Starknet and compile Cairo code, you need to install several tools.  | 
 | 5 | + | 
 | 6 | +The following tools are recommended to begin developing on Starknet:  | 
 | 7 | + | 
 | 8 | +[cols="1,1,1,1"]  | 
 | 9 | +[%autowidth.stretch]  | 
 | 10 | +|===  | 
 | 11 | +|Tool name | Description | Documentation |Code Repository  | 
 | 12 | + | 
 | 13 | +|Starkli  | 
 | 14 | +|A command-line interface that allows you to interact with Starknet.  | 
 | 15 | +|https://book.starkli.rs/[book.starkli.rs]  | 
 | 16 | +|https://github.com/xJonathanLEI/starkli[github.com/xJonathanLEI/starkli]  | 
 | 17 | + | 
 | 18 | +|Scarb  | 
 | 19 | +|A build toolchain and package manager for Cairo and Starknet ecosystems.  | 
 | 20 | +|https://docs.swmansion.com/scarb/[docs.swmansion.com/scarb]  | 
 | 21 | +|https://github.com/software-mansion/scarb[github.com/software-mansion/scarb]  | 
 | 22 | + | 
 | 23 | +|===  | 
 | 24 | + | 
 | 25 | +[#installing_starkli]  | 
 | 26 | +== Installing Starkli  | 
 | 27 | + | 
 | 28 | +The steps for installing Starkli and upgrading Starkli are identical.  | 
 | 29 | + | 
 | 30 | +.Procedure  | 
 | 31 | + | 
 | 32 | +. Install Starkliup, the installer for the Starkli environment:  | 
 | 33 | ++  | 
 | 34 | +[source,shell]  | 
 | 35 | +----  | 
 | 36 | +curl https://get.starkli.sh | sh  | 
 | 37 | +----  | 
 | 38 | ++  | 
 | 39 | +Starkliup should now be installed.  | 
 | 40 | + | 
 | 41 | +. Restart the terminal.  | 
 | 42 | + | 
 | 43 | +. Install Starkli:  | 
 | 44 | ++  | 
 | 45 | +[source,shell]  | 
 | 46 | +----  | 
 | 47 | +starkliup  | 
 | 48 | +----  | 
 | 49 | ++  | 
 | 50 | +Starkli should now be installed.  | 
 | 51 | + | 
 | 52 | +. Restart the terminal and run the following command to verify the installation:  | 
 | 53 | ++  | 
 | 54 | +[source,shell]  | 
 | 55 | +----  | 
 | 56 | +starkli --version  | 
 | 57 | +----  | 
 | 58 | ++  | 
 | 59 | +Starkli prints the current version.  | 
 | 60 | + | 
 | 61 | +[#setting_environment_variables_for_starkli]  | 
 | 62 | +== Setting environment variables for Starkli  | 
 | 63 | + | 
 | 64 | +For the majority of flags available on Starkli you can set environment variables to make the commands shorter and easier to manage.  | 
 | 65 | + | 
 | 66 | +Setting environment variables for Starkli significantly simplifies command execution and management, thereby enhancing efficiency, readability, and control when using Starkli.  | 
 | 67 | + | 
 | 68 | +The two primary environment variables that are vital for effective usage of Starkli's CLI are:  | 
 | 69 | + | 
 | 70 | +[horizontal,labelwidth="25"]  | 
 | 71 | +`STARKNET_ACCOUNT`:: The location of the xref:set-up-an-account.adoc#creating_an_account_descriptor[Account Descriptor] file.  | 
 | 72 | +`STARKNET_KEYSTORE`:: The location of the keystore file for the xref:set-up-an-account.adoc#creating_a_signer[Signer].  | 
 | 73 | + | 
 | 74 | +Set these environment variables as follows:  | 
 | 75 | + | 
 | 76 | +[source,bash]  | 
 | 77 | +----  | 
 | 78 | +export STARKNET_ACCOUNT=~/.starkli-wallets/deployer/account.json  | 
 | 79 | +export STARKNET_KEYSTORE=~/.starkli-wallets/deployer/keystore.json  | 
 | 80 | +----  | 
 | 81 | + | 
 | 82 | +[#installing_scarb]  | 
 | 83 | +== Installing Scarb  | 
 | 84 | + | 
 | 85 | +Scarb is compatible with macOS, Linux, and Windows operating systems.  | 
 | 86 | + | 
 | 87 | + | 
 | 88 | +=== MacOS and Linux installation  | 
 | 89 | + | 
 | 90 | +It is highly recommended to install Scarb via the link:https://asdf-vm.com/[`asdf`] version manager.  | 
 | 91 | + | 
 | 92 | +Installing Scarb with `asdf` seamlessly integrates with the Cairo xref:tools:devtools/vscode.adoc[Cairo VSCode extension], and allows to easily switch between different versions of Scarb, globally or per project.  | 
 | 93 | + | 
 | 94 | +.Procedure  | 
 | 95 | + | 
 | 96 | +. Follow the installation steps of `asdf` on the link:https://asdf-vm.com/guide/getting-started.html[official website].  | 
 | 97 | ++  | 
 | 98 | + | 
 | 99 | +. Install the Scarb plugin:  | 
 | 100 | ++  | 
 | 101 | +[source, bash]  | 
 | 102 | +----  | 
 | 103 | +asdf plugin add scarb  | 
 | 104 | +----  | 
 | 105 | + | 
 | 106 | +. Install the latest version of Scarb  | 
 | 107 | ++  | 
 | 108 | +[source, bash]  | 
 | 109 | +----  | 
 | 110 | +asdf install scarb latest  | 
 | 111 | +----  | 
 | 112 | + | 
 | 113 | + | 
 | 114 | +. Set a global version for Scarb  | 
 | 115 | ++  | 
 | 116 | +[source, bash]  | 
 | 117 | +----  | 
 | 118 | +asdf global scarb latest  | 
 | 119 | +----  | 
 | 120 | + | 
 | 121 | + | 
 | 122 | +. Check if Scarb is installed correctly  | 
 | 123 | ++  | 
 | 124 | +[source, bash]  | 
 | 125 | +----  | 
 | 126 | +scarb --version  | 
 | 127 | +----  | 
 | 128 | + | 
 | 129 | +You should see the version of Scarb, Cairo and Sierra.  | 
 | 130 | + | 
 | 131 | +[TIP]  | 
 | 132 | +====  | 
 | 133 | +See additional commands for updating Scarb and switching between versions in the link:https://asdf-vm.com/manage/commands.html[`asdf` documentation], or by running `asdf --help`.  | 
 | 134 | +====  | 
 | 135 | + | 
 | 136 | + | 
 | 137 | + | 
 | 138 | +=== Windows installation  | 
 | 139 | + | 
 | 140 | +Scarb's installation on Windows requires manual setup.  | 
 | 141 | + | 
 | 142 | +.Procedure  | 
 | 143 | + | 
 | 144 | +. Follow the steps in the link:https://docs.swmansion.com/scarb/download.html#windows[Scarb documentation].  | 
 | 145 | +. Restart the terminal and run the following command to verify the installation:  | 
 | 146 | ++  | 
 | 147 | +[source, bash]  | 
 | 148 | +----  | 
 | 149 | +scarb --version  | 
 | 150 | +----  | 
 | 151 | + | 
 | 152 | +Scarb should now be installed.  | 
0 commit comments