Http connector for steemit [php-graphene-node-client v3.0.2]

in #utopian-io7 years ago (edited)

php-graphene-node-client
It is PHP API client for Steem/GOLOS blockchain

Github or packagist with MIT license. Author @t3ran13 and active helper @semasping

In Release v3.0.2

  • new Http connection
  • SteemitHttpConnector in InitConnector by default

Aсcording this post libraries need to use new endpoint and http/jsonrpc calls instead of websockets.

Usage example:
Let get account count in Steemit

use GrapheneNodeClient\Connectors\Http\SteemitHttpConnector;

$command = new GetAccountCountCommand(new SteemitHttpConnector());

$commandQuery = new CommandQueryData();
$content = $command->execute($commandQuery);

var_dump($content);

If you use own connector witch extends WSConnectorAbstract()
You have to use new HttpConnectorAbstract()

<?php

namespace My\App;

use GrapheneNodeClient\Commands\DataBase\CommandAbstract;
use GrapheneNodeClient\Connectors\ConnectorInterface;

class MySteemitConnector extends HttpConnectorAbstract
{
    /**
     * @var string
     */
    protected $platform = self::PLATFORM_STEEMIT;

    /**
     * max number of tries to get answer from the node
     *
     * @var int
     */
    protected $maxNumberOfTriesToCallApi = 3;

    /**
     * https or http servers, can be list. First node is default, other are reserve.
     * After $maxNumberOfTriesToCallApi tries connects to default it is connected to reserve node.
     *
     * @var string|array
     */
    protected $nodeURL = ['https://api.steemit.com'];
}



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

Thank you for the contribution. It has been approved.

You can contact us on Discord.
[utopian-moderator]

Hey @semasping I am @utopian-io. I have just upvoted you!

Achievements

  • You have less than 500 followers. Just gave you a gift to help you succeed!
  • Seems like you contribute quite often. AMAZING!

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!

mooncryption-utopian-witness-gif

Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x

Resteemed your article. This article was resteemed because you are part of the New Steemians project. You can learn more about it here: https://steemit.com/introduceyourself/@gaman/new-steemians-project-launch

Могу сказать одно, @semasping, что если человек крут, то он крут во всем!

Спасибо!

Мне пoнрaвилось, а чтo вы дyмaете по этомy поводу?

The @OriginalWorks bot has determined this post by @semasping to be original material and upvoted it!

ezgif.com-resize.gif

To call @OriginalWorks, simply reply to any post with @originalworks or !originalworks in your message!

Congratulations @semasping! You have completed some achievement on Steemit and have been rewarded with new badge(s) :

Award for the number of comments received

Click on any badge to view your own Board of Honor on SteemitBoard.
For more information about SteemitBoard, click here

If you no longer want to receive notifications, reply to this comment with the word STOP

By upvoting this notification, you can help all Steemit users. Learn how here!