mirror of
https://github.com/waku-org/nwaku.git
synced 2025-01-29 16:15:54 +00:00
Use waku protocol; switch to p2p in multiaddress; trace
This commit is contained in:
parent
31a6d9a051
commit
c67e36fc13
@ -23,6 +23,7 @@ proc newStandardSwitch*(privKey = none(PrivateKey),
|
|||||||
address = MultiAddress.init("/ip4/127.0.0.1/tcp/0"),
|
address = MultiAddress.init("/ip4/127.0.0.1/tcp/0"),
|
||||||
triggerSelf = false,
|
triggerSelf = false,
|
||||||
gossip = false): Switch =
|
gossip = false): Switch =
|
||||||
|
info "newStandardSwitch"
|
||||||
proc createMplex(conn: Connection): Muxer =
|
proc createMplex(conn: Connection): Muxer =
|
||||||
result = newMplex(conn)
|
result = newMplex(conn)
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ task wakutest2, "Build Experimental Waku tests":
|
|||||||
exec "build/" & name
|
exec "build/" & name
|
||||||
|
|
||||||
task wakunode2, "Build Experimental Waku cli":
|
task wakunode2, "Build Experimental Waku cli":
|
||||||
buildBinary "wakunode", "waku/node/v2/", "-d:chronicles_log_level=DEBUG"
|
buildBinary "wakunode", "waku/node/v2/", "-d:chronicles_log_level=TRACE"
|
||||||
|
|
||||||
task wakusim2, "Build Experimental Waku simulation tools":
|
task wakusim2, "Build Experimental Waku simulation tools":
|
||||||
buildBinary "wakunode", "waku/node/v2/", "-d:chronicles_log_level=DEBUG"
|
buildBinary "wakunode", "waku/node/v2/", "-d:chronicles_log_level=DEBUG"
|
||||||
|
@ -5,13 +5,14 @@ import
|
|||||||
eth/p2p/[discovery, enode, peer_pool, bootnodes, whispernodes],
|
eth/p2p/[discovery, enode, peer_pool, bootnodes, whispernodes],
|
||||||
# TODO remove me
|
# TODO remove me
|
||||||
../v1/rpc/[wakusim, key_storage],
|
../v1/rpc/[wakusim, key_storage],
|
||||||
libp2p/standard_setup,
|
|
||||||
libp2p/multiaddress,
|
libp2p/multiaddress,
|
||||||
libp2p/crypto/crypto,
|
libp2p/crypto/crypto,
|
||||||
libp2p/protocols/protocol,
|
libp2p/protocols/protocol,
|
||||||
libp2p/peerinfo,
|
libp2p/peerinfo,
|
||||||
rpc/wakurpc,
|
rpc/wakurpc,
|
||||||
../../protocol/v2/waku_protocol
|
../../protocol/v2/waku_protocol,
|
||||||
|
# TODO: Pull out standard switch from tests
|
||||||
|
../../tests/v2/standard_setup
|
||||||
|
|
||||||
# TODO: Use
|
# TODO: Use
|
||||||
# protocol/waku_protocol
|
# protocol/waku_protocol
|
||||||
@ -57,6 +58,7 @@ proc dialPeer(p: WakuProto, address: string) {.async.} =
|
|||||||
|
|
||||||
info "Dialing peer", multiAddr
|
info "Dialing peer", multiAddr
|
||||||
p.conn = await p.switch.dial(remotePeer, WakuSubCodec)
|
p.conn = await p.switch.dial(remotePeer, WakuSubCodec)
|
||||||
|
info "Post switch dial"
|
||||||
# Isn't there just one p instance? Why connected here?
|
# Isn't there just one p instance? Why connected here?
|
||||||
p.connected = true
|
p.connected = true
|
||||||
|
|
||||||
@ -188,7 +190,8 @@ proc run(config: WakuNodeConf) =
|
|||||||
# let rpcServer ...
|
# let rpcServer ...
|
||||||
|
|
||||||
# Is it a "Standard" Switch? Assume it is for now
|
# Is it a "Standard" Switch? Assume it is for now
|
||||||
var switch = newStandardSwitch(some keys.seckey, hostAddress, triggerSelf = true, gossip = true)
|
# NOTE: This should be WakuSub here
|
||||||
|
var switch = newStandardSwitch(some keys.seckey, hostAddress, triggerSelf = true, gossip = false)
|
||||||
let wakuProto = newWakuProto(switch)
|
let wakuProto = newWakuProto(switch)
|
||||||
switch.mount(wakuProto)
|
switch.mount(wakuProto)
|
||||||
|
|
||||||
@ -199,7 +202,9 @@ proc run(config: WakuNodeConf) =
|
|||||||
|
|
||||||
let id = peerInfo.peerId.pretty
|
let id = peerInfo.peerId.pretty
|
||||||
info "PeerInfo", id = id, addrs = peerInfo.addrs
|
info "PeerInfo", id = id, addrs = peerInfo.addrs
|
||||||
let listenStr = $peerInfo.addrs[0] & "/ipfs/" & id
|
# Try p2p instead
|
||||||
|
let listenStr = $peerInfo.addrs[0] & "/p2p/" & id
|
||||||
|
#let listenStr = $peerInfo.addrs[0] & "/ipfs/" & id
|
||||||
# XXX: this should be /ip4..., / stripped?
|
# XXX: this should be /ip4..., / stripped?
|
||||||
info "Listening on", full = listenStr
|
info "Listening on", full = listenStr
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user