A phoenix depicted in a book by FJ Bertuch
A PHP project to create a distributed and decentralized system for selecting lottery winners and to ensure game fairness with an open system.
This is a project that is currently under development. I'll keep updating this repository.
This is the first commit in the Phoenix repository with any code. We have laid down the basic foundations for the blockchain ledger.
Phoenix follows the the front controller software design pattern; an application with a single controller that handles all the requests - in this case, the controller is the init.php
file.
For the sake of simplicity, Phoenix will use HTTP GET requests during early days of development. Though we will use POST requests or sockets as we implement the networking functionality.
- Creating blockchains
Just as we mentioned in the wiki, Phoenix consists of rounds and each round has it's own blockchain.
You can make a blockchain by making a GET request with the parameter createBlockchain
. This will result in a blockchain generated with a random round ID.
As we said in the wiki before, blockchains in Phoenix are in the JSON file format, thus you can find the newly generated blockchain in the 'blockchain' folder.
It will look something like this
As you can see, a genesis block with the special
key is automatically generated.
- Creating blocks
You can create blocks by making GET requests with the parameters createBlock
and roundId
.
After adding two blocks to the blockchain, this is how it looks like
In the next few versions, we are going to work further on the blockchain, introduce the network architecture and integrate Bitcoin.