Questions tagged [python]

Python is a dynamic and strongly typed programming language designed to emphasize usability.

Filter by
Sorted by
Tagged with
24
votes
2answers
4k views

What is the merit of creating new smart contract languages like Solidity instead of using other languages?

What is the pros and cons of creating new languages like Solidity for smart contracts instead of using other computer languages like Golang or Python?
2
votes
1answer
2k views

Format of LevelDB files in nodes directory? Trouble pulling contents with python leveldb API

I am interested in exploring the data in ~/.ethereum/nodes, which I believe contains previous connection attempts and information about the nodes. (Is that correct?) But I am stuck trying to pull the ...
14
votes
3answers
2k views

How to parse blocks with Python?

I'm building a basic analytics framework for the Ethereum blockchain. As a first step I need to extract the data and I'd like to do this in Python. I've been using Geth as a client on OSX and so, as ...
4
votes
1answer
643 views

Creating eth_newFilter topic listeners with Python

Ethereum JSON RPC allows one to listen to contract events through eth_newFilter call. Based on non-authoritative sources, eth_newFilter takes topics parameter which is somehow a hash that is ...
2
votes
2answers
2k views

Is there api way to get Token transfer data of exact token?

What I need I need all information of tab "Token Transfers" in token info at etherscan. Exactly in format at the site. For example I want to get all Token Transfers from here https://etherscan.io/...
8
votes
3answers
5k views

Why did Serpent die?

Was really excited about the prospects of working on Ethereum with its python implementation but learnt that it's getting deprecated...why has this happened and can we hope for any other python ...
6
votes
2answers
1k views

How can I change the gas price or the gas limit when testing with pyethereum?

I've got some code that's ultimately destined to run on a private network. I'm testing it with the lovely pyethereum, doing things like: from ethereum import tester as t class testMyContract(...
4
votes
1answer
1k views

Metamask integration with web3.py

I've used metamask with web3.js multiple times before, with no issue. It's simple to integrate it, like discussed here: https://github.com/ethereum/web3.py/blob/master/docs/providers.rst How does one ...
3
votes
1answer
380 views

Why cannot catch events retrospectively using filter (eth_newFilter)?

I've put the same filter with eth_newFilter before and after a set of transactions. The one which is installed after transactions catched 0 events. Is it how events work? Is there any other way to ...
2
votes
1answer
142 views

solcx compile_files Key error

I am using python package py-solc-x for compiling the smart contract. os.path.abspath("D:/new.sol") Gives path where my test contract exits. 'D:\\new.sol' Then i use compile_files to compile the ...
1
vote
1answer
917 views

How to call write functions via Python web3.py, w3.eth.sendRawTransaction()

Hi I am running Python web3.py (not web3.js) to interact with contract functions: w3 = Web3(HTTPProvider('http://room1.abc.com:8545/')) txn = ctrtInstance.functions.setzString(zString)....
1
vote
2answers
846 views

How to communicate with smart contract using python?

I have developed a smart contract on remix IDE and now I want to communicate with it using python. What python libraries can I use ?
8
votes
1answer
3k views

Why use filters - eth_getLogs vs eth_newFilter

It seems to me eth_getLogs is much simpler than eth_newFilter + eth_getFilterLogs. eth_getLogs has no need for installation, got same parameters, catches events retrospectively. What are use cases ...
5
votes
3answers
9k views

Are there any implementations of smart contracts in Python?

I want to implement some smart contracts and I am strongest in python.
1
vote
1answer
6k views

How can I generate a wallet in python?

Im trying to write a python script that can generate a new wallet for that user, but I need to be able to keep the private key. I followed this : Stack overflow answer And got these results: import ...
8
votes
1answer
6k views

How to connect Ethereum RPC Client to a remote server?

I have Ethereum node running the JSON RPC server on this IP example 136.10.164.134 . Then I want to use a client to push some data. I see this library to make the client. But I can't connect to my ...
8
votes
1answer
386 views

Check if a contract implements specific ABI using JSON-RPC

In my Python web service, I'd like to confirm if a contract supports specific ABI (certain call methods). I am running get and communicating over JSON RPC. What are steps to for this? I am guessing ...
5
votes
2answers
994 views

(Python) eth_getFilterChanges --> data --> how to decode?

Edit: solved, scroll down. How to decode filter results? A contract is emitting this Event event Send(address from, address to, uint value) With ethjsonrpc and its eth_getFilterChanges I am ...
4
votes
1answer
1k views

Getting Method ID “Keccak hash” in Python

I am trying to derive the Method ID, the Keccak (SHA-3) hash, in Python so that I may call the functions of my contracts once they are deployed as detailed in the ABI documentation: https://github.com/...
3
votes
1answer
3k views

How to send a transaction to myetherapi.com with Web3.py

I am having trouble interacting with myetherapi.com using web3.py. I am able to create a few functions that were working, like get_eth_balance() below. But to send transactions like send_eth(), I just ...
1
vote
1answer
2k views

Python ECDSA Public Key Recovery

How do you recover the EC public key from a VRS style signature in python? I am trying to setup some encryption between two parties via ECIES, but I first wanted to obtain the public key via recovery ...
6
votes
1answer
436 views

What are the main differences from Python and Serpent?

Serpent looks quite similar to Python. What behaviors or syntax would be on your list to warn other Serpent developers about?
5
votes
3answers
3k views

Can't access to contract functions via web3.py

I have already created contract and deployed to ethereum mainnet. Now I wanna read logs. But I can't as calling print(contract_instance.address) and contract_instance.eventFilter('Transfers') show me ...
5
votes
1answer
271 views

Cannot catch every event (logs) from contract - catch a couple of random events instead

My contract has a transaction which fires an event. I was able to catch every event when I was sending transactions manually. But now I'm sending 100 transactions in cycle and get only 2..5 events. ...
4
votes
1answer
5k views

How to build a raw transaction to interact with a contract, with web3.py

Thanks to the support of this community I am able to create transactions on the network using the guidance provided in this post: How to send a transaction to myetherapi.com with Web3.py To send a ...
3
votes
2answers
1k views

How send bytes32 in web3.py?

Constructor takes byte32 value. How send32 value, using web3.py or only python?
3
votes
3answers
1k views

How to sync pyethapp (python ethereum client) with the mainnet?

I just installed pyethapp. However, I'm unable to sync the blockchain. Here is what I get when I run the client: 0 ✓ user@host ~ $ pyethapp run Failed to import scrypt. This is not a fatal error but ...
3
votes
1answer
372 views

How to get a message from web3.shh using Python

Good afternoon. I'm trying to implement the "Status" at the moment. I use the library Web3.shh. I sent the message and gives the answer "True", but I can not receive all the messages on the other ...
1
vote
1answer
2k views

Python 3 How to make Event Filter via createFilter web3.py v4.2.1

According to the Web3.py Documentation: http://web3py.readthedocs.io/en/latest/filters.html Quote "event_filter = contract.events.myEvent.createFilter(fromBlock='latest', {'filter': {'arg1':10}})" ...
0
votes
1answer
63 views

Apparent mismatch between Oraclize CBOR and python3 CBOR encodings

I encoded a value using the Oraclize CBOR library like so: Buffer.buffer memory cborArgs; Buffer.init(cborArgs, 64); cborArgs.startArray(); cborArgs.encodeUInt(10); cborArgs....
0
votes
2answers
946 views

Increase all values of mapping or array without loop

Would it be possible to increase all the values of a mapping or array (without a loop)? Example: mapping(address => uint) score; uint[] values; function increase_scores() public { // ...