Download the PHP package pnqi/ethereum-client without Composer
On this page you can find all versions of the php package pnqi/ethereum-client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download pnqi/ethereum-client
More information about pnqi/ethereum-client
Files in pnqi/ethereum-client
Package ethereum-client
Short Description ethereum rpc client, offline sign, php. fork from myxtype/ethereum-client.
License MIT
Informations about the package ethereum-client
PHP版以太坊RPC客户端
Fork from myxtype/ethereum-client.
更新说明
-
修复guzzle依赖版本:
从
"guzzlehttp/guzzle": "^6.3"
改为"guzzlehttp/guzzle": ">=6.3"
,这样可以防止与laravel9.x等父级项目依赖的guzzle版本相冲突。 - 修复
Utils::weiToEth()
非静态函数。
ethereum-client
ethereum rpc client, offline sign, php
PHP版的以太坊RPC客户端,支持离线交易、生成私钥与地址。你不用专门购买一台服务器来运行以太坊客户端。
你可以使用以太坊公共节点,比如:https://infura.io 你可以将你用户的私钥加密存储在数据库中,使用的时候取出解密,直接发送交易。
这样不仅高效率且安全(如果你执意要使用服务器来运行以太坊客户端,这个项目也支持)。
安装
composer.json
然后composer update
即可。
或者直接
composer require pnqi/ethereum-client
使用
详细使用请参考examples
文件夹
你可以在这里:https://infura.io/docs 看到更多可使用的RPC方法。
初始化
初始化你可以直接给一个RPC的连接地址,或者参考GuzzleHttp Options
给出一些自定义的选项。
GuzzleHttp Options.
RPC
使用RPC接口非常简单,你直接参考 https://ethereum.gitbooks.io/frontier-guide/content/rpc.html 这里列出的接口使用。
你需要根据RPC文档设置参数,注意数字一般都需要转为十六进制。
你也可以使用额外的RPC方法,当然这需要你的私有节点,如果你用的公共节点则没有此方法。
你可以直接使用这个类提供的离节点创建地址与私钥。
离线创建交易并用节点广播
你可以在你本地直接发送交易,而不需要私有节点,你只需要连接到公共节点就行。
All versions of ethereum-client with dependencies
kornrunner/keccak Version ^1.0
guzzlehttp/guzzle Version >=6.3