Skip to content

API client lib for communication with geth (go-ethereum) node.

License

Notifications You must be signed in to change notification settings

Skillerz/geth-jsonrpc-php-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Downloads this Month Latest Stable Version Build Status Scrutinizer Code Quality Coverage Status

Introduction

This API client lib is used to communicate with geth (go-ethereum) node.

Via this client lib you can easily run operation on the node such is:

  • Get account balance,
  • sign transactions,
  • deploy transactions,
  • ...

Full documentation of all methods that can be run on geth node are described here: https://github.com/ethereum/wiki/wiki/JSON-RPC#json-rpc-methods

Install

composer require achse/geth-jsonrpc-php-client

Usage

// Create HTTP client instance (you can use something simplier just wrap it by using IHttpClient interface)
// Create JsonRpc client which can run any operation on your geth node
$httpClient = new GuzzleClient(new GuzzleClientFactory(), 'localhost', 8545);
$client = new Client($httpClient);

// Run operation (all are described here: https://github.com/ethereum/wiki/wiki/JSON-RPC#json-rpc-methods)
$result = $client->callMethod('eth_getBalance', ['0xf99ce9c17d0b4f5dfcf663b16c95b96fd47fc8ba', 'latest']);

// $result ==='0x16345785d8a0000'

About

API client lib for communication with geth (go-ethereum) node.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages