Skip to content

Commit 192a904

Browse files
authored
Enviorment setup refactor (#1414)
* refactore env setup * minor fix * minor fix * minor fix * code review * minor fix
1 parent 2202db6 commit 192a904

File tree

1 file changed

+65
-77
lines changed

1 file changed

+65
-77
lines changed

components/Starknet/modules/quick-start/pages/environment-setup.adoc

Lines changed: 65 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,73 @@
11
[id="setup"]
22
= Setting up your environment
33

4-
In order to interact with Starknet and compile Cairo code, you need to install several tools.
4+
== Overview
55

6-
The following tools are recommended to begin developing on Starknet:
6+
In order to use Starknet, you need to install several tools. This section will walk you through installing the three most recommended tools to begin developing on Starknet:
77

8-
[cols="1,1,1,1"]
9-
[%autowidth.stretch]
10-
|===
11-
|Tool name | Description | Documentation |Code Repository
8+
* xref:tools:devtools/clis.adoc#starkli[Starkli], a command-line interface that allows you to interact with Starknet.
129

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]
10+
* xref:tools:devtools/smart-contract-tools.adoc#scarb[Scarb], a build toolchain and package manager for Cairo and Starknet ecosystems.
1711

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]
12+
* xref:tools:devtools/smart-contract-tools.adoc#starknet_foundry[Starknet Foundry], the go-to framework for building and testing Starknet Smart Contracts
2213

23-
|Starknet Foundry
24-
|The go to framework for building, and testing Starknet Smart Contracts.
25-
|https://foundry-rs.github.io/starknet-foundry/[foundry-rs.github.io/starknet-foundry]
26-
|https://github.com/foundry-rs/starknet-foundry[github.com/foundry-rs/starknet-foundry]
27-
28-
29-
|===
14+
To review all Starknet developer tools, check out the xref:tools:devtools/overview.adoc[tools and resources section].
3015

3116
[#installing_starkli]
32-
== Installing Starkli
17+
== Setting up Starkli
18+
19+
=== MacOS and Linux installation
3320

34-
The steps for installing Starkli and upgrading Starkli are identical.
21+
It is highly recommended to install Starkli on MacOS and Linux using the link:https://get.starkli.sh[`starkliup` portable script]. `starkliup` manages shell configuration for you, and using any other installation method requires to link:https://book.starkli.rs/shell-completions[manually set up shell completions].
3522

3623
.Procedure
3724

38-
. Install Starkliup, the installer for the Starkli environment:
25+
. Download `starkliup`:
3926
+
4027
[source,shell]
4128
----
4229
curl https://get.starkli.sh | sh
4330
----
31+
32+
. Restart the terminal and install Starkli:
4433
+
45-
Starkliup should now be installed.
34+
[source,shell]
35+
----
36+
starkliup
37+
----
4638

47-
. Restart the terminal.
39+
. Restart the terminal and verify that Starkli is installated correctly:
40+
+
41+
[source,shell]
42+
----
43+
starkli --version
44+
----
45+
46+
=== Windows installation
47+
48+
Starknet Foundry's installation on Windows requires manually setting up shell completions.
49+
50+
.Procedure
4851

4952
. Install Starkli:
5053
+
5154
[source,shell]
5255
----
53-
starkliup
56+
cargo install --locked --git https://github.com/xJonathanLEI/starkli
5457
----
55-
+
56-
Starkli should now be installed.
5758

58-
. Restart the terminal and run the following command to verify the installation:
59+
. Restart the terminal and verify that Starkli is installated correctly:
5960
+
6061
[source,shell]
6162
----
6263
starkli --version
6364
----
6465
+
65-
Starkli prints the current version.
66+
67+
. Set up Starkli's shell completions by following the instructions in the link:https://book.starkli.rs/shell-completions[Starkli documentation].
6668

6769
[#setting_environment_variables_for_starkli]
68-
== Setting environment variables for Starkli
70+
=== Environment variables setup
6971

7072
For the majority of flags available on Starkli you can set environment variables to make the commands shorter and easier to manage.
7173

@@ -77,7 +79,7 @@ The two primary environment variables that are vital for effective usage of Star
7779
`STARKNET_ACCOUNT`:: The location of the xref:set-up-an-account.adoc#creating_an_account_descriptor[Account Descriptor] file.
7880
`STARKNET_KEYSTORE`:: The location of the keystore file for the xref:set-up-an-account.adoc#creating_a_signer[Signer].
7981

80-
Set these environment variables as follows:
82+
The following sections assume these environment variables are set as follows:
8183

8284
[source,bash]
8385
----
@@ -86,85 +88,72 @@ export STARKNET_KEYSTORE=~/.starkli-wallets/deployer/keystore.json
8688
----
8789

8890
[#installing_scarb]
89-
== Installing Scarb
90-
91-
Scarb is compatible with macOS, Linux, and Windows operating systems.
92-
91+
== Setting up Scarb
9392

9493
=== MacOS and Linux installation
9594

96-
It is highly recommended to install Scarb via the link:https://asdf-vm.com/[`asdf`] version manager.
97-
98-
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.
95+
It is highly recommended to install Scarb on MacOS and Linux via the link:https://asdf-vm.com/[`asdf` version manager]. 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, both globally and per project (see full details in the link:https://asdf-vm.com/manage/commands.html[`asdf` documentation] or by running `asdf --help`).
9996

10097
.Procedure
10198

102-
. Follow the installation steps of `asdf` on the link:https://asdf-vm.com/guide/getting-started.html[official website].
99+
. Verify that `asdf` is installed:
103100
+
101+
[source, bash]
102+
----
103+
asdf --version
104+
----
105+
+
106+
or install it by following the instructions in the link:https://asdf-vm.com/guide/getting-started.html[`asdf` documentation].
104107

105-
. Install the Scarb plugin:
108+
. Install the `asdf` Scarb plugin:
106109
+
107110
[source, bash]
108111
----
109112
asdf plugin add scarb
110113
----
111114

112-
. Install the latest version of Scarb
115+
. Install the latest version of Scarb:
113116
+
114117
[source, bash]
115118
----
116119
asdf install scarb latest
117120
----
118121

119-
120-
. Set a global version for Scarb
122+
. Restart the terminal and verify that Scarb is installed correctly:
121123
+
122124
[source, bash]
123125
----
124-
asdf global scarb latest
126+
scarb --version
125127
----
126128

127-
128-
. Check if Scarb is installed correctly
129+
. Set a global version for Scarb (need for using `scarb init`):
129130
+
130131
[source, bash]
131132
----
132-
scarb --version
133+
asdf global scarb latest
133134
----
134135

135-
You should see the version of Scarb, Cairo and Sierra.
136-
137-
[TIP]
138-
====
139-
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`.
140-
====
141-
142-
143-
144136
=== Windows installation
145137

146138
Scarb's installation on Windows requires manual setup.
147139

148140
.Procedure
149141

150-
. Follow the steps in the link:https://docs.swmansion.com/scarb/download.html#windows[Scarb documentation].
151-
. Restart the terminal and run the following command to verify the installation:
142+
. Follow the instructions in the link:https://docs.swmansion.com/scarb/download.html#windows[Scarb documentation].
143+
144+
. Restart the terminal and verify that Scarb is installed correctly:
152145
+
153146
[source, bash]
154147
----
155148
scarb --version
156149
----
157150

158-
Scarb should now be installed.
159-
160151
[#starknet_foundry_setup]
161152
== Setting up Starknet Foundry
162153

163-
// Starknet Foundry is the go to framework for building, and testing Starknet Smart Contracts.
164-
165-
=== Installing Starknet Foundry on MacOS and Linux
154+
=== MacOS and Linux installation
166155

167-
Although other options are possible, it is highly recommended to install Starknet Foundry using the link:https://asdf-vm.com/[`asdf` version manager]. Installing Starknet Foundry with `asdf` allows to easily switch between different versions of Starknet Foundry, both globally and per project.
156+
It is highly recommended to install Starknet Foundry on MacOS and Linux using the link:https://asdf-vm.com/[`asdf` version manager]. Installing Starknet Foundry with `asdf` allows to easily switch between different versions of Starknet Foundry, both globally and per project (see full details in the link:https://asdf-vm.com/manage/commands.html[`asdf` documentation] or by running `asdf --help`).
168157

169158
.Procedure
170159

@@ -174,7 +163,7 @@ Although other options are possible, it is highly recommended to install Starkne
174163
+
175164
[source, bash]
176165
----
177-
asdf plugin-add starknet-foundry
166+
asdf plugin add starknet-foundry
178167
----
179168

180169
. Install the latest version of Starknet Foundry:
@@ -184,29 +173,28 @@ asdf plugin-add starknet-foundry
184173
asdf install starknet-foundry latest
185174
----
186175

187-
// . Set a global version for Starknet Foundry using `asdf`:
188-
// +
189-
// [source, bash]
190-
// ----
191-
// asdf global starknet-foundry latest
192-
// ----
193-
176+
. Set a global version for Starknet Foundry using `asdf` (need for using `scarb init`):
177+
+
178+
[source, bash]
179+
----
180+
asdf global starknet-foundry latest
181+
----
194182

195-
. Verify that Starknet Foundry is installed correctly:
183+
. Restart the terminal and verify that Starknet Foundry is installed correctly:
196184
+
197185
[source, bash]
198186
----
199187
snforge --version
200188
sncast --version
201189
----
202190

203-
=== Installing Starknet Foundry on Windows
191+
=== Windows installation
204192

205193
Starknet Foundry's installation on Windows requires manual setup.
206194

207195
.Procedure
208196

209-
. Follow the steps in the link:https://foundry-rs.github.io/starknet-foundry/getting-started/installation.html#installation-on-windows[Starknet Foundry documentation].
197+
. Follow the instructions in the link:https://foundry-rs.github.io/starknet-foundry/getting-started/installation.html#installation-on-windows[Starknet Foundry documentation].
210198
. Restart the terminal and verify that Starknet Foundry is installed correctly:
211199
+
212200
[source, bash]

0 commit comments

Comments
 (0)