Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

New answers tagged

0

The number of variables you are allowed to use is limited. I encountered this error a lot of times in the past. It is very frustrating. However, there is no good solution to this problem. You have to obey to what the error log tells you: Use fewer variables. This is very unfortunate. But your best chance might be creating a second struct which stores the ...


1

In theory once a transaction hash is given it stays forever. However in the case of testnets the rule of thumb is that you should never rely on something staying forever. They are called test nets for a reason. They may get screwed up (and have been screwed up many times in the past) for whatever test reasons. Typically they get screwed due to a test of an ...


0

They are specified when you run geth --help from a command line. When I run it locally on my PC (with Geth v1.5.7-stable-da2a22c3 installed), I get: --fast Enable fast syncing through state downloads --light Enable light client mode Sorry, apparently this Geth version doesn't support full...


2

Not sure where exactly it is officially documented, but I recently wrote an article about Running an Ethereum Full Node on a RaspberryPi 4 (model B) where I provide in the introduction a summary of the different syncing modes of Geth. Extract from the article: Blockchain sync mode [--syncmode]: full sync: A full sync downloads all the data (block ...


0

Solved issue when added "ByzantiumBlock": 0, to genesis.json. Otherwise geth node is not capable of calling contracts from another contract. More details on https://github.com/alastria/alastria-node/issues/278


0

OP didn't say if this is sales tax, income tax, or something else so we have no information about how it is calculated. I'm going with a tax form/tax remittance scheme as it seems the most likely. On the surface, this sounds like a "request payment" app, and little more. If confidentiality is a concern, then it takes diligent efforts to protect it and one ...


0

It seems to be an issue with invoking with web3 via a nonsecure http connection, although I don't know why. This is what I did to get it to work: Set up an ngrok secure tunnel Run geth as follows: geth --rinkeby --rpc --rpcport=8545 --rpcaddr 0.0.0.0 --rpccorsdomain "*" Use the following URL to connect from anywhere. It works with truffle, geth console, ...


0

I don't know the infrastructure of your current project. However it is worth to try changing: web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545")); to: web3 = new Web3(new Web3.providers.HttpProvider("http://192.168.1.37:8545")); You are using geth attach with this IP as well so it might solve your problem. Edit 1: As it seems to ...


0

A sample program: pragma solidity ^0.5.2; contract bank{ struct Person{ uint id; bytes32 name; } mapping(address => Person) public p; function getDetails(address a) public view returns(uint ,bytes32){ Person storage person = p[a]; return(person.id , person.name); } function setDetails(address a,uint id , bytes32 name) public{ ...


1

If you are trying to generate a Java smart contract wrapper you should use the web3j cli. You can still use truffles contract schema. $ web3j truffle generate [--javaTypes|--solidityTypes] /path/to/<truffle-smart-contract-output>.json -o /path/to/src/main/java -p com.your.organisation.name https://web3j.readthedocs.io/en/latest/smart_contracts.html


0

Just to elaborate on Mahesh's answer. Transactions can't be cancelled or marked as failed. Once you submit a transaction to the network there is no way to cancel it. The only thing you can do it overwrite the transaction. Note that this is just a trick and in reality it just means that you send another transaction to the network with the same nonce. If the ...


0

You can drop/reject transactions using Ethereal with an automated python script that encounters on every 5 seconds. To understand more about Ethereal, Go through below link : Releasing Stuck Ethereum Transactions Hope this answer will help You.


0

You can use this service to dump parity private key https://github.com/lispczz/parity-dumpprivkey


0

You must to provide the correct nonce. The high nonce tnx will be pending in txpool queue until all the lower nonce tnx was mined


0

You don't have to use push with an array. You can add a new element modifying its length. Candidate[] public candidates; function addCandidate(string memory _name) public { uint idx = candidates.length; candidates.length += 1; candidates[idx].name = _name; } Another option is to use a mapping. You will need to keep the length separately. mapping (...


0

This is world first Ethereum account 0xD1648503B1CCC5B8BE03FA1EC4F3EE267E6ADF7B in genesis 5,828ETH I found it in go-ethereum source code


1

The doc [https://docs.ipfs.io/] mentioned that pinning an item is essentially marking it for the garbage collector not to delete it, so it will not be deleted. if i will pin my hash is is possible that still IPFS deletes my information from server because i am using public gateway If using public gateway, more likely it will be deleted. This is similar ...


0

User can make transaction to the blockchain using third party api. User needs to sign the transaction with his keystore. Then he can send it to the blockchain. Metamask you can use; which is a browser plugin. It can be connected to any node of the network. The user will provide the credentials of the keystore in this plugin and make transaction. To get the ...


0

Probably the unlocking process for you account has not completed at the time of transaction. May be there is a solution in this answer: Error: account unlock with HTTP access is forbidden when unlock an account in Geth console


1

ERC20 and ERC721 are, by definition, interfaces. You cannot attach extra data to the prescribed functions, e.g. transfer() because that will break compatibility with the standard interface. You didn't say what you want to achieve so it's not possible to be specific about the solution. Two common approaches spring to mind. ERC20 is for fungible assets - ...


0

This looks like an issue with version 2.0.0 of ethereumjs-tx: https://github.com/ethereumjs/ethereumjs-tx/issues/165 16 You will need to construct your transaction like below: const tx = new Tx(txObject, {chain:'ropsten', hardfork: 'petersburg'})


0

This looks like an issue with version 2.0.0 of ethereumjs-tx: https://github.com/ethereumjs/ethereumjs-tx/issues/165 16 You will need to construct your transaction like below: const tx = new Tx(txObject, {chain:'ropsten', hardfork: 'petersburg'})


1

From the team at Blocknative... A Speed Up transaction will typically have: An identical nonce, From the same Wallet address, Sent to an external account (not a smart contract), with At least a 10% higher gas fee, and The identical value, plus Gets signed-and-successfully-submitted before the original transaction is confirmed. You'll want to make ...


0

The call to on(...) runs asynchronously (returns immediately). You can fix it as follows: async function task() { const receipts = new Array(length); for (let i = 0; i < length; i++) { feeTx = { ... }; receipts[i] = await web3.eth.sendTransaction(feeTx); } // handle `receipts` here } task(); // do not ...


0

you are using one hyphen? here the argument or the option wants two hyphens --nousb, geth -h | grep nousb geth --help | grep nousb only a short-option wants one hyphen.. -h ;)


2

Just a guess because the link seems to be dead, but maybe you're using libraries? From https://solidity.readthedocs.io/en/v0.5.11/using-the-compiler.html: If your contracts use libraries, you will notice that the bytecode contains substrings of the form __$53aea86b7d70b31448b230b20ae141a537$__. These are placeholders for the actual library addresses. The ...


0

Running as systemd: Create geth.service file (/etc/systemd/system/geth.service): sudo nano /etc/systemd/system/geth.service Paste the below [Unit] Description=Geth [Service] Type=simple User={$USER} Restart=always RestartSec=12 ExecStart=/bin/geth --syncmode "full" --rpc --rpcaddr "0.0.0.0" [Install] WantedBy=default.target Replace {$USER} with ...


0

Best way is to run as systemd: Create geth.service file (/etc/systemd/system/geth.service): sudo nano /etc/systemd/system/geth.service Paste the below [Unit] Description=Geth [Service] Type=simple User={$USER} Restart=always RestartSec=12 ExecStart=/bin/geth --syncmode "full" --rpc --rpcaddr "0.0.0.0" [Install] WantedBy=default.target Replace {$USER} ...


0

Hope this helps. Create geth.service file (/etc/systemd/system/geth.service): sudo nano /etc/systemd/system/geth.service Paste the below (Change config in ExecStart to TestNet): [Unit] Description=Geth [Service] Type=simple User={$USER} Restart=always RestartSec=12 ExecStart=/bin/geth --syncmode "full" --rpc --rpcaddr "0.0.0.0" [Install] WantedBy=...


0

Best way is to run as systemd: Create geth.service file (/etc/systemd/system/geth.service): sudo nano /etc/systemd/system/geth.service Paste the below [Unit] Description=Geth [Service] Type=simple User={$USER} Restart=always RestartSec=12 ExecStart=/bin/geth --syncmode "full" --rpc --rpcaddr "0.0.0.0" [Install] WantedBy=default.target Replace {$USER} ...


0

In my case, I used private chain, so I could deploy it when I deploy from node address. If you want to deploy from any other address, it is better to use sendTransaction to deploy contract.


0

We can unlock account only for the account that made from web3.eth.personal.newAccount(password, [callback]. If your address is made by in any other way, you don't have to unlock it. You need your privatekey.


1

Running Status's go server (in a docker image) will do what you want: no blockchain syncing, plus an exposed HTTP API interface that meets the JSONRPC standard. Following these instructions worked for me: https://status.im/technical/run_status_node.html Namely docker run --rm \ -p 8545:8545 \ -v $(pwd)/http-enabled.json:/config/config.json \ ...


0

This is more of a question for the ubuntu stackexchange. You have two options: Execute with sudo. This will work for sure: sudo geth --datadir blokchain init genesis.json There might be a problem with permission (chmod set incorrectly). Try setting it on the entire folder. sudo chmod -r 777 myFolderThatContainsEntireChain. This isn't the best solution but ...


1

This line: contract.getCounter().send(); should be contract.getCounter().call({from:yourAccount}); Reason When you request state from Ethereum, it doesn't cost gas because you're just reading a node. If the node is on your computer, you're just reading your hard drive. On the other hand, when you change state, it requires miners to pick up the change ...


1

[Note that this answer addresses the static block reward, and ignores both transaction fees paid to miners, and uncle rewards.] So if i an given a block number what is the formula to calculate the block reward For blocks 0 -> 4,369,999 the reward was 5 ETH. During the Byzantium hard fork (Oct 2017) EIP-649 reduced the reward from 5 to 3. For blocks 4,...


0

There is no formula to calculate block rewards. The change in block rewards take place by virtue of hard forks. In the new fork, along with other things, the block rewards can be adjusted. These adjustments are discussed by the ethereum community via Ethereum Improvement Proposals. Read this article about forks Also block reward is a property of the block ...


0

When you are using the --stdio-ui parameter, you have to interact in json format. For example to reply with your password phrase use: {"jsonrpc":"2.0","id":1,"result":{"text": "password phrase"}} When experimenting it is easier to start without the --stdio-ui parameter, then you can just paste the password and enter anwers like "y".


0

There is a filter function in web3 javascript API and you can get pending txs by it. A simple print script as follows: web3.eth.filter("pending").watch( function(error,result){ if (!error) { console.log(result); } } ) Hope It will Help You...


0

If you invoke a function that doesn't exists in a contract it will call the fallback function. In the case of the DAO it will execute the following function which returns a bool. function () returns (bool success) { if (now < closingTime + creationGracePeriod && msg.sender != address(extraBalance)) return createTokenProxy(msg.sender);...


0

I got the same question, did you get the answer, if you solved this question ,please tell me how to solve it, Thinks


0

More questions followed in the comments that lead to this answer. I have found my mistake. The owner has to Authorize himself/herself too. The Contract was denying access to the hash the whole time due to authorization.


1

Since it is private is there a way to replace solidity with vanilla JS? You'd need to write a compiler that could compile JS to EVM bytecode, and I'm pretty sure no one has done that yet. The accepted answer to the following question might help explain the rationale behind developing a new smart contract languages, rather than use an existing language ...


0

Let me answer you one by one. How to retrieve your public and private key? Inside your geth directory, you will be able to see the keystore file. You can use this node module (https://www.npmjs.com/package/keythereum) to retrieve the private key using the password you used while creating the account. When I am checking this address in etherscan it shows ...


Top 50 recent answers are included