Several quick start options are available:
- Download the latest release.
- Clone the repo:
git clone https://github.com/adshares/php-ads-client.git
- Install with Composer:
composer require adshares/ads-client
Initialize CliDriver (Command line Driver) with ADS blockchain credentials (account address, private key, node host and port).
$driver = new CliDriver($this->address, $this->secret, $this->host, $this->port);
Please, note that by default CliDriver
ads as ADS blockchain client application
and saves cache to
This behaviour can be overwritten with
Initialize client with driver.
$client = new AdsClient($driver);
Call commands using created client. In current version client supports all block explorer commands and basic transaction.
Supported block explorer commands:
Tests are split into three categories: end-to-end, unit and coding style.
Aim of end to end test is to check integration between PHP ADS Client and ADS blockchain network. Therefore working network must be set and ADS client must be installed in system. Tests are placed in
tests/E2E directory and can be run with PHPUnit.
Unit tests are placed in
tests/Unit directory and can be run with PHPUnit.
Coding style tests
PHP Code Sniffer is used to check compatiblity with PHP language and PSR-2 standard.
./vendor/bin/phpcs -s --standard=PHPCompatibility src tests ./vendor/bin/phpcs -s --standard=PSR2 src tests
PHP Code Beautifier and Fixer can be used for automatic fix of PSR-2 incompatibility.
./vendor/bin/phpcbf -s --standard=PSR2 src tests
PHPStan is used for static analysis.
./vendor/bin/phpstan --no-ansi --no-progress analyse -c phpstan.neon -l 7 src tests