{ "info": { "author": "balakrishnan", "author_email": "krishnasmartt@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: Public Domain", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2" ], "description": "ethjsonrpc\n==========\n\nPython client for Ethereum using the JSON-RPC interface\n\n* complete: implements all 62 JSON-RPC methods plus several client-specific methods\n* provides a high-level interface to create contracts on the blockchain and to call contract methods\n\nImportant note\n--------------\n\nThe API is not yet stable, so please use caution when upgrading.\n\nInstallation\n------------\n\nYou may need additional libraries and tools before installing ethjsonrpc.\n\nOn Ubuntu 16.04:\n\n.. code:: bash\n\n $ sudo apt install python-minimal\n $ sudo apt install gcc\n $ sudo apt install virtualenv # optional but recommended\n $ sudo apt install libpython-dev\n $ sudo apt install libssl-dev\n\n\nOn Ubuntu 14.04:\n\n.. code:: bash\n\n $ sudo apt-get install python-virtualenv # optional but recommended\n $ sudo apt-get install libpython-dev\n $ sudo apt-get install libssl-dev\n\n\nTo install pyethmobi:\n\n.. code:: bash\n\n $ pip install pyethmobi\n\n\nMake sure to have a node running an Ethereum client (such as geth) for the library to connect to.\n\nExample\n-------\n\n.. code:: python\n\n >>> from pyethmobi import EthJsonRpc # to use Parity-specific methods, import ParityEthJsonRpc\n >>> c = EthJsonRpc('127.0.0.1', 8545)\n >>> c.net_version()\n u'1'\n >>> c.web3_clientVersion()\n u'Geth/v1.3.3/linux/go1.5.1'\n >>> c.eth_gasPrice()\n 50000000000\n >>> c.eth_blockNumber()\n 828948\n\n\nHigh-level functionality\n------------------------\n\nThese examples assume the following simple Solidity contract:\n\n.. code::\n\n contract Example {\n\n string s;\n\n function set_s(string new_s) {\n s = new_s;\n }\n\n function get_s() returns (string) {\n return s;\n }\n }\n\n\nCompile it like this:\n\n.. code:: bash\n\n $ solc --binary stdout example.sol\n\n\nSetup\n`````\n\n.. code:: python\n\n >>> compiled = '606060405261020f806100136000396000f30060606040526000357c01000000000000000000000000000000000000000000000000000000009004806375d74f3914610044578063e7aab290146100bd57610042565b005b61004f600450610191565b60405180806020018281038252838181518152602001915080519060200190808383829060006004602084601f0104600302600f01f150905090810190601f1680156100af5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61010d6004803590602001906004018035906020019191908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050905061010f565b005b806000600050908051906020019082805482825590600052602060002090601f01602090048101928215610160579182015b8281111561015f578251826000505591602001919060010190610141565b5b50905061018b919061016d565b80821115610187576000818150600090555060010161016d565b5090565b50505b50565b60206040519081016040528060008152602001506000600050805480601f0160208091040260200160405190810160405280929190818152602001828054801561020057820191906000526020600020905b8154815290600101906020018083116101e357829003601f168201915b5050505050905061020c565b9056'\n >>> from pyethmobi import EthJsonRpc # to use Parity-specific methods, import ParityEthJsonRpc\n >>> c = EthJsonRpc('127.0.0.1', 8545)\n\n\nCreating a contract on the blockchain\n`````````````````````````````````````\n\n.. code:: python\n\n >>> # continued from above\n >>> contract_tx = c.create_contract(c.eth_coinbase(), compiled, gas=300000)\n >>> # wait here for the contract to be created when a new block is mined\n >>> contract_addr = c.get_contract_address(contract_tx)\n >>> contract_addr\n u'0x24988147f2f2300450103d8c42c43182cf226857'\n\n\nCalling a contract function with a transaction (storing data)\n`````````````````````````````````````````````````````````````\n\n.. code:: python\n\n >>> # continued from above\n >>> tx = c.call_with_transaction(c.eth_coinbase(), contract_addr, 'set_s(string)', ['Hello, world'])\n >>> tx\n u'0x15bde63d79466e3db5169a913bb2069130ca387033d2ff2e29f4dfbef1bc6e0d'\n\n\nCalling a contract function on the local blockchain (reading data)\n``````````````````````````````````````````````````````````````````\n\n.. code:: python\n\n >>> # continued from above\n >>> results = c.call(contract_addr, 'get_s()', [], ['string'])\n >>> results\n ['Hello, world']\n\n\nAdditional examples\n-------------------\n\nPlease see ``test.py`` for additional examples.\n\nImplemented JSON-RPC methods\n----------------------------\n\n* web3_clientVersion\n* web3_sha3\n* net_version\n* net_listening\n* net_peerCount\n* eth_protocolVersion\n* eth_syncing\n* eth_coinbase\n* eth_mining\n* eth_hashrate\n* eth_gasPrice\n* eth_accounts\n* eth_blockNumber\n* eth_getBalance\n* eth_getStorageAt\n* eth_getTransactionCount\n* eth_getBlockTransactionCountByHash\n* eth_getBlockTransactionCountByNumber\n* eth_getUncleCountByBlockHash\n* eth_getUncleCountByBlockNumber\n* eth_getCode\n* eth_sign\n* eth_sendTransaction\n* eth_sendRawTransaction\n* eth_call\n* eth_estimateGas\n* eth_getBlockByHash\n* eth_getBlockByNumber\n* eth_getTransactionByHash\n* eth_getTransactionByBlockHashAndIndex\n* eth_getTransactionByBlockNumberAndIndex\n* eth_getTransactionReceipt\n* eth_getUncleByBlockHashAndIndex\n* eth_getUncleByBlockNumberAndIndex\n* eth_getCompilers\n* eth_compileSolidity\n* eth_compileLLL\n* eth_compileSerpent\n* eth_newFilter\n* eth_newBlockFilter\n* eth_newPendingTransactionFilter\n* eth_uninstallFilter\n* eth_getFilterChanges\n* eth_getFilterLogs\n* eth_getLogs\n* eth_getWork\n* eth_submitWork\n* eth_submitHashrate\n* db_putString\n* db_getString\n* db_putHex\n* db_getHex\n* shh_version\n* shh_post\n* shh_newIdentity\n* shh_hasIdentity\n* shh_newGroup\n* shh_addToGroup\n* shh_newFilter\n* shh_uninstallFilter\n* shh_getFilterChanges\n* shh_getMessages\n\nParity-only JSON-RPC methods\n----------------------------\n\nTo use these methods, make sure that you're\n\n* running Parity as your client\n* running with the ``--tracing on`` option\n* using this library's ``ParityEthJsonRpc`` client (not the vanilla ``EthJsonRpc`` client)\n\nMethods:\n\n* trace_filter\n* trace_get\n* trace_transaction\n* trace_block\n\nReference\n---------\n\n* https://github.com/ethereum/wiki/wiki/JSON-RPC\n* https://github.com/ethcore/parity/wiki/JSONRPC-trace-module\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/balakrishnan2/pyethmobi", "keywords": "", "license": "Unlicense", "maintainer": "", "maintainer_email": "", "name": "pyethmobi", "package_url": "https://pypi.org/project/pyethmobi/", "platform": "", "project_url": "https://pypi.org/project/pyethmobi/", "project_urls": { "Homepage": "https://github.com/balakrishnan2/pyethmobi" }, "release_url": "https://pypi.org/project/pyethmobi/0.1/", "requires_dist": null, "requires_python": "", "summary": "ethereum JSON-RPC client", "version": "0.1" }, "last_serial": 3039174, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "e1ab50e98f9105a5dda6eedb77f30d92", "sha256": "62381679db58e0405b85b7b27b80f667e4883a7d41d621f4d79bf0d6394624cd" }, "downloads": -1, "filename": "pyethmobi-0.1.tar.gz", "has_sig": false, "md5_digest": "e1ab50e98f9105a5dda6eedb77f30d92", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10169, "upload_time": "2017-07-21T11:55:11", "url": "https://files.pythonhosted.org/packages/45/b4/2883b668444f051cab48ec68c907b49384b79d665e06c745489cc66372a7/pyethmobi-0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e1ab50e98f9105a5dda6eedb77f30d92", "sha256": "62381679db58e0405b85b7b27b80f667e4883a7d41d621f4d79bf0d6394624cd" }, "downloads": -1, "filename": "pyethmobi-0.1.tar.gz", "has_sig": false, "md5_digest": "e1ab50e98f9105a5dda6eedb77f30d92", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10169, "upload_time": "2017-07-21T11:55:11", "url": "https://files.pythonhosted.org/packages/45/b4/2883b668444f051cab48ec68c907b49384b79d665e06c745489cc66372a7/pyethmobi-0.1.tar.gz" } ] }