do correct dht lookup

pull/5/head v0.0.1
Jeff Becker 6 years ago
parent 1c26fb5e40
commit eeb9c9e5b4
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

@ -5,8 +5,10 @@ SIGN = gpg --sign --detach
REPO := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
CC ?= cc
CXX ?= c++
TARGETS = llarpd
TARGETS = lokinet
SIGS = $(TARGETS:=.sig)
SHADOW_ROOT ?= $(HOME)/.shadow
@ -22,15 +24,15 @@ TESTNET_LOG=$(TESTNET_ROOT)/testnet.log
clean:
rm -f build.ninja rules.ninja cmake_install.cmake CMakeCache.txt
rm -rf CMakeFiles
rm -f $(TARGETS)
rm -f $(TARGETS) llarpd
rm -f $(SHADOW_PLUGIN) $(SHADOW_CONFIG)
rm -f *.sig
debug-configure: clean
cmake -GNinja -DCMAKE_BUILD_TYPE=Debug -DWITH_TESTS=ON
cmake -GNinja -DCMAKE_BUILD_TYPE=Debug -DWITH_TESTS=ON -DCMAKE_C_COMPILER=$(CC) -DCMAKE_CXX_COMPILER=$(CXX)
release-configure: clean
cmake -GNinja -DSTATIC_LINK=ON -DCMAKE_BUILD_TYPE=Release -DRELEASE_MOTTO="$(shell cat motto.txt)"
cmake -GNinja -DSTATIC_LINK=ON -DCMAKE_BUILD_TYPE=Release -DRELEASE_MOTTO="$(shell cat motto.txt)" -DCMAKE_C_COMPILER=$(CC) -DCMAKE_CXX_COMPILER=$(CXX)
debug: debug-configure
ninja
@ -38,17 +40,19 @@ debug: debug-configure
release-compile: release-configure
ninja
cp llarpd lokinet
strip $(TARGETS)
$(TARGETS): release-compile
%.sig: $(TARGETS)
$(SIGN) $*
release: $(SIGS)
shadow-configure: clean
cmake -GNinja -DCMAKE_BUILD_TYPE=Debug -DSHADOW=ON
cmake -GNinja -DCMAKE_BUILD_TYPE=Debug -DSHADOW=ON -DCMAKE_C_COMPILER=$(CC) -DCMAKE_CXX_COMPILER=$(CXX)
shadow-build: shadow-configure
ninja clean
@ -59,7 +63,7 @@ shadow: shadow-build
bash -c "$(SHADOW_BIN) -w $$(cat /proc/cpuinfo | grep processor | wc -l) $(SHADOW_CONFIG) &> $(SHADOW_LOG) || true"
testnet-configure: clean
cmake -GNinja -DCMAKE_BUILD_TYPE=Debug
cmake -GNinja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=$(CC) -DCMAKE_CXX_COMPILER=$(CXX)
testnet-build: testnet-configure
ninja

@ -282,16 +282,20 @@ hop length.
link relay commit record (LRCR)
record requesting relaying messages for 300 seconds to router
record requesting relaying messages for 600 seconds to router
on network who's i is equal to RC.k and decrypt data any messages using
PKE(n, rc.K, c) as symettric key for encryption and decryption.
if l is provided and is less than 600 and greater than 10 then that lifespan
is used (in seconds) instead of 600 seconds.
if w is provided and fits the required proof of work then the lifetime of
the path is extended by w.y seconds
{
c: "<32 byte public encryption key used for upstream>",
i: "<32 byte RC.k of next hop>",
l: uint_optional_lifespan,
n: "<32 bytes nounce for key exchange>",
r: "<16 bytes rx path id>",
t: "<16 bytes tx path id>",
@ -302,6 +306,7 @@ the path is extended by w.y seconds
w if provided is a dict with the following struct
{
t: time_created_seconds_since_epoch,
v: 0,
y: uint32_seconds_extended_lifetime,
z: "<32 bytes nonce>"

@ -119,7 +119,7 @@ llarp_router::HandleAsyncLoadRCForSendTo(llarp_async_load_rc *job)
// we don't have the RC locally so do a dht lookup
llarp_router_lookup_job *lookup = new llarp_router_lookup_job;
lookup->user = router;
memcpy(lookup->target, job->rc.pubkey, PUBKEYSIZE);
memcpy(lookup->target, job->pubkey, PUBKEYSIZE);
lookup->hook = &HandleDHTLookupForSendTo;
llarp_dht_lookup_router(router->dht, lookup);
}
@ -365,7 +365,7 @@ llarp_router::Tick()
if(inboundLinks.size() == 0)
{
auto N = llarp_nodedb_num_loaded(nodedb);
if(N > 5)
if(N > 2)
{
paths.BuildPaths();
}

Loading…
Cancel
Save