{"id":18056088,"url":"https://github.com/sephynox/phpblock","last_synced_at":"2025-04-11T02:06:51.688Z","repository":{"id":57040186,"uuid":"345402307","full_name":"sephynox/phpblock","owner":"sephynox","description":"A lightweight asynchronous PHP server/client for blockchain networks.","archived":false,"fork":false,"pushed_at":"2021-03-24T20:44:33.000Z","size":296,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-11T02:05:35.400Z","etag":null,"topics":["async","blockchain","ethereum","jsonrpc","php","react","rest"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sephynox.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["sephynox"]}},"created_at":"2021-03-07T16:57:54.000Z","updated_at":"2023-09-06T02:34:55.000Z","dependencies_parsed_at":"2022-08-23T22:00:08.200Z","dependency_job_id":null,"html_url":"https://github.com/sephynox/phpblock","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sephynox%2Fphpblock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sephynox%2Fphpblock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sephynox%2Fphpblock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sephynox%2Fphpblock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sephynox","download_url":"https://codeload.github.com/sephynox/phpblock/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248328167,"owners_count":21085261,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["async","blockchain","ethereum","jsonrpc","php","react","rest"],"created_at":"2024-10-31T01:13:35.329Z","updated_at":"2025-04-11T02:06:51.660Z","avatar_url":"https://github.com/sephynox.png","language":"PHP","funding_links":["https://github.com/sponsors/sephynox"],"categories":[],"sub_categories":[],"readme":"# PHPBlock\nA lightweight asynchronous `PHP` server/client for blockchain networks.\n\n[![PHP Composer](https://github.com/sephynox/phpblock/actions/workflows/php.yml/badge.svg?branch=main)](https://github.com/sephynox/phpblock/actions/workflows/php.yml)\n\n\u003e Currently in development. Not all endpoints are available. Help welcome!\n\nTable of Contents\n-----------------\n  - [Supported Platforms](#supported-platforms)\n    - [Future Platforms](#future-platforms)\n  - [Documentation](#documentation)\n    - [Quick Start Example](#quick-start-example)\n    - [Promises Example](#promises-example)\n    - [Install](#install)\n    - [Testing](#testing)\n  - [License](#license)\n  - [Donate](#donate)\n\nTODO\n\n## Supported Platforms\n\n* Ethereum\n\n### Future Platforms\n\n* Cardano\n### Quick Start Example\nCall the Ethereum `eth_protocolversion` endpoint.\n```php\n\u003c?php\n\nrequire_once('./vendor/autoload.php');\n\n$Ethereum = new PHPBlock\\Network\\Ethereum\\Client();\n\n$Ethereum-\u003eethProtocolVersion()\n    -\u003ethen(function (string $version) {\n        echo \"The protocol version is: \" . $version . \"\\n\";\n    });\n\n$Ethereum-\u003erun();\n```\n### Promises Example\nYou can chain calls and pass along additional information to next the link in\nthe promise chain.\n```php\n\u003c?php\n\nrequire_once('./vendor/autoload.php');\n\nuse PHPBlock\\Network\\Ethereum\\Model\\Gwei;\nuse PHPBlock\\Network\\Ethereum\\Model\\Transaction;\nuse PHPBlock\\Network\\Ethereum\\Type\\Hash32;\nuse PHPBlock\\Network\\Ethereum\\Type\\HexAddress;\n\nuse function PHPBlock\\Helper\\pass;\n\n$Ethereum = new PHPBlock\\Network\\Ethereum\\Client();\n# Lightweight types for all data elements.\n$value = new Gwei(Gwei::ethToGwei('.0001'));\n$to = new HexAddress('0x579ACE666FBbb2cE728B5F335E69Dc7A2C8623D4');\n$from = new HexAddress('0x268d5eBe19aF845c23E0Fd4290725E9679Cd1B7d');\n$sendTransaction = Transaction::make($to, $from, $value);\n\n$Ethereum-\u003eethSendTransaction($sendTransaction)\n    -\u003ethen(function (Hash32 $hash32) use ($Ethereum) {\n        # Pass additional values easily similar to a tuple.\n        return pass($Ethereum-\u003eethGetTransactionByHash($hash32), $hash32);\n    })-\u003ethen(function (array $data) {\n        [$receiveTransaction, $hash32] = $data;\n\n        if ($receiveTransaction-\u003ehash == $hash32) {\n            echo \"The hashes match!\";\n        }\n    });\n\n$Ethereum-\u003erun();\n```\n## Install\nGet started quickly [using Composer](https://getcomposer.org).\n```\n$ composer require phpblock/core\n```\n## Testing\n\nIn order to run tests, you must first clone this repo and then install the \ndependencies [through Composer](https://getcomposer.org):\n\n```bash\n$ composer install\n```\nYou can then use the \n[geth client](https://geth.ethereum.org/docs/install-and-build/installing-geth) \nor [ganache-cli](https://github.com/trufflesuite/ganache-cli) to test \nEthereum RPC calls. You can also install the \n[ganache client on Windows](https://www.trufflesuite.com/ganache).\n```bash\n#Using geth (Ubuntu):\nsudo add-apt-repository -y ppa:ethereum/ethereum\nsudo apt-get update\nsudo apt-get install ethereum\n\n#Using geth (OS X \u0026 brew):\nbrew tap ethereum/ethereum\nbrew install ethereum\nbrew install ethereum --devel\n\n#Using ganache-cli (npm)\nnpm install -g ganache-cli\nganache-cli\n```\n\nThis project uses PHPUnit and PHPBench. To run the test suite, enter the \nproject root and run:\n```bash\n$ composer run-script check\n```\n\n## License\n\nMIT, see [LICENSE file](LICENSE).\n\n## Donate\n**BTC**: bc1qkqsfuaptqcslwmxh5lz2utxls4pe7wnjhepa2s\n\n**ETH**: 0x00E069d105F61564530859A35FE0D007C3536a35\n\n**ADA**: addr1qywvljkfnyyey38te86tshjscn6yw25c069lf82jfjgv57m3txy8f0nf4wnjwcr8uxmlg9wk7lt6uu7g5w9x077v8lwqgsulw6\n\n**DOGE**: D949UWaLauvKyhX6PNuXGavmMNS6uFcjfS\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsephynox%2Fphpblock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsephynox%2Fphpblock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsephynox%2Fphpblock/lists"}