lajosbencz/geth-php

PHP wrapper for Geth JSON RPC

Installs: 393

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 1

Forks: 0

Open Issues: 1

pkg:composer/lajosbencz/geth-php

0.2.1 2017-09-14 10:13 UTC

This package is auto-updated.

Last update: 2025-10-12 06:53:10 UTC


README

PHP wrapper for Geth JSON-RPC

INSTALL

composer require lajosbencz/geth-php

USAGE

$geth = new \GethApi\GethApi([
        // Geth JSON-RPC version
        'version' => '2.0',
        // Host part of address
        'host' => '127.0.0.1',
        // Port part of address
        'port' => 8545,
        // Return results as associative arrays instead of objects
        'assoc' => true,
]);

$version = $geth->web3_getVersion();

$accounts = $geth->eth_accounts();
foreach($accounts as $account) {
    echo $account, ': ', $geth->eth_getBalance($account, 'latest'), PHP_EOL;
}

TODO

  • Parallel requests
  • Implement experimental PUB/SUB