PHPackages                             aelf/aelf-sdk - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. aelf/aelf-sdk

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

aelf/aelf-sdk
=============

AElf php SDK

v1.2.3(3y ago)1118[1 PRs](https://github.com/AElfProject/aelf-sdk.php/pulls)MITPHPPHP &gt;=5.6

Since Dec 10Pushed 2y ago7 watchersCompare

[ Source](https://github.com/AElfProject/aelf-sdk.php)[ Packagist](https://packagist.org/packages/aelf/aelf-sdk)[ Docs](https://github.com/AElfProject/aelf-sdk.php)[ RSS](/packages/aelf-aelf-sdk/feed)WikiDiscussions dev Synced 3w ago

READMEChangelog (3)Dependencies (7)Versions (8)Used By (0)

AElf-sdk.php
============

[](#aelf-sdkphp)

\#Introduction

This is a PHP client library, used to communicate with the [AElf](https://github.com/AElfProject/AElf) API.

Installation
------------

[](#installation)

AElf php SDK

In order to install this library via composer run the following command in the console:

```
$ composer require aelf/aelf-sdk

```

composer require curl/curl

If you directly clone the sdk You must install composer and execute it in the root directory

```
"aelf/aelf-sdk": "dev-dev"

```

Environment configuration And extensions that need to be turned on
------------------------------------------------------------------

[](#environment-configuration-and-extensions-that-need-to-be-turned-on)

```
1. PHP => 7.0
2. gmp
3. curl

```

Basic usage
-----------

[](#basic-usage)

```
require_once 'vendor/autoload.php';
use AElf\AElf;
$url = '127.0.0.1:8000';
$aelfClient = new AElf($url);
$height = $aelfClient->GetBlockHeight();
```

### Examples

[](#examples)

You can also see full examples in `./example`;

### Interface

[](#interface)

Interface methods can be easily available by the instance "aelfClient" shown in basic usage. The following is a list of input parameters and output for each method. Check out the [Web api reference](https://docs.aelf.io/v/dev/reference) for detailed Interface description.

#### IBlockAppService

[](#iblockappservice)

```
public function getBlockHeight();

public function getBlockByHash($blockHash,$includeTransactions = false);

public function getBlockByHeight($blockHeight,$includeTransactions = false);
```

#### IChainAppService

[](#ichainappservice)

```
public function getChainStatus();

public function getContractFileDescriptorSet($address);

public function getCurrentRoundInformationAsync();

public function getTaskQueueStatusAsync();

public function getChainIdAsync();
```

#### INetAppService

[](#inetappservice)

```
 public function addPeer($address);

 public function removePeer($address);

 public function getPeers($withMetrics);

 public function getNetworkInfo();
```

#### ITransactionAppService

[](#itransactionappservice)

```
public function getTransactionPoolStatus();

public function executeTransaction($input);

public function executeRawTransaction($input);

public function createRawTransaction($input);

public function sendRawTransaction($input);

public function sendTransaction($input);

public function sendTransactions($input);

public function getTransactionResult($transactionId);

public function getTransactionResults($blockHash, $offset = 0, $limit = 10);

public function getMerklePathByTransactionId($transactionId);
```

#### IClientService

[](#iclientservice)

```
public function isConnected();

public function getFormattedAddress($privateKey, $address);

public function getAddressFromPubKey($pubKey) ;

public function getGenesisContractAddress();

public function getContractAddressByName($privateKey, $contractNameHash);
```

### Test

[](#test)

This module contains tests for all services provided by AElf. You can see how to properly use services provided by AElf here.

You need to firstly set necessary parameters to make sure tests can run successfully.

1. Set baseUrl to your target url.

    ```
    $url = "Http://127.0.0.1:8001";
    ```
2. Give a valid privateKey of a node.

    ```
    $this->privateKey = 'be3abe5c1439899ac2efd0001e15715fd989a3ae11f09e1cb95d320cd4993e2a';
    ```

### Note

[](#note)

You need to run a local or remote AElf node to run the unit test successfully. If you're not familiar with how to run a node or multiple nodes, please see [Running a node](https://docs.AElf.io/v/dev/main/main/run-node) / [Running multiple nodes](https://docs.AElf.io/v/dev/main/main/multi-nodes) for more information.

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 58.1% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~409 days

Total

3

Last Release

1212d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/555c25e167ae42dccbff43319e651079d741a4cd06a62e9241e0ec5e8636d36a?d=identicon)[aelf](/maintainers/aelf)

---

Top Contributors

[![HeQiaoYu](https://avatars.githubusercontent.com/u/47774746?v=4)](https://github.com/HeQiaoYu "HeQiaoYu (36 commits)")[![DeepWY](https://avatars.githubusercontent.com/u/120615733?v=4)](https://github.com/DeepWY "DeepWY (17 commits)")[![wudameinv](https://avatars.githubusercontent.com/u/53204268?v=4)](https://github.com/wudameinv "wudameinv (7 commits)")[![jason-aelf](https://avatars.githubusercontent.com/u/45928543?v=4)](https://github.com/jason-aelf "jason-aelf (2 commits)")

---

Tags

aelf-sdkaelfAElf php SDK

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/aelf-aelf-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/aelf-aelf-sdk/health.svg)](https://phpackages.com/packages/aelf-aelf-sdk)
```

###  Alternatives

[google/common-protos

Google API Common Protos for PHP

175117.7M73](/packages/google-common-protos)[flow-php/flow

PHP ETL - Extract Transform Load - Data processing framework

85036.3k](/packages/flow-php-flow)[clarifai/clarifai-php-grpc

Clarifai PHP gRPC client

1229.6k](/packages/clarifai-clarifai-php-grpc)[volcengine/volc-sdk-php

Volcengine SDK for PHP

35129.1k5](/packages/volcengine-volc-sdk-php)[mynaparrot/plugnmeet-sdk

plugNmeet PHP SDK

102.8k](/packages/mynaparrot-plugnmeet-sdk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
