Skip to content
Maciej Pilarczyk edited this page Jul 20, 2021 · 9 revisions


We use SemVer for versioning. For the versions available, see the tags on this repository.

Several quick start options are available:


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 uses ads as ADS blockchain client application and saves cache to ~/.ads directory. This behaviour can be overwritten with $driver->setCommand(string) and $driver->setWorkingDir(string) methods.

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:

  • getAccount,
  • getAccounts,
  • getBlock,
  • getBlockIds,
  • getBroadcast,
  • getMe,
  • getMessage,
  • getMessageIds,
  • getTransaction.

Supported transactions:

  • broadcast,
  • sendMany,
  • sendOne.


Tests are split into three categories: end-to-end, unit and coding style.

End-to-end tests

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. ADS network configuration can be setup in phpunit.xml file.

Unit tests

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=PSR12 src tests

PHP Code Beautifier and Fixer can be used for automatic fix of PSR-2 incompatibility.

./vendor/bin/phpcbf -s --standard=PSR12 src tests

PHPStan is used for static analysis.

./vendor/bin/phpstan --no-ansi --no-progress analyse -c phpstan.neon -l 7 src tests