Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [web3.py]

Web3.py helps you access your Ethereum node from Python. It is web3.js for Python.

0
votes
1answer
23 views

How to use a metamask Wallet from web3,py?

I deployed contracts to Ropsten test net using truffle and a metamask wallet to pay for the transactions and Infura as a Hosted ethereum node. To do that in Truffle, I have to use the truffle-...
-1
votes
0answers
17 views

Getting eth blocks timenstamp fast

I downloaded all transactions for one token over the last year. Currently I have dataframe with 200000 entries. For each entry I have block number and amount transacted. Now I need to transform block ...
0
votes
1answer
31 views

Problem with running web3.py code

I am trying to run this code from web3 import Web3, HTTPProvider import json import pprint import requests from random import randint # Debug flags debug_transaction = False debug_CALL_transactions ...
0
votes
0answers
26 views

What does this error mean? web3.exceptions.UnhandledRequest: No providers responded to the RPC request:

I'm trying also to install web3.py and I installed web3 via pip. now I'm running into this issue. from web3.auto import w3 w3.eth.blockNumber Traceback (most recent call last): File "<pyshell#...
1
vote
1answer
16 views

How can I increase EVM time in web3.py?

When working with web3.js, Truffle and Ganache, I can do this: web3.currentProvider.send({method: "evm_increaseTime", params: [numOfSeconds]}); How can I do the equivalent in web3.py? When I do: ...
1
vote
1answer
31 views

Is there any way to know why a contract call cannot work through web3.py?

I have a deployed smart contract and attempt to write codes to call it through web3.py. I'm getting the following error when I call estimateGas(). ValueError: {'code': -32000, 'message': 'gas ...
0
votes
0answers
15 views

how to return transaction receipt in JSON format web3.py

I am trying to return transaction receipt in a JSON from my flask API (python). in JS this is absolutely easy but I can't get the receipt or the transaction hash to pass. All I get is Object of type ...
0
votes
0answers
19 views

How to find specific reason Ether transaction failed

Using Web3.py I am trying to deploy a contract to an Ethereum Ropsten Test Network. Every time I attempt the deploy, I print the returned transaction hash and take it to Etherscan.io to check on its ...
1
vote
1answer
18 views

Transaction Hash after deploying contract with Web3.py too long

I managed to successfully deploy a contract using Web3.py to the Ethereum Ropsten network using this bit of code def deploy(self): instance = self.w3.eth.contract(abi=self.abi, bytecode=self.bin) ...
1
vote
1answer
36 views

web3py: get public key from transaction

I'm trying to retrieve the public key of an address from a transaction. I'm getting the transaction via tx = web3.eth.getTransaction('xxx') According to the docs the public key should be retrievable ...
1
vote
1answer
50 views

How to integrate rinkeby test network with centralised server?

I am new to ethereum blockchain. I want to create ICO platform based website. I have created smart contract and deployed on rinkeby test network. I used python web3.py library to integrate python with ...
2
votes
1answer
47 views

web3 python sendTransaction error

from web3 import * etherscan_provider = Web3.HTTPProvider( 'https://api.etherscan.io/api') w3 = Web3(etherscan_provider) signed_txn = w3.eth.account.signTransaction(dict( gas = 2000000, ...
2
votes
1answer
40 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 ...
1
vote
1answer
30 views

web3.py manually derive address from public key string [for dummies]

Let's say I need to derive the address from a public key string. 0xbb8250cc01a0afa7dcaee987b2adda8d1b0a0bb2f7cc427bd942a98c7837364d62e6ea4728a99db39fd55a6f7474a159ca88a96b40279044a1349a2280c8cd43 ...
0
votes
0answers
57 views

ERC20 Token transfer gas/gasLimit problem

Transfering ERC20 token to an address using KyberNetworkProxy trade function. Asked this question previously came to these results Transaction fails and successfully transfer ERC20 tokens too. ...
0
votes
0answers
42 views

Transaction fail/reverted (success in Remix). Problem with Transaction Data “txn['data']”

Smart Contract Function KyberNetworkProxy obj = KyberNetworkProxy(0x818E6FECD516Ecc3849DAf6845e3EC868087B755); event DepositKyber( address indexed peerWallet, address indexed ...
1
vote
1answer
14 views

web3.py equivalent to geth console command eth.pendingTransactions

I'm currently running a geth server and use the geth console for sysadmin stuff, while using web3.py for interfacing with geth programmatically. From the geth console, there is a handy command eth....
1
vote
1answer
57 views

web3py: get public key from private key (without prior transaction)

Is there a way to get the public key from a private key with web3.py? I know I could get it by checking a transaction signed by that key but that's not working for me in this example. It should be ...
1
vote
1answer
43 views

Ethereum how to create account on parity hosted on Kovan network?

I have a parity node hosted on kovan network. How to create account using web3py? I used web3.personal.newAccount()=>which is giving error as no method found. What are the api's available for parity?
1
vote
1answer
94 views

How can I retrieve the transaction hash / block hash of a contract that has already been deployed?

If you use Web3.py to deploy a Solidity contract to the blockchain, you can retrieve a transaction hash, like this: tx_hash = w3.eth.sendRawTransaction(signed.rawTransaction) Once you have that ...
-1
votes
1answer
62 views

How to call Sell event and buy token function with help of web3.py?

I am new to ethereum block-chain. I created a ERC20 token and crow-sale smart contract in solidity. I also deployed these smart contract with the help of web3.py. I created a contract instance. ...
0
votes
1answer
17 views

Creating an Ethereum id Hash

I'm trying to understand how to convert my transaction data into the id hash before signing the transaction. Let's say I have this data: transaction = { 'to': to_address, 'from': ...
1
vote
0answers
53 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("...
0
votes
0answers
64 views

web3.py installation problem

I am trying to install web3.py in ubuntu 18.04.1 but I am receiving this error message. I have followed the web3.py documentation and created a virtual environment. I have python 3.6.6 which was came ...
2
votes
2answers
52 views

How to send a python bytearray into solidity function by web3.py?

I have a solidity function declared as: function setUnitData(bytes32[10] my_input_array) public payable {...} When I run this code: contract = self.contract_instance['../contracts/test.sol:test'] ...
1
vote
0answers
30 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 ...
0
votes
1answer
25 views

SyntaxError: invalid syntax on web.py with contract ABI

everybody, I'm stuck with a SyntaxError: invalid syntax every time I try running this script on the contract_abi variable that I got from the Remix IDE. I'm currently trying to connect with a smart ...
0
votes
1answer
112 views

Unable to load Solidity contract using `compile_files` function with web3.py

I am new to ethereum block-chain. I created a ERC20 smart-contract with help of open-zeppelin framework. I used py-solc package for solidity compilation with python. I imported compile_files function ...
1
vote
1answer
23 views

How does web3.auto choose a provider node?

I'm having this other issue which has forced me to rely on either infura or web3.auto in order to make the getTransactionReceipt call. I've noticed that when I create a w3 instance from web3.auto it ...
0
votes
1answer
67 views

Converting web3.sha3() bytes to string (Python)?

The code I am having trouble with: new_address = Web3.sha3(rlp.encode([normalize_address(accountAddress), nonce]))[-40:] return '0x'+new_address new_adress remains in bytes and I can't join it with ...
1
vote
0answers
25 views

Why Ropsten Testnet has Total Ether Supply < the biggest ether holder balance?

Let's see two below image that I cropped them from ropsten.etherscan.io. Can someone tell me why Total Ether Supply < the first address balance?
1
vote
1answer
116 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
2answers
57 views

Publishing contracts with libraries using web3.py

Im trying to publish contracts with libraries in them and im getting the below issue. Contracts without libraries publish just fine. Can someone who might have faced this issue before advise what the ...
1
vote
0answers
31 views

How to integrate myether wallet in ICO crowd-sale application with python web3.py library

I am new to ethereum block-chain. I am learning to implantation of Ethereum decentralise application with python web3.py. I successfully compile and deploy smart contract with web3.py. Now, I want to ...
1
vote
1answer
77 views

Contract deploy error with web3.py: Incorrect argument count

I am trying to deploy ERC20 based token with web3.py. I successfully compiled the solidity contract, but get an error when I deploy. The exception is raised in this line: tx_hash = contract.deploy(...
1
vote
1answer
77 views

How we store end user details when we create ICO based ethereum DAPP? [closed]

I am new to ethereum blockchain.I want to create ICO based ERC20 token selling DAPP(Decentralized Application). I have created and deployed smart contract on ethereum private blockchain network and ...
0
votes
1answer
159 views

Call function from contract using sendTransaction() - web3.py

I have contract Test.sol migrated to privatenet running on port '8545' which updates value of 'a'. Test.sol pragma solidity ^0.4.20; contract Test{ uint public a=2; function updateval(uint b) ...
2
votes
1answer
30 views

py-evm output with extra bytes

I have simple smart contract pragma solidity ^0.4.17; contract Inbox { string public message; constructor() public payable { message = "Hi there!"; } function setMessage(...
2
votes
1answer
82 views

web3.py constructor(address type)

I tried to deploy the contract on my testrpc, but I get error when my constructor using "address" type. Here is my python code: import json import web3 from solc import compile_source from web3....
0
votes
2answers
164 views

Get Gas use of a transaction with web3

is it possible to get the information about the actual amount of gas that was used for a transaction? I have the transaction hash and I'd like to know the gas that was used by this transaction after ...
1
vote
0answers
105 views

Not able to view Token Transfers Using Infura and Web3? [duplicate]

I am trying to get insight into token transactions for various smart contracts using infura and web.py. The following snippet of code I thought should return me transactions for that contract, but I'm ...
0
votes
1answer
41 views

How to determine using web3.py when this contract's tokens are unlocked? (contract code attached)

Currently the tokens of this contract are locked. I want to be able to figure out when the tokens of this contract have become transferrable in my python script. I'm using web3.py for this work. Link ...
3
votes
2answers
25 views

Why does confirm that there is always 1 block apart on the mainnet when initiate multi-transactions simultaneously- by web3.py and Infura.io

1.I have a need to initiate multiple transactions to the same contract address in the fastest time and get confirmation from the network. Means that multiple transactions are recorded in the same ...
0
votes
1answer
157 views

How Do I Get List of Transactions for Specific Token(s) using Web3? [duplicate]

I'm trying to pull together a dataset on various token transcations using the web3 module in python. However, being new, I'm confused by how to subset the blockchain information to a specific ...
2
votes
1answer
28 views

Is there dumpprivkey analogue in geth?

I'm creating new address with web3.py with this code: from web3 import Web3 w3 = Web3(Web3.HTTPProvider('http://localhost:8545')) w3.personal.newAccount('the-passphrase') And have few questions: ...
0
votes
0answers
77 views

Unable to connect to geth via web3.py

I'm launching geth with following command: geth --testnet --syncmode="full" --rpcaddr "0.0.0.0" --rpccorsdomain "localhost" --rpc But when I'm trying to interact with geth by this python code from ...
1
vote
1answer
150 views

Recover JavaScript Signed Message in Python Web3

Running into problems taking a signed message from Web3.js, and recovering the signing address in Web3.py. Here is my code in JavaScript to create a signed message: async function sign_message() { ...
1
vote
0answers
146 views

ImportError: cannot import name geth_poa_middleware

Web3.py version 3.15.0 Python: Python 3.5.2 OS: linux I have followed @carver 's answer related to Rinkeby failure with web3.py — Could not format value '0x…' as field 'extraData' related to web3....
1
vote
1answer
160 views

How to filter indexed events and watch callback return value using Web3.py

For example, I have an event where using clusterAddress as key, I want to find the other arguments (storageID, desc, etc.), only having the clusterAddress indexed. I added the indexed keyword for the ...
0
votes
0answers
64 views

get all TRX erc2 tokens from block address web3py/web3js/..?

I am kind of a blockchain beginner. Is there any way for me get get erc20token list given a block number. I want to use infura.io for this. I was thinking 1. get all events from blockchain, filter by ...