# Setting Up Accounts in Starknet: A Primer for Blockchain Developers
## Scarb and Asdf
To kick off your developer journey in the Starknet ecosystem, one of your initial steps should be to install [Scarb](https://docs.swmansion.com/scarb/). Scarb serves as both a toolchain and a package manager, specifically designed for the Cairo and Starknet platforms. However, it's worth noting that the ecosystem is constantly evolving at a rapid pace. Due to this fast development cycle, you'll likely need to keep up with frequent library updates. To manage different versions of your tools seamlessly, a version manager becomes essential. Fortunately, the Starknet ecosystem has a reliable solution for this: the [asdf](https://asdf-vm.com/guide/getting-started.html) version manager.
### Installation Steps
Firstly, we'll assume that you have already installed [Homebrew](https://brew.sh/) on your system. If not, please do so before proceeding.
```shell
# Install asdf using Homebrew
brew install asdf
# Add asdf.sh to your shell profile (this example uses ~/.bash_profile)
echo -e "\n. \"$(brew --prefix asdf)/libexec/asdf.sh\"" >> ~/.bash_profile
```
### Configuring Scarb with asdf
Once you've set up asdf, it's time to install the latest version of Scarb and configure it as your global environment:
```
# Install the latest version of Scarb
asdf install scarb latest
# Set the latest version as your global environment
asdf global scarb latest
```
### Switching Between Scarb Versions
The real beauty of using asdf lies in its flexibility. Should you need to switch between different Scarb versions for specific tasks, all you need to do is:
```
# Install the specific version of Scarb you need
asdf install scarb 0.x.y
# Set that version as your global environment
asdf global scarb 0.x.y
```
### Setup your local deployment accounts
So you've messed around with Truffle, Hardhat, or maybe even Foundry, huh? You're used to just booting up a local blockchain, throwing your private key into Metamask, and diving into code. Starknet, though, plays a different game. Before you can mess with smart contracts, you've got to set up some local accounts.
Quick heads-up: In Starknet, all accounts are actually smart contracts. First, you declare the code. Then, you can make an instance of it (but not before sending some funds to its precalculated address).
Let's say you're itching to get started on the Goerli testnet. You're gonna want an account for that, so let's make one and call it deployer. You'll need to create two files for each account: a keystore.key and an account.json. The second one's generated from the first. Here's how to do it:
```shell
# Make a folder for the deployer
mkdir -p ~/.starkli-wallets/deployer
# Jump into that directory
cd ~/.starkli-wallets/deployer
# Create a shiny new keystore file
starkli signer keystore new keystore.json
```
In this step, you need the private key from katana account and your password.

```
# Kick off the account.json file
starkli account oz init account.json --keystore={path/to/keystore.json} --rpc={https://starknet-goerli.g.alchemy.com/v2/api-key}
```
At the end of the previous steps, you'll snag an address for what will be your live account. To get it up and running, send some funds to it, like on the Goerli testnet for instance. Then, make it official by deploying the account. This magic trick is called 'counterfactual deployment.'
```
starkli account deploy account.json
```
#### Local Dev with Katana and Starkli
So, you wanna go local and use Katana? Sweet. After installing Katana, you can boot up a local chain with this simple command:
```
katana --accounts 3 --seed 0 --gas-price 250
```
This tells Katana to whip up 3 accounts for you. You'll get account addresses, as well as private and public keys. But to roll with Starkli, you'll still need to follow the previous account setup. So let's start by making a "katana" folder.
```shell
# Make a folder for the katana account
mkdir -p ~/.starkli-wallets/katana
# Jump into that directory
cd ~/.starkli-wallets/katana
```
What's different this time? Well, you've got a Katana account with all the goodies. No need to make a new one with Starkli. All that's missing is the class_hash. To fetch it, just run:
```
starkli account fetch {account-address} --rpc={katana_rpc}
```
Got it? Awesome. Now, tweak your account.json like this, and fill in your specific values:
```json
{
"version": 1,
"variant": {
"type": "open_zeppelin",
"version": 1,
"public_key": {PUBLIC_KEY}
},
"deployment": {
"status": "deployed",
"class_hash": {CLASS_HASH}
"address": {ACCOUNT_ADDRESS}
}
}
```
Last thing, generate the keystore.json from account.json:
```
starkli signer keystore from-key keystore.json
```
And there you have it! You've got your Starknet accounts ready to rock, either on Goerli or locally with Katana. Happy BUIDL!