Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
9a13f49
remove solana-validator crate
Arrowana May 12, 2021
69faf2b
Create .gitpod.yml
johnnieskywalker May 17, 2021
6fafc4a
Create .gitpod.Dockerfile
johnnieskywalker May 17, 2021
8fd3d52
Merge pull request #15 from johnnieskywalker/patch-1
bartosz-lipinski May 17, 2021
48635c1
Merge pull request #14 from Arrowana/remove-solana-validator
bartosz-lipinski May 17, 2021
582ebbc
localnet:logs: add url as a parameter
max-block May 18, 2021
3dbfb4e
Adds GitHub actions configuration
macalinao Jun 14, 2021
ab2b6a1
master -> main
macalinao Jun 14, 2021
f888b80
Merge pull request #16 from max-block/patch-1
bartosz-lipinski Jun 14, 2021
4559f2d
Working directory
macalinao Jun 14, 2021
db3b934
Remove lint/test
macalinao Jun 14, 2021
aa9ce89
Use rust stable
macalinao Jun 15, 2021
3e72a4f
Update cargo dependencies
macalinao Jun 15, 2021
7976a55
Use Solana 1.6.12 everywhere
macalinao Jun 15, 2021
d06bcad
install linux deps on unit tests
macalinao Jun 15, 2021
0b5da7c
Only include solana-validator in test-bpf
macalinao Jun 15, 2021
9699b76
Optional dependency
macalinao Jun 15, 2021
85f3d17
Optional dep
macalinao Jun 15, 2021
31c43b9
implement program test rather than using TestValidator
Arrowana Jun 15, 2021
b4bd88a
Merge pull request #22 from Arrowana/program-test
bartosz-lipinski Jun 17, 2021
cecbf58
Fix Jest test runner
ebramanti Jun 24, 2021
f540f74
update @solana packages
Arrowana Jul 22, 2021
0658f22
Merge pull request #26 from Arrowana/update-solana-packages
bartosz-lipinski Jul 23, 2021
3fc3f4d
Merge pull request #20 from saber-hq/igm/github-actions
bartosz-lipinski Jul 24, 2021
36df3ea
chore(deps): bump @solana/spl-token-registry from 0.2.2 to 0.2.203
dependabot[bot] Jul 24, 2021
105a608
Merge branch 'main' into fix-jest-tests
bartosz-lipinski Jul 26, 2021
569a74d
Merge pull request #24 from ebramanti/fix-jest-tests
bartosz-lipinski Jul 26, 2021
8b8fe5a
Merge pull request #33 from solana-labs/dependabot/npm_and_yarn/solan…
bartosz-lipinski Jul 26, 2021
00aa49c
Adds solana wallet adapter (#39)
0xC0A1 Aug 11, 2021
94b1986
feat: update keys to show connection to mainnet
bartosz-lipinski Aug 28, 2021
de54f17
Merge remote-tracking branch 'upstream/main' into feature/keys
bartosz-lipinski Aug 28, 2021
c459115
chore: update format
bartosz-lipinski Aug 28, 2021
22b7f74
chore: fix build
bartosz-lipinski Aug 28, 2021
d5f960d
chore: format
bartosz-lipinski Aug 28, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "daily"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"

- package-ecosystem: "cargo"
directory: "/program"
schedule:
interval: "daily"
23 changes: 23 additions & 0 deletions .github/workflows/frontend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Frontend

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: "**/node_modules"
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- uses: actions/setup-node@v2
with:
node-version: "14"
- run: yarn install
- name: Build
run: yarn build
85 changes: 85 additions & 0 deletions .github/workflows/program.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

env:
CARGO_TERM_COLOR: always
SOLANA_VERSION: "1.6.12"
RUST_TOOLCHAIN: stable

defaults:
run:
working-directory: ./program

jobs:
lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Install Rust nightly
uses: actions-rs/toolchain@v1
with:
override: true
profile: minimal
toolchain: ${{ env.RUST_TOOLCHAIN }}
components: rustfmt, clippy
- name: Cache dependencies
uses: Swatinem/rust-cache@v1
- name: Run fmt
run: cargo fmt -- --check
- name: Run clippy
run: cargo clippy -- --deny=warnings

unit-tests:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Install Linux dependencies
run: sudo apt-get install -y pkg-config build-essential libudev-dev
- name: Install Rust nightly
uses: actions-rs/toolchain@v1
with:
override: true
profile: minimal
toolchain: ${{ env.RUST_TOOLCHAIN }}
- name: Cache dependencies
uses: Swatinem/rust-cache@v1
- name: Run unit tests
run: cargo test --lib

integration-tests:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Cache dependencies
uses: Swatinem/rust-cache@v1
- name: Install Linux dependencies
run: sudo apt-get install -y pkg-config build-essential libudev-dev

# Install Solana
- name: Cache Solana binaries
uses: actions/cache@v2
with:
path: ~/.cache/solana
key: ${{ runner.os }}-${{ env.SOLANA_VERSION }}
- name: Install Solana
run: |
sh -c "$(curl -sSfL https://release.solana.com/v${{ env.SOLANA_VERSION }}/install)"
echo "$HOME/.local/share/solana/install/active_release/bin" >> $GITHUB_PATH
export PATH="/home/runner/.local/share/solana/install/active_release/bin:$PATH"
solana --version
echo "Generating keypair..."
solana-keygen new -o "$HOME/.config/solana/id.json" --no-passphrase --silent

# Run tests
- name: Build program
run: cargo build-bpf
- name: Run tests
run: cargo test-bpf
1 change: 1 addition & 0 deletions .gitpod.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# ignore this file it is just to allow gitpod to run
24 changes: 24 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
image:
file: .gitpod.Dockerfile
tasks:
- init: |
sh -c "$(curl -sSfL https://release.solana.com/v1.6.12/install)"
export PATH=~/.local/share/solana/install/active_release/bin:$PATH
command: |
rustup toolchain link bpf node_modules/@solana/web3.js/bpf-sdk/dependencies/rust-bpf
gp open README-gitpod.md
yarn
yarn start

github:
prebuilds:
# enable for the master/default branch (defaults to true)
master: true
# enable for all branches in this repo (defaults to false)
branches: false
# enable for pull requests coming from this repo (defaults to true)
pullRequests: true
# add a check to pull requests (defaults to true)
addCheck: true
# add a "Review in Gitpod" button as a comment to pull requests (defaults to false)
addComment: true
33 changes: 20 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# 🏗 Solana App Scaffold

Scaffolding for a dapp built on Solana

# Quickstart
Expand All @@ -22,26 +23,30 @@ yarn start
```

# Environment Setup

1. Install Rust from https://rustup.rs/
2. Install Solana v1.6.7 or later from https://docs.solana.com/cli/install-solana-cli-tools#use-solanas-install-tool
3. Install Node
4. Install NPM, Yarn

# Build Smart Contract (compiled for BPF)

Run the following from the program/ subdirectory:

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

# Directory structure

## program

Solana program template in Rust

### program/src/lib.rs
* process_instruction function is used to run all calls issued to the smart contract

- process_instruction function is used to run all calls issued to the smart contract

## src/actions

Expand All @@ -54,20 +59,22 @@ React context objects that are used propagate state of accounts across the appli
## src/hooks

Pyth hook
* usePyth - hook for fetching products and prices

- usePyth - hook for fetching products and prices

Generic react hooks to interact with token program:
* useUserBalance - query for balance of any user token by mint, returns:
- balance
- balanceLamports
- balanceInUSD
* useUserTotalBalance - aggregates user balance across all token accounts and returns value in USD
- balanceInUSD
* useAccountByMint
* useTokenName
* useUserAccounts

- useUserBalance - query for balance of any user token by mint, returns:
- balance
- balanceLamports
- balanceInUSD
- useUserTotalBalance - aggregates user balance across all token accounts and returns value in USD
- balanceInUSD
- useAccountByMint
- useTokenName
- useUserAccounts

## src/views

* home - main page for your app
* faucet - airdrops SOL on Testnet and Devnet
- home - main page for your app
- faucet - airdrops SOL on Testnet and Devnet
Loading