@@ -26,6 +26,7 @@ install extensions
2626<?php
2727
2828use GrapheneNodeClient\Commands\CommandQueryData;
29+ use GrapheneNodeClient\Commands\Commands;
2930use GrapheneNodeClient\Commands\Single\GetDiscussionsByCreatedCommand;
3031use GrapheneNodeClient\Connectors\WebSocket\GolosWSConnector;
3132use GrapheneNodeClient\Connectors\WebSocket\SteemitWSConnector;
@@ -48,10 +49,21 @@ $commandQuery->setParamByKey('0:limit', $limit);
4849$commandQuery->setParamByKey('0:select_tags', [$tag]);
4950$commandQuery->setParamByKey('0:tag', $tag);
5051
52+
53+ //and use single command
5154$command = new GetDiscussionsByCreatedCommand(new GolosWSConnector());
5255$golosPosts = $command->execute(
5356 $commandQuery
5457);
58+
59+ //or commands aggregator class
60+ $commands = new Commands(new GolosWSConnector());
61+ $golosPosts = $commands->get_discussions_by_created()
62+ ->execute(
63+ $commandQuery
64+ );
65+
66+
5567// will return
5668// [
5769// "id" => 1,
@@ -66,12 +78,25 @@ $golosPosts = $command->execute(
6678// ]
6779// ]
6880
81+
82+ //single command
6983$command = new GetDiscussionsByCreatedCommand(new SteemitWSConnector());
7084$steemitPosts = $command->execute(
7185 $commandQuery,
7286 'result',
7387 SteemitWSConnector::ANSWER_FORMAT_ARRAY // or SteemitWSConnector::ANSWER_FORMAT_OBJECT
7488);
89+
90+ //or commands aggregator class
91+ $commands = new Commands(new GolosWSConnector());
92+ $golosPosts = $commands->get_discussions_by_created()
93+ ->execute(
94+ $commandQuery,
95+ 'result',
96+ SteemitWSConnector::ANSWER_FORMAT_ARRAY // or SteemitWSConnector::ANSWER_FORMAT_OBJECT
97+ );
98+
99+
75100// will return
76101// [
77102// [
@@ -119,7 +144,11 @@ $steemitPosts = $command->execute(
119144
120145All single commands can be called through Commands Class as methods (example: (new Commands)->get_block()->execute(...) )
121146
147+
122148### broadcast operations templates
149+
150+ namespace GrapheneNodeClient\Tools\ChainOperations
151+
123152- vote
124153- transfer
125154- comment
@@ -161,12 +190,16 @@ $answer = OpVote::doSynchronous(
161190
162191## Implemented Connectors List
163192
164- namespace: GrapheneNodeClient\Connectors\WebSocket;
193+ namespace: GrapheneNodeClient\Connectors\WebSocket OR GrapheneNodeClient\Connectors\Http ;
165194
166195- GolosWSConnector (wss://ws.golos.io)
167- - SteemitWSConnector (wss://ws.steemit.com)
196+ - SteemitWSConnector (wss://steemd.minnowsupportproject.org)
197+ - SteemitHttpConnector (https://steemd.privex.io )
198+
199+ List of available STEEM nodes are [ here] ( https://www.steem.center/index.php?title=Public_Websocket_Servers )
200+
168201
169- switch between connectors
202+ #### Switching between connectors
170203``` php
171204<?php
172205
@@ -254,6 +287,13 @@ class GolosWSConnector extends WSConnectorAbstract
254287 */
255288 protected $platform = self::PLATFORM_GOLOS;
256289
290+ /**
291+ * waiting answer from Node during $wsTimeoutSeconds seconds
292+ *
293+ * @var int
294+ */
295+ protected $wsTimeoutSeconds = 5;
296+
257297 /**
258298 * max number of tries to get answer from the node
259299 *
0 commit comments