Questions tagged [python]

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

64 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
5
votes
0answers
1k views

How to install the Python bitcoin module on windows for presale wallet import?

I've been holding Ethereum since the pre-sale. I want to continue to just hold my presale wallet because its safe as cold storage (rather than importing into my wallet). However, I want to be able to ...
4
votes
0answers
577 views

How to use the hashimoto light algorithm in pyethash?

I have a problem with using the hashimoto light algorithm in pyethash. I am using pyethash version 23.1 and comparing the results with ethash.run (ethashjs 0.0.7). Using the same inputs the result ...
3
votes
3answers
426 views

How to make a Docker container talk to geth.ipc on local host

from web3 import Web3 web3 = Web3(Web3.IPCProvider("/Ethereum/geth.ipc")) print(f'IPC connected: {web3.isConnected()}') # want to return True I have the above script Dockerized and I'm trying to ...
3
votes
1answer
734 views

How to get all transaction lists of local ethereum wallet using web3.py?

I have developed django project that have local ethereum wallet using web3.py. I want to get transaction history of my wallet. But I have no way. Please help me.
3
votes
0answers
1k views

How to encode data payload in ETH transaction

I'm using python to sign and send ETH transactions, and would like to do the same for ERC-20 token transactions as well. I'm having trouble correctly encoding the data payload to invoke the transfer ...
3
votes
0answers
189 views

Simple hello packet

I am trying to generate a simple hello packet for handshaking with a remote Ethereum client using the encode method from the rlp library. from rlp import encode hello = bytearray(encode([0x00, 4, "...
3
votes
0answers
61 views

Effectively debugging pyethapp

I have also asked the technical details of pyethapp's use of gevents here. I'm trying to run a transaction step by step in a debugger and see how it is being signed and added to the blockchain. I am ...
2
votes
0answers
166 views

How w3.eth.filter('latest').get_new_entries() works exactly?

I try to monitor new transactions. from web3.auto import w3 import time l = w3.eth.filter('latest') while True: ts = time.time() ll = l.get_new_entries() for i in ll: print('===== Block ...
2
votes
0answers
587 views

How to fix a web3.py HTTPConnectionPool read timeout error

I have a web3.py program running and everything was seemingly working. I was connecting to my local server via the automatic connection offered in web3.py. I am now getting the following error: ...
2
votes
0answers
118 views

Merkle-Patricia-Trie-Root is wrong. How to get transaction proof? in Python3

I am trying to calculate proof that a specific Transaction is mined with a specific difficulty. So far I got the Block via JSON_RPC and all its Transactions. I am Using the trie Library for Python 3....
2
votes
0answers
505 views

pip install ethereum failed

I run pip install ethereum to install the package named ethereum for python. Yet I got following error: Requirement already satisfied: ethereum in c:\users\wenbo\anaconda3\lib\site-packages\ethereum-...
2
votes
0answers
621 views

What is the best practice of a Dapp development mixed with Python/Django?

I've written and tested the Smart Contracts in Truffle, and now want to develop a front-end and a small back-end for my Dapp. So far, I preferred MVP frameworks, particularly Django. Therefore, what ...
2
votes
0answers
358 views

eth_sendTransaction for function with address type parameters

I'm interacting with my local private blockchain created using geth. I'm able to use eth_call, but now I have some problems with eth_sendTransaction. The signature of the function is this: function ...
2
votes
0answers
143 views

pretty_compile in pyethereum

I am learning Serpent with pyethereum in Spyder (so I have a running log of what I have tried and learned), but I am stuck in translating standard features of Serpent (such as pretty_compile) from ...
2
votes
0answers
235 views

Is the DAG the same for all (private/main/test) nets?

Reading about the proof of work, I got to the data generation part (mainly the DAG) and found it in: ~/.ethash/full-R23-0000000000000000 In the ethash it is mentioned that the DAG is generated from ...
1
vote
0answers
18 views

Call contract method via raw transaction in python

From what I've read online I can't call the method I want to in python using contract.functions.myfunc(param1,param2 becaues infura doens't support these types of transactions. So instead I want to ...
1
vote
1answer
19 views

Verify ethereum signed message using python

Is there any way to verify signed message using python? Google do not provide any useful info. I don't believe that there are no any lib which can do it. Any suggestions? Many thanks!!!
1
vote
0answers
37 views

Require not working on geth private node

I have created this contract to manage a votation: pragma solidity ^0.5.7; contract Votacion{ mapping(uint => address[]) private votosCandidatos; uint[] listaCandidatos; bool abierta; address ...
1
vote
0answers
36 views

Web3.py transfer call failing, not sure why

I am trying to learn how to work with ethereum and ERC20 tokens. I have managed to setup ganache and deploy my contract. I can see it on ganache and I can connect and read the balance of the token on ...
1
vote
1answer
73 views

How get private key in private network?

I launched a private RPC Blockchain network and connected through another computer to this network. The connection is successful. How can I get a private key(through Python) if the file is on another ...
1
vote
0answers
28 views

how can I get the account locked information via python web3?

There is a command personal.listWallets in geth cli to get the account locked/unlocked status such as below: > personal.listWallets[1] { accounts: [{ address: "...
1
vote
0answers
36 views

pass struct from web3 python interface to solidity

I have created a smart contract with some solidity functions which take structs, enums and mappings(all defined in my contract) as arguments. I intend to call these functions from my web3 python ...
1
vote
0answers
30 views

Inconsistent responses with 'eth_getTransactionByHash' through RPC API. Can anyone help?

I have been using the requests library with python to query the geth/rpc api in order to get ETH transaction data. I connected to geth via "geth --rpc --unlock TESTINGADDRESSWITHNOVALUE --allow-...
1
vote
0answers
30 views

fail for read ethereum node base on leveldb.py

I installed leveldb base on python3.6.but when I using leveldb.LevelDB import path for files to be read. a error occered "leveldb.LevelDBError: Corruption: 3 missing files; e.g.: D:/downloads_by_geth/...
1
vote
1answer
169 views

How to access Parity node's mempool with web3.py?

I'm running a Parity node with parity --jsonrpc-api all, then connecting to it in python3 with w3 = web3.Web3(web3.HTTPProvider('http://localhost:8545')). I can call print(w3.eth.getBlock('latest'))...
1
vote
0answers
21 views

How to get live mempool transactions whitout full blokchain

I just want to analyse all mempool txs in realtime. I cant use an api because after several requests my ip gets blocked for some minutes, so I dont get the txs in this time. Thank you for help.
1
vote
1answer
269 views

Error whilst running solidity with python(py-solc)

I have been running my code which involves deployment of smart contract to Ethereum Ropsten network. I ran this successfully for some time but last week did installed another software after which ...
1
vote
0answers
211 views

Using web3.py, I get a key error when connecting to a remote server with 3 nodes running (autoconnect works fine)

I have a web3.py project that is successfully performing basic tasks (read from blockchain, send tx, process data, etc.). It is connected to a remote server that is running an ETH node, a Rinkeby node,...
1
vote
1answer
41 views

What is the best (cheapest) method to store RGB/RGBA pixel data in a smart contract (on ethereum-classic blockchain) with python?

I would to implement a method to store pixel (RGB/RGBA) in a Smart contract (on ethereum-classic blockchain) from python and with the cheapest method ( when storing and updating pixel data) I try to ...
1
vote
0answers
206 views

Transaction hash using web3.py received but variable state not changed

Trying to send a value to function and set it to a variable. Making transaction using txn = contractInstact.transact({ 'from': Web3.toChecksumAddress("...
1
vote
0answers
159 views

eventFilter web3.py in python to get events of locally deployed smart contracts using geth

I have tried ganache and geth too for contracts deployment locally hosted port # 8545. A function of deployed contract is called from another smart contract (deployed locally on same port) So its ...
1
vote
1answer
303 views

How to access a deployed smart contract attributes using web3.eth.contract(abi,address) in python

web3 = Web3(provider=HTTPProvider(http://ropsten.infura.io/v4/API_KEY) abi = '[{"constant":false,"inputs":[{"name":"_utxoPos","type":"uint256"},{"name":"_txBytes","type":"bytes"},{"name":"_proof","...
1
vote
1answer
63 views

Can some one suggest a method to know the incoming transactions in a nodes addresses?

I am trying to figure out a solution to find if there is any update in wallet address in my node i am using web3py.
1
vote
0answers
429 views

Python web3 Call Contract Not Working

On local ganache testnet, all functions of my contract are already working fine under JS web3. While under Python web3 (4.1.0), calling view function and sending ether to the contract work (so ...
1
vote
1answer
173 views

Python state channel client

Stumbled upon this piece of Solidity code which is an Ethereum payment channel : https://github.com/mattdf/payment-channel How am I to write a Python client that interacts with it over Web3 ? What ...
1
vote
1answer
549 views

How do you change a contract value using ConciseContract in web3.py?

In my contract, I expect that my_contract.a() will not make any updates to values in the blockchain, but my_contract.change_value(new_val) should. However, change_value() is not making the change I ...
1
vote
0answers
165 views

Problem with the code for fetching data from ether scan

I am trying to fetch ICO data via python from etherscan.io through the API but hitting a problem. I am using the code by Corey Petty for python bindings also using his code for ICO analysis Full ...
1
vote
0answers
54 views

Is there a way to get proper block object of pyethereum with RPC?

I am running a geth node and I would like to connect to the node with python and get instance of the Block class: https://github.com/ethereum/pyethereum/blob/develop/ethereum/blocks.py#L164 is there ...
0
votes
0answers
7 views

Detecting dropped and replaced transactions web3.py

I am using web3.py. Given a transaction hash, is there any way to determine if a transaction was dropped and replaced by another transaction with the same nonce? Currently i am looping w3.eth....
0
votes
0answers
7 views

Getting txpool with python web3 and infura

I am trying to monitor pending transactions with python web3 and an infura node. I am currently using web3.eth.getBlock(block_identifier='pending', full_transactions=True) on a loop to fetch pending ...
0
votes
1answer
19 views

Invisible transaction

I work in a Ropsten testnet. I have a Python application that sends a transaction and returns the transaction's txHash. It is possible to send a maximum of 500 transactions in one request. The ...
0
votes
0answers
19 views

How can I replicate the Token Tracker etherscan page using python and etherscan API?

So I want to list top tokens and their associated stats, like on https://etherscan.io/tokens. Even simpler than that, how can I use the etherscan python API (or https://github.com/corpetty/py-...
0
votes
1answer
16 views

Issues with using/installing python solidity parser

I am trying to install and use python solidity parser by ConsenSys I keep on getting the following error File "<stdin>", line 1, in <module> File "/home/seed/.local/lib/python3.5/site-...
0
votes
0answers
29 views

How to config geth node to get ERC-20 tokens balances

I'm trying to tune my geth node to get ERC-20 tokens balances, but y API call always returns {'jsonrpc': '2.0', 'id': 1, 'result': '0x'} My geth node version: instance=Geth/v1.9.13-stable-cbc4ac26/...
0
votes
0answers
35 views

Install py-solc-x using python, there is an error

I am using python to install py-solc-x, but there is an error during installation: [root@localhost ~]# python3 -m solcx.install v0.4.25 ERROR: Unknown option --version /usr/local/python3/lib/python3....
0
votes
0answers
21 views

Real time access of transaction using websockets and web3py

I want to build the backend in Django using django channels that access the realtime blockchain data. Here is my smart contract. mapping(uint => Task) public tasks; event TaskCreated( uint ...
0
votes
0answers
31 views

Why does this code outputs error:“unknown account”?

Python code: from web3 import Web3 import json web = "http://10.0.141.114:8545" web3 = Web3(Web3.HTTPProvider(web)) abi=json.loads('[ { "constant": false, "inputs": [ { "name": "_cad_number", "type":...
0
votes
0answers
51 views

How to deploy contract instance in blockchain with abi and contract address?

I am following this (python ethereum interface tutorial) and contracts to compile and deploy in ganache cli. Till now i am able to compile and deploy contracts with web3.py,py-solc and ganache node. ...
0
votes
0answers
37 views

Sign Message using passphrase only

I'm creating an authentication system using python and web3.py. I'm trying to authenticate a user using from web3.auto import w3 msg = 'sdb41554xcb4xc548cxd84dxcb' message = encode_defunct(text=...
0
votes
0answers
38 views

Can't install `eth-tester` Python Package

I am trying to install [eth-tester][1] Python Package so that I can use it to load test ethereum in my account by using its get_balance() function. First when i installed this package using; pip ...