I am following rust tutorials online, and I found that some websites are using cargo build command while others are using anchor build command to build the project.
What is the difference between these two commands?
I am following rust tutorials online, and I found that some websites are using cargo build command while others are using anchor build command to build the project.
What is the difference between these two commands?
Jon C
On
Under the hood, anchor build does cargo build-bpf and then extracts the program's IDL at src/lib.rs.
cargo build-bpf (now cargo build-sbf) differs from cargo build because it specifically builds a Solana on-chain program, and not a general binary / library that can be used on your system.
And the IDL is an important feature of Anchor -- it exposes the program's interface to be consumed by any client.
Cargois Rust's build manager.Anchoris a framework specifically for solana/rust. It has extra features for a better development experience. It is similar totruffleframework for Ethereum.What Anchor does for you