@@ -26,6 +26,7 @@ install extensions
26
26
<?php
27
27
28
28
use GrapheneNodeClient\Commands\CommandQueryData;
29
+ use GrapheneNodeClient\Commands\Commands;
29
30
use GrapheneNodeClient\Commands\Single\GetDiscussionsByCreatedCommand;
30
31
use GrapheneNodeClient\Connectors\WebSocket\GolosWSConnector;
31
32
use GrapheneNodeClient\Connectors\WebSocket\SteemitWSConnector;
@@ -48,10 +49,21 @@ $commandQuery->setParamByKey('0:limit', $limit);
48
49
$commandQuery->setParamByKey('0:select_tags', [$tag]);
49
50
$commandQuery->setParamByKey('0:tag', $tag);
50
51
52
+
53
+ //and use single command
51
54
$command = new GetDiscussionsByCreatedCommand(new GolosWSConnector());
52
55
$golosPosts = $command->execute(
53
56
$commandQuery
54
57
);
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
+
55
67
// will return
56
68
// [
57
69
// "id" => 1,
@@ -66,12 +78,25 @@ $golosPosts = $command->execute(
66
78
// ]
67
79
// ]
68
80
81
+
82
+ //single command
69
83
$command = new GetDiscussionsByCreatedCommand(new SteemitWSConnector());
70
84
$steemitPosts = $command->execute(
71
85
$commandQuery,
72
86
'result',
73
87
SteemitWSConnector::ANSWER_FORMAT_ARRAY // or SteemitWSConnector::ANSWER_FORMAT_OBJECT
74
88
);
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
+
75
100
// will return
76
101
// [
77
102
// [
@@ -119,7 +144,11 @@ $steemitPosts = $command->execute(
119
144
120
145
All single commands can be called through Commands Class as methods (example: (new Commands)->get_block()->execute(...) )
121
146
147
+
122
148
### broadcast operations templates
149
+
150
+ namespace GrapheneNodeClient\Tools\ChainOperations
151
+
123
152
- vote
124
153
- transfer
125
154
- comment
@@ -161,12 +190,16 @@ $answer = OpVote::doSynchronous(
161
190
162
191
## Implemented Connectors List
163
192
164
- namespace: GrapheneNodeClient\Connectors\WebSocket;
193
+ namespace: GrapheneNodeClient\Connectors\WebSocket OR GrapheneNodeClient\Connectors\Http ;
165
194
166
195
- 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
+
168
201
169
- switch between connectors
202
+ #### Switching between connectors
170
203
``` php
171
204
<?php
172
205
@@ -254,6 +287,13 @@ class GolosWSConnector extends WSConnectorAbstract
254
287
*/
255
288
protected $platform = self::PLATFORM_GOLOS;
256
289
290
+ /**
291
+ * waiting answer from Node during $wsTimeoutSeconds seconds
292
+ *
293
+ * @var int
294
+ */
295
+ protected $wsTimeoutSeconds = 5;
296
+
257
297
/**
258
298
* max number of tries to get answer from the node
259
299
*
0 commit comments