This article introduces Puppeth, a powerful tool for managing and deploying private Ethereum blockchains, which is provided with Geth, one of the most popular Ethereum nodes. You can also install Puppeth independently (provided that Go is installed):
go get github.com/ethereum/go-ethereum/cmd/puppeth
Key points:
Startup process:
This tutorial will use two virtual machines. Due to Puppeth restrictions, it is impossible to deploy sealed nodes on the same machine.
If you are not familiar with Vagrant, we recommend that you read the relevant starting guide.
mkdir my_project; cd my_project git clone https://github.com/swader/homestead_improved hi_puppeth1 git clone https://github.com/swader/homestead_improved hi_puppeth2
Modify the IP address in the hi_puppeth2
folder to 192.168.10.11
(rather than 192.168.10.10
).
Modify the Homestead.yaml
file of each clone and open the following port:
ports: - send: 8545 to: 8545 - send: 30301 to: 30301 - send: 30302 to: 30302 - send: 30303 to: 30303 - send: 30304 to: 30304 - send: 30305 to: 30305 - send: 30306 to: 30306
Add virtual host in host/etc/hosts
file:
<code>192.168.10.10 homestead.test 192.168.10.11 puppethnode.test</code>
(If your VM address is different, please change the IP address.)
Runvagrant up
and use vagrant ssh
to enter each virtual machine. Please run in two separate terminals to keep both machines running at the same time.
Prerequisite:
Install the following software onEach machine:
Puppeth runs auxiliary applications and Ethereum nodes in the Docker container, so Docker is required. Installing Geth is also useful.
sudo add-apt-repository -y ppa:ethereum/ethereum sudo apt-get update sudo apt-get install \ apt-transport-https \ ca-certificates \ curl \ software-properties-common \ ethereum \ docker.io \ docker-compose
sudo usermod -a -G docker $USER
folder on the host (external to VM): myproject
mkdir node1 node2 geth --datadir node1 account new geth --datadir node2 account new
Puppeth Guide:
After the virtual machine is running and the account is initialized, start using Puppeth. Run Puppeth in the new terminal of the host.First, enter the network name (for example, "puptest").
Connect to remote server: Select option 3, enter the server address (for example
), and provide the SSH key password or password. Repeat this process to connect to the second VM. vagrant@192.168.10.10
Configure the new Genesis Block: Select Option 2, select Consensus Engine (PoA is recommended), set block time, specify the account that allows sealing and pre-funded accounts.
Deploy network components:
After the deployment is complete, visit the Ethstats page (for example homestead.test:8081
) to view the node status.
Conclusion:
You can now easily develop and deploy smart contracts. Puppeth is a one-stop blockchain service management tool that simplifies the blockchain development process. The Docker container is configured to start automatically, so restarting the VM does not require reconfiguration.
(Because I cannot access the image link, I used the placeholders "Image 1" to "Image 8". Please replace it with the actual image link.)
The above is the detailed content of Using Puppeth, the Ethereum Private Network Manager. For more information, please follow other related articles on the PHP Chinese website!