Skip to content
This repository has been archived by the owner on Apr 19, 2022. It is now read-only.

Latest commit

 

History

History
62 lines (47 loc) · 1.61 KB

README.md

File metadata and controls

62 lines (47 loc) · 1.61 KB

Voting example (Solana program)

Solana is a decentralized blockchain.

Run on a local machine

  1. Check you've installed Rust:

    rustc -V # rustc 1.55.0 (c8dfcfe04 2021-09-06)
  2. Check you've installed Solana CLI:

    solana -V # solana-cli 1.7.12 (src:ca83167c; feat:2013646575)
    • Note: The example has been developed on Kubuntu 21.04.
    • Note: Use WSL on Windows.
  3. Check you've installed Node.js:

    node --version # v12.21.0
  4. Check you've installed Yarn:

    yarn --version # 1.22.15
  5. Check you've installed Anchor:

    anchor --version # 0.17.0
  6. Go to the /program directory.

  7. Start Solana localnet:

    solana-test-validator -C ./config.yml
    • Tip: -r, --reset: Reset the ledger to genesis if it exists.
  8. Open a new terminal tab and go to /program again.

  9. Airdrop SOLs

    solana airdrop -C ./config.yml 1 ./keypairs/voting-owner-keypair.json
    
    solana airdrop -C ./config.yml 1 ./keypairs/voter-keypair.json
  10. Build the program:

    anchor build
  11. Deploy the program:

    solana program deploy -C ./config.yml --program-id ./keypairs/program-keypair.json ./target/deploy/voting_program.so
    • Note: We can't (?) set a custom keypair with anchor deploy.
  12. Continue in /app/README.md.