Update Of PHP Graphene Node Client [v5.1.2 - v5.2.0]

in #utopian-io6 years ago

php-graphene-node-client

It is PHP API client for VIZ/STEEM/GOLOS/WHALESHARES blockchain

Github or packagist with MIT license. Author @t3ran13 and active contributor @semasping

In Release v5.1.2

  • upd VIZ public nodes list
  • fix InitConnector bug for VIZ

In Release v5.1.3

  • VIZ content operation was deleted
  • VIZ custom operation was added

In Release v5.1.3

  • Steem HTTPS nodes was updated in connector
  • Own Classes with operations IDs and fields types was added for each chain
  • New GetTransactionHex command was added (debug your serialized transactions)
  • New BOOL and INT8 types were added for operation fields
  • Beneficiaries serialization was fixeds

upd VIZ public nodes list

Actual list of VIZ nodes are:

fix InitConnector bug for VIZ

It was not working correct before and was fixed. Now you can use InitConnector for convenient simultaneous work with few chains.

$connector = InitConnector::getConnector(ConnectorInterface::PLATFORM_VIZ);

VIZ content operation was deleted

It was deprecated and does not wark in VIZ anymore.

VIZ custom operation was added

It is the same as custom_json in STEEM/GOLOS/WHALESHARES, but in VIZ it has other name

Example of using

$connector = InitConnector::getConnector(ConnectorInterface::PLATFORM_VIZ);
$chainName = $connector->getPlatform();
/** @var CommandQueryData $tx */
$tx = Transaction::init($connector);
$tx->setParamByKey(
    '0:operations:0',
    [
        'custom',
        [
            'required_auths'         => [],
            'required_posting_auths' => ['guest123'],
            'id'                     => 'YOUR_ID',
            'json'                   => json_encode(YOUR_JSON)
        ]
    ]
);
Transaction::sign(
    $chainName,
    $tx,
    [
        'posting' => '5POSTING_KEY', 
    ]
);

$command = new BroadcastTransactionSynchronousCommand($connector);
$answer = $command->execute(
    $tx
);

Steem HTTPS nodes was updated in connector

Actual list of STEEM HTTPS nodes are:

Own Classes with operations IDs and fields types was added for each chain

Each chain has own class with operations IDs and fields types:

  • ChainOperationsGolos.php
  • ChainOperationsSteem.php
  • ChainOperationsViz.php
  • ChainOperationsWhaleshares.php

Thanks of this each chain can has difference in operations from other and it is easy to add this changes.

New GetTransactionHex command was added (debug your serialized transactions)

It is best way for dubag serialiaer with GetTransactionHex api method.
You have to prepare Tx without signature and send it to node and witch back serialized hex string.

$chainName = $connector->getPlatform();
/** @var CommandQueryData $tx */
$tx = Transaction::init($connector);

$tx->setParamByKey(// some data
);

$command = new GetTransactionHexCommand($connector);
$answer = $command->execute(
    $tx
);
echo PHP_EOL . '<pre>' . print_r($answer, true) . '<pre>';

New BOOL and INT8 types were added for operation fields

This types use for serialization Tx. Now it is easy to add some operation with this types.

Beneficiaries serialization was fixeds

It was bug with serialization Tx with 2 and more beneficiaries. It works correct now.


It is better with each commit

Commits were done by me in master branch

  • fix InitConnector bug for VIZ
  • upd VIZ public nodes list
  • upd VIZ new operation
  • upd VIZ operation content is deleted
  • fix VIZ custom operation order
  • ups own operations list for each chain (last 14 days)
  • fix viz and whaleshares operations and new operation for steem, whale and golos (last 14 days)
  • add GetTransactionHex command (last 14 days)
  • add own serializer operations types for each chain (last 14 days)
  • add type BOOL for operation field and fix type beneficiaries (last 14 days)
  • upd https nodes of steem (last 14 days)
  • upd README (last 14 days)

Compare v5.1.1 - v5.2.0

Sort:  

Welcome back! It's cool to see you guys are still actively working on this, as I remember seeing some posts about this project before. Here is some feedback:

  • In the comparison there are some commits > 14 days old - even if we are sort of lenient with this, try and keep it below.
  • Some magic numbers like 16511 and variables called n2, n3 etc. - could make into constants and make more descriptive respectively.
  • Could provide a description of what the function does instead of only having the arguments' names and types.
  • Some funny indentation in the lists. Is lining up everything like this common in PHP?

Am interested to see what kind of features you guys add next. Any specific plans?


Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.

To view those questions and the relevant answers related to your post, click here.


Need help? Chat with us on Discord.

[utopian-moderator]

Hi :)
Thanks for feedback!

Some funny indentation in the lists. Is lining up everything like this common in PHP?

It is my style more than PSR, but at most it corresponds to PSR =)

Am interested to see what kind of features you guys add next. Any specific plans?

I do not have so much time as before and i am working ander other project - subchain for steem/viz chains.
i have some ideas about improvements for lib and i will add it in future

It's the 2nd time this week I've seen indentation like this, pretty funny. It reminds me of what I used to do when I first started programming because I thought it looked nice, and then someone told me off lol.

Thank you for your review, @amosbastian! Keep up the good work!

Hi @t3ran13!

Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation!
Your post is eligible for our upvote, thanks to our collaboration with @utopian-io!
Feel free to join our @steem-ua Discord server

Hey, @t3ran13!

Thanks for contributing on Utopian.
We’re already looking forward to your next contribution!

Get higher incentives and support Utopian.io!
Simply set @utopian.pay as a 5% (or higher) payout beneficiary on your contribution post (via SteemPlus or Steeditor).

Want to chat? Join us on Discord https://discord.gg/h52nFrV.

Vote for Utopian Witness!

Coin Marketplace

STEEM 0.19
TRX 0.19
JST 0.033
BTC 89479.36
ETH 3038.26
USDT 1.00
SBD 2.80