Skip to content

Commit

Permalink
feat: add rust template
Browse files Browse the repository at this point in the history
  • Loading branch information
bartosz-lipinski committed Feb 16, 2021
1 parent c58d8f1 commit b67a1ba
Show file tree
Hide file tree
Showing 11 changed files with 6,209 additions and 8 deletions.
6 changes: 1 addition & 5 deletions .env
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
# HOST Public Key used for additional swap fees
LEND_HOST_FEE_ADDRESS=''

# Rewired variables to comply with CRA restrictions
REACT_APP_LEND_HOST_FEE_ADDRESS=$LEND_HOST_FEE_ADDRESS
# Add envrioment type variables this file to expose the to react app
38 changes: 35 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,37 @@
# dapp-scaffold
# Solana App Scaffold
Scaffolding for a dapp built on Solana

# Environment Setup
1. Install Rust from https://rustup.rs/
2. Install Solana v1.5.0 or later from https://docs.solana.com/cli/install-solana-cli-tools#use-solanas-install-tool
3. Install Node
4. Install NPM
5. Run
```
npm install
```
# Build Smart Contract (compiled for BPF)

```
$ cargo build-bpf
$ cargo test-bpf
```

# Run dapp

`
npm start
`

# Directory structure

## program

Solana program template in Rust by @mvines

### src/lib.rs


## src/actions

Setup here actions that will interact with Solana programs using sendTransaction function
Expand All @@ -15,11 +43,15 @@ React context objects that are used propagate state of accounts across the appli
## src/hooks

Generic react hooks to interact with token program:
* useUserBalance - query for balance of any user token by mint, returns:
- balance
- balanceLamports
- balanceInUSD
* useAccountByMint
* useTokenName
* useUserAccounts
* useUserBalance


## src/views

* home -
* faucet - airdrops SOL on Testnet and Devnet
3 changes: 3 additions & 0 deletions program/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/*-dump.txt
/*.so
/target/
Loading

0 comments on commit b67a1ba

Please sign in to comment.