Steven Allen
d73a51776e
new: allow overriding the user-agent with an option
Instead of using a global variable.
This also:
* Adds an option to the identify service to set the user agent.
* Removes the ability to pass an identify service to NewHost as any reasonable
Identify service already needs to be constructed with an instance of the host.
5 years ago
Christian Muehlhaeuser
169f2d4139
Avoid unnecessary conversions ( #685 )
No need to convert these types.
5 years ago
Christian Muehlhaeuser
0603b30056
Make use of time.Until & time.Since ( #681 )
No need to manually subtract timestamps.
5 years ago
Christian Muehlhaeuser
40cb489097
Fixed typos ( #680 )
Just a few nit-picky typo fixes.
5 years ago
Steven Allen
4c28cc75df
test: fix test fallout from notify push
5 years ago
Steven Allen
3a41aa03ac
test: mark helpers
5 years ago
Steven Allen
97f639055e
test: ensure double-closing the host doesn't cause any issues
5 years ago
Steven Allen
428d7135a5
doc: ensure nobody tries to add teardown logic to the host close function again
5 years ago
Steven Allen
2f06021e0c
fix: use the goprocess for closing
fixes #668
5 years ago
Raúl Kripalani
e69d17141c
integrate the event bus, handle protocol update events, make identify emit deltas ( #659 )
5 years ago
Steven Allen
1449765980
basic_host: ensure we close correctly when the context is canceled
As long as we _accept_ a context, we need to obey it.
5 years ago
Raúl Kripalani
d87f89314c
Consolidate abstractions and core types into go-libp2p-core ( #601 )
6 years ago
vyzo
3437213b5f
close connection manager
6 years ago
vyzo
b8616c65b3
use cancelable background context in identify
6 years ago
vyzo
f17a4a8667
preallocate map in sameAddrs
6 years ago
vyzo
ebc5d16f5d
use a map in sameAddrs to avoid quadratic behaviour
6 years ago
vyzo
c73f68bdb4
explicit Start method for basic host
6 years ago
vyzo
5845909754
add initialization delay in basic host background task
6 years ago
vyzo
7502fc44c9
add a background task in basic host that periodically pushes identify if needed
6 years ago
vyzo
b8a152f593
use a background worker for updating/gcing the observed address set
6 years ago
Steven Allen
16a60f9751
reduce nat error level
6 years ago
Steven Allen
8c8f08e36f
natmgr: rename refresh to sync
6 years ago
Steven Allen
3617750071
better nat mapping
1. Update to work with https://github.com/libp2p/go-libp2p-nat/pull/14 .
2. Avoid observed addrs when our NAT tells us about external addrs.
3. Ignore bad addrs reported by our NAT. Substitute with observed addrs.
4. Fix https://github.com/libp2p/go-libp2p/issues/428 .
6 years ago
Matt Joiner
3b8d83ffdc
Resolve addrs with P2P instead of IPFS ( #539 )
6 years ago
vyzo
5d8988f3ee
add comment about the unstable nature of BasicHost.PushIdentify
6 years ago
vyzo
a89e74a155
basic host: export AddrsFactory, provide method to push identify
6 years ago
Steven Allen
63256192d7
fix buggy addr equal in test
6 years ago
vyzo
0fa1c25479
ping service in basic host
6 years ago
vyzo
e7fc8861f9
downgrade protocol mux failure log to debug
6 years ago
Can ZHANG
92ec4b2d18
Updates due to code review
6 years ago
Can ZHANG
e6b1e07f11
Updates due to code review
6 years ago
Can ZHANG
ef51fdbe09
Deduplicate addresses of host output
6 years ago
Steven Allen
c83318bf08
Revert "Merge pull request #386 from libp2p/fix/correct-external-addr"
This reverts commit aca83b9b63
, reversing
changes made to 86b8929d4d
.
This was is not the correct fix. We already expose these addresses via the
host's AllAddrs method. The real problem is probably that we just don't ever
tell anyone about them (unless we disconnect and reconnect to our nearby DHT
nodes).
We need an address gossip protocol.
6 years ago
Steven Allen
7133f4124f
when we do a nat port mapping, explicitly remember the mapped address
related to #383
I won't call this *fixed* yet but it should help.
6 years ago
Łukasz Kurowski
39791b176c
function cannot be formatted as string
6 years ago
Steven Allen
a361bf0394
check for connectedness using Connectedness
(counting open connections requires copying)
7 years ago
Steven Allen
41c6834850
refactor for transport changes
Also, make the libp2p constructor fully useful. There should now be no need to
manually construct a swarm/host.
7 years ago
Jakub Sztandera
b6ae1d152a
misc: downgrade a warning to info
It is source of most warning noise in Warning channel and we would like
to enable warning channel some time in future by default
7 years ago
Steven Allen
62f92f7e73
always make the host context cancelable
There's really no reason to *only* do this if we have relays enabled. Doing it
this way makes `go vet` happier and reduces conditional logic.
7 years ago
Kevin Atkinson
af895a81d5
Fix most "go vet" errors.
7 years ago
Jeromy
85d0247d16
use connmgr interface instead of connmgr directly
7 years ago
vyzo
ecb14089a7
basic_host: fix warning message
7 years ago
Steven Allen
7cdd4bc984
Reset on error in basic_host
7 years ago
Lars Gierth
e0c5c22dbc
Avoid unneccessary multiaddr resolutions
7 years ago
Lars Gierth
0c23c9684c
Resolve /dns4, /dns6, /dnsaddr multiaddrs
8 years ago
vyzo
6be81d34c1
basic_host: take base context as parameter in NewHost
7 years ago
vyzo
fd23cf6fa5
basic_host: add the relay after the host construction is complete
7 years ago
vyzo
7f1ffcbd4e
basic_host: NewHost: don't panic on relay errors, return an error instead
The legacy interface stays unchanged with a panic though.
7 years ago
vyzo
3b6d61122f
basic_host: integrate circuit relay as a transport with an option
7 years ago
Jeromy
665234f694
WIP: add ConnManager interface method
7 years ago