Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • cellframe/python-cellframe
1 result
Show changes
Commits on Source (9)
......@@ -38,3 +38,6 @@
path = cellframe-sdk-python/libdap-app-cli-python
url = https://gitlab.demlabs.net/cellframe/libdap-app-cli-python.git
branch = master
[submodule "cellframe-sdk-python/libdap-chain-wallet-python"]
path = cellframe-sdk-python/libdap-chain-wallet-python
url = https://gitlab.demlabs.net/cellframe/libdap-chain-wallet-python.git
......@@ -68,7 +68,7 @@ else()
SET( CPACK_PACKAGE_NAME "${PROJECT_NAME}")
SET( CPACK_PACKAGE_VERSION_MAJOR 0)
SET( CPACK_PACKAGE_VERSION_MINOR 9)
SET( CPACK_PACKAGE_VERSION_PATCH 14)
SET( CPACK_PACKAGE_VERSION_PATCH 15)
add_definitions("-DDAP_VERSION_MAJOR=\"${CPACK_PACKAGE_VERSION_MAJOR}\"")
add_definitions("-DDAP_VERSION_MINOR=\"${CPACK_PACKAGE_VERSION_MINOR}\"")
......@@ -85,6 +85,7 @@ else()
add_subdirectory(cellframe-sdk-python/libdap-chain-python)
add_subdirectory(cellframe-sdk-python/libdap-app-cli-python)
add_subdirectory(cellframe-sdk-python/libdap-client-python)
add_subdirectory(cellframe-sdk-python/libdap-chain-wallet-python)
target_compile_options(dap_chain_common_python_module PRIVATE "-fpic")
......@@ -95,6 +96,7 @@ else()
target_compile_options(dap_chain_python_module PRIVATE "-fpic")
target_compile_options(dap_app_cli_python_module PRIVATE "-fpic")
target_compile_options(dap_client_python_module PRIVATE "-fpic")
target_compile_options(dap_chain_wallet_python_module PRIVATE "-fpic")
#if (SKBUILD)
message(STATUS "Make python extension")
......@@ -161,6 +163,7 @@ target_link_libraries(${PROJECT_NAME} cellframe-sdk dap_python_module
dap_chain_net_python_module
dap_chain_gdb_python_module
dap_app_cli_python_module
dap_chain_wallet_python_module
${PYTHON_LIBRARIES}
)
......
......@@ -271,7 +271,7 @@ PyObject *python_cellframe_init(PyObject *self, PyObject *args){
}
s_init_http_client_simple = true;*/
} else if (strcmp(c_value, "Wallet") == 0){
if (dap_chain_wallet_init() != 0){
if (dap_chain_wallet_init_py() != 0){
PyErr_SetString(CellFrame_error, "Failed to initialize Wallet module. ");
return NULL;
}
......@@ -288,7 +288,7 @@ PyObject *python_cellframe_init(PyObject *self, PyObject *args){
return NULL;
}
} else if (strcmp(c_value, "ChainCSDagPos") == 0){
if (dap_chain_cs_dag_poa_init() != 0){
if (dap_chain_cs_dag_pos_init() != 0){
PyErr_SetString(CellFrame_error, "Failed to initialize ChainCSDagPos module. ");
return NULL;
}
......@@ -406,7 +406,8 @@ PyMODINIT_FUNC PyInit_libCellFrame(void){
PyType_Ready(&DapStreamCtl_DapStreamCtlType) < 0 ||
PyType_Ready(&DapMempool_DapMempoolType) < 0 ||
// ====
PyType_Ready(&DapAppCli_dapAppCliType ) < 0
PyType_Ready(&DapAppCli_dapAppCliType ) < 0 ||
PyType_Ready(&DapChainWallet_dapChainWalletType) < 0
){
log_it(L_CRITICAL,"Not all py modules are ready for init");
return NULL;
......@@ -477,6 +478,7 @@ PyMODINIT_FUNC PyInit_libCellFrame(void){
// =============
PyModule_AddObject(module, "ChainGDB", (PyObject*)&DapChainGDBObject_DapChainGDBType);
PyModule_AddObject(module, "ChainWallet", (PyObject*)&DapChainWallet_dapChainWalletType);
PyModule_AddObject(module, "Http", (PyObject*)&DapHTTP_DapHTTPType);
PyModule_AddObject(module, "EncHttp", (PyObject*)&DapEncHTTP_DapEncHTTPType);
......@@ -525,6 +527,12 @@ void deinit_modules(void){
dap_common_deinit();
submodules_deint = true;
}
if (s_init_wallet){
dap_chain_wallet_deinit_py();
}
dap_config_close(g_config);
dap_config_deinit();
dap_common_deinit();
}
PyObject *python_cellframe_deinit(PyObject *self, PyObject *args){
......
Subproject commit c833958ae5e623292aa1d54617548cb4a42f9525
Subproject commit 3cbb19cd5483dfee7c1bb68bbe88027e2be9a282
Subproject commit f3babc654fa7233dec17b88515e2bc5b061bd9a6
Subproject commit 0b135fbdaa7fdb217afddf76469e84fe87d68871
Subproject commit 591cf4502be97766a9ac800bb66de761890c1c9f
Subproject commit 83f950f59d3ba97bcac9f108e8fb93bd12bfcfb3
Subproject commit 1ef04620dc5df45ef8da6a080c2f40c295514b42
#!/usr/bin/python3
# CellFrame SDK.Python v0.9 Example Application #1
from CellFrame.libCellFrame import *
from CellFrame import *
import os
import json
import sys
......
#!/usr/bin/python3
from CellFrame.libCellFrame import init, Cert,CryptoKeyType
from string import Template
import os
from CellFrame import init, Cert, CryptoKeyType
# from string import Template
# import os
import sys
import json
import MyAuthConf
import random
import string
......@@ -23,12 +24,13 @@ except json.decoder.JSONDecodeError as jex:
exit(-1)
# Produce random string
def randomString(stringLength=10):
"""Generate a random string of fixed length """
letters = string.ascii_lowercase
return ''.join(random.choice(letters) for i in range(stringLength))
# Action Help
def help():
print("CA managment script usage: ")
......
#!/usr/bin/python3
import sys
import os
from CellFrame.libCellFrame import AppCli
from CellFrame import AppCli
app_name="MyAuth"
app_name = "MyAuth"
tmp_dir = os.getcwd() + "/tmp"
var_dir = os.getcwd() + "/var"
sys.exit( AppCli.main(app_name,tmp_dir+"/node_cli", sys.argv ))
sys.exit(AppCli.main(app_name, tmp_dir+"/node_cli", sys.argv))
from CellFrame.libCellFrame import *
from CellFrame import AppCliServer, logItNotice
def cmdUser(argv, strReply):
reply="user managment command:\n"
reply = "user managment command:\n"
for arg in argv:
reply+=" arg"+str(arg)+"=\""+arg+"\"\n"
reply += " arg"+str(arg)+"=\""+arg+"\"\n"
AppCliServer.setReplyText(reply, strReply)
def init():
AppCliServer.cmdItemCreate("user",cmdUser,"User managment command","""
AppCliServer.cmdItemCreate("user", cmdUser, "User managment command", """
Print user list
user list
......
import os
from string import Template
def getNetworkName(appName,sep="-"):
def getNetworkName(appName, sep="-"):
return appName.lower()+sep+"dev"
def getJsonString(app_name, log_level="DEBUG"):
tmp_dir = os.getcwd() + "/tmp"
var_dir = os.getcwd() + "/var"
......@@ -87,12 +89,12 @@ def getJsonString(app_name, log_level="DEBUG"):
}
}"""
)
tpl_vars={
"var_dir":var_dir,
"tmp_dir":tmp_dir,
"app_name":app_name,
tpl_vars = {
"var_dir": var_dir,
"tmp_dir": tmp_dir,
"app_name": app_name,
"net_name": getNetworkName(app_name),
"log_level":log_level
"log_level": log_level
}
return ret_tpl.substitute(tpl_vars)
......@@ -33,9 +33,10 @@
#include "wrapping_dap_stream_ctl.h"
#include "wrapping_dap_mempool.h"
#include "wrapping_dap_http_folder.h"
#include "dap_chain_wallet_python.h"
//#include "dap_http_client_simple.h"
#include "dap_chain_wallet.h"
//#include "dap_chain_wallet.h"
#include "dap_chain_cs.h"
#include "dap_chain_cs_dag.h"
#include "dap_chain_cs_dag_poa.h"
......
......@@ -70,7 +70,7 @@ class CMakeBuild(build_ext):
setup(
name="CellFrame",
version="0.9-post14",
version="0.9-post15",
description="CellFrame SDK",
author='Demlabs (2007-2020)',
license="GNU GPLv3",
......