monero-integrations / monerophp
由Monero-Integrations团队编写的PHP Monero库。
dev-master
2024-01-20 09:09 UTC
Requires
- php: >=7.3
- ext-bcmath: *
- ext-curl: *
- ext-json: *
- kornrunner/keccak: ^1.1
Requires (Dev)
Suggests
- ext-gmp: Used to have a multiple math precision for generating address
This package is auto-updated.
Last update: 2024-09-20 10:32:48 UTC
README
Monero库
由Monero Integrations 团队编写的PHP Monero库。
工作原理
此库包含3个主要部分
- Monero守护进程JSON RPC API包装器,
daemonRPC.php
- Monero钱包(《monero-wallet-rpc》)JSON RPC API包装器,
walletRPC.php
- Monero/Cryptonote工具箱,
cryptonote.php
,包含用于Monero相关密码学中的低级函数以及用于生成Monero私钥/公钥等高级方法。
除此之外,还包括其他用于可移植性的低级库,例如ed25519库、SHA3库等。
预览
文档
文档可以在 /docs
文件夹中找到。
配置
要求
- Monero守护进程(《monerod》)
- 带有PHP的Web服务器,例如XMPP、Apache或NGINX
- cURL PHP扩展用于JSON RPC API
- GMP PHP扩展,用于大约100倍的计算速度(与BCMath相比)
推荐使用Debian(或Ubuntu)。
入门
- 在testnet上启动Monero守护进程(《monerod》)。
monerod --testnet --detach
- 在testnet上启动Monero钱包RPC接口(《monero-wallet-rpc》)。
monero-wallet-rpc --testnet --rpc-bind-port 28083 --disable-rpc-login --wallet-dir /path/to/wallet/directory
-
编辑
example.php
,用您的《monerod》和《monero-wallet-rpc》的IP地址(对于testnet,分别使用127.0.0.1:28081
和127.0.0.1:28083
)。 -
使用您的Web服务器(例如XMPP、Apache/Apache2、NGINX等)提供
example.php
,并导航到它。如果一切设置正确,您的Monero守护进程和钱包的信息将显示出来。