# Getting started with Madara

By [Karnot](https://paragraph.com/@karnot) · 2024-01-29

---

If you’ve reached here, it probably means you already have your Madara node up and running 🚀

Now it’s time that we start playing around with Madara - deploy accounts, contracts and get your app chain up and kicking (and move you on top of the [leaderboard](https://leaderboard.availproject.org/) as well 😉).

### Using starknet.js

Starkent.js is an npm library that allows you to interact with Starknet using Node.js. We have created some sample scripts for you that allow you to

1.  Declare a contract
    
2.  Deploy a contract
    
3.  Transfer funds to an account
    
4.  Get a transaction receipt
    

[https://github.com/karnotxyz/madara-get-started](https://github.com/karnotxyz/madara-get-started)

If you’ve ever used Node.js before, using these scripts should be a breeze! The instructions to use the scripts are in the README of the repo. Good luck 👍

### Using starkli

**Installing starkli**

[starkli](https://github.com/xJonathanLEI/starkli) is a CLI tool which allows you to interact with the Starknet based chain using your terminal! Currently, Madara is compatible with starkli v0.1.20. To install this version, go to this [link](https://github.com/xJonathanLEI/starkli/releases/tag/v0.1.20) and download the asset which is compatible with your machine (`arm` or `x86`, `mac`, `linux` or `windows`). Once downloaded, you can extract the file to get your binary. Once you’ve the binary, you can add the binary location to your `PATH` and access it on your terminal with `starkli`. Alternatively, you can `cd` to the location of the binary on your terminal and use `./starkli`. For the tutorial, we will assume you’ve added it to your path.

Ensure you’ve the correct version using

    starkli --version
    0.1.20 (e4d2307)
    

**Setting up starkli**

1.  Once you’ve starkli installed, add your Madara RPC url to the `env`. By default, this would be `http://localhost:9944` if you’re running it locally. If you’ve hosted your chain for the Clash of Nodes campaign, this would be the `rpc_url` you submitted for the listing.
    
        export STARKNET_RPC="http://localhost:9944/"
        
    
2.  The next step is to declare the Open Zepplin account contracts on your Madara chain! For this, you can use one of our js scripts above. You need to have Node.js installed.
    
        git clone https://github.com/karnotxyz/madara-get-started
        npm i
        node scripts/declare.js
        ./contracts/OpenZeppelinAccountCairoOne.sierra.json
        ./contracts/OpenZeppelinAccountCairoOne.casm.json 
        
    
    If you see the message, `Contract is already declared`it’s fine! It means you’re on the later version of Madara where we added this contract to genesis.
    
3.  Awesome! You’re now setup to start using `starkli`. Follow this amazing [tutorial](https://book.starkli.rs/tutorials/starkli-101) here to interact with your Madara chain.
    
4.  Some pointers to keep in mind when running the above tutorial.
    
    1.  Madara chains currently support Cairo 2.1.0. The above tutorial is also based on Scarb 0.6.1 which is compatible with this Cairo version. To install this specific Scarb version, you can use asdf as explained [here](https://docs.swmansion.com/scarb/download.html#install-via-asdf).
        
    2.  When you create your Scarb project according to the tutorial, add the following code inside the `Scarb.toml` file
        
            [dependencies]
            starknet = ">=2.1.0"
            
            [[target.starknet-contract]]
            
        

### Learning more about Starknet and Cairo

By now, you might have got the idea that using a Madara chain is similar to using Starknet. You just need to point your RPC url to Madara! So, if you’ve used Starknet before, you are ready to get started. However, if you haven’t, it’s not too late! Here are some good resources to give you a head start on your journey.

1.  Starknet book: [https://book.starknet.io/](https://book.starknet.io/)
    
2.  Starknet docs: [https://docs.starknet.io/](https://docs.starknet.io/)
    
3.  Cairo book: [https://book.cairo-lang.org/](https://book.cairo-lang.org/)
    
4.  Starknet Basecamp: [https://www.youtube.com/watch?v=8GH92wM4jB0&list=PLMXIoXErTTYX-ZSxlaYDxsR66l5a39IwA](https://www.youtube.com/watch?v=8GH92wM4jB0&list=PLMXIoXErTTYX-ZSxlaYDxsR66l5a39IwA)
    
5.  About Madara + Demo: [https://www.youtube.com/watch?v=gKGumhRISLU](https://www.youtube.com/watch?v=gKGumhRISLU)
    

### 🛠️ Take part in the Madara Hackathon

Starkware has organised an hackathon with a Madara [track](https://taikai.network/starkware/hackathons/starknet-winter-hackathon/categories?token=NLPU3RY9KA6U7AQO). The track has over $4000 in cash prizes for projects that build exciting things on top of Madara. And one of the problem statements is building an app chain! So if you believe you’ve something exciting, don’t forget to share it with us here and possible grab a cash prize 💸

---

*Originally published on [Karnot](https://paragraph.com/@karnot/getting-started-with-madara)*
