Difference between `cargo build` , `cargo build-bpf` and `cargo build-sbf`

2.1k views Asked by At

I am new to blockchain and I am using solana/anchor/cargo/rust to build a project. I am confused about these commands. What is the difference between cargo build, cargo build-bpf and cargo build-sbf?

1

There are 1 answers

1
Frank C. On BEST ANSWER

cargo build - Unless otherwise directed to build for a different architecture, this will compile your rust source and emit an executable file.

cargo build-bpf - Solana programs (smart contracts) are compiled to BPF (google it) bytecode. The Solana program run-time executes your smart contract in a BPF VM. deprecated in favor of:

cargo build-sbf - More comprehensive implementation of generated byte-code and interpreter