|
1 |
| -#!/usr/bin/env python |
2 |
| -# - * - coding: utf - 8 - |
3 |
| -# 2019.12.28 update gm config |
4 |
| -import os |
5 |
| -from eth_utils.crypto import set_crypto_type, CRYPTO_TYPE_GM, CRYPTO_TYPE_ECDSA |
6 |
| - |
7 |
| - |
8 |
| -class client_config: |
9 |
| - """ |
10 |
| - 类成员常量和变量,便于用.调用和区分命名空间 |
11 |
| - """ |
12 |
| - # keyword used to represent the RPC Protocol |
13 |
| - PROTOCOL_RPC = "rpc" |
14 |
| - # keyword used to represent the Channel Protocol |
15 |
| - PROTOCOL_CHANNEL = "channel" |
16 |
| - |
17 |
| - # ---------crypto_type config-------------- |
18 |
| - # crypto_type : 大小写不敏感:"GM" for 国密, "ECDSA" 或其他是椭圆曲线默认实现。 |
19 |
| - crypto_type = "ECDSA" |
20 |
| - crypto_type = crypto_type.upper() |
21 |
| - set_crypto_type(crypto_type) # 使密码算法模式全局生效,切勿删除此行 |
22 |
| - |
23 |
| - # -------------------------------------- |
24 |
| - # configure below |
25 |
| - # ---------client communication config-------------- |
26 |
| - client_protocol = "channel" # or PROTOCOL_CHANNEL to use channel prototol |
27 |
| - # client_protocol = PROTOCOL_CHANNEL |
28 |
| - remote_rpcurl = "http://127.0.0.1:8545" # 采用rpc通信时,节点的rpc端口,和要通信的节点*必须*一致,如采用channel协议通信,这里可以留空 |
29 |
| - channel_host = "127.0.0.1" # 采用channel通信时,节点的channel ip地址,如采用rpc协议通信,这里可以留空 |
30 |
| - channel_port = 20200 # 节点的channel 端口,如采用rpc协议通信,这里可以留空 |
31 |
| - channel_ca = "bin/ca.crt" # 采用channel协议时,需要设置链证书,如采用rpc协议通信,这里可以留空 |
32 |
| - channel_node_cert = "bin/sdk.crt" # 采用channel协议时,需要设置sdk证书,如采用rpc协议通信,这里可以留空 |
33 |
| - channel_node_key = "bin/sdk.key" # 采用channel协议时,需要设置sdk私钥,如采用rpc协议通信,这里可以留空 |
34 |
| - fiscoChainId = 1 # 链ID,和要通信的节点*必须*一致 |
35 |
| - groupid = 1 # 群组ID,和要通信的节点*必须*一致,如和其他群组通信,修改这一项,或者设置bcosclient.py里对应的成员变量 |
36 |
| - |
37 |
| - # ---------account &keyfile config-------------- |
38 |
| - # 注意账号部分,国密和ECDSA采用不同的配置 |
39 |
| - contract_info_file = "bin/contract.ini" # 保存已部署合约信息的文件 |
40 |
| - account_keyfile_path = "bin/accounts" # 保存keystore文件的路径,在此路径下,keystore文件以 [name].keystore命名 |
41 |
| - account_keyfile = "pyaccount.keystore" |
42 |
| - account_password = "123456" # 实际使用时建议改为复杂密码 |
43 |
| - gm_account_keyfile = "gm_account.json" # 国密账号的存储文件,可以加密存储,如果留空则不加载gm_account_password = "123456" |
44 |
| - gm_account_password = "123456" |
45 |
| - # ---------console mode, support user input-------------- |
46 |
| - background = True |
47 |
| - |
48 |
| - # ---------runtime related-------------- |
49 |
| - # path of solc compiler |
50 |
| - # solc_path = "./bin/solc/v0.4.25/solc" |
51 |
| - # solc_path = "C:\\Users\\DELL\\AppData\\Local\\Programs\\Python\\Python37-32\Lib\\site-packages\\fiscobcos\\bin\\solc.exe" |
52 |
| - # gm_solc_path = "./bin/solc/v0.4.25/solc-gm" |
53 |
| - # solcjs_path = "./solcjs" |
54 |
| - |
55 |
| - logdir = "bin/logs" # 默认日志输出目录,该目录必须先建立 |
| 1 | +#!/usr/bin/env python |
| 2 | +# - * - coding: utf - 8 - |
| 3 | +# 2019.12.28 update gm config |
| 4 | +import os |
| 5 | +from eth_utils.crypto import set_crypto_type, CRYPTO_TYPE_GM, CRYPTO_TYPE_ECDSA |
| 6 | + |
| 7 | + |
| 8 | +class client_config: |
| 9 | + """ |
| 10 | + 类成员常量和变量,便于用.调用和区分命名空间 |
| 11 | + """ |
| 12 | + # keyword used to represent the RPC Protocol |
| 13 | + PROTOCOL_RPC = "rpc" |
| 14 | + # keyword used to represent the Channel Protocol |
| 15 | + PROTOCOL_CHANNEL = "channel" |
| 16 | + |
| 17 | + # ---------crypto_type config-------------- |
| 18 | + # crypto_type : 大小写不敏感:"GM" for 国密, "ECDSA" 或其他是椭圆曲线默认实现。 |
| 19 | + crypto_type = "ECDSA" |
| 20 | + crypto_type = crypto_type.upper() |
| 21 | + set_crypto_type(crypto_type) # 使密码算法模式全局生效,切勿删除此行 |
| 22 | + |
| 23 | + # -------------------------------------- |
| 24 | + # configure below |
| 25 | + # ---------client communication config-------------- |
| 26 | + client_protocol = "channel" # or PROTOCOL_CHANNEL to use channel prototol |
| 27 | + # client_protocol = PROTOCOL_CHANNEL |
| 28 | + remote_rpcurl = "http://192.168.80.144:8545" # 采用rpc通信时,节点的rpc端口,和要通信的节点*必须*一致,如采用channel协议通信,这里可以留空 |
| 29 | + channel_host = "192.168.80.144" # 采用channel通信时,节点的channel ip地址,如采用rpc协议通信,这里可以留空 |
| 30 | + channel_port = 20200 # 节点的channel 端口,如采用rpc协议通信,这里可以留空 |
| 31 | + channel_ca = "bin/ca.crt" # 采用channel协议时,需要设置链证书,如采用rpc协议通信,这里可以留空 |
| 32 | + channel_node_cert = "bin/sdk.crt" # 采用channel协议时,需要设置sdk证书,如采用rpc协议通信,这里可以留空 |
| 33 | + channel_node_key = "bin/sdk.key" # 采用channel协议时,需要设置sdk私钥,如采用rpc协议通信,这里可以留空 |
| 34 | + fiscoChainId = 1 # 链ID,和要通信的节点*必须*一致 |
| 35 | + groupid = 1 # 群组ID,和要通信的节点*必须*一致,如和其他群组通信,修改这一项,或者设置bcosclient.py里对应的成员变量 |
| 36 | + |
| 37 | + # ---------account &keyfile config-------------- |
| 38 | + # 注意账号部分,国密和ECDSA采用不同的配置 |
| 39 | + contract_info_file = "bin/contract.ini" # 保存已部署合约信息的文件 |
| 40 | + account_keyfile_path = "bin/accounts" # 保存keystore文件的路径,在此路径下,keystore文件以 [name].keystore命名 |
| 41 | + account_keyfile = "pyaccount.keystore" |
| 42 | + account_password = "123456" # 实际使用时建议改为复杂密码 |
| 43 | + gm_account_keyfile = "gm_account.json" # 国密账号的存储文件,可以加密存储,如果留空则不加载gm_account_password = "123456" |
| 44 | + gm_account_password = "123456" |
| 45 | + # ---------console mode, support user input-------------- |
| 46 | + background = True |
| 47 | + |
| 48 | + # ---------runtime related-------------- |
| 49 | + # path of solc compiler |
| 50 | + # solc_path = "./bin/solc/v0.4.25/solc" |
| 51 | + solc_path = "C:\\Users\\DELL\\AppData\\Local\\Programs\\Python\\Python37-32\Lib\\site-packages\\fiscobcos\\bin\\solc.exe" |
| 52 | + gm_solc_path = "./bin/solc/v0.4.25/solc-gm" |
| 53 | + solcjs_path = "./solcjs" |
| 54 | + |
| 55 | + logdir = "bin/logs" # 默认日志输出目录,该目录必须先建立 |
0 commit comments