<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
hubwiz01 / hyperledger-fabric-sdk-php-cn example snippets
$config = new \AmericanExpress\HyperledgerFabricClient\Config\ClientConfig([
// See `test/integration/config.php` for an example.
]);
$response = \AmericanExpress\HyperledgerFabricClient\Client\ClientFactory::fromConfig($config)
->getChannel('foo')
->getChaincode('example_cc')
->invoke('query', 'a');
$config = new \AmericanExpress\HyperledgerFabricClient\Config\ClientConfig([
// See `test/integration/config.php` for an example.
]);
$response = \AmericanExpress\HyperledgerFabricClient\Client\ClientFactory::fromConfig($config, 'peerOrg1')
->getChannel('foo')
->getChaincode('example_cc')
->invoke('query', 'a');
$config = new \AmericanExpress\HyperledgerFabricClient\Config\ClientConfig([
// See `test/integration/config.php` for an example.
]);
$options = new \AmericanExpress\HyperledgerFabricClient\Transaction\TransactionOptions([
'peer' => 'peer1',
]);
$response = \AmericanExpress\HyperledgerFabricClient\Client\ClientFactory::fromConfig($config, 'peerOrg1')
->getChannel('foo')
->getChaincode('example_cc')
->invoke('query', 'a', $options);
$config = new \AmericanExpress\HyperledgerFabricClient\Config\ClientConfig([
// See `test/integration/config.php` for an example.
]);
$response = \AmericanExpress\HyperledgerFabricClient\Client\ClientFactory::fromConfig($config)
->getChannel('foo')
->getChaincode(['name' => 'example_cc', 'version' => '1', 'path' => 'github.com/example_cc'])
->invoke('query', 'a');
composer docs
composer
bash
php --version
bash
git clone https://github.com/americanexpress/hyperledger-fabric-sdk-php && cd $_
composer update
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.