| 12345678910111213141516171819202122232425 |
- package main
- import (
- "blockchain-go/p2p"
- "blockchain-go/p2p/nat"
- "fmt"
- "github.com/ethereum/go-ethereum/crypto"
- )
- func main() {
- key, _ := crypto.GenerateKey()
- config := p2p.Config{
- PrivateKey: key,
- Name: "p2p",
- NAT: nat.Any(),
- }
- server := &p2p.Server{
- Config: config,
- }
- err := server.Start()
- if err != nil {
- fmt.Printf(err.Error() + "\n")
- }
- }
|