Added whisper debug interface + whisper fixes

This commit is contained in:
obscuren
2014-12-15 17:14:02 +01:00
parent 993280ec03
commit 01a6db9324
6 changed files with 32 additions and 28 deletions

View File

@ -5,10 +5,8 @@ package main
import (
"fmt"
"log"
"net"
"os"
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/logger"
"github.com/ethereum/go-ethereum/p2p"
"github.com/ethereum/go-ethereum/whisper"
@ -20,12 +18,12 @@ func main() {
pub, _ := secp256k1.GenerateKeyPair()
whisper := whisper.New(&event.TypeMux{})
whisper := whisper.New()
srv := p2p.Server{
MaxPeers: 10,
Identity: p2p.NewSimpleClientIdentity("whisper-go", "1.0", "", string(pub)),
ListenAddr: ":30303",
ListenAddr: ":30300",
NAT: p2p.UPNP(),
Protocols: []p2p.Protocol{whisper.Protocol()},
@ -35,13 +33,5 @@ func main() {
os.Exit(1)
}
// add seed peers
seed, err := net.ResolveTCPAddr("tcp", "poc-7.ethdev.com:30300")
if err != nil {
fmt.Println("couldn't resolve:", err)
os.Exit(1)
}
srv.SuggestPeer(seed.IP, seed.Port, nil)
select {}
}