Recall to API And reserve nodes [php-graphene-node-client v2.3.2]

Words
66
Reading
1 min
Listen
Play
9y

It is updated to solve error answers from API

WSConnectorAbstract.php was updated

  • possibility to recall to API when getting error in answer (default $maxNumberOfTriesToCallApi = 3)
  • possibility to connetc to reserve nodes (after $maxNumberOfTriesToCallApi tries recall you can connect to reserve nodes)

Use

<?php

namespace My\App\Commands;

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

class GolosWSConnector extends WSConnectorAbstract
{
    /**
     * @var string
     */
    protected $platform = self::PLATFORM_GOLOS;

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

    /**
     * wss or ws 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 = ['wss://ws.golos.io', 'wss://api.golos.cf'];
}



Github or packagist with MIT license. Author t3ran13@t3ran13

It is better with each commit

transisto@transisto add it to steemtools.com please

Recall to API And reserve nodes [php-graphene-node-client v2.3.2] | Ecency