Davirain 17afe2e7a4 add rust workspace and update crates version (#41) %!s(int64=2) %!d(string=hai) anos
..
anchor 17afe2e7a4 add rust workspace and update crates version (#41) %!s(int64=2) %!d(string=hai) anos
native 17afe2e7a4 add rust workspace and update crates version (#41) %!s(int64=2) %!d(string=hai) anos
solang 2c0880bb8d solang 0.3.1 %!s(int64=2) %!d(string=hai) anos
README.md a2831045ac reorg to match readme %!s(int64=3) %!d(string=hai) anos

README.md

Custom Instruction Data

Let's take a look at how to pass our own custom instruction data to a program. This data must be serialized to Berkeley Packet Filter (BPF) format - which is what the Solana runtime supports for serialized data.

BPF is exactly why we use cargo build-bpf to build Solana programs in Rust. For instructions sent over RPC it's no different. We'll use a library called borsh on both client and program side.


For native, we need to add borsh and borsh-derive to Cargo.toml so we can mark a struct as serializable to/from BPF format.

For Anchor, you'll see that they've made it quite easy (as in, they do all of the serializing for you).