All Projects → kesar → Ethereum Php

kesar / Ethereum Php

Ethereum Client in PHP

Projects that are alternatives of or similar to Ethereum Php

Iroha Ios
iOS Swift library for Iroha, a simple distributed ledger
Stars: ✭ 81 (-8.99%)
Mutual labels:  blockchain
Blockchain Kotlin
这是kotlin版的简化示例区块链demo;另外还有java版的;这个小demo能让你了解区块链中增加/效验Hash,增加工作量证明,增加/效验preHash,转账,利用webSocket技术实现节点之间的通信/同步/广播.
Stars: ✭ 85 (-4.49%)
Mutual labels:  blockchain
Polymesh
Node for Polymesh Blockchain
Stars: ✭ 88 (-1.12%)
Mutual labels:  blockchain
Stellarexplorer
Ledger Explorer for the Stellar Network 🚀
Stars: ✭ 82 (-7.87%)
Mutual labels:  blockchain
Elementsproject.org
Source code for the ElementsProject.org website
Stars: ✭ 84 (-5.62%)
Mutual labels:  blockchain
Awesome Privacy On Blockchains
A curated list of privacy on blockchains resources
Stars: ✭ 86 (-3.37%)
Mutual labels:  blockchain
Iroha Python
Python library for Hyperledger Iroha, a simple distributed ledger.
Stars: ✭ 81 (-8.99%)
Mutual labels:  blockchain
Dotcoin
A simple and integrity blockchain implementation in Golang
Stars: ✭ 89 (+0%)
Mutual labels:  blockchain
Solana Web3.js
Solana JavaScript SDK
Stars: ✭ 85 (-4.49%)
Mutual labels:  blockchain
Bitnfc
Bitcoin NFC Android Mobile Wallet - JS + Ionic + Cordova + Bitcore + Blockchain.info API + Cordova NFC plugin
Stars: ✭ 88 (-1.12%)
Mutual labels:  blockchain
Chaingear
The consensus computer driven database framework
Stars: ✭ 83 (-6.74%)
Mutual labels:  blockchain
Clutter
Fully distributed twitter built on holochain
Stars: ✭ 84 (-5.62%)
Mutual labels:  blockchain
Blockchaintechnology
Blockchain Frontier Technology Tracking
Stars: ✭ 88 (-1.12%)
Mutual labels:  blockchain
Copernicus
An alternative implementation of the Bitcoin Cash protocol, written in Golang
Stars: ✭ 83 (-6.74%)
Mutual labels:  blockchain
Tokenscript
TokenScript schema, specs and paper
Stars: ✭ 89 (+0%)
Mutual labels:  blockchain
Whale
🐋 Show Ethereum and Bitcoin price in command line interface (CLI).
Stars: ✭ 81 (-8.99%)
Mutual labels:  blockchain
Purple
Official Rust implementation of the Purple Protocol
Stars: ✭ 85 (-4.49%)
Mutual labels:  blockchain
Hypepool
🚀 ⚡️ ✨ next-gen mining pool server software
Stars: ✭ 89 (+0%)
Mutual labels:  blockchain
Vvisp
A Smart Way to Operate Smart Contracts on EVM Based Blockchains like Ethereum
Stars: ✭ 89 (+0%)
Mutual labels:  blockchain
Bitsharesjs
JavaScript tools for BitShares Encryption and Serialization
Stars: ✭ 88 (-1.12%)
Mutual labels:  blockchain

Ethereum Client in PHP

Examples:

<?php
use EthereumPHP\EthereumClient;
use EthereumPHP\Types\BlockHash;
use EthereumPHP\Types\BlockNumber;

include 'vendor/autoload.php';

$randomAddress = new \EthereumPHP\Types\Address('0x7eff122b94897ea5b0e2a9abf47b86337fafebdc');
$randomHash = '0xb903239f8543d04b5dc1ba6579132b143087c68db1b2168786408fcbce568238';

$client = new EthereumClient('http://localhost:8545');

// net
echo $client->net()->version() , PHP_EOL;
echo $client->net()->listening() , PHP_EOL;
echo $client->net()->peerCount() , PHP_EOL;


// web3
echo $client->web3()->clientVersion() , PHP_EOL;
echo $client->web3()->sha3('0x68656c6c6f20776f726c64') , PHP_EOL;
echo $client->eth()->protocolVersion() , PHP_EOL;
echo $client->eth()->syncing() , PHP_EOL;

// eth
$coinbase = $client->eth()->coinbase();
if ($coinbase) {
    echo $coinbase->toString() , PHP_EOL;
}
echo $client->eth()->mining() , PHP_EOL;
echo $client->eth()->hashRate() , PHP_EOL;
echo $client->eth()->gasPrice()->toEther() , PHP_EOL;
foreach ($client->eth()->accounts() as $account) {
    echo $account->toString() , PHP_EOL;
}

echo $client->eth()->blockNumber() , PHP_EOL;
echo $client->eth()->getBalance($randomAddress, new BlockNumber())->toEther() , PHP_EOL;
echo $client->eth()->getTransactionCount($randomAddress, new BlockNumber()) , PHP_EOL;
echo $client->eth()->getBlockTransactionCountByHash(new BlockHash($randomHash)) , PHP_EOL;
echo $client->eth()->getUncleCountByBlockHash(new BlockHash($randomHash)) , PHP_EOL;
echo $client->eth()->getUncleCountByBlockNumber(new BlockNumber()) , PHP_EOL;
echo $client->eth()->getCode($randomAddress, new BlockNumber()) , PHP_EOL;
echo $client->eth()->sign($randomAddress, '0xdeadbeaf') , PHP_EOL;
foreach ($client->eth()->getCompilers() as $compiler) {
    echo $compiler , PHP_EOL;
}
print_r($client->eth()->compileSolidity('contract test { function multiply(uint a) returns(uint d) {   return a * 7;   } }"'));


// management: personal
foreach ($client->personal()->listAccounts() as $account) {
    echo $account->toString() , PHP_EOL;
}
$account = $client->personal()->newAccount('test');
echo $account->toString() , PHP_EOL;
echo $client->personal()->unlockAccount($account, 'test', 20) , PHP_EOL;
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].