-1

I am trying to create a web wallet application using "@solana/web3.js" for study purposes. The backend side is using PHP (Laravel).

Which of the following is the best option on how to call web3.js on the backend side?

  1. Call it from PHP using the exec function like "node xxxxx.js

  2. Call node.js from PHP via curl, etc.

  3. Using web3.js from PHP is not a good idea (backend should be implemented in node.js)

  4. None of the above (Please tell me how to do that.)

fujon
  • 1

2 Answers2

0

Maybe #4, look into ethereum's JSON RPC that web3.js wraps and call the endpoints directly from back-end.

Jakub Ner
  • 36
  • 2
0

Your best bet will be to use a PHP package that can interact with Solana. There's a currently-deprecated-but-maybe-coming-back package that you can use at https://github.com/tighten/solana-php-sdk

Jon C
  • 7,019
  • 10
  • 17