This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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>"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require "../vendor/autoload.php"; | |
$rlp = new \FurqanSiddiqui\Ethereum\RLP(); | |
$jsonData = '{ | |
"emptystring": { | |
"in": "", | |
"out": "0x80" | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require "../vendor/autoload.php"; | |
$eth = new \FurqanSiddiqui\Ethereum\Ethereum(); | |
echo "<pre>"; | |
//// CREATE PRIVATE KEY | |
//$prv = $eth->keyPairs()->privateKeyFromEntropy(hash("sha256", "whocares1")); | |
//$prv1 = $eth->keyPairs()->privateKeyFromEntropy(hash("sha256", "whocares2")); | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require "../vendor/autoload.php"; | |
$eth = new \FurqanSiddiqui\Ethereum\Ethereum(); | |
$eth->networkConfig()->setChainId(3); | |
echo "<pre>"; | |
//// CREATE PRIVATE KEY | |
$prv = $eth->keyPairs()->privateKeyFromEntropy(hash("sha256", "whocares1")); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
declare(strict_types=1); | |
require "../vendor/autoload.php"; | |
$sky = new \SkyCoin\SkyCoin("192.168.100.27", 6420); | |
$walletFactory = new \SkyCoin\Wallets\WalletsFactory($sky); | |
echo "<pre>"; | |
////GET BLOCK BY HEIGHT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
declare(strict_types=1); | |
require "../vendor/autoload.php"; | |
use FurqanSiddiqui\ECDSA\ECDSA; | |
use FurqanSiddiqui\ECDSA\Curves\Secp256k1; | |
use Comely\DataTypes\Buffer\Base16; | |
use \kornrunner\Keccak; | |