Skip to content

Latest commit

 

History

History
46 lines (34 loc) · 1.21 KB

README.md

File metadata and controls

46 lines (34 loc) · 1.21 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. Go to the /program directory.

  4. Start Solana localnet:

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

  6. Airdrop SOLs

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

    cargo build-bpf
  8. Deploy the program:

    solana program deploy -C ./config.yml --program-id ./keypairs/program-keypair.json ./target/deploy/voting_program.so
  9. Continue in /app/README.md.