Satoshi-api 0.3.2版本发布:简化比特币核心API访问
Satoshi-api 0.3.2版本发布:简化比特币核心API访问作者:James Bentley
来源:Pypi.org
引用:https://pypi.org/project/satoshi-api/0.3.2/
Satoshi-api 0.3.2版本正式发布,该版本通过提供一个干净的REST接口,将比特币核心的JSON-RPC封装起来,并增加了数据分析、智能缓存和分层速率限制等功能。此外,还提供了可选的集成,包括邮件通知(Resend)、持久速率限制(Upstash Redis)和以隐私为首要考虑的分析(PostHog),但默认情况下这些功能都是禁用的。
**安装与运行**
1. 使用pip安装satoshi-api:
pip install satoshi-api
2. 设置环境变量:
export BITCOIN_RPC_USER=your_user
export BITCOIN_RPC_PASSWORD=your_password
3. 运行satoshi-api:
satoshi-api
4. API访问地址:http://localhost:9332
5. 文档地址:http://localhost:9332/docs
**示例**
使用curl获取推荐费用:
curl http://localhost:9332/api/v1/fees/recommended | jq
输出示例:
{
"data": {
"recommendation": "Fees are low. Good time to send.",
"estimates": {
"high": 4,
"medium": 2,
"low": 1
}
},
"meta": {
"timestamp": "...",
"node_height": 939462,
"chain": "main
页:
[1]