Questions tagged [python]

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

83 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
6
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
600 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
535 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
1k 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
2k 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
192 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
62 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
54 views

How to get token prices with UNISWAP API

I am using uniswap python api to get live token prices. I am using all the variation of the built-in functions. However, it does not give me the right value. HERE IS MY CODE address = "...
2
votes
0answers
29 views

What are the front running bots?

I've been seeing too many threads about this. I was curious about what are they how do they function? Is it basically an automated trading algorithm that just executes trades when a cryptocurrency is ...
2
votes
1answer
25 views

How can I do abi.encodePacked in Python or PHP?

Just concatenating strings doesn't work. Keccak::hash(10 . $address, 256) is what I'm doing atm.
2
votes
1answer
449 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'))...
2
votes
0answers
235 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
1answer
306 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 ...
2
votes
0answers
691 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
124 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
602 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
643 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
361 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
145 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
237 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
1answer
187 views

Perform an automated transaction using 1inch API

To perform an automated 1 inch transaction I use these two functions. It works well at first. Unfortunately, in the last few days I have always had the same errors: Fail with error 'Return amount is ...
1
vote
1answer
19 views

How to parse the node information in the nodes directory by leveldb?

I want to get all the node IP addresses of ETH, so I need to parse the geth/nodes directory, but I can't find the specific data format and cannot parse it. I found a same problem, but there is no ...
1
vote
0answers
38 views

In Python, how do I use subscriptions, or otherwise perform asynchronous operations?

I have the following code that polls for transactions every second. I want to make it more responsive, and not use polling, but instead something quicker. tx_all_pending = w3.eth.filter('pending') ...
1
vote
1answer
130 views

web3.py ( web3.exceptions.CannotHandleRequest: Could not discover provider while making request: method:eth_call ) --help

proveedores= ['https://mainnet.infura.io/v3/KEY_KEY','https://ropsten.infura.io/v3/KEY_KEY'] from web3 import Web3 , HTTPProvider, IPCProvider, WebsocketProvider from web3.auto import w3 web3= Web3(...
1
vote
0answers
45 views

Can not run more than 1 event in Infura

I am trying to listening to many events from infura but it is not working. Only one filter work, when I add the second filter, this message appear: RuntimeError: cannot call recv while another ...
1
vote
3answers
149 views

Let's say I forgot first 2 words of the seed, how could I find an account with ether in it?

Let's say I forgot first 2 words of the seed. I want to write a program that brute-forces all possible bip-39 word combinations for the first 2 words, generate private/public keys, addresses, and go ...
1
vote
0answers
24 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
45 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
44 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
45 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
121 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
35 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
60 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
34 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
48 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
0answers
34 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
0answers
229 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
50 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
245 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
184 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
343 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
67 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
458 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
179 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
564 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
168 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
55 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

How do I pass a dictionary for the in3_registry value for the Incubed Python API?

I am using Python 3. I have installed the in3 (Incubed) Python module. I want to invoke the ClientConfig of the in3 Python API in a specific way. There is an in3_registry argument that is part of ...
0
votes
0answers
17 views

Python Web3 get all events

I am using web3 5.14.0 and Infura I am trying to get all transfer event for link chain token like the following: from web3 import Web3 ABI_REQUEST_ENDPOINT = 'https://api.etherscan.io/api?module=...
0
votes
0answers
17 views

A python module equivalent to Nethereum codegen

Does anyone know a Python module that can help me convert an ABI for a contract to a python class automatically. Nethereum has Codegen for C#, is there anything like that for python ?