Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

knight2008/ethereum-php

Open more actions menu
 
 

Repository files navigation

PHP interface to Ethereum JSON-RPC API

Install the library in a composer file

{
  "repositories": [
    {
      "type": "git",
      "url": "https://github.com/digitaldonkey/ethereum-php.git"
    }
  ],
  "require": {
    "digitaldonkey/ethereum-php": "dev-master",
  }
}

This is the important part of composer.json in Drupal Ethereum Module.

Extend

use Ethereum\EthereumClient;
use Ethereum\Ethereum_Message;
use Ethereum\Ethereum_Transaction;

class EthereumController extends ControllerBase {

  public $client;

  public function __construct($host = FALSE) {
    if (!$host) {
      $host = 'http://localhost:8445'
    }
    $this->client = new EthereumClient($host);
  }

}

Use

    try {
      $eth = new EthereumController();
      echo $eth->client->eth_protocolVersion();
    }
    catch (\Exception $exception) {
      die ("Unable to connect.");
    }

Documentation

For reference see the Ethereum RPC documentation and for data encoding RLP ddcumentation in Ethereum Wiki.

There is also a more readyble Ethereum Frontier Guide version.

About

PHP interface to Ethereum JSON-RPC API.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%
Morty Proxy This is a proxified and sanitized view of the page, visit original site.