README.md
This commit is contained in:
parent
eca04e1c91
commit
41887b35b0
53
README.md
Normal file
53
README.md
Normal file
@ -0,0 +1,53 @@
|
||||
# web3.php
|
||||
|
||||
A php interface for interacting with the Ethereum blockchain and ecosystem.
|
||||
|
||||
# Install
|
||||
|
||||
composer sc0vu/web3.php
|
||||
|
||||
# Usage
|
||||
|
||||
### Web3
|
||||
|
||||
###### simple
|
||||
```
|
||||
use Web3/Web3;
|
||||
|
||||
$web3 = new Web3('http://localhost:8545');
|
||||
$web3->clientVersion(function ($err, $version) {
|
||||
if ($err !== null) {
|
||||
// do something
|
||||
return;
|
||||
}
|
||||
if (isset($client->result)) {
|
||||
echo 'Client version: ' . $version->result;
|
||||
} else {
|
||||
// do something rpc error
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
###### batch
|
||||
```
|
||||
use Web3/Web3;
|
||||
|
||||
$web3 = new Web3('http://localhost:8545');
|
||||
$web3->batch(true);
|
||||
$web3->clientVersion();
|
||||
$web3->hash('0x1234');
|
||||
$web3->execute(function ($err, $data) {
|
||||
if ($err !== null) {
|
||||
// do something
|
||||
return;
|
||||
}
|
||||
// do something
|
||||
})
|
||||
```
|
||||
|
||||
### Eth
|
||||
|
||||
Todo
|
||||
|
||||
# License
|
||||
MIT
|
Loading…
Reference in New Issue
Block a user