@@ -249,6 +249,14 @@ use GrapheneNodeClient\Connectors\ConnectorInterface;
249
249
250
250
class MyConnector implements ConnectorInterface
251
251
{
252
+ public function setConnectionTimeoutSeconds($timeoutSeconds) {
253
+ // TODO: Implement setConnectionTimeoutSeconds() method.
254
+ }
255
+
256
+ public function setMaxNumberOfTriesToReconnect($triesN) {
257
+ // TODO: Implement setMaxNumberOfTriesToReconnect() method.
258
+ }
259
+
252
260
/**
253
261
* platform name for witch connector is. steemit or golos.
254
262
*/
@@ -319,49 +327,49 @@ class GolosWSConnector extends WSConnectorAbstract
319
327
320
328
321
329
## Creating Own Command
330
+
331
+ You have to update $steemAPI/$golosAPI properties in class GrapheneNodeClient\Commands\Commands.php as shown below
332
+
322
333
``` php
323
334
<?php
324
335
325
- namespace My\App\Commands;
326
336
327
- use GrapheneNodeClient\Commands\Single\CommandAbstract;
337
+ namespace GrapheneNodeClient\Commands;
338
+
339
+
328
340
use GrapheneNodeClient\Connectors\ConnectorInterface;
329
341
330
- class MyCommand extends CommandAbstract
342
+ /**
343
+ * @method Commands broadcast_transaction()
344
+ * //...
345
+ * @method Commands your_method()
346
+ */
347
+ class Commands implements CommandInterface
331
348
{
332
- protected $method = 'method_name';
333
- //protected $apiName = 'login_api'; in CommandAbstract have to be set correct $apiName
334
-
335
- //If different for platforms
336
- protected $queryDataMap = [
337
- ConnectorInterface::PLATFORM_GOLOS => [
338
- //on the left is array keys and on the right is validators
339
- //validators for ani list element have to be have '*'
340
- '*:limit' => ['integer'], //the discussions return amount top limit
341
- '*:select_tags:*' => ['nullOrString'], //list of tags to include, posts without these tags are filtered
342
- '*:select_authors:*' => ['nullOrString'], //list of authors to select
343
- '*:truncate_body' => ['nullOrInteger'], //the amount of bytes of the post body to return, 0 for all
344
- '*:start_author' => ['nullOrString'], //the author of discussion to start searching from
345
- '*:start_permlink' => ['nullOrString'], //the permlink of discussion to start searching from
346
- '*:parent_author' => ['nullOrString'], //the author of parent discussion
347
- '*:parent_permlink' => ['nullOrString'] //the permlink of parent discussion
349
+ //...
350
+ //protected $projectApi = [ 'method_name' => [ 'apiName' => 'api_name', 'fields'=>['массив с полями из команды']]];
351
+ protected $steemAPI = [
352
+ //...
353
+ 'broadcast_transaction' => [
354
+ 'apiName' => 'network_broadcast_api',
355
+ 'fields' => [
356
+ '0:ref_block_num' => ['integer'],
357
+ '0:ref_block_prefix' => ['integer'],
358
+ '0:expiration' => ['string'],
359
+ '0:operations:*:0' => ['string'],
360
+ '0:operations:*:1' => ['array'],
361
+ '0:extensions' => ['array'],
362
+ '0:signatures' => ['array']
363
+ ]
348
364
],
349
- ConnectorInterface::PLATFORM_STEEMIT => [
350
- //for list params
351
- '*:tag' => ['nullOrString'], //'author ',
352
- '*:limit ' => ['integer'], //'limit'
353
- '*:start_author' => ['nullOrString'], //'start_author' for pagination,
354
- '*:start_permlink' => ['nullOrString'] //'start_permlink' for pagination,
365
+ //...
366
+ 'broadcast_transaction' => [
367
+ 'apiName' => 'your_method ',
368
+ 'fields ' => [
369
+ //your fields
370
+ ]
355
371
]
356
372
];
357
-
358
-
359
- //If the same for platforms
360
- //protected $queryDataMap = [
361
- // route example: 'key:123:array' => $_SESSION['key'][123]['array']
362
- // 'some_array_key:some_other_key' => ['integer'], // available validators are 'required', 'array', 'string',
363
- // 'integer', 'nullOrArray', 'nullOrString', 'nullOrInteger'.
364
- //];
365
373
}
366
374
367
375
@@ -399,6 +407,25 @@ $rep = Reputation::calculate($account['reputation']);
399
407
400
408
```
401
409
410
+ ## Bandwidth
411
+
412
+ Before to make transaction you can see user bandwidth
413
+
414
+ ``` php
415
+ <?php
416
+
417
+ use GrapheneNodeClient\Tools\Bandwidth;
418
+
419
+ $answer = Bandwidth::getBandwidthByAccountName('golos-top-newbie', 'market', $connector);
420
+
421
+ //Array
422
+ //(
423
+ // [used] => 3120016
424
+ // [available] => 148362781
425
+ //)
426
+
427
+ ```
428
+
402
429
403
430
## Transaction for blockchain (broadcast)
404
431
0 commit comments