Skip to content

Recall to API And reserve nodes

Choose a tag to compare

@t3ran13 t3ran13 released this 23 Oct 14:48
· 182 commits to master since this release

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'];
}