"npx hardhat accounts" not available in Hardhat latest version 2.9.9 - ethereum

I have installed the latest version of hardhat. It installed fine.
After setting hardhat up and installing all the required packages, when I run:
npx hardhat accounts
It gives an error:
Error HH303: Unrecognized task accounts
It seems like 'account' task has been removed in the latest version of hardhat. My question is now to get the list of wallet accounts that hardhat generates?

I have the same situation on 2022-08-16.
To get the available accounts, I use the npx hardhat node command.
The command sequence I performed was:
$ npx hardhat --version
2.10.1
$ npx hardhat accounts
Error HH303: Unrecognized task accounts
For more info go to https://hardhat.org/HH303 or run Hardhat with --show-stack-traces
$ npx hardhat node
Started HTTP and WebSocket JSON-RPC server at http://127.0.0.1:8545/
Accounts
========
WARNING: These accounts, and their private keys, are publicly known.
Any funds sent to them on Mainnet or any other live network WILL BE LOST.
Account #0: 0xf39Fd6e51a...ffFb92266 (10000 ETH)
Private Key: 0xac0974bec39a1...478cbed5efcae784d7bf4f2ff80
Account #1: 0x70997970C51812...b50e0d17dc79C8 (10000 ETH)
Private Key: 0x59c6995e998f97a5a...9dc9e86dae88c7a8412f4603b6b78690d
.
.
.

This is because the accounts tasks is not included in the latest release. Add the following in your hardhat.config.js
task("accounts", "Prints the list of accounts", async () => {
const accounts = await ethers.getSigners();
for (const account of accounts) {
console.log(account.address);
}
});

im not sure but I managed to fix this by migrating waffle to Beth chai masters as required and rm from config the waffle and add the chai masters
after that could not get accounts els how than "npx hardhat node" looks like accounts are displayed when launching the node if it can help!

I use yarn hardhat node to display a list of hardhat accounts on the terminal

Related

GoError: Error: the method personal_newAccount does not exist/is not available at web3.js

I just installed geth and
I start an instance of geth with this command: geth --rinkeby --syncmode=light --http
then I attach to that instance with this command: geth attach http://127.0.0.1:8545
and it seems to work well...
personal command return me that:
but on command personal.newAccount() I get this error:
From what I found in a old post: https://ethereum.stackexchange.com/questions/51772/account-created-using-web3-is-not-showing-in-geth-console I should allow personal api on starting command, but right now --rpcapi personal option is not available.
Do you have any idea what I did wrong?

Token doesn't want to deploy to a blockchain

I have created and compiled a smart contract and created my deploy token file as well. When I run ganache-cli on one terminal it gives me '''eth_getTransactionByHash''' and while the brownie run scripts is running on the other terminal it says '''awaiting transaction from mempool'''
I logged into my MetaMask account as well and created a new Account with the RPC and chain ID provided.
Please help.
I had the same issue when running ganache-cli. I fixed it by passing some parameters
ganache-cli --port 8545 --gasLimit 12000000 --accounts 10 --hardfork istanbul --mnemonic brownie

Error with prysm beacon-chain with testnet pyrmont

I am trying to run a beacon-chain for Ethereum2.0 in the pyrmont testnet with Prysm and Besu.
I run the ETH1 node with the command :
besu --network=goerli --data-path=/root/goerliData --rpc-http-enabled
This command is working and download the entire blockchain, then run properly.
But when I launch :
./prysm.sh beacon-chain --http-web3provider=localhost:8545 --pyrmont
I get :
Verified /root/prysm/dist/beacon-chain-v1.0.0-beta.3-linux-amd64 has been signed by Prysmatic Labs.
Starting Prysm beacon-chain --http-web3provider=localhost:8545 --pyrmont
[2020-11-18 14:03:06] WARN flags: Running on Pyrmont Testnet
[2020-11-18 14:03:06] INFO flags: Using "max_cover" strategy on attestation aggregation
[2020-11-18 14:03:06] INFO node: Checking DB database-path=/root/.eth2/beaconchaindata
[2020-11-18 14:03:08] ERROR main: database contract is xxxxxxxxxxxx3fdc but tried to run with xxxxxxxxxxxx6a8c
I tried to delete the previous data folder /root/goerliData and re-download the blockchain but nothing changed...
Why does the database contract didn't change and what should I do ?
Thanks :)
The error means that you have an existing database for another network, probably medalla.
Try starting your beacon node with the flag --clear-db next time, and you'll see it the error disappear and start syncing Pyrmont.

accounts[0] returns network name in string

I am running a set of smart contracts in test mode in order to perform some initial tests. However and very strangely, when running truffle migrate --network testrpc and using accounts[0] in my migration files, I get the following error:
Error: Provided address "t" is invalid, the capitalization checksum test failed, or its an indrect IBAN address which can't be converted.
In this string, "t" is in fact the first letter of testrpc. If I use accounts[1] I get a "e", etc...
I was previously using testrpc command line encironment and later switched to ganache-cli to try and solve the issue. Unfortunately nothing worked quite as I expected and I am still stuck with the issue.
I am running on Ubuntu so that may cause the issue?
EDIT 1: Migration file:
// Starting deployment of asset
module.exports = async function(deployer, network, accounts) {
// owner wallet
var wallet = accounts[0];
};
I didn't find why it didn't work with testrpc, so I switched to ganache-cli which also provided the same issue... I finally resigned myself to use Ganache Client app, and it worked...

Could not connect to Ethereum client (testrpc)

I've properly installed geth, truffle and testrpc. Now I'm trying to do some Ethereum contract tutorials. I initialized project by truffle init, so the project folder with default contracts was created, then I ran testrpc and compiled contracts by typing truffle compile (build directory was created successfully). The thing is, truffle test is not working as if there is no testrpc running.I'm using Git Bash on Windows. What might be the problem?
Screen
check this out
You need a test file in your directory before you can run truffle test
You need two CMD window,
one to run testrpc command (Do not terminate),
second window to compile
To compile, run the command below
Web3 = require('web3')
web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545")
solc = require('solc')
sourceCode = fs.readFileSync('ContractFile.sol').toString()
compileCode = solc.compile(sourceCode)
//Get the interface of contract
contractABI = JSON.parse(compileCode.contracts[':ContractFile'].interface)
//Get the bytecode of the contract
bytecode = compiledCode.contracts[':ContractFile'].bytecode
//Ready to deploy
ContractFileContract = web3.eth.contract(contractABI)
//use the object above to deploy the contract
ContractDeployed = ContractFileContract.new({data: bytecode, from: web3.eth.account[0], gas: 4700000})
//Check your testrpc console.
Don't forget to declear solidity version at the top of you contract.