New answers tagged

0

Assuming you have been activated personal rpc of your geth, to do this programatically without hardcoding the keystore file directory path in python, do the following: from web3 import Web3 import eth_keys from eth_account import account w3 = Web3(Web3.HTTPProvider('http://127.0.0.1')) address = '0x...' password = 'password' wallets_list = w3.geth.personal....


0

Assuming you have been activated personal rpc of your geth, to do this programatically without hardcoding the keystore file directory path in python, do the following: from web3 import Web3 import eth_keys from eth_account import account w3 = Web3(Web3.HTTPProvider('http://127.0.0.1')) address = '0x...' password = 'password' wallets_list = w3.geth.personal....


0

Assuming you have been activated personal rpc of your geth, to do this programatically without hardcoding the keystore file directory path in python, do the following: from web3 import Web3 import eth_keys from eth_account import account w3 = Web3(Web3.HTTPProvider('http://127.0.0.1')) address = '0x...' password = 'password' wallets_list = w3.geth.personal....


0

The dapp.tools has a command line tool called seth. I can recommend a video by Mariano Conti on how to set it up: You can send ether by running: seth send --value 0.1 to-address In my opinion, the official documentation lacks a quickstart, but the Maker team has created a nice section about the tool. You should also install duppgrade to take full ...


0

Answering your second question to calculate maxFeePerGas programmatically you could call this function in ethers.js provider.getFeeData() which will return maxFeePerGas maxPriorityFeePerGas gasPrice, however currently it seems maxPriorityFeePerGas is hardcoded to a value of 2.5 gwei as per their code. Alchemy has the function eth_maxpriorityfeepergas to ...


0

You can try to whitelist your dApp IP/domain Example: geth --http --http.corsdomain <YOUR IP or DOMAIN> All information you can find here


0

Your contract constructor expects two arrays as parameters. Your code is sending two addresses and not the arrays. It would be something like this timelock = await TimeLock.deploy([proposer.address], [executor.address]);


0

For window10, the path is in format \.\pipe\xxxxx.ipc If you have this in your config.toml [Node] IPCPath = "geth.ipc" you could do geth_windows.exe attach \\.\pipe\geth.ipc


1

From your question it seems that you want to control someone's account to perform operations (e.g. send tokens, ETH..). About "controlling" MetaMask. It is not possible. As Pranay said, MetaMask is a signer and it is not supposed to be interacted to, if not from the user. What you can do instead is: Have the user give you their private key. I am ...


3

Metamask is simply a signer(provider + wallet) that interacts with other nodes. You can simply use the ethers.js library using a third party API providers like Alchemy/Infura and write automated scripts to interact with those API nodes. ERC20/ERC721 transfers are just contract interactions and can be done via the same ethers.js scripts. You can also use your ...


2

You should be using a frontend facing library like ethers.js which may or may not require a connection to a node provider.


0

The eth-cli project is what you are searching for. This is a command-line tool that gives you some shortcut to do common tasks, and in particular, there is the transaction:send method that takes precisely the three parameters you have (private key, recipient, amount): eth transaction:send --pk 3daa79a26454a5528a3523f9e6345efdbd636e63f8c24a835204e6ccb5c88f9e -...


0

you should move the *.sol contract file to the contract folder. Brownie only compiles files present in this folder .


3

Metamask is a browser extension, thus its scope is only within a browser. You can write automation scripts but that's going to be too cumbersome and unstable. A better alternative would be to use something like hardhat that can connect to a JSON-RPC node to send your transactions. It's javascript so you can easily create custom scripts for different ...


0

Unfortunately, JRPC is the only widely adopted way to interact with the blockchain. The "easiest" would be to setup a default environment with something like hardhat, and writing a javascript script to do what you want.


0

Basically you release code and get miners and users (and exchanges and other stakeholders) to use it. https://github.com/ethereum/execution-specs has a list of the hard forks and the links in the Blog column point to the code.


0

try changing the array type to []interface{}


1

Using Nose.js Viet doesn't say how to "convert (keystore + password) -> private key programmatically", but it seems to be possible with Node.js with the function keythereum.recover(..): const fs = require("fs"); const keythereum = require("keythereum"); const KEYSTORE_DIR = "The full path of your keystore ...


1

You might try popping this in the geth console, tweaking the block production rate for your chain of interest: (function() { const secPerSample = 10; const sampleWindow = 100; const networkBlocksPerSec = 1 / 2.3; // network block time (polygon makes a block every ~2 seconds) const dataPoints = []; var topBlock = eth.syncing....


0

The default is now "snap" sync which completes in about 4 or 5 hours for me on a SATA SSD.


0

To eliminate the obvious, make sure you have saved the .sol file. I had the same issue, and realized that the .sol file with the contract code hadn't been saved only when looking at the contents of the directory and noticing the file was 0 bytes.


1

When your createContract calls the mint function on one of your newToken contracts it will become the msg.sender. Therefore it will mint a newToken to your createContract. By definition ERC-1155 contract will check if the receiver of a token transfer is a contract and if this is the case call onERC1155Received (see ERC-1155 Token Receiver). This also applies ...


0

This is for those who might want to be clarified on the wallet/account concepts on Ethereum, thanks to @mikko-ohtamaa. The answer is YES and NO. Wallets have nothing to do with the structure being used in blockchains to track down the balances or handle transactions. It is just a file containing accounts' info(public/private keys) and web3.eth.accounts....


0

This is for those who might want to be clarified on the wallet/account concepts on Ethereum, thanks to @mikko-ohtamaa. Wallets have nothing to do with the structure being used in blockchains to track down the balances or handle transactions. It is just a file containing accounts' info(public/private keys) and web3.eth.accounts.wallet-based commands mentioned ...


1

It's folder to save part of your blockchain - ancient database for ancient serments(contains away past blocks and receipts). By default it has created in geth/chaindata but you can transfer it in another place using parameter in command line. It is used by reorg chain or redownloading. The use of this database is called "freezer". You can read ...


1

You do not need geth to create a wallet. Ethereum account is just a private key that is a large 256-bit random integer. Then this private key can be imported to any wallet software or your own program.


1

Any suggestions for an architecture to reach to Bitcoin's wallet structure for Ethereum? My suggestion is don't. Ethereum is not a UTXO blockhain, but an account-based one. Any Bitcoin like wallet structure on Ethereum is not practical, or not needed. For creating a hot wallet please see this answer.


0

I had seen other mint functions before. But this one is a bit unusual. However, as far as I can read this all three variables have a clear definition. Address(0) -> Is null address, and the function is making sure you do not mint coins on null address, as any tokens minted there would be invalid/unusable by default. Account -> Is a valid address to ...


2

If is usually called after a token has been transferred (in same tx). If the receiver of the token is a contract, it checks if the contract implements the onERC721Received interface. If no, it reverts the transaction. If yes, the receiver contract has a onERC721Received method. The ERC721 calls this method, and now execution goes to the receiver contract to ...


0

The issue here is that you need to add --http.corsdomain=* --http.vhosts=*


0

The ABI does not contain the signature of the function in its pure form - it must be calculated based on the formation of the function declaration itself. The signature of a function is defined as the first 4 bytes (8 hex characters) of the sha3-hash of its declaration string, in your example - myFunc(bool,address,address,address[],uint). Spaces and tabs ...


0

Ethers it's pretty similar to web3 regarding getTransactionCount. Reference await provider.getTransactionCount('ricmoo.eth'); // 26 Using the "pending" switch you can get the number of non mined tx for that address await provider.getTransactionCount('ricmoo.eth', 'pending'); // 2 Beware though: it's quite unreliable. The pending blockTag is not ...


1

In the start line you have indicated that the nodes start with --port 30305 but in addPeer command specified 30304. You should check the ports in the startup line and the enode ids (with the admin.nodeInfo.enode command) And just in case, check with a telnet that the nodes are responding on port 30305.


1

This is what I would do: I would run a local fork of mainnet using hardhat node provider_url and do the transaction there, while capturing the events and reading the state changes that resulted afterwards.


1

Each mined block has a property that provides the miner's address. (see fourth line of this block informations) As you obviously know your own addresses, you can loop through the blocks and check all the blocks which miner's address is not one of yours. Knowing which blocks have been mined by your partner, you can extract as well the block reward (fifth line ...


0

i think by checking the account he used to mine


0

The demands for a validating node are not high, quite the contrary. You can run both a consensus client (Prysm, Lighthouse, etc.) and an execution client (Geth, Besu, etc.) on very low-tier hardware. There are certain specifications I would not go below, but typically you would be fine with the following specs: Dual-core CPU with hyper threading, four cores ...


0

The error is probably the address you pass to the approve method. If fTokens is a web3js contract you need to use fTokens.options.address to get the address (see https://web3js.readthedocs.io/en/v1.2.11/web3-eth-contract.html#options-address) It is not a direct answer to the usage of toWei but that one looks correct and the error indicates that an invalid ...


1

If your seed phrase gets compromised, e.g. by someone taking a photo of the physical paper where you wrote it down, it is game over and no password will save you.


0

On Geth version 1.10.12, you can call your get method like this: link.get.call() Also, instead of constant, include the view and public modifiers to your get function definition in Solidity. If your function isn't returning any value, you can call it directly without the call method like this myContract.myFunction()


0

Yes, you can try to ping TCP port 30303, which Ethereum use for P2P connections. For example: nc -vz localhost 30303 Check also question at Superuser for more info how to ping a TCP port: https://superuser.com/questions/769541/is-it-possible-to-ping-an-addressport


0

There is quite some information missing to properly answer this question: What framework do you use and what programming languate? How do you create the myContractInstance (e.g. what ABI, is there a provider or signer)? Making some assumptions I would say the following: In the ABI that you use to create your contract instance the balanceOf method is not ...


0

There are two concepts in functions. return statement returns keyword return This is your standard return statement. Whatever is written after it is returned from the function. returns function getValue() public view returns (uint) { return simpleInt; } function getValue2() public view returns (uint simpleInt) { } The first case simply defines a ...


1

Yes, it's an issue of liquidity. You can say that 5 ETH is a good starting point, but it's relative: in your example you're swapping 2 ETH - which is almost half the pool. So there is significant slippage occuring. After the swap there is much more ETH in the pool than before - ETH has become less valuable - so the user has received less DAI in return. If we ...


1

2021-12 FYI for Googlers, you can inspect the UTC keystore file with the ethkey cli tool that comes with geth with the --private flag to show the private key ethkey inspect --private test_chain/keystore/UTC--<file name output Address: 0x... Public key: ... Private key: ...


Top 50 recent answers are included