Development And Debug Of php-graphene-node-client[Debugger sub-project]

in #utopian-io7 years ago

php-graphene-node-client

It is PHP API client for Steem/GOLOS blockchain

Github or packagist with MIT license. Author @t3ran13 and active helper @semaspring

Debugger

Sometimes you need checking of work some calls or debug them but you can't do you in the php-graphene-node-client library. To do it you need some project. Debugger was created for this goal - you can copy files to php-graphene-node-client library and develope/debug it on the fly (without install to any project).

Github

Install debugger

  • make cmd git clone git@github.com:t3ran13/php-graphene-node-client.git and copy files there (or if you have a project with php-graphene-node-client than make reserve copy and copy files there)
  • install docker
  • install docker-compose
  • cmd cd prodect_dir
  • run docker-compose project with cmd docker-compose up -d (to stop use docker-compose stop)
  • run from cmd docker-compose exec --user www-data php-fpm bash -c "composer install"

Remove debugger from project

  • cmd cd prodect_dir
  • cmd docker-compose down
  • delete all debugger files from project

Use

  • cmd cd prodect_dir
  • make some command call in Debug\Test.php
  • run docker
  • run docker project with cmd docker-compose up -d (to stop use docker-compose stop)
  • run from cmd docker-compose exec --user www-data php-fpm bash -c "php Debug/Test.php" and see answer

Examples Debug\Test.php

<?php


namespace GrapheneNodeClient\Debug;

use GrapheneNodeClient\Commands\CommandQueryData;
use GrapheneNodeClient\Commands\Login\GetApiByNameCommand;
use GrapheneNodeClient\Debug\Connectors\WebSocket\GolosWSConnector;
use GrapheneNodeClient\Debug\Connectors\WebSocket\SteemitWSConnector;
use GrapheneNodeClient\Debug\TestCommand;


ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
define('PATH', __DIR__ . '/..');
require __DIR__ . "/Autoloader.php"; // only in GrapheneNodeClient project
require __DIR__ . '/../vendor/autoload.php';



$command = new GetApiByNameCommand(new SteemitWSConnector());
$commandQueryData = new CommandQueryData();
$commandQueryData->setParams(
    ['follow_api']
);
$answer = $command->execute(
    $commandQueryData
);

echo '<pre>' . print_r($answer, true) . '<pre>';

//Or Broadcast Operation 

$answer = OpVote::doSynchronous(
    ConnectorInterface::PLATFORM_STEEMIT,
    'guest123',
    '5JRaypasxMx1L97ZUX7YuC5Psb5EAbF821kkAGtBj7xCJFQcbLg',
    'firepower',
    'steemit-veni-vidi-vici-steemfest-2016-together-we-made-it-happen-thank-you-steemians',
    10000
);

echo '<pre>' . print_r($answer, true) . '<pre>'; die;

You can use Debug\TestCommand.php as Template for your own commands

<?php

// code as above
use GrapheneNodeClient\Debug\TestCommand;

$command = new TestCommand(new GolosWSConnector());
$commandQueryData = new CommandQueryData();
$commandQueryData->setParams(
    ['follow_api']
);
$command->execute(
    $commandQueryData
);


It is better with each commit

Commits were done by me

  • added commands debugger
  • Removed the .idea folder
  • README.md upd
  • WSConnectorAbstract.php upd / dockerfile-php7-fpm upd for broadcast testing / Test.php added upvote operation



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

I think this post was upvoted to 100% by mistake by utopian-io.

An explanation should be coming.

Yes, it was a mistake. @elear was logged in with the utopian account. He mistakenly voted on it with 100%. Here's the explanation: https://steemit.com/mistake/@elear/i-made-a-mistake

We are sorry this happened.

))) remove flags please.
I do not need anti-utopian)

@t3ran13 I asked @grumpycat to remove the downvote. If it is not removed within the cash out, I will send you the equivalent of 11% utopian voting power in liquid steem. Sorry for the mistake. At least you got some more followers ;p

Thanks for minut of my success)
I hope he will remove flag, it is better than money)

Happy end

Hi . Im Rosa. I would like to know u more and be friends ?

This is likely a bug. There's even no comment from the bot.

it is soo awesome and do not need any comment! 80% sites in the world were made on PHP! https://haydenjames.io/80-percent-web-powered-by-php/

Haha. No, I mean that's how the utopian bot's supposed to work and this one's a deviation. A bug in the code. I wasn't talking anything about your post.

It is ok)
It was mine 1 minute of success

=)
it is ok, perhaps i am just lucky man)

Yes its needed more xplanation

i think bot is impressed, because 80% sites in the world are made with php. He just knows it and understend all importance of php client for steem blockchain! Clever bot)

Most likely!

No point in removing it though so I say, well done that man (lucky sod!)

This was my fault and I explain the reason here https://steemit.com/mistake/@elear/i-made-a-mistake. I am asking @grumpycat to remove the downvote.

@grumpycat
Why do not you like php?))

I want learn more, can you send me an email?

Hi . Im Rosa. I would like to know u more and be friends ?

what do you mean?
i am in steemit.chat with the same name

your post is very interesting, I like your post, because it can add insight to me, hopefully in the future can provide better postings, so I can know many things in my life, thank you very much. and also hopefully useful for other stemit friends.

What a nice vote keep it up,you can still make more of it

Hi . Im Rosa. I would like to know u more and be friends ?

Hi . Im Rosa. I would like to know u more and be friends ?

i think this is mistake from utopian bot ... because utopian never give upvote 100%
we will fixed this issue

Yes that true you clear the point and bring out the main point...comment and upvote @horlly

Php client is awesome!)

.

Show link pls

.

I got it from steemjs examples)
But anyway thank you!

.

You cant without active posting key)

Holy fuck that's a big vote!

That whale has sank the Titanic .....with his vote!

Hi . Im Rosa. I would like to know u more and be friends ?

i am surprised=)

Hi @aggroed it's surely a mistake. maybe this will be changed when @elear wakes up.

cool, thx.

@t3ran13 no error. You have done everything. It a killer post. That should hit $1000, yes it should. A big welldone.

Hi . Im Rosa. I would like to know u more and be friends ?

Repeating the same comment makes you sound like a bot! If it walks like a bot, squawks like a bot, it may be flagged for being a bot!

Your Reputation Could be a Tasty Snack with the Wrong Comment!

Thank You! ⚜

Yes that true because this platform is for people to use there medula oblaganta and there i q here

Helo rosa. How are you. I am esther. How is everything generally.

will see)
I do not think so, because I'm dark horse here

Nice one bro. Am seeing a new set of crptomilloniares from steem.
It so amazing been here.
Pls. Follow me and upvote am new
@maxvoice

Well done. Upvoted and followed.... waiting for more posts..

nice job..following you

Really good job bro thanks i like this post and your all post is very important and helpful thanks

Approved.

You can contact us on Discord.
[utopian-moderator]

thank you)

Thats a nice piece looking forward to creating something as good as yours u gething ma vote

Peace over all of us, very nice post from either the word or the appearance

I am a beginner, I need the support of seniors players long steemit to support my passion in playing this, steemit

I say thank you😊

Nice post,
I will love to learn more from you
@t3ran13 do follow back.
Thanks

Interesting this post, in fact I've been a few weeks in steemit and I'm taking experience in this

I really like to see your post, and can feel the pleasure there from your photos, your post is indeed very good, it seems I have a lot to learn from you, please help

It is not easy to understand, does it real works?

@t3ran13, interesting posts make the reader captivated...

Nice and useful post. I like your post. Hopefully what you give and inform in your post can be useful for everyone. Thank you.

Perfect explanation thanks. Upvoted.

very interesting i would like to learn more from you :) about blockchain :)

Very nice article. I like it the knowledge you have shared.
Follow me an upvote my posts. I'll follow you

Good info. Tq. Please up vote my post. Thanx

Great post .. i think 🙂

hello, i ve read thru but couldnt understand it.. can u explain further via email

Great one bro. I also have this feelings that steem will break record next year and build up another crptomillonaires.
Kudos bro. On your side.

Pls guys am new here show some love and follow me @maxvoice and upvote my INTRO. and comment. Love you all, WE SHALL MEET AT THE TOP.

I say thank you

a first timer at Utopian.io a 100%vote is rare...Congrats for the terrific work @t3ran13...kip up the good work.....

@utopian-io sometimes bot sleeps for longer and many a post does not get proper value. Please do something for them as well..

thank you) many people dislike 100%vote and flags me))) it is a little bit strange...

for example https://steemit.com/vessel/@jesta/vessel-0-2-0-interact-with-steem-securely-from-any-website
noone flag)))

indeed :) expect the unusual....@utopian-io

It's an error - the upvote will be fixed. The max upvote we have in the codes is around 10% and as you can see the @utopian.io bot didn't even commented here.

lol....sometimes bot sleeps so much tthat some post does not get proper value...and some time bot fumbles like aything...that make anyone a king overnite......

Yeah, the developers are working hard to make this bot work properly.

Да за твой пост нешуточная битва разыгралась! elear плюсанул его со 100% силой, вот только он был в это время не в своем аккаунте, а под утопианом. А боту не разрешается никого апать со 100%VP, вот кто-то и возмутился. Щас пытаются восстановить справедливость и отозвать флагеров.

Сначало минута славы, теперь минута позора)))
Мдя уж, вот и кодь для стима, я им такую штуку выкатил, а они думают что переплатили)))

Есть и позитив небольшой - ты привлек всеобщее внимание.
Заметь, создатель утопиана твою штуку заценил. И я так поняла, вообще посторонний чувак флаг кинул, из тех, у которых на все свое мнение, вроде бернисандерса.

Это он создатель утопиана? Прикольно)

Позитив конечно есть, +70 подписчиков, реклама в топе, комментов море, простотров море. Никто ничего не понимает, но все давольны и общаются) даже у ботов диалоги получились)))

This is another revolution to the steemers

What do you mean?)

Very good
Follow me @saifulnizam

HAHA you are such a geek!! love the debugger.

Hipster))

thanks you too)

You're responding to a comment farmer.

A farmer must reply and respond to comments but it must be a meaningful comment..upvote and comment @horlly.

it does not matter)

Hi . Im Rosa. I would like to know u more and be friends ?