Solana Anchor with Ruby On Rails

Viewed 25

Have the next problem, I use the Anchor to build and deploy the program on Solana blockchain and now I met with the problem of how to interact with this program using ruby in rails, as I understand it, first we have to use binary encoding to send a transaction, and if we want to get data, use the same decoding, maybe someone has some examples of how the encoding should be done correctly? as I understand it, we encode the ID of the program, the last hash of the block, the name of the function and the data to create a transaction. Maybe someone has done this using ruby and has an example? sincerely grateful!

1 Answers

It's going to be really annoying to do in Ruby. You have to use the Solana API/RPC to build and send the transaction, including encoding the data for accounts using Borsh (or whatever, but most use Borsh) etc.

I'd use JS/TS to do all of the interacting with your program unless you have a very good reason to do otherwise and a lot of time and energy on your hands. TS already has this stuff in web3.js / Anchor.

Related