bpx-chain/bpx-beacon-php 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

bpx-chain/bpx-beacon-php

最新稳定版本:1.0.0

Composer 安装命令:

composer require bpx-chain/bpx-beacon-php

包简介

Official PHP wrapper for the BPX Beacon Client RPC API

README 文档

README

Official PHP wrapper for the BPX Beacon Client RPC API

Install

composer require bpx-chain/bpx-beacon-php

Requirements

  • PHP >= 7.0
  • cURL

Usage

Check examples/ folder for more usage examples.

<?php
require __DIR__ . '/vendor/autoload.php';
    
try {
    $beacon = new BPX\Beacon('localhost', 8201, 'C:\private_beacon.crt', 'C:\private_beacon.key');
    $farmer = new BPX\Farmer('localhost', 8204, 'C:\private_farmer.crt', 'C:\private_farmer.key');
    $harvester = new BPX\Harvester('localhost', 8205, 'C:\private_harvester.crt', 'C:\private_harvester.key');
    $crawler = new BPX\Crawler('localhost', 8206, 'C:\private_crawler.crt', 'C:\private_crawler.key');
        
    var_dump(
        $beacon -> getBlockchainState()
    );
    
    var_dump(
        $farmer -> getRewardTargets(true)
    );
		
    $harvester -> refreshPlots();
    
    var_dump(
        $crawler -> getPeerCounts()
    );
}
    
catch(BPX\Exceptions\ConnException $e) {
    echo "Connection error: " . $e->getMessage();
}
    
catch(BPX\Exceptions\BPXException $e) {
    echo "BPX error: " . $e->getMessage();
}    
?>

统计信息

  • 总下载量: 18
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2024-10-27