When I looked at blockchain code and interactions almost everything was written in Java and I wanted to expand on other languages, being able to interact with the blockchain. I went with PHP because it opens the door to millions of developers being able to integrate in to the Theta blockchain. With smart contracts being implemented a developer can simply fire up a Linux server write a PHP script and integrate it into their website. This dramatically opens the door for development not just in Java or JavaScript but also in PHP.

What it does

  • is a full node block explorer for the Theta Network. It allows the user to search for addresses and transaction hashes. It also keeps track of staking addresses, their balances / rewards and allows anyone to be able to download coinbase transactions. This is done using a local node and PHP.
  • CLI web interface is a JavaScript explorer and uses main API. This does not require a Linux server to run and anyone can type in the commands to return block, transaction, and other information. It even allows a user to download JSON data directly from the API to a file.
  • examples are five examples that show developers how to interact with the Theta blockchain using PHP and a local node or JavaScript.

Challenges I ran into

  • The local node going out of sync. Configuring the correct number of peers was a major issue. For a lower end server the max peers should not be set above 22 peers or the node with constantly go out of sync.
  • Unlike a Window's node which stays near the minimum number of peers a Linux node always tries to go to the max number of allowed peers and you need 4 cores + and 16GB + of ram on the server or must greatly reduce max number of peers for slower servers.
  • The local node not being able to sync from block 1. With all the new Guardian nodes coming online you can easily be put in a group with no one having the information for block one, two, etc and it never updates. To overcome this I found setting the max peers to 500 and min to 250 allowed the node to continually update.
  • The local node running on test net sapphire does not have any peers with block one in it. I ran it for 3 days at 500 peers max and not one could give me the information so I had to start it from a snapshot.

Accomplishments that I'm proud of

Creating two interfaces with the Theta blockchain using PHP and JavaScript that are both fully functional. Currently I have 3 nodes running. One on a snapshot of main net, one currently syncing on main net so it will be a full node, and one started on a snapshot of test net.


Built With

+ 3 more
Share this project: