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

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

0
votes
0answers
7 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
8 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
0answers
22 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
11 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
23 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
22 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
votes
0answers
11 views

I am not seeing an error but can't load web3 in Python?

My point is when I try to load web3, this is what I get: https://imgur.com/a/K0alBG9 It's in python3.6 web3.4.4. I can't use Python 3.5 and web3 > web3.4.4. Web3 3.5 seems to have removed ...
1
vote
1answer
39 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
28 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
22 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
33 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
61 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
42 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
24 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
33 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
50 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 ...
0
votes
0answers
37 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
38 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 ...
2
votes
2answers
23 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
55 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
24 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
30 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
69 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
75 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
114 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
34 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 ...
0
votes
0answers
25 views

Transaction doesn't get reverted when I add gas parameter in web3

I have a function with modifier that I call through web3.py. If I do this function call without using the gas parameter, like this: MyContract.functions.preBid(100, 10, 0).transact({'from': accounts[...
0
votes
1answer
33 views

AttributeError: 'Web3' has no attribute 'shh'

Web3.py version: 4.2.1 Python: 3.5.2 OS: linux geth version: 1.8.0-unstable I am running geth with --shh flag and --rpcapi "admin,eth,net,web3,debug,shh" from web3 import Web3, HTTPProvider web3 = ...
1
vote
1answer
35 views

Transaction fail (Tx is Successful in Remix)

I get a transaction failed when trying to execute the following contract: pragma solidity ^0.4.23; pragma experimental ABIEncoderV2; contract state { uint256 contract_version = 1; ...
0
votes
1answer
53 views

Parity dev node cannot send transactions via web3 py

I'm using a parity dev node via docker with the following set-up: docker run -d -p 8545:8545 parity/parity --config dev --jsonrpc-interface all --jsonrpc-apis all --jsonrpc-cors "*" When I attempt ...
0
votes
1answer
47 views

How to make batch transaction in ethereum using web3.py

I want to make batch transaction in ethereum using the web3.py. I found web3.createBatch() in Web3.js, but i can not find it on web3.py.
3
votes
1answer
111 views

web3.py createFilter: filter => SyntaxError: positional argument follows keyword argument

Web3.py version 4.2.1 geth version: 1.8.0-unstable I have followed web3.py guide for filtering. Through the contract instance api: event_filter = mycontract.events.myEvent.createFilter(fromBlock='...
0
votes
1answer
99 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. ...
1
vote
0answers
56 views

How to call transferFrom using web3.py

I want to make a function that allows you to send tokens from one owner to another. nonce = w3.eth.getTransactionCount(from_['address']) unsigned_transaction = contract.functions....
0
votes
2answers
120 views

AttributeError: 'Web3' object has no attribute 'shh'

Web3.py version: 4.2.1 Python: 3.5.2 OS: linux geth version: 1.8.0-unstable I am running geth with --shh flag and --rpcapi "admin,eth,net,web3,debug,shh" from web3 import Web3, HTTPProvider web3 = ...
2
votes
1answer
107 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
1answer
95 views

Whisper: How could we print received messages that are actually stored in the memory when geth was closed or shh.newMessageFilter() is not activated?

Whisper Protocol is not well documented related to its usage. I believe this issue will help other users who might face with similar problem. Each sent message has time-to-live in seconds (ttl), that ...
2
votes
1answer
75 views

DEVp2p Wire Protocol tutorial on geth or Web3.js/Web3.py

I was looking to develop an application using ÐΞVp2p Wire Protocol and I'm having trouble finding an example or tutorial. I was able to find only ÐΞVp2p Wire Protocol's wiki. [Q] Does anybody has a ...
1
vote
0answers
33 views

How to catch errors in web3.py

How can I catch revert or out of gas errors in web3.py? I'd like to call a function through web3.py and in case it gets reverted I'd like to try it again after a couple of seconds.
1
vote
0answers
51 views

Using web3py with truffle framework

Can we use web3.py with Truffle framework ? If yes, please share such integration examples
1
vote
1answer
56 views

Identify all events occurred in a single transaction

Is it possible to identify all the events occurred within a single transaction? I just want to group events by transaction, but looks like it is not possible. e.g. all the events have different ...
0
votes
0answers
243 views

Get all the past events of the contract

how can we get all the past events of the contract ? I am trying like this : on web3.js ( "web3": "^1.0.0-beta.34"): // Add the web3 node module var Web3 = require('web3'); // Show web3 where it ...
0
votes
1answer
186 views

How to get all address transactions?

I use Infura as a provider of HTTP. But Infura does not allow you to make a filter. requests.exceptions.HTTPError: 405 Client Error: Method Not Allowed for url: https://ropsten.infura.io/ ...
1
vote
2answers
91 views

How can I simply sign an Ethereum transaction?

I want to use blockcypher to work with the Ethereum network. In the documentation they give an example of a signer tool written on Go, but I'm use Python. What is the simplest way to sign a ...
1
vote
1answer
51 views

Reading transaction data off the node

I'm connected to an Ethereum node (running Geth) I manage and I'm able to connect to it using RPC. I can access web3 in the terminal after issuing geth console. I can access and run the RPC function ...
0
votes
0answers
23 views

create data that linked to previous data in etherium web3

i have a smart contract code like following contract Book { string public page; function Book() public { page = 'Hello'; } function setPage(string _page) public { ...
0
votes
1answer
235 views

Convert String to Bytes32 Web3.py v4.3 Python

I'm using web3.py v4.x and I have an issue to convert string to bytes32. First I checked out Web3.py conversion APIs. So I used Web3.toBytes but still not working. Kindly check out the below error for ...
0
votes
0answers
47 views

How to use token contract?

I create token contract and register to ropsten test net. Just this. So I can see the contract code, abi and binary here. And I copy abi from there and paste to file in my project. Using this abi, I ...
0
votes
1answer
91 views

Solidity smart contract inherited function output failed

I'm trying to inherit a function from the parent contract into child contract and its working fine in remix JavaScript VM. I did the following steps: Deployed the parent contract in remix JavaScript ...
0
votes
0answers
38 views

How send transaction in HDwallet of ethereum?

Using pywallet, I have created ethereum wallet. This wallet is HDWallet. In this case, I can create sub-wallet(child wallet). But this sub wallet has no private key. So using web3.eth.Api, I can't ...