Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/riteshpuvvada/rust-calculator-in-solana

A simple Rust DApp Calculator in Solana 🦀
https://github.com/riteshpuvvada/rust-calculator-in-solana

blockchain-technology dapps-development decentralized rust-lang solana solana-program tyepscript wallet

Last synced: 27 days ago
JSON representation

A simple Rust DApp Calculator in Solana 🦀

Awesome Lists containing this project

README

        


Rust Calculator 🖩 in Solana 🦀




This Calculator written Rust using [Anchor âš“](https://project-serum.github.io/anchor/getting-started/introduction.html)

## Setting up the Environment:

* Rust Installation:

```bash
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/env
rustup component add rustfmt
```

* Solana Installation:

```bash
sh -c "$(curl -sSfL https://release.solana.com/v1.8.0/install)"
```
**Please update your `PATH` environment variable to include the solana programs**

* [Anchor âš“](https://project-serum.github.io/anchor/getting-started/introduction.html) Installation:

```bash
npm i -g @project-serum/anchor-cli
```

* And we can use Cargo to install CLI:

```bash
cargo install --git https://github.com/project-serum/anchor --tag v0.17.0 anchor-cli --locked
```

---

## Configurations on Solana CLI

```bash
solana config get
```

Configure `RPC URL`

```bash
solana config set --url localhost
```

Wallet address and airdrop some **SOL**

```bash
solana address
```

* For more comprehensive details of your account

```
solana account
```
---

### Build project from scratch

* Setting up anchor project

```bash
anchor init

cd
```

* Compile the project

```bash
anchor build
```

* To run tests

```bash
anchor test
```