我正在创建加密货币交换,并希望测试我的应用程序,为此,我需要添加开发帐户余额。请帮助我在我的专用网络中生成乙醚作为测试用途。
我正在使用geth来运行ethereum节点。
发布于 2017-05-28 23:36:17
由于您使用的是go-ethereum,所以我建议您尝试使用新的工具来设置名为puppeth的私有ethereum网络。它可以从1.6版中获得。当您回答向导的问题时,有一个问题是Which accounts should be pre-funded?
ubuntu@test1:~$ puppeth
+-----------------------------------------------------------+
| Welcome to puppeth, your Ethereum private network manager |
| |
| This tool lets you create a new Ethereum network down to |
| the genesis block, bootnodes, miners and ethstats servers |
| without the hassle that it would normally entail. |
| |
| Puppeth uses SSH to dial in to remote servers, and builds |
| its network components out of Docker containers using the |
| docker-compose toolset. |
+-----------------------------------------------------------+
Please specify a network name to administer (no spaces, please)
> foobar
Sweet, you can set this via --network=foobar next time!
INFO [05-28|23:33:58] Administering Ethereum network name=foobar
WARN [05-28|23:33:58] No previous configurations found path=/home/ubuntu/.puppeth/foobar
What would you like to do? (default = stats)
1. Show network stats
2. Configure new genesis
3. Track new remote server
4. Deploy network components
> 2
Which consensus engine to use? (default = clique)
1. Ethash - proof-of-work
2. Clique - proof-of-authority
> 2
How many seconds should blocks take? (default = 15)
> 15
Which accounts are allowed to seal? (mandatory at least one)
> 0xfbb1b73c4f0bda4f67dca266ce6ef42f520fbb98
> 0x
Which accounts should be pre-funded? (advisable at least one)
> 0xfbb1b73c4f0bda4f67dca266ce6ef42f520fbb98
> 0x发布于 2017-06-28 09:56:23
为了测试目的,您应该使用testRPC。在默认情况下,它提供了10个帐户,每个帐户都有一些最初的余额。这样,您就不必解锁帐户或添加余额,而且要快速测试代码也比geth快得多。
使用以下命令安装它-
npm install -g ethereumjs-testrpc发布于 2017-06-28 08:58:08
你有三个选择:
1-挖掘:在节点中运行miner.start()来获取一些新的以太,然后在您的余额之间进行拆分
2-用一个成因文件输入您的私人链,该文件定义了您的帐户余额,使用:
"alloc":{“133ded6da4e99fa9e37d75cb9e8cba18aa9a7796”:{ "balance":"100000000000“}
https://ethereum.stackexchange.com/questions/16779
复制相似问题