alex-mamchenkov / multichain-jsonrpc
Multichain JSON-RPC Client
v1.0.1
2018-04-26 09:47 UTC
Requires
- php: >=7.0
- guzzlehttp/guzzle: ~6.0
This package is auto-updated.
Last update: 2025-05-27 04:39:00 UTC
README
About
Multichain JsonRPC Client class allows to interact with a JSON RPC blockchain APIs by sending the commands and getting back response arrays of data.
This implementation also allows to work with MultiChain (https://www.multichain.com/) blockchain platform by providing chain name during the initialization of the instance.
As none of the blockchain APIs are directly defined in the Client, but instead a proxy via magic method is used, it should be possible to use this client with more or less any blockchain JSON-RPC service.
Developed by Alexander Mamchenkov (http://alex.mamchenkov.net)
Usage Example
# Create new instance
$instance = new AlexMamchenkov\Multichain\JsonRPC\Client([
'url' => 'http://127.0.0.1:7208',
'user' => 'rpcuser',
'pass' => 'rpcpass',
'chain' => 'test'
]);
# Get blockchain info
print_r($instance->getinfo());
# For MultiChain streams
print_r($instance->liststreamitems('test_stream'));