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

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

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
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 ...
0
votes
0answers
14 views

Plot charts using json data [closed]

I want to plot charts in c# using 1 lakh json data from my python api. I am using Google charts for plotting the graph,but the issue is that it is not working due to large data.How can I sort this ...
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
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","...
2
votes
1answer
38 views

What is pyethereum?

I have seen a definition here saying: "This is the Python core library of the Ethereum project" So what is it's use? To develop dapps using python on the ethereum network?
3
votes
1answer
34 views

What advantages does Trinity have over Geth or Parity? What differences does it have?

With the exception of the language it is being written in, what are the main differences that Trinity has over Geth or Parity (if any). What advantages does it have? Disadvantages?
2
votes
1answer
17 views

Are Solidity modifiers functionally equivalent to Python decorators?

I understand that in Solidity if a function has a modifier, this modifier runs first, prior the the logic within the function running. This is done for checks of ownership, checks of state, etc. In ...
2
votes
1answer
26 views

Using Python to invoke smart contract [duplicate]

I'm currently writing a thesis on a simulation of a peer to peer electricity market. The payments between the agents of the simulation would be settled through an Eth smart contract. I would like to ...
1
vote
1answer
23 views

Argument encoding: list of uints (uint[48])

Using python web3 module, attempting to call a contract function that takes one argument, a list of 48 uints: function checkOrderBatch(uint[48] input) external view returns(uint16[16] status, uint[...
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 ...
1
vote
1answer
39 views

Decoding Contract Log's “Data” field With eth-abi Throws Error: “Padding bytes were not empty: b'0x0000000000'”

I used this guide to create the code below. I suspect the error is somewhat related to the encoding processes I do to the strings, as that is the only place where I deviate from the guide. Here is my ...
0
votes
1answer
47 views

Transaction done, but nonce does not update and call to a function returns zero

I've used web3py to deploy a contract and send some transactions to it. I calculate the nonce this way: nonce = web3.eth.getTransactionCount(account, "pending") When I deploy the contract, ...
0
votes
0answers
14 views

How to process a request with oraclize on the server?

First of all, it's the first time I use Oraclize. I have a contract makes a request to a remote server (Python) that I have, my question is, how to process that request? If I understand correctly, the ...
2
votes
0answers
21 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....
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
14 views

Pulling ETH-BTC quotes from coinbase programmatically [closed]

I am using the coinbase 2.1.0 python api to pull prices. I have been able to pull BTC-USD prices but not ETH-BTC. My code is: from coinbase.wallet.client import Client api_key = "" api_secret = "" ...
0
votes
1answer
57 views

How to read “allevents” using Python web3 (there's capability in web3.js)?

Is there a mechanism to create a listener for all events being emitted from a smart contract for the python web3 library. There is a way to do it in web3.js: myContract.events.allEvents([options][, ...
0
votes
2answers
84 views

How to get all ethereum addresses?

I am going to get all ehtereum wallet addresses with positive balance. I tried to get addresses with a method to get transaction. I have got transaction from blocknumber(0~ Inf). Using web3 and ...
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.
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. ...
0
votes
1answer
313 views

dictionaries inside lists - python [closed]

i'm trying to access a dictionary within a list and cannot seem to get my for loop to get the key, then the value... i've place an image herein so that its easy for me to explain. so you can see, i ...
1
vote
1answer
61 views

Transaction fails when calling contract function with return value

I'm hitting some unintuitive behavior in solidity when one of my contracts calls another. I'm testing the contracts with web3py. Here's is the most minimal example I could come up with. Note that it ...
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.
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 ...
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
55 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
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 ...
1
vote
1answer
242 views

How to use sendRawTransaction of web3.py?

I read the web3.eth.API carefully and I typed the code in my project. signed_txn = self.web3.eth.account.signTransaction( { 'nonce': self.web3.eth.getTransactionCount(Web3....
0
votes
0answers
82 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 ...
2
votes
1answer
187 views

How to make Ethereum tx using web3.py?

I am new to Ethereum. Using pywallet, In my project, I had make ethereum wallet in local. Infura API is used as a provider for me. https://mainnet.infura.io/MYTOKEN So I get balance of address ...
1
vote
1answer
228 views

Python 3 How to make Event Filter via createFilter web3.py v4.2.1

According to the Web3.py Documentation: http://web3py.readthedocs.io/en/latest/filters.html Quote "event_filter = contract.events.myEvent.createFilter(fromBlock='latest', {'filter': {'arg1':10}})" ...
0
votes
1answer
41 views

Python How to make Filter topics: encode integers to its hex string representation

In the documentation: http://web3py.readthedocs.io/en/latest/filters.html Quote "Subsequent topic items are the hex encoded values for indexed event arguments. In the above example, the second item ...
0
votes
2answers
237 views

How to convert/decode Solidity bytes32 to Python string via web3.py

Inside a Solidity contract, I have this variable: zBytes32 = "HelloBytes32"; after Python web3.py retrieving that variable, zbytes32 = contractInstance.functions.getzBytes32().call() print(...
0
votes
1answer
301 views

How to call write functions via Python web3.py, w3.eth.sendRawTransaction()

Hi I am running Python web3.py(Not web3.js) to interact with contract functions: txn = ctrtInstance.functions.setzString(zString).buildTransaction() txn['nonce'] = 3643 # I have to add those into ...
1
vote
2answers
273 views

How to decode txn_hash from contract function call via Python web3.py, w3.eth.sendRawTransaction

Hi I am running Python web3.py(Not web3.js) to run this: txn = ctrtInstance.functions.setzString(zString).buildTransaction() print('\ntxn: '+ str(txn)) txn['nonce'] = 3643 txn['chainId'] = 3 ...
2
votes
0answers
134 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-...
3
votes
1answer
95 views

How to get a message from web3.shh using Python

Good afternoon. I'm trying to implement the "Status" at the moment. I use the library Web3.shh. I sent the message and gives the answer "True", but I can not receive all the messages on the other ...
0
votes
1answer
27 views

Apparent mismatch between Oraclize CBOR and python3 CBOR encodings

I encoded a value using the Oraclize CBOR library like so: Buffer.buffer memory cborArgs; Buffer.init(cborArgs, 64); cborArgs.startArray(); cborArgs.encodeUInt(10); cborArgs....
0
votes
1answer
22 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
193 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 ...
0
votes
1answer
49 views

public address variable causes BadFunctionCall exception

See the contracts at the bottom. You will notice that the contracts are identical, except that the first contract's authority field is marked public, while the second isn't. The second contract works ...
0
votes
0answers
173 views

error in web3.py: gas required exceeds allowance or alway s failing transaction

In solidity I have functioninitAll(). The related codes are shown as below: int public lamb = 200; int[] public posMiu; int[] public negMiu; int public lambdaSize = 25; int public miuSize = 300; int ...
0
votes
0answers
42 views

Connection error while trying to connect to rpc provider from a docker container

I am running testrpc on my localhost and I am trying to connect to it from a docker container. I am getting Connection error, when my python program tries to contact the rpc provider. Port 8545 is ...
0
votes
1answer
278 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
0answers
86 views

How do I send function call to a contract that includes multiple variables in web3 python? [duplicate]

In web3 python you define transaction like this: transaction = { 'to': to_address, 'value': int(eth_amount*(10**18)), 'gas': 26000, 'gasPrice': int(gwei*(10**9)), ...
0
votes
1answer
116 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
0answers
26 views

How to set up client service script written on python?

I have a blockchain network with 2 miners on computer, node on RPi, and a contract deployed. I am writing a script to upload readings from sensor connected to Pi, and the script is on python. The ...