mirror of
https://github.com/clitor-is-protocol/kevacoin-php.git
synced 2025-02-10 22:14:17 +00:00
update readme
This commit is contained in:
parent
b2ed118272
commit
f4af32f33e
45
README.md
45
README.md
@ -1,2 +1,45 @@
|
|||||||
# kevacoin-php
|
# kevacoin-php
|
||||||
Composer library for PHP applications
|
|
||||||
|
Composer library for PHP applications
|
||||||
|
|
||||||
|
## Install
|
||||||
|
|
||||||
|
`composer require clitor-is-protocol/kevacoin`
|
||||||
|
|
||||||
|
## Examples
|
||||||
|
|
||||||
|
To simply interact with Kevacoin API, use PHP library, e.g.
|
||||||
|
|
||||||
|
`composer require kevachat/kevacoin`
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
// Connect kevacoin
|
||||||
|
$client = new \Kevachat\Kevacoin\Client(
|
||||||
|
$protocol,
|
||||||
|
$host,
|
||||||
|
$port,
|
||||||
|
$username,
|
||||||
|
$password
|
||||||
|
);
|
||||||
|
|
||||||
|
// Get meta data by namespace
|
||||||
|
if ($meta = $client->kevaGet($namespace, '_CLITOR_IS_'))
|
||||||
|
{
|
||||||
|
// Init reader with meta data received
|
||||||
|
$reader = new \ClitorIsProtocol\Kevacoin\Reader(
|
||||||
|
$meta['value']
|
||||||
|
);
|
||||||
|
|
||||||
|
// Recommended to check the meta is valid
|
||||||
|
if ($reader->valid())
|
||||||
|
{
|
||||||
|
// Grab namespace records from blockchain
|
||||||
|
if ($pieces = $client->kevaFilter($namespace))
|
||||||
|
{
|
||||||
|
// Implement your app logic
|
||||||
|
echo $reader->data($pieces);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
Loading…
x
Reference in New Issue
Block a user