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:
Ask Questions: Pay for the base fee and reward for each question you asked. Base fee will be returned when an answer is selected and the reward will be given to the selected answer.
Answer: You can submit the answer in the question's thread.
Earn:
solana-cli
or Sol Faucet.Please follow the following best practice for all development on this project.
app/
: frontend Vuejs applicationprograms/
: Rust backend smart contracttarget/
: target directory for deployment, generated after anchor build
target/deploy/so_lution-keypair.json
: the private key that proves you own the contracttarget/idl/so_lution.json
: an interface description language file used to specify the interface between frontend and backend, like a schematests/
: tests that are run against the Rust backendAnchor.toml
: the main configuration file for AnchorVersions
node 16.*.*
anchor-cli 0.24.2
solana-cli 1.9.25
rustc 1.61.0
Current Deployed ProgramID on Devnet: AhTPm4QecF67HhvFnYVJkM9jrgMwJcJNC3ULTHnaxdkX
target/deploy/so_lution-keypair.json
Authority of Deployed Program on Devnet: Eyrm7NECYjcR2AZh1BfQ63mLoDBycwuFQRhiU4FrdQem
When you change the programID, make sure to check the following files and make sure that they or consistent (or you can just Ctrl + F search the entire directory)
Anchor.toml
programs/src/lib.rs
target/idl/so_lution.json
# Generate new keypair
solana-keygen new
# Check your wallet address
solana address
# Check your wallet balance
solana balance
# 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
# 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
Anchor.toml
, programs/src/lib.rs
anchor run copy-idl
import base58
json_string = [...] # ~/.config/solana/id.json
private_key = base58.b58encode(bytes(json_string))
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
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.