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 | |
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"; | |
$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"; | |
$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_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_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); | |
//$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 | |
$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 | |
// 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"); |
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"; | |
echo "<pre>"; | |
$bip39 = new \FurqanSiddiqui\BIP39\BIP39(); | |
//$entropy = \FurqanSiddiqui\BIP39\BIP39::Generate(); | |
//$genEntropy = $bip39->generateSecureEntropy(); |