Skip to main content

PHP RPC Lib

  • Team Name: gmajor
  • Payment Address: 0xC3094f0ddce699a1Ad9Ef2621DF68Cd297a4c44F(Dai)
  • Level: 1

Project Overview 📄​

PHP RPC Lib is PHP lib for query http rpc used by substrate.

Overview​

  • PHP is an extremely common development language in the web field, and currently there is no RPC library for substrate. I have already developed https://github.com/gmajor-encrypt/php-scale-codec in the previous grant. PHP RPC Lib is necessary to interact with the chain

Project Details​

  • Sr 25519

Since PHP does not have an encryption library for sr25519

Will provide the following interfaces

  1. SR25519.NewKeypairFromSeed(seed)
  2. SR25519.sign(message),
  3. SR25519.verify(message, signature)
  • Send transaction

Example

$api = new SubstrateRpc("websocket_or_http_url");
$signer = new SubstrateRpc\Util\Keyring\Signer("privatekey");// or HD
$api->setSigner($signer);
$tx = $api->tx->balances->transfer("to_address", 10000);
$tx->signAndSend();
  • Read/subscribe HTTP/Websocket to RPC endpoints

Example

$api = new SubstrateRpc("websocket_or_http_url");
$api->rpc->System->Heath();

# or read storage
$api = new SubstrateRpc("websocket_or_http_url");
$api->rpc->state->System->Account("/ALICE");

Ecosystem Fit​

Can help php language developers to easily access the substrate (polkadot) ecology

Team 👥​

Team members​

  • gmajor

Contact​

individual

Team's experience​

I have many years of php development experience and nearly three years of blockchain development experience, familiar with PHP, GOLANG, PYTHON, JS

Team Code Repos​

https://github.com/gmajor-encrypt/php-scale-codec

https://github.com/gmajor-encrypt/php-substrate-api

Development Status 📖​

Development Roadmap 🔩​

Overview​

  • Total Estimated Duration: 2 months
  • Total Costs: 9000 DAI

Milestone 1​

  • Estimated duration: 1 month
  • FTE: 1
  • Costs: 5000 USD
NumberDeliverableSpecification
0a.LicenseApache 2.0 / MIT / Unlicense
0b.DocumentationSimple documentation on how to use this library
1.HTTP RPC supportHttp Rpc support, include http/websocket
2.sr25519sr25519 bindings
3.Unit testIncluding all the unit tests mentioned above
4.PackagistSubmit to Packagist for composer to use

Milestone 2​

  • Estimated Duration: 1 month
  • FTE: 1
  • Costs: 4,000 USD
NumberDeliverableSpecification
0a.LicenseApache 2.0 / MIT / Unlicense
0b.DocumentationSimple documentation on how to use this library
1.Extrinsic encodeExtrinsic encode
2.Signed Extrinsic sendSend transaction support, include ed25519&sr25519
3.substrate rpc apisupport all substrate rpc like https://polkadot.js.org/docs/substrate/rpc
4.Unit testIncluding all the unit tests mentioned above
5.PackagistSubmit to Packagist for composer to use

Future Plans​

  1. Long-term support, Because I found that the underlying changes of the substrate are still very frequent, like metadata, I expect will be a long-term job in the future