New answers tagged

1

Only the phase 0 of Eth2 is about to release. And that also will only launch a public common testnet, nothing more. So there is no real hurry with anything. In any case when the real Eth2.0 launches (after a year or two) you probably have to decide yourself whether you want to continue mining 1.0 chain (which will be active at least for some time) or ...


0

The ethash folder does not contains any chain data, but cached files for PoW system (here is another questions tha can be useful delete .ethash folder. Using the init command, will not delete any database (as far as I know, init command on an already started BC will not do anything). If you want to remove the db completely, you can run the command geth --...


0

This error comes from the Class EnsResolver as shown above "org.web3j.ens.EnsResolutionException" and it is saying that the node you are connected to does not have a Public Resolver installed in that could provide an access to the API. "Your node does not Provide an access to a valid public resolver in order to access other API methods." ...


0

This problem is really stupid: importRawKey is not expecting "0x" at the start of the hex string. So if you have privateKey = "0xffffffffffffff" // etc pass = "blah" Try chopping off the first 2 characters with .slice(2): web3.eth.personal.importRawKey(privateKey.slice(2), pass)


0

I have implemented the above method with python, and it feels about the same as the computing power of the whole network hashrate! eth = create_rpc("ETH") current_height = int(eth.eth_blockNumber(), 16) sampleSize = 200 current_block = eth.eth_getBlockByNumber(hex(current_height), False) pre_height = eth.eth_getBlockByNumber(hex(current_height - ...


0

The parameters are not wrong, there's no error during deployment and the compiler is acting as expected. In Solidity, when you declare a variable as public, you are telling the compiler to create a public function with the same name of the variable, so that you can query the value of the variable from outside the smart contract. In your case, you are ...


0

Regarding token recipients Any address can be the beneficiary, receiving ERC-20 and ERC-721 tokens (and also ERC-1155, ERC-777, and any other tokens). Regarding token contracts (the thing that emits the events) However, no, it is not possible for a token contract to both be an ERC-721 and an ERC-20 contract at the same time because those two specifications ...


1

Yes, the migration has failed. This error means you have insufficient Ethers to deploy your contract, you should therefore redeploy with the correct amount of ETH.


0

web3.geth.personal.list_wallets(). Delegates to personal_listWallets RPC Method Returns the list of wallets managed by Geth. >>> web3.geth.personal.list_wallets() [{ accounts: [{ address: "0x44f705f3c31017856777f2931c2f09f240dd800b", url: "keystore:///path/to/keystore/UTC--2020-03-30T23-24-43.133883000Z--...


0

Standard can be "retro compatible". However, I do not think it is the case for ERC-20 and ERC-721. Indeed, they are related to different types of token, fongible and non fongible. So you cannot manage both at once in this case as function names are the same, but behavior is different. However, if you are interested in both fongible and non fongible ...


0

That looks like the contract is the recipient of both types of tokens. The contract might have functionality to also transfer the tokens out of it but it might not. If it doesn't have such functionality the tokens simply stay there and can never be transferred out of it. You can't implement both of the standards in one contract as they have overlapping ...


0

You can now. Here is an example: https://github.com/zhiyuan2007/sample-ethereum.toml/blob/master/geth.toml geth --configfile=config.toml


0

Usually smart contract's source code must be validated by Etherscan to let it understand all functions and read it correctly, but the source code for the contract you referred is not verified. It is very likely that contract does not follow the standard for names and functions, so even if Etherscan can vaguely understand that it represents a ERC-721 token, ...


1

Try specifying explicitly your private network informations such as in this example from the web3js documentation : web3.eth.accounts.signTransaction({ to: '0xF0109fC8DF283027b6285cc889F5aA624EaC1F55', value: '1000000000', gas: 2000000 common: { baseChain: 'mainnet', hardfork: 'petersburg', customChain: { name: 'custom-chain', chainId: 1, ...


1

Direct inboud connections for a geth client (please not server, such a bad word ^^) is very rare and usually you must allow this behaviour with a proper configuration of your firewall, your home router, and so on, and in some cases you cannot achieve that without talking with your network administrator or even your ISP. Even with a classic cloud installation ...


1

Plese note that syncing optimization is up to clients, not to Ethereum, so each client implements its very own optimization method. When you say fast sync, I think you refer to geth. Fast sync is now the default sync mode for geth, and it is a way to prioritize objects you want to sync so you can start to work with the chain sooner. In particular, in geth's ...


1

Fast sync nodes do have all TX receipts, hence all logs.


0

You may by the following: Step-I: on your console write "node" and then enter ~/../currentDir> node Then: >var Web3 = require("web3"); >console.log(Web3.version); Output: '1.2.11' //version


0

Update for 2020: It's just Web3.version E.g. console.log(Web3.version);


1

With $ geth --datadir pom you are not initializing a custom chain, you are just starting the client on the Mainnet using a custom folder. To inizialize a custom network you need to use the init parameter with a genesis file, like this: $ geth --datadir pom init [yourGenesisFile.json] And after that you need to pass the custom folder value - pom in your ...


1

Looking at the image, it seems to me you are importing the backup of a private network to a node initializated with the Mainnet. I suspect this because: geth says ChainID is 1, so Mainnet the import process seems to stop with the very first block and the error is unknown ancestor, so it don't know the genesis block your block #1 hash is not the hash of the ...


0

When working with rust/cargo, make sure you have the dependencies installed. You can see your error even makes the suggestion: is 'cmake' not installed? Rust generally gives good tips as to what's going on. Be sure to read the full error as well next time. You can either try running: brew install cmake or check the download page: https://cmake.org/install/


1

No, you need to use an SSD. Q: Wait, so I can’t run a full node on an HDD? A: Unfortunately not. Doing a fast sync on an HDD will take more time than you’re willing to wait with the current data schema. Even if you do wait it out, an HDD will not be able to keep up with the read/write requirements of transaction processing on mainnet. You however should be ...


0

From the Geth FAQ https://geth.ethereum.org/docs/faq Q. How do Ethereum syncing work? A. The current default mode of sync for Geth is called fast sync. Instead of starting from the genesis block and reprocessing all the transactions that ever occurred (which could take weeks), fast sync downloads the blocks, and only verifies the associated proof-of-works. ...


0

You need to use an SSD. Q: Wait, so I can’t run a full node on an HDD? A: Unfortunately not. Doing a fast sync on an HDD will take more time than you’re willing to wait with the current data schema. Even if you do wait it out, an HDD will not be able to keep up with the read/write requirements of transaction processing on mainnet. You however should be able ...


0

Thank you very much was also having the same issue when I tried to run geth for the first time on my system. I applied what is suggested above, i.e. port forward TCP and UDP ports 30303 on the router. I am using a Huawei B525 router and did the following: settings->security->special applications-> special applications list Name: geth; status: on; ...


0

During full sync the state is generated locally, for both archive and full nodes, starting from genesis. The only difference between those nodes are pruning options. For fast sync, the node needs to download some old state snapshot (30-1000 blocks behind tip) make sure that it corresponds to state hash in block header, and from there the sync is the same as ...


1

Just need to change the port for light client and default datadirectory: geth # defaults to port 30303 and ~/.ethereum geth --syncmode light --port 30304 --datadir ~/.ethereum-02 Reference: How to run two nodes on the same device?


0

Ternary operator: <conditional> ? <if-true> : <if-false> The code in the example can be interpreted as: if (duePayouts + paidPayouts > PAYOUTS) { duePayouts = PAYOUTS - paidPayouts; } else { // NOTE: In that case we can just skip section 'else' duePayouts = duePayouts; }


0

That part of code is called "conditional operator" and is mostly used in C++. It is same as this code: if( duePayouts + paidPayouts > PAYOUTS ){ duePayouts = PAYOUTS - paidPayouts; }else{ duePayouts = duePayouts; } The "?" is like "if" and ":" is like "else". It's Format is like this: conditional ...


0

A smart contract is identified with an address on ethereum blockchain. So, you can call it from another by referencing its address. As far as I know, there is a way to do this: contract CalledContract { function doSomething() public { } } contract CallerContract { function callAnotherContract(address addr) external { CalledContract ...


1

are you sure tessera is running ? are you sure the ipc file is at the location specified 'qdata/dd1/geth.ipc' ? how are you running the network ? are you using Quorum wizard ?


1

It is because geth setting was wrong. I need to set genesis block to other instead of Homestead.


3

Ethereum blockchain's smart contracts run on a specific type of bytecode. Solidity is one of the languages with which you can produce the required bytecode - another option being Vyper (also some other small partially forgotten languages). The reason you can't use other languages (such as Rust) currently is that you can't produce the required bytecode from ...


1

No, signing without the "\x19Ethereum Signed Message" prefix is unsafe and dangerous. For example, see https://github.com/ethers-io/ethers.js/issues/555 by ricmoo: This is not, in general, possible and is incredibly unsafe. :s Basically, allowing signing raw messages, without a prefix, enables an app to steal all ether, tokens and assets, which is ...


0

For every public variable in your contract, Solc generates a getter function of the same name. So what you see in the ABI is in fact a representation of: function message() public view returns (string);


2

So you basically want to do a backup & restore. I've been looking into this, to update our genesis configuration for a private Parity chain, but never go to actually try it. As far as I know there's no clean way to do this, without exporting state parity export state, see Parity docs. This command requires the chain to be synced with –fat-db on. You can ...


0

To merge states of two private blockchains Assuming there is no overlap on accounts and assets between two chains Create and fund genesis accounts of chain #1 on chain #2 Replay all transactions of chain #1 on chain #2


0

On ERC20, all these functions emit the exact same event: event Transfer(address indexed _from, address indexed _to, uint256 _value); On ERC721, all these functions emit the exact same event: event Transfer(address indexed _from, address indexed _to, uint256 indexed _tokenId);


0

I solved my problem. Apparently the issue was with the IPC provider. I changed it to HttpProvider(path_to_local_node) and now it is working flawlessly on the ethereum node and returning logs as desired. I am posting the updated code: let web3 = new Web3(new Web3.providers.HttpProvider(nodeURL)); const params = { address: "...


1

You can solve this problem using Divide & Conquer strategy: async function getPastLogs(web3, address, topics, fromBlock, toBlock) { if (fromBlock <= toBlock) { try { return await web3.eth.getPastLogs({address, topics, fromBlock, toBlock}); } catch (error) { const midBlock = (fromBlock + toBlock) >&...


Top 50 recent answers are included