Skip to content

Instantly share code, notes, and snippets.

View askaaqib's full-sized avatar
⚒️
Same old, Same old

Aqib. askaaqib

⚒️
Same old, Same old
  • Pakistan
View GitHub Profile
@askaaqib
askaaqib / rlp.php
Last active November 6, 2020 05:10
RLPObject
<?php
$txBodyObj = new \FurqanSiddiqui\Ethereum\RLP\RLPObject();
$txBodyObj->encodeInteger("39");sh
//$txBodyObj->encodeInteger(2864434397);
$txBodyObj->encodeInteger(845527306194141);
$txBodyObj->encodeInteger(32);
$clause1 = new \FurqanSiddiqui\Ethereum\RLP\RLPObject();
$clause1->encodeHexString("9fdee3753061cc9033f8bcfb9fd81c18cc137f05");
@askaaqib
askaaqib / endians.php
Created November 10, 2020 06:21
Endians
<?php
require "../vendor/autoload.php";
$be = \FurqanSiddiqui\Ethereum\Math\Integers::Pack_UInt_BE(0x12135895);
$le = \FurqanSiddiqui\Ethereum\Math\Integers::Pack_UInt_LE(0x12135895);
echo "<h3>Big</h3>";
print_r($be);
echo "<h3>Little</h3>";
print_r($le);
@askaaqib
askaaqib / rlp-new.php
Created November 10, 2020 06:22
RLP from json to table
<?php
require "../vendor/autoload.php";
$rlp = new \FurqanSiddiqui\Ethereum\RLP();
$jsonData = '{
"emptystring": {
"in": "",
"out": "0x80"
},
@askaaqib
askaaqib / account-test.php
Created November 11, 2020 06:06
Account Test - TNC Sdk
<?php
require_once "../vendor/autoload.php";
$ip = "185.244.248.40";
$port = 3030;
$tnc = new \TNC\TncCoin($ip,$port);
$af=new \TNC\Accounts\AccountFactory($tnc);
//Get Account
//$account = $af->getAccounts(["lorenzo"]);
//echo "<pre>";
@askaaqib
askaaqib / block-test.php
Created November 11, 2020 06:07
Block Test - Tnc
<?php
require_once "../vendor/autoload.php";
$ip = "185.244.248.40";
$port = 3030;
$tnc = new \TNC\TncCoin($ip,$port);
$bf= new \TNC\Blocks\BlockFactory($tnc);
//Latest Block
@askaaqib
askaaqib / Tnc.php
Created November 11, 2020 06:14
TncCoin
<?php
require_once "../vendor/autoload.php";
$ip = "185.244.248.40";
$port = 3030;
$tnc = new \TNC\TncCoin($ip,$port);
//$accountFactory = new \TNC\Accounts\AccountFactory($tnc);
//$account = $accountFactory->createAccount("lorenzo","nopass","alex","nopass");
//print_r($account);
@askaaqib
askaaqib / client.php
Created November 12, 2020 06:15
Client Socket
<?php
$host = "127.0.0.1";
$port = 25003;
$message = "Hello Server";
echo "Message To server :".$message;
// create socket
$socket = socket_create(AF_INET, SOCK_STREAM, 0) or die("Could not create socket\n");
// connect to server
$result = socket_connect($socket, $host, $port) or die("Could not connect to server\n");
@askaaqib
askaaqib / server.php
Created November 12, 2020 06:16
Server Socket
<?php
// set some variables for configation
$host = "127.0.0.1";
$port = 25003;
// naver timeout! then set 0
set_time_limit(0);
// Create socket
$socket = socket_create(AF_INET, SOCK_STREAM, 0) or die("Could not create socket\n");
// Bind socket to port
$result = socket_bind($socket, $host, $port) or die("Could not bind to socket\n");
@askaaqib
askaaqib / bip39.php
Created November 17, 2020 07:23
Bip39, Create Entropy, Mnemonics, Seeds
<?php
declare(strict_types=1);
require "../vendor/autoload.php";
echo "<pre>";
$bip39 = new \FurqanSiddiqui\BIP39\BIP39();
//$entropy = \FurqanSiddiqui\BIP39\BIP39::Generate();
//$genEntropy = $bip39->generateSecureEntropy();
@askaaqib
askaaqib / account_details.php
Created November 25, 2020 04:35
Accoun Details - Stellar PHP Api
<?php
declare(strict_types=1);
require "../vendor/autoload.php";
use ZuluCrypto\StellarSdk\Server;
// See 01-create-account.php for where this was generated
//$publicAccountId = 'GCCZACJX7DHEWGK5WJ2ONRGAJN2RBGGCX3OO4NF66JMJ4MNACKED577A';
$publicAccountId = 'GBN2Q4QX72P5COMA2EJDRL42BCUXZVPM4FDNCMEMQHL7Z3AWJEL3SETT';