Download the PHP package mul53/blzphp without Composer

On this page you can find all versions of the php package mul53/blzphp. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package blzphp

blzphp

Latest Version on Packagist Build Status Coverage Status Quality Score Total Downloads

Installation

You can install this library via Composer: composer require bluzelle/blzphp

Getting Started

In general, you must initialize blzphp before calling any other functions. Do the following using your own configuration parameters as applicable to initialize:

This performs some initial checks, retrieves your account information, and returns an object through which you can call the rest of the API functions.

You may now use the functions described below to perform database operations, as well as retrieve account and status information.

blzphp API documentation

Read below for detailed documentation on how to use the Bluzelle database service.

new Bluzelle\Client({...})

Configures the Bluzelle connection. Multiple clients can be created by creating new instances of this class.

Argument Description
address The address of your Bluzelle account
mnemonic The mnemonic of the private key for your Bluzelle account
endpoint (Optional) The hostname and port of your rest server. Default: http://localhost:1317
uuid (Optional) Bluzelle uses UUID's to identify distinct databases on a single swarm. We recommend using Version 4 of the universally unique identifier. Defaults to the account address.
chain_id (Optional) The chain id of your Bluzelle account. Default: bluzelle

The calls below are methods of the instance created by instantiating the Bluzelle::Swarm::Client class.

General Functions

version()

Retrieve the version of the Bluzelle service.

Returns a promise resolving to a string containing the version information, e.g.

Throws an exception if a response is not received from the connection.

account()

Retrieve information about the currently active Bluzelle account.

Returns a promise resolving to a JSON object representing the account information, e.g.

Throws an exception if a response is not received from the connection.

Database Functions

create($key, $value ,$gas_info[, $lease_info])

Create a field in the database.

Argument Description
key The name of the key to create
value The string value to set the key
gas_info Object containing gas parameters (see above)
lease_info (optional) Minimum time for key to remain in database (see above)

Returns a promise resolving to nothing.

Throws an exception when a response is not received from the connection, the key already exists, or invalid value.

read($key, $prove)

Retrieve the value of a key without consensus verification. Can optionally require the result to have a cryptographic proof (slower).

Argument Description
key The key to retrieve
prove A proof of the value is required from the network (requires 'config trust-node false' to be set)

Returns a promise resolving the string value of the key.

Throws an exception when the key does not exist in the database. Throws an exception when the prove is true and the result fails verification.

txRead($key, $gas_info)

Retrieve the value of a key via a transaction (i.e. uses consensus).

Argument Description
key The key to retrieve
gas_info Object containing gas parameters (see above)

Returns a promise resolving the string value of the key.

Throws an exception when the key does not exist in the database.

update($key, $value , gas_info, lease_info)

Update a field in the database.

Argument Description
key The name of the key to create
value The string value to set the key
gas_info Object containing gas parameters (see above)
lease_info (optional) Positive or negative amount of time to alter the lease by. If not specified, the existing lease will not be changed.

Returns a promise resolving to nothing.

Throws an exception when the key doesn't exist, or invalid value.

delete($key, $gas_info)

Delete a field from the database.

Argument Description
key The name of the key to delete
gas_info Object containing gas parameters (see above)

Returns a promise resolving to nothing.

Throws an exception when the key is not in the database.

has($key)

Query to see if a key is in the database. This function bypasses the consensus and cryptography mechanisms in favor of speed.

Argument Description
key The name of the key to query

Returns a promise resolving to a boolean value - true or false, representing whether the key is in the database.

txHas($key, $gas_info)

Query to see if a key is in the database via a transaction (i.e. uses consensus).

Argument Description
key The name of the key to query
gas_info Object containing gas parameters (see above)

Returns a promise resolving to a boolean value - true or false, representing whether the key is in the database.

keys()

Retrieve a list of all keys. This function bypasses the consensus and cryptography mechanisms in favor of speed.

Returns a promise resolving to an array of strings. ex. ["key1", "key2", ...].

txKeys($gas_info)

Retrieve a list of all keys via a transaction (i.e. uses consensus).

Argument Description
gas_info Object containing gas parameters (see above)

Returns a promise resolving to an array of strings. ex. ["key1", "key2", ...].

rename($key, $new_key, $gas_info)

Change the name of an existing key.

Argument Description
key The name of the key to rename
new_key The new name for the key
gas_info Object containing gas parameters (see above)

Returns a promise resolving to nothing.

Throws an exception if the key doesn't exist.

Argument Description
key The name of the key to query

Returns a promise resolving to a boolean value - true or false, representing whether the key is in the database.

count()

Retrieve the number of keys in the current database/uuid. This function bypasses the consensus and cryptography mechanisms in favor of speed.

Returns a promise resolving to an integer value.

txCount($gas_info)

Retrieve the number of keys in the current database/uuid via a transaction.

Argument Description
gas_info Object containing gas parameters (see above)

Returns a promise resolving to an integer value.

deleteAll($gas_info)

Remove all keys in the current database/uuid.

Argument Description
gas_info Object containing gas parameters (see above)

Returns a promise resolving to nothing.

keyValues()

Enumerate all keys and values in the current database/uuid. This function bypasses the consensus and cryptography mechanisms in favor of speed.

Returns a promise resolving to a JSON array containing key/value pairs, e.g.

txKeyValues($gas_info)

Enumerate all keys and values in the current database/uuid via a transaction.

Argument Description
gas_info Object containing gas parameters (see above)

Returns a promise resolving to a JSON array containing key/value pairs, e.g.

multiUpdate($key_values, $gas_info)

Update multiple fields in the database.

Argument Description
key_values An array of objects containing keys and values (see example avove)
gas_info Object containing gas parameters (see above)

Returns a promise resolving to nothing.

Throws an exception when any of the keys doesn't exist.

getLease($key)

Retrieve the minimum time remaining on the lease for a key. This function bypasses the consensus and cryptography mechanisms in favor of speed.

Argument Description
key The key to retrieve the lease information for

Returns a promise resolving the minimum length of time remaining for the key's lease, in seconds.

Throws an exception when the key does not exist in the database.

txGetLease($key, $gas_info)

Retrieve the minimum time remaining on the lease for a key, using a transaction.

Argument Description
key The key to retrieve the lease information for
gas_info Object containing gas parameters (see above)

Returns a promise resolving the minimum length of time remaining for the key's lease, in seconds.

Throws an exception when the key does not exist in the database.

renew_lease($key, $gas_info, $lease_info)

Update the minimum time remaining on the lease for a key.

Argument Description
key The key to retrieve the lease information for
gas_info Object containing gas parameters (see above)
lease_info (optional) Minimum time for key to remain in database (see above)

Returns a promise resolving the minimum length of time remaining for the key's lease.

Throws an exception when the key does not exist in the database.

renewLeaseAll($gas_info, $lease_info)

Update the minimum time remaining on the lease for all keys.

Argument Description
gas_info Object containing gas parameters (see above)
lease_info (optional) Minimum time for key to remain in database (see above)

Returns a promise resolving the minimum length of time remaining for the key's lease.

Throws an exception when the key does not exist in the database.

getNShortestLease($n)

Retrieve a list of the n keys in the database with the shortest leases. This function bypasses the consensus and cryptography mechanisms in favor of speed.

Argument Description
n The number of keys to retrieve the lease information for

Returns a JSON array of objects containing key, lease (in seconds), e.g.

txGetNShortestLease($n, $gas_info)

Retrieve a list of the N keys/values in the database with the shortest leases, using a transaction.

Argument Description
n The number of keys to retrieve the lease information for
gas_info Object containing gas parameters (see above)

Returns a JSON array of objects containing key, lifetime (in seconds), e.g.

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to phpgems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/mul53/bluzelle. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.

License

The gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the Bluzelle project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.


All versions of blzphp with dependencies

PHP Build Version
Package Version
Requires php Version ~7.2
bitwasp/bech32 Version ^0.0.1
bitwasp/bitcoin Version ^1.0
guzzlehttp/guzzle Version ~6.0
simplito/bn-php Version ^1.1
simplito/elliptic-php Version ^1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package mul53/blzphp contains the following files

Loading the files please wait ....