Skip to content
Snippets Groups Projects
Commit 0080544b authored by Dmitriy A. Gerasimov's avatar Dmitriy A. Gerasimov
Browse files

[*] Massive update

parent 3287547c
No related branches found
No related tags found
No related merge requests found
Showing
with 77 additions and 71 deletions
#!/bin/sh
python3 setup.py bdist -d build -u root -g root --formats egg
\ No newline at end of file
python3 setup.py bdist -d build -u root -g root --formats egg
\ No newline at end of file
Subproject commit 0c4d5463f0fc06aa86c83a55b4cbc72f70d65b00
Subproject commit 824f564c2b18d464ee87957a1db96392192175d2
Subproject commit 5f2f2a6461c75a2bff3bd259a87cb8917194b987
Subproject commit 502854695f779611a0373003a2e3488801667f4c
libdap-chain-python @ b013c766
Subproject commit 95cbc3329247ee600361e6f0963e838a7df79aa0
Subproject commit b013c766c9b283754c89fe049d45005567be88fa
Subproject commit f417b4bddf62150773c58620d5c3fd31e63910f0
Subproject commit 6e835a3a748734b7e4fe0219d594f3bc9901b627
libdap-python @ e6d2c3c3
Subproject commit 226080a34304743dd3041048de8304014831bf7b
Subproject commit e6d2c3c3d2dc9daac606c56719d43e6c0a8e58ab
Subproject commit 38dbb16a91a3054baf829fe16db5cbbbd5032ac5
Subproject commit b94ce7ff857e87caee9d95c06a73790ab31dfc69
tmp/*
var/log/*
var/lib/ca/*
var/lib/global_db
var/lib/wallet/*
#!/usr/bin/python3
from CellFrame.libCellFrame import *
import os
......@@ -7,13 +9,13 @@ var_dir = os.getcwd() + "/var"
json_string = """{
"modules": ["Crypto", "ServerCore", "Http", "HttpFolder", "GlobalDB", "Client", "HttpClientSimple", "Mempool",
"Chain", "Wallet", "ChainCSDag", "ChainCSDagPoa", "ChainCSDagPos", "GDB", "Net", "ChainNetSrv", "EncHttp",
"Chain", "Wallet", "ChainCSDag", "ChainCSDagPoa", "ChainCSDagPos", "GDB", "Net", "AppCliServer", "ChainNetSrv", "EncHttp",
"Stream", "StreamCtl", "HttpSimple", "StreamChChain", "StreamChChainNet", "StreamChChainNetSrv"],
"DAP": {
"config_dir": \""""+tmp_dir+"""\",
"log_level": "L_DEBUG",
"application_name": \""""+app_name+"""\",
"file_name_log": \""""+app_name+""".text\"
"file_name_log": \""""+var_dir+"/log/"+app_name+".log"+"""\"
},
"Stream" : {
"DebugDumpStreamHeaders": false
......@@ -35,15 +37,15 @@ json_string = """{
},
"conserver": {
"enabled": true,
"listen_unix_socket_path": \""""+tmp_dir+"""/node_cli\"
"listen_unix_socket_path": \""""+tmp_dir+"/node_cli"+"""\"
},
"resources": {
"threads_cnt": 0,
"pid_path": \""""+var_dir+"""/run/cellframe-node.pid\",
"log_file": \""""+var_dir+"""/log/cellframe-node.log\",
"wallets_path": \""""+var_dir+"""/lib/wallet\",
"ca_folders": [ \""""+var_dir+"""/lib/ca\", \""""+os.getcwd()+"""/ca\"],
"dap_global_db_path": \""""+var_dir+"""/lib/global_db\",
"pid_path": \""""+ var_dir+"/run/"+ app_name+".pid"+"""\" ,
"log_file": \""""+var_dir+"/log/"+ app_name+".log"+"""\",
"wallets_path": \""""+var_dir+"/lib/wallet" + """\",
"ca_folders": [ \""""+var_dir+"""/lib/ca\" ],
"dap_global_db_path": \""""+var_dir+"/lib/global_db"+"""\",
"dap_global_db_driver": "cdb"
},
"networks":{
......
#!/usr/bin/python3
import sys
import os
from CellFrame.libCellFrame import *
......
Directory for certificate
#!/bin/sh
sudo /usr/bin/python3 /usr/lib/python3/dist-packages/easy_install.py $1
#pragma once
#include <Python.h>
#include "dap_common.h"
#include "dap_string.h"
#include"dap_file_utils.h"
#ifdef __cplusplus
extern "C" {
#endif
#undef LOG_TAG
#define LOG_TAG "generator_config_file"
char* getCharFromPyObject(PyObject *obj);
......@@ -37,6 +33,3 @@ void writeSectorsToFile(FILE *file, PyObject *sectors, int count, ...);
*/
int gen_config_files(const char *cfgDir, const char *app_name, PyObject *cfg_JSON);
#ifdef __cplusplus
}
#endif
......@@ -59,38 +59,9 @@
#include "dap_common.h"
PyObject *python_cellframe_init(PyObject *self, PyObject *args);
#ifdef __cplusplus
extern "C" {
#endif
#undef LOG_TAG
#define LOG_TAG "python-cellframe"
static bool init_crypto;
static bool init_chain;
static bool init_app_cli;
static bool init_stream;
static bool init_stream_ctl;
static bool init_http_folder;
static bool init_http;
static bool init_http_enc;
static bool init_server_core;
static bool init_mempool;
static bool init_http_client_simple;
static bool init_wallet;
static bool init_cs_dag;
static bool init_cs_dag_poa;
static bool init_cs_dag_pos;
static bool init_chain_net_srv;
static bool init_ks;
static PyObject* CellFrame_error;
static PyObject *python_cellframe_init(PyObject *self, PyObject *args);
static PyObject *python_cellframe_deinit(PyObject *self, PyObject *args);
PyObject *python_cellframe_deinit(PyObject *self, PyObject *args);
static PyMethodDef CellFramePythonMethods[] = {
{"init", python_cellframe_init, METH_VARARGS, "Initialization of the python-cellframe interface DAP (Deus Applicaions Prototypes)"},
......@@ -118,13 +89,11 @@ static struct PyModuleDef CellFramePythonModule = {
NULL, /* module documentation, may be NULL */
-1, /* size of per-interpreter state of the module,
or -1 if the module keeps state in global variables. */
CellFramePythonMethods
CellFramePythonMethods,
NULL,
NULL,
NULL,
NULL
};
PyMODINIT_FUNC PyInit_libCellFrame(void);
#ifdef __cplusplus
}
#endif
setup.py 100644 → 100755
#!/usr/bin/python3
import os
import re
import sys
......@@ -52,7 +53,7 @@ class CMakeBuild(build_ext):
build_args += ['--', '/m']
else:
cmake_args += ['-DCMAKE_BUILD_TYPE=' + cfg]
build_args += ['--', '-j2']
build_args += ['--', '-j4']
env = os.environ.copy()
env['CXXFLAGS'] = '{} -DVERSION_INFO=\\"{}\\"'.format(
......@@ -68,9 +69,9 @@ class CMakeBuild(build_ext):
setup(
name="CellFrame",
version="0.9-0",
version="0.9-post8",
description="CellFrame SDK",
author='DEMLABS Inc. (2017-2020)',
author='Demlabs (2007-2020)',
license="GNU GPLv3",
packages=['CellFrame'],
ext_modules=[CMakeExtension('CellFrame/libCellFrame')],
......
#include "generator_config_file.h"
#define LOG_TAG "generator_config_file"
static void writeGroupInFile(FILE *file, char *group){
fputs("[", file);
fputs(group, file);
......
#include "python-cellframe.h"
static PyObject *python_cellframe_init(PyObject *self, PyObject *args){
#define LOG_TAG "python-cellframe"
bool init_crypto;
bool init_chain;
bool init_app_cli;
bool init_stream;
bool init_stream_ctl;
bool init_http_folder;
bool init_http;
bool init_http_enc;
bool init_server_core;
bool init_mempool;
bool init_http_client_simple;
bool init_wallet;
bool init_cs_dag;
bool init_cs_dag_poa;
bool init_cs_dag_pos;
bool init_chain_net_srv;
bool init_ks;
PyObject* CellFrame_error;
PyObject *python_cellframe_init(PyObject *self, PyObject *args){
const char *app_name;
const char *file_name_log;
const char *config_dir;
......@@ -282,6 +306,12 @@ static PyObject *python_cellframe_init(PyObject *self, PyObject *args){
return NULL;
}
}
if (strcmp(c_value, "AppCliServer") == 0){
if (dap_chain_node_cli_init(g_config) != 0 ){
PyErr_SetString(CellFrame_error, "Failed to initialize AppCliServer " );
return NULL;
}
}
// if (strcmp(c_value, "ENC") == 0){
......@@ -293,7 +323,7 @@ static PyObject *python_cellframe_init(PyObject *self, PyObject *args){
PyMODINIT_FUNC PyInit_libCellFrame(void){
if (PyType_Ready(&DapObject_DapObjectType) < 0 || PyType_Ready(&dapCrypto_dapCryptoType) < 0 ||
if (PyType_Ready(&DapCoreObjectType) < 0 || PyType_Ready(&dapCrypto_dapCryptoType) < 0 ||
PyType_Ready(&ServerCore_ServerCoreType) < 0 || PyType_Ready(&dapEvents_dapEventsType) < 0 ||
PyType_Ready(&dapEventsSocket_dapEventsSocketType) < 0 ||
PyType_Ready(&CryptoKeyTypeObjecy_CryptoKeyTypeObjecyType) < 0 ||
......@@ -420,7 +450,7 @@ PyMODINIT_FUNC PyInit_libCellFrame(void){
return module;
}
static PyObject *python_cellframe_deinit(PyObject *self, PyObject *args){
PyObject *python_cellframe_deinit(PyObject *self, PyObject *args){
if (init_crypto)
dap_crypto_deinit();
if (init_chain){
......@@ -459,7 +489,7 @@ int main(int argc, char **argv) {
}
/* Add a built-in module, before Py_Initialize */
PyImport_AppendInittab("libCellFrame", PyInit_libCellFrame);
PyImport_AppendInittab("CellFrame", PyInit_libCellFrame);
/* Pass argv[0] to the Python interpreter */
Py_SetProgramName(program);
......@@ -470,7 +500,7 @@ int main(int argc, char **argv) {
/* Optionally import the module; alternatively,
import can be deferred until the embedded script
imports it. */
PyImport_ImportModule("libCellFrame");
PyImport_ImportModule(".");
PyMem_RawFree(program);
return 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment