YHTerrance / SOLution

Novel concept of answer-to-earn platform built on Solana.
6 stars 0 forks source link
answer-to-earn blockchain rust solana vue3

SOLution

Concept

Our goal is to create a place for people to ask questions and get valuable answers incentivized by our novel business model of answer-to-earn. Since our main target is STEM students who strive to get the best quality of information from the Internet. Our app also supports Tex and Markdown syntaxes.

What you can do:

poster

Demo Video

SOLution Demo Video

Play with the app

  1. Install your wallet for Solana (Phantom or Solflare Supported).
  2. Airdrop yourself from SOL using solana-cli or Sol Faucet.
  3. Enjoy the app! (Demo Link).

Important: Before you start

Please follow the following best practice for all development on this project.

Project Structure

Resources

Environment

Getting Started (Development Cycle)

1. Clone repository

2. Create your Solana Wallet

# Generate new keypair
solana-keygen new
# Check your wallet address
solana address
# Check your wallet balance
solana balance

3. Develop locally

# Make sure you’re on the localnet.
solana config set --url localhost
# And check your Anchor.toml file. (check keypair path and network of use)

# Code…

# Run the tests. (builds, deploys, tests, and shuts off all at once)
anchor test

# -r resets the validator to genesis (or it will preload from test-ledger/)
solana-test-validator [-r]
anchor build
anchor deploy

# Run tests on the created local server to generate dummy data (Note that it will probably fail if your validator is not freshly created)
anchor run test

# Copy the new IDL to frontend.
anchor run copy-idl

# Serve your frontend application on localnet.
cd app && yarn run serve

4. Develop on Devnet (Possibly Mainnet in the future)

# Switch to the devnet cluster to deploy there.
solana config set --url devnet

# !! Update your Anchor.toml file !!

# Airdrop yourself some money if necessary. (Do this multiple times likely need 2 ~ 4 SOL)
solana airdrop 2

# Build and deploy to devnet.
anchor build
anchor deploy

# Copy the new IDL to frontend.
anchor run copy-idl

# Run frontend for devnet locally
cd app && yarn run serve:devnet

Helpful tips

Modifying program ID

Import filesystem wallet into Phantom wallet

import base58
json_string = [...] # ~/.config/solana/id.json
private_key = base58.b58encode(bytes(json_string))

Import Phantom wallet into filesystem wallet

import base58
byte_array = base58.b58decode(MY_PRIVATE_KEY_IN_BASE58)
json_string = "[" + ",".join(map(lambda b: str(b), byte_array)) + "]" # ~/.config/solana/id.json

License

SOLution is licensed under Apache 2.0.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in SOLution by you, as defined in the Apache-2.0 license, shall be licensed as above, without any additional terms or conditions.