Questions tagged [python]

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

103 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
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
13 views

IPFS hash link keep loading without not responding

I'm trying to add many JSON files in IPFS using the following API from this liberary py-ipfs-http-client, after running locally ipfs daemon: client.add('item.json') And here is the output of the item....
0
votes
0answers
21 views

Blockchain. Using sub-wallets through the main wallet without any restrictions or commissions

What I mean: Alleged example: I have a wallet "A". This is the main wallet. I want to creat 5 sub-wallets (in real case it will be more than 10.000 sub-wallets) from the main wallet - "...
0
votes
0answers
6 views

How do I sign with web3.py?

Can I have some clarification on what is the first argument of web3.eth.sign. it says here that the first argument is a account-- What is an account? Is it my ethereum address or a private key. it ...
0
votes
0answers
7 views

Can you use Ganache to test create wallet using web3py?

I am using the web3.py library using the web3.eth.account.create () to create my own wallets, my question is if there is any way to use the Ganache services as Provider to be able to perform tests ...
0
votes
0answers
9 views

generate signmessage in python web3

I am learning solidity NFT, I am trying to generate v, r ,s using python web3 require(owner() == ecrecover(keccak256(abi.encodePacked(this, tokenId)), v, r, s), "owner should sign tokenId"); ...
0
votes
0answers
13 views

How to parse trace output using ABI & web3?

I am pulling a trace from a Parity node using the JSONRPC API. It looks like this: print(trace) { 'action': { 'callType': 'staticcall', 'from': '0xXXXXXXXXXXXXXXXXXXXXXXXXXXXX', ...
0
votes
0answers
15 views

Is Web3 on Python hosted on a Raspberry Pi possible?

I've created a Discord bot that allows users to calculate their net worth including altcoins and LP tokens, which I want to use web3 to determine the value of. I did the standard pip install web3 on ...
0
votes
0answers
19 views

Ethereum Input Data Decoding

I Have the following input: ...
0
votes
0answers
23 views

AttributeError: Module 'Users' Has No Method 'Main'

In Brownie I'm running a script which sends me this error "AttributeError: Module 'Users' Has No Method 'Main'. Do you have any suggestions on how I can fix this? import os from brownie import ...
0
votes
0answers
7 views

Why would Web3 return an empty array after calling the solidity function

So I want to interact with my Smart Contract from remix with python library called Web3. The problem is when I try to call the function from the smart contract it runs successfully but it only returns ...
0
votes
1answer
11 views

How to use smtp protocol in solidity smart contract via chainlink Oracle

i had developed a external adapter that make a http get request to cryptocompare api and get latest eth-usd price for me. from bridge import Bridge class Adapter: base_url = 'https://min-api....
0
votes
0answers
11 views

Event data has insufficient length | What does this mean?

I've seen this warning from time to time when working with Brownie Event data has insufficient length This is after I made a call to a Chainlink node, calling a function like: function requestUsers()...
0
votes
0answers
13 views

How do I get the deployed contract's address from a ContractContainer object in Brownie?

I want to chain contract deployment, where the second contract gets as a parameter the address of the first. I'm using Brownie : from brownie import ContractA, ContractB , accounts def main(): ...
0
votes
0answers
13 views

Geth python node no transactions / no data

I want to get transaction information on the blockchain ethereum using Go Ethereum (GETH) with web3 and python. I am running eth node on windows using the following command : geth --http --syncmode ...
0
votes
0answers
29 views

Get ALL Token transfers from Block using Web3.py

I am looking for a way to get all token transfers from the block using web3.py. I can now get the simple transfer or transferFrom data which was sent directly to token contract. But how can I parse a ...
0
votes
1answer
580 views

How to interact with a BSC contract using Python

Binance Smart Chain. I've first tried sending a transaction with python: from web3 import Web3 transaction = { 'chainId': 97, # 97: Testnet. 56: main. 'to': '0xmyaddress', '...
0
votes
0answers
11 views

my python event listener create duplicates in case of multiple event in one transaction

I have an issue to manage with my listener in python, here is my code : def handle_event(event, log_index): receipt = w3.eth.waitForTransactionReceipt(event['transactionHash']) ...
0
votes
0answers
27 views

get “event name” using web3

I want to build a listener in python using web3 as usual. The issue is that I have a lot of event on my contract (let say 30), and depending the event I have an action to do. Here is my code, and I'll ...
0
votes
0answers
31 views

Programmatically convert log data (hexadecimal) into negative decimal value

I'm having some trouble converting negative numbers in the log data of an Ethereum transaction. In this transaction, log index 192, topic 3 is listed as "...
0
votes
0answers
293 views

Python Web3 Contract Filtering

I am trying to filter out transactions from BSC and read their input data (specifically borrows from venus), however I am having trouble getting my event filter to work properly. I have already tried ...
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
60 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
24 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 ?
0
votes
0answers
21 views

Quorum: Sending Private Transaction With Python

I am trying to experiment with GoQuorum and Python. I have read the documentation about how privateTransactions work and I am trying to perform one. Since Python's web3py does not support the ...
0
votes
0answers
2k views

requests.exceptions.ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=7545): Max retries exceeded with url

I created a blockchain app using Ethereum, I downloaded a virtual box. I activated the smart contract on the virtual box and connected it to the Python file on the original device. When the ...
0
votes
0answers
84 views

gas_estimate returning error for too man arguments

running Web3 5.13; python 3.9; Mac 10.15.7 Trying to run test on solidity contract based on the example provided in teh Web3.py docs. When running this I receive an error stating TypeError: ...
0
votes
1answer
406 views

How to get event log Web3.py?

I am using solidity 0.7.4, web3.py 5.12.2, and python 3.7. I am working with Windows 10. My goal is to emit an event inside a solidity function, in order to retrieve the log after the function is ...
0
votes
0answers
437 views

Pass ADDRESS(string) as argument to contract function using web3.py

I've been stuck on this isseu for more then 24 hrs now. I have the following function in my solidity contract: function getBalance(address _addr) public view returns(uint256){ return userBalance[...
0
votes
0answers
73 views

Does Infura support Event Filters?

Does Infura support creating filters to Listen to events ? I have a dapp with many events, and would like to test it in Ropsten testnet and python web3.py, but it seems infura does not support filters....
0
votes
0answers
94 views

Getting wrong nonce when trying to send transaction

Im using opencv in ganache in this app to send an ethereum transaction In my app im getting the transaction that i send like that nonce = web3.eth.getTransactionCount(account_1) tx = { 'nonce': nonce,...
0
votes
0answers
77 views

Duplicate events from get_new_entries using web3.py

I'm struggling to understand how to properly poll events emitted from contracts. The provider I'm using is Infura. My code boils down to the following: filter = target_event.createFilter(fromBlock='...
0
votes
0answers
31 views

Known transaction error in Python3

I'm experimenting on an automatic ethereum wallet. But I have some problems. The first process is successful but it's error message the second process: Known transaction how do I solve this problem? ...
0
votes
3answers
335 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 ...
0
votes
0answers
338 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
536 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
31 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
193 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
56 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
362 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
66 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
1answer
697 views

How to listen contract event in Python

The test contract is pragma solidity ^0.5.0; contract Test{ event Here(uint256 indexed a); uint256 public a; function add() public returns (uint256){ a += 1; emit Here(...
0
votes
0answers
134 views

How to make ECDSA signature of (value_1, value_2) with web3 on Python?

I want to call function with four parameters. I know how to create two of them, but the last two is the r and s components of ECDSA signature of (param_1, param_2). I tried this (and a lot of ...
0
votes
1answer
559 views

How to deploy contract with local private key?

I am trying to deploy my contract onto the blockchain in my private network with local private key (no wallet: I used web3.auto.w3.account.create()). I know how to send normal transaction with local ...
0
votes
1answer
646 views

Ethereum Token: How to decide gas price and gas limit using token transaction?

I made ERC20 token. And I am going to implement to send token using web3.py. Here I want to calculate gas price and gas limit using token transaction. If anyone know about that, please help me. ...
0
votes
1answer
122 views

How to send transaction using ethereum contract?

I made ethereum contract according to sample code. And then generated ethereum wallet. The abstract contract is as follow. pragma solidity ^0.4.18; /** * @title ERC20Basic * @dev Simpler version ...
0
votes
0answers
375 views

pywallet: Which is the private key of child wallet?

Using pywallet, I have developed ethereum wallet under following code. seed = wallet.generate_mnemonic() wallet_info = wallet.create_wallet(network=network, seed=seed, children=0) In this case ...
0
votes
1answer
2k views

Web3.py transact works but call doesn't

I am trying to call a fairly simple contract on a private blockchain: function getOwner() public returns (address) { return owner; } And here is my running it from an interactive Python shell: &...
0
votes
1answer
252 views

How to sign a simple transfer TX with digitalbitbox python api

I'm trying to sign a simple transfer transaction using digitalbitbox's python api (see here and code snippet below). I send the following json to the HW wallet api: Sending: {"sign":{"data":[{"...
0
votes
1answer
922 views

Problem with sha3.keccak_256() update method in Python

I made a simple SHA3 Python script to generate Ethereum addresses and priv/pub keys. After that I sent some ETH to those addresses but then found out that priv keys do not correspond to the addresses ...