Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
celllframe-node
Manage
Activity
Members
Labels
Plan
Issues
5
Issue boards
Milestones
Code
Merge requests
24
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cellframe
celllframe-node
Commits
fc0d6173
Commit
fc0d6173
authored
4 years ago
by
Aleksei Voronin
Browse files
Options
Downloads
Patches
Plain Diff
[*] support for CDB plugin is moved into cellframe-sdk
parent
8c897fc8
No related branches found
No related tags found
1 merge request
!157
[*] support for CDB plugin is moved into cellframe-sdk
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CMakeLists.txt
+4
-4
4 additions, 4 deletions
CMakeLists.txt
cellframe-sdk
+1
-1
1 addition, 1 deletion
cellframe-sdk
sources/main.c
+2
-56
2 additions, 56 deletions
sources/main.c
with
7 additions
and
61 deletions
CMakeLists.txt
+
4
−
4
View file @
fc0d6173
...
...
@@ -8,7 +8,7 @@ set(CMAKE_C_STANDARD 11)
SET
(
CPACK_PACKAGE_NAME
"
${
PROJECT_NAME
}
"
)
SET
(
CPACK_PACKAGE_VERSION_MAJOR 3
)
SET
(
CPACK_PACKAGE_VERSION_MINOR 5
)
SET
(
CPACK_PACKAGE_VERSION_PATCH
7
)
SET
(
CPACK_PACKAGE_VERSION_PATCH
8
)
# init CellFrame SDK
add_definitions
(
"-DDAP_VERSION=
\"
${
CPACK_PACKAGE_VERSION_MAJOR
}
\"
"
)
...
...
@@ -16,9 +16,9 @@ set(SUBMODULES_NO_BUILD ON)
set
(
SUPPORT_PYTHON_PLUGINS ON
)
if
(
NOT WIN32
)
set
(
CELLFRAME_MODULES
"core chains mining network srv cs-dag-poa cs-dag-pos cs-none srv-app srv-app-db srv-datum srv-xchange srv-stake srv-vpn"
)
set
(
CELLFRAME_MODULES
"core chains mining network srv cs-dag-poa cs-dag-pos cs-none srv-app srv-app-db srv-datum srv-xchange srv-stake
modules-dynamic
srv-vpn"
)
else
()
set
(
CELLFRAME_MODULES
"core chains mining network srv cs-dag-poa cs-dag-pos cs-none srv-app srv-app-db srv-datum srv-xchange srv-stake"
)
set
(
CELLFRAME_MODULES
"core chains mining network srv cs-dag-poa cs-dag-pos cs-none srv-app srv-app-db srv-datum srv-xchange srv-stake
modules-dynamic
"
)
endif
()
include
(
cellframe-sdk/cmake/OS_Detection.cmake
)
...
...
@@ -143,7 +143,7 @@ if(UNIX AND NOT WIN32)
target_link_libraries
(
${
NODE_TARGET
}
${
ALL_LIBRARIES
}
)
else
()
target_link_libraries
(
${
NODE_TARGET
}
${
NODE_LIBRARIES
}
${
CMAKE_DL_LIBS
}
pthread
)
target_link_libraries
(
${
NODE_TARGET
}
${
NODE_LIBRARIES
}
pthread
)
target_link_libraries
(
${
NODE_CLI_TARGET
}
${
NODE_CLI_LIBRARIES
}
pthread
)
target_link_libraries
(
${
NODE_TOOL_TARGET
}
${
NODE_TOOL_LIBRARIES
}
pthread
)
endif
()
...
...
This diff is collapsed.
Click to expand it.
cellframe-sdk
@
8ec1a1ba
Compare
3fffb232
...
8ec1a1ba
Subproject commit
3fffb23237376a17c146e17d343f7c204cceac01
Subproject commit
8ec1a1ba820611ee2aa18d97a722b0391e7167fc
This diff is collapsed.
Click to expand it.
sources/main.c
+
2
−
56
View file @
fc0d6173
...
...
@@ -59,6 +59,7 @@
#include
"dap_http.h"
#include
"dap_http_folder.h"
#include
"dap_dns_server.h"
#include
"dap_modules_dynamic_cdb.h"
#include
"dap_events.h"
...
...
@@ -79,12 +80,9 @@
#include
"dap_chain_net_srv_app.h"
#include
"dap_chain_net_srv_app_db.h"
#include
"dap_chain_net_srv_datum.h"
#include
"dap_chain_net_bugreport.h"
#include
"dap_chain_net_news.h"
#include
"dap_chain_net_srv_geoip.h"
#ifdef DAP_OS_LINUX
#include
<dlfcn.h>
#include
"dap_chain_net_srv_vpn.h"
#include
"dap_chain_net_srv_vpn_cdb.h"
#include
"dap_chain_net_srv_vpn_cdb_server_list.h"
...
...
@@ -135,10 +133,8 @@
void
parse_args
(
int
argc
,
const
char
**
argv
);
void
exit_if_server_already_running
(
void
);
bool
s_node_load_cdb_lib
(
dap_http_t
*
a_server
);
static
const
char
*
s_pid_file_path
=
NULL
;
static
const
char
*
s_default_path_modules
=
NULL
;
bool
dap_chain_net_srv_pay_verificator
(
dap_chain_tx_out_cond_t
*
a_cond
,
dap_chain_datum_tx_t
*
a_tx
)
{
return
true
;
}
...
...
@@ -167,7 +163,6 @@ int main( int argc, const char **argv )
#elif DAP_OS_UNIX
g_sys_dir_path
=
dap_strdup_printf
(
"/opt/%s"
,
dap_get_appname
());
#endif
s_default_path_modules
=
dap_strdup_printf
(
"%s/var/modules/"
,
g_sys_dir_path
);
{
char
l_log_path
[
MAX_PATH
]
=
{
'\0'
};
...
...
@@ -415,18 +410,14 @@ int main( int argc, const char **argv )
// Init HTTP-specific values
dap_http_new
(
l_server
,
dap_get_appname
()
);
#ifdef DAP_OS_LINUX
#ifndef __ANDROID__
if
(
dap_config_get_item_bool_default
(
g_config
,
"cdb"
,
"enabled"
,
false
)
)
{
if
(
s_node
_load_cdb
_lib
(
DAP_HTTP
(
l_server
))
==
false
){
if
(
dap_modules_dynamic
_load_cdb
(
DAP_HTTP
(
l_server
))){
log_it
(
L_CRITICAL
,
"Can't init CDB module"
);
return
-
3
;
}
else
{
log_it
(
L_NOTICE
,
"Central DataBase (CDB) is initialized"
);
}
}
#endif
#endif
// Handshake URL
enc_http_add_proc
(
DAP_HTTP
(
l_server
),
ENC_HTTP_URL
);
...
...
@@ -435,18 +426,6 @@ int main( int argc, const char **argv )
dap_stream_add_proc_http
(
DAP_HTTP
(
l_server
),
STREAM_URL
);
dap_stream_ctl_add_proc
(
DAP_HTTP
(
l_server
),
STREAM_CTL_URL
);
// BugReport URLs
bool
l_bugreport_url_enabled
=
dap_config_get_item_bool_default
(
g_config
,
"server"
,
"bugreport_url_enabled"
,
false
);
if
(
l_bugreport_url_enabled
)
{
dap_chain_net_bugreport_add_proc
(
DAP_HTTP
(
l_server
));
}
// News URLs
bool
l_news_url_enabled
=
dap_config_get_item_bool_default
(
g_config
,
"server"
,
"news_url_enabled"
,
false
);
if
(
l_news_url_enabled
)
{
dap_chain_net_news_add_proc
(
DAP_HTTP
(
l_server
));
}
const
char
*
str_start_mempool
=
dap_config_get_item_str
(
g_config
,
"mempool"
,
"accept"
);
if
(
str_start_mempool
&&
!
strcmp
(
str_start_mempool
,
"true"
))
{
dap_chain_mempool_add_proc
(
DAP_HTTP
(
l_server
),
MEMPOOL_URL
);
...
...
@@ -604,36 +583,3 @@ void exit_if_server_already_running( void ) {
}
}
#ifdef DAP_OS_LINUX
#ifndef __ANDROID__
bool
s_node_load_cdb_lib
(
dap_http_t
*
a_server
){
char
l_lib_path
[
MAX_PATH
]
=
{
'\0'
};
const
char
*
l_cdb_so_name
=
"libcellframe-node-cdb.so"
;
dap_sprintf
(
l_lib_path
,
"%s/%s"
,
s_default_path_modules
,
l_cdb_so_name
);
void
*
l_cdb_handle
=
NULL
;
l_cdb_handle
=
dlopen
(
l_lib_path
,
RTLD_NOW
);
if
(
!
l_cdb_handle
){
log_it
(
L_ERROR
,
"Can't load %s module: %s"
,
l_cdb_so_name
,
dlerror
());
return
false
;
}
int
(
*
dap_chain_net_srv_vpn_cdb_init
)(
dap_http_t
*
);
const
char
*
l_init_func_name
=
"dap_chain_net_srv_vpn_cdb_init"
;
*
(
void
**
)
(
&
dap_chain_net_srv_vpn_cdb_init
)
=
dlsym
(
l_cdb_handle
,
l_init_func_name
);
char
*
error
;
if
((
error
=
dlerror
())
!=
NULL
)
{
log_it
(
L_ERROR
,
"%s module: %s error loading %s (%s)"
,
l_cdb_so_name
,
l_init_func_name
,
error
);
return
false
;
}
int
l_init_res
=
(
*
dap_chain_net_srv_vpn_cdb_init
)(
a_server
);
if
(
l_init_res
){
log_it
(
L_ERROR
,
"%s: %s returns %d"
,
l_cdb_so_name
,
l_init_func_name
,
error
);
return
false
;
}
return
true
;
}
#endif
#endif
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment