# EthereumPHP **Repository Path**: pinyutest/ethereum-php ## Basic Information - **Project Name**: EthereumPHP - **Description**: 1 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-12-13 - **Last Updated**: 2022-12-13 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Ethereum Client in PHP Examples: ```php 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; ```