0

I'm trying to develop a web application that interacts with web3. I have to create accounts, wallet and perform transaction. I'd like to know which is the best way to interact with web3 on the server side.

  • Just require the library in your nodejs code. What are you writing your server in? – cleanunicorn Mar 16 '18 at 13:25
  • PHP, i'm not be able to integrate php with nodejs – alle.manfredi Mar 16 '18 at 14:04
  • You need a library that implements this github.com/ethereum/wiki/wiki/JSON-RPC – cleanunicorn Mar 16 '18 at 14:10
  • Or you could write your own library that sends requests to an Ethereum node – cleanunicorn Mar 16 '18 at 14:12
  • Write node scripts that PHP calls to execute. Or as already stated, create your own PHP library or find someone that has. :) – MSwezey Mar 16 '18 at 14:31
0

To interact with the Ethereum network you need to be able to communicate with a node.

The web3 library does exactly this but it is for JavaScript. For other languages you need to find a library that has the JSON-RPC calls implemented or write your own library that does this.

0

On the server side, we have another native golang binding with smart contract, we dont need to use web3

https://github.com/ethereum/go-ethereum/wiki/Native-DApps:-Go-bindings-to-Ethereum-contracts

0

Since you mentioned you're using PHP on the server side, check out the ethereum-php client.

require __DIR__ . '/vendor/autoload.php';
use Ethereum\Ethereum;

try {
    $eth = new Ethereum('https://mainnet.infura.io');
    echo $eth->eth_protocolVersion()->val();
}
catch (\Exception $exception) {
    die ("Unable to connect.");
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.