Download the PHP package jamielsharief/blockchain without Composer

On this page you can find all versions of the php package jamielsharief/blockchain. 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 blockchain

Blockchain (beta)

license build coverage status

A Blockchain database suitable for both private or public blockchains.

Trying it out

I have included demo.php which will create a Blockchain with Blocks and Transactions

Clone the source code to a directory

Run composer install

Then run the demo script

Create

To create a Blockchain instance, provide a path to where data for that Blockchain will be stored.

For a private Blockchain, set difficulty to 0, since no proof of work is required.

The Blockchain is created when you add the first Block of Transactions.

Create a Transaction object and pass the data to the constructor.

Create a Block and add a Transaction to it, you can add as many Transactions as you need for each Block.

To add the Block to the Blockchain

Finding Blocks

To get a Block provide the block number

You can also search by hash

To get the most recent Block

Counting

To count the number of Blocks in the Blockchain

List

To get a list of hashes of the most recent X Blocks with the Block number.

To list a custom amount of Blocks

All

To go through all Blocks in the Blockchain, use the all method which yeilds each Block so that it can be done in a memory efficient manner.

The following options can be used

Validating the Blockchain

On my 2012 Mac Book it took me approx 9 minutes to validate a Blockchain with 1.2 million Blocks and roughly 6 million Transactions.

To validate the entire Blockchain.

Todo

I am thinking the following:

Resources


All versions of blockchain with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4.0
originphp/defer Version ^3.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 jamielsharief/blockchain contains the following files

Loading the files please wait ....