mirror of
https://github.com/oxen-io/lokinet
synced 2023-12-14 06:53:00 +01:00
make shadow compile
This commit is contained in:
parent
0242e293c9
commit
a319c994de
|
@ -87,21 +87,19 @@ endif()
|
|||
set(EXE llarpd)
|
||||
set(EXE_SRC daemon/main.cpp)
|
||||
|
||||
#if(SODIUM_INCLUDE_DIR)
|
||||
# include_directories(${SODIUM_INCLUDE_DIR})
|
||||
#endif()
|
||||
if(SODIUM_INCLUDE_DIR)
|
||||
include_directories(${SODIUM_INCLUDE_DIR})
|
||||
endif()
|
||||
|
||||
#if(SODIUM_LIBRARIES)
|
||||
# set(SODIUM_LIB ${SODIUM_LIBRARIES})
|
||||
#else()
|
||||
# set(SODIUM_LIB sodium)
|
||||
#endif()
|
||||
|
||||
find_library (
|
||||
SODIUM_LIB
|
||||
NAMES sodium libsodium
|
||||
HINTS "/usr/local/lib"
|
||||
)
|
||||
if(SODIUM_LIBRARIES)
|
||||
set(SODIUM_LIB ${SODIUM_LIBRARIES})
|
||||
else()
|
||||
find_library (
|
||||
SODIUM_LIB
|
||||
NAMES sodium libsodium
|
||||
HINTS "/usr/local/lib"
|
||||
)
|
||||
endif()
|
||||
|
||||
set(LIBS ${SODIUM_LIB} pthread)
|
||||
|
||||
|
|
2
Makefile
2
Makefile
|
@ -64,7 +64,7 @@ shadow-build: shadow-configure
|
|||
|
||||
shadow: shadow-build
|
||||
python3 contrib/shadow/genconf.py $(SHADOW_CONFIG)
|
||||
bash -c "$(SHADOW_BIN) -w $$(cat /proc/cpuinfo | grep processor | wc -l) $(SHADOW_CONFIG) &> $(SHADOW_LOG) || true"
|
||||
bash -c "$(SHADOW_BIN) -w $$(cat /proc/cpuinfo | grep processor | wc -l) $(SHADOW_CONFIG) &> $(SHADOW_LOG)"
|
||||
|
||||
testnet-configure: clean
|
||||
cmake -GNinja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=$(CC) -DCMAKE_CXX_COMPILER=$(CXX)
|
||||
|
|
|
@ -34,13 +34,13 @@ def addPeer(conf, baseDir, peer):
|
|||
conf['connect'][peer] = os.path.join(baseDir, '{}.signed'.format(peer))
|
||||
|
||||
|
||||
def createNode(pluginName, root, peer):
|
||||
def createNode(pluginName, root, peer, life=600):
|
||||
node = etree.SubElement(root, 'node')
|
||||
node.attrib['id'] = peer['name']
|
||||
node.attrib['interfacebuffer'] = '{}'.format(1024 * 1024 * 100)
|
||||
app = etree.SubElement(node, 'process')
|
||||
app.attrib['plugin'] = pluginName
|
||||
app.attrib['time'] = '50'
|
||||
app.attrib['time'] = '{}'.format(life)
|
||||
app.attrib['arguments'] = peer['configfile']
|
||||
|
||||
|
||||
|
@ -57,6 +57,8 @@ def makeBase(settings, name, id):
|
|||
def makeClient(settings, name, id):
|
||||
peer = makeBase(settings, name, id)
|
||||
nodeconf(peer['config'], getSetting(settings, 'baseDir', 'tmp'), name)
|
||||
peer['config']['services'] = {
|
||||
}
|
||||
return peer
|
||||
|
||||
|
||||
|
@ -122,7 +124,8 @@ def genconf(settings, outf):
|
|||
|
||||
if __name__ == '__main__':
|
||||
settings = {
|
||||
'topology': os.path.join(shadowRoot, 'share', 'topology.graphml.xml')
|
||||
'topology': os.path.join(shadowRoot, 'share', 'topology.graphml.xml'),
|
||||
'runFor': '{}'.format(60 * 10 * 1000)
|
||||
}
|
||||
with open(sys.argv[1], 'w') as f:
|
||||
genconf(settings, f)
|
||||
|
|
|
@ -131,8 +131,8 @@ Decryption:
|
|||
|
||||
verify h == MDS(n + x, S)
|
||||
D = SD(x, S, n)
|
||||
H = D[0:4]
|
||||
P = D[4:4+H.s]
|
||||
H = D[0:6]
|
||||
P = D[6:6+H.s]
|
||||
|
||||
message types:
|
||||
|
||||
|
|
|
@ -26,6 +26,7 @@ struct llarp_rc
|
|||
byte_t signature[SIGSIZE];
|
||||
uint64_t last_updated;
|
||||
|
||||
#ifdef __cplusplus
|
||||
bool
|
||||
BEncode(llarp_buffer_t *buf) const
|
||||
{
|
||||
|
@ -37,6 +38,7 @@ struct llarp_rc
|
|||
{
|
||||
return llarp_rc_bdecode(this, buf);
|
||||
}
|
||||
#endif
|
||||
};
|
||||
|
||||
void
|
||||
|
|
|
@ -22,7 +22,7 @@ struct llarp_thread_job
|
|||
void *user;
|
||||
/** called in threadpool worker thread */
|
||||
llarp_thread_work_func work;
|
||||
|
||||
#ifdef __cplusplus
|
||||
llarp_thread_job(void *u, llarp_thread_work_func w) : user(u), work(w)
|
||||
{
|
||||
}
|
||||
|
@ -30,6 +30,7 @@ struct llarp_thread_job
|
|||
llarp_thread_job() : user(nullptr), work(nullptr)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
};
|
||||
|
||||
/// for single process mode
|
||||
|
|
Loading…
Reference in a new issue