forked from MultiChain/multichain
-
Notifications
You must be signed in to change notification settings - Fork 0
/
community.h
137 lines (117 loc) · 6.88 KB
/
community.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
// Copyright (c) 2014-2019 Coin Sciences Ltd
// MultiChain code distributed under the GPLv3 license, see COPYING file.
#ifndef MULTICHAIN_COMMUNITY_H
#define MULTICHAIN_COMMUNITY_H
#include "multichain/multichain.h"
#include "wallet/wallettxs.h"
#include "rpc/rpcutils.h"
#define MC_EFT_NONE 0x0000000000000000
#define MC_EFT_STREAM_SELECTIVE_INDEX 0x0000000000000100
#define MC_EFT_STREAM_OFFCHAIN_SELECTIVE_RETRIEVE 0x0000000000000200
#define MC_EFT_STREAM_OFFCHAIN_SELECTIVE_PURGE 0x0000000000000400
#define MC_EFT_STREAM_READ_RESTRICTED_READ 0x0000000000001000
#define MC_EFT_STREAM_READ_RESTRICTED_WRITE 0x0000000000002000
#define MC_EFT_STREAM_READ_RESTRICTED_DELIVER 0x0000000000004000
#define MC_EFT_NETWORK_SIGNED_RECEIVE 0x0000000000010000
#define MC_EFT_NETWORK_SIGNED_SEND 0x0000000000020000
#define MC_EFT_NETWORK_ENCRYPTED_CONNECTIONS 0x0000000000040000
#define MC_EFT_FEEDS 0x0000000000100000
#define MC_EFT_ALL 0xFFFFFFFFFFFFFFFF
typedef struct mc_EnterpriseFeatures
{
void * m_Impl;
mc_EnterpriseFeatures()
{
Zero();
}
~mc_EnterpriseFeatures()
{
Destroy();
}
void Zero();
void Destroy();
int Prepare();
int Initialize(
const char *name, // Chain name
uint32_t mode); // Unused
int STR_CreateSubscription(mc_TxEntity *entity,const std::string parameters);
uint32_t STR_CheckAutoSubscription(const std::string parameters,bool check_license);
int STR_CreateAutoSubscription(mc_TxEntity *entity);
int STR_TrimSubscription(mc_TxEntity *entity,const std::string parameters);
int STR_IsIndexSkipped(mc_TxImport *import,mc_TxEntity *parent_entity,mc_TxEntity *entity);
int STR_NoRetrieve(mc_TxEntity *entity);
int STR_IsOutOfSync(mc_TxEntity *entity);
int STR_SetSyncFlag(mc_TxEntity *entity,bool confirm);
int STR_GetSubscriptions(mc_Buffer *subscriptions);
int STR_PutSubscriptions(mc_Buffer *subscriptions);
Value STR_RPCRetrieveStreamItems(const Array& params);
Value STR_RPCPurgeStreamItems(const Array& params);
Value STR_RPCPurgePublishedItems(const Array& params);
int STR_RemoveDataFromFile(int fHan, uint32_t from, uint32_t size, uint32_t mode);
Value FED_RPCCreateFeed(const Array& params);
Value FED_RPCSuspendFeed(const Array& params);
Value FED_RPCDeleteFeed(const Array& params);
Value FED_RPCRescanFeed(const Array& params);
Value FED_RPCAddFeedStreams(const Array& params);
Value FED_RPCRemoveFeedStreams(const Array& params);
Value FED_RPCAddFeedBlocks(const Array& params);
Value FED_RPCRemoveFeedBlocks(const Array& params);
Value FED_RPCPurgeFeedFile(const Array& params);
Value FED_RPCListFeeds(const Array& params);
int FED_EventTx(const CTransaction& tx,int block,CDiskTxPos* block_pos,uint32_t block_tx_index,uint256 block_hash,uint32_t block_timestamp);
bool OFF_ProcessChunkRequest(unsigned char *ptrStart,unsigned char *ptrEnd,vector<unsigned char>* payload_response,vector<unsigned char>* payload_relay,
map<uint160,int>& mapReadPermissionedStreams,string& strError);
bool OFF_ProcessChunkResponse(mc_RelayRequest *request,mc_RelayResponse *response,map <int,int>* request_pairs,mc_ChunkCollector* collector,string& strError);
bool OFF_GetScriptsToVerify(map<uint160,int>& mapReadPermissionedStreams,vector<CScript>& vSigScriptsIn,vector<CScript>& vSigScriptsToVerify,string& strError);
bool OFF_VerifySignatureScripts(uint32_t msg_type,mc_OffchainMessageID& msg_id,mc_OffchainMessageID& msg_id_to_respond,uint32_t flags,
vector<unsigned char>& vPayload,vector<CScript>& vSigScriptsToVerify,string& strError,int& dos_score);
bool OFF_CreateSignatureScripts(uint32_t msg_type,mc_OffchainMessageID& msg_id,mc_OffchainMessageID& msg_id_to_respond,uint32_t flags,
vector<unsigned char>& vPayload,set<CPubKey>& vAddresses,vector<CScript>& vSigScripts,string& strError);
bool OFF_GetPayloadForReadPermissioned(vector<unsigned char>* payload,int *ef_cache_id,string& strError);
void OFF_FreeEFCache(int ef_cache_id);
unsigned char* OFF_SupportedEnterpriseFeatures(unsigned char* min_ef,int min_ef_size,int *ef_size);
CPubKey WLT_FindReadPermissionedAddress(mc_EntityDetails* entity);
int WLT_CreateSubscription(mc_TxEntity *entity,uint32_t retrieve,uint32_t indexes,uint32_t *rescan_mode);
int WLT_DeleteSubscription(mc_TxEntity *entity,uint32_t rescan_mode);
int WLT_StartImport();
int WLT_CompleteImport();
int WLT_NoIndex(mc_TxEntity *entity);
int WLT_NoRetrieve(mc_TxEntity *entity);
bool NET_ProcessHandshakeData(CNode* pfrom, std::string sENTData,bool fIsVerackack);
std::vector<unsigned char> NET_PushHandshakeData(CNode* pfrom,bool fIsVerackack);
bool NET_FinalizeHandshake(CNode* pfrom);
void NET_FreeNodeData(void *pNodeData);
bool NET_IsEncrypted(CNode* pfrom);
bool NET_IsFinalized(CNode* pfrom);
int NET_ReadHeader(void *pNodeData,CNetMessage& msg,const char *pch,unsigned int nBytes);
void NET_ProcessMsgData(void *pNodeData,CNetMessage& msg);
int NET_StoreInCache(void *pNodeData,CNetMessage& msg,const char *pch,unsigned int nBytes);
bool NET_RestoreFromCache(CNode* pfrom);
bool NET_PushMsg(void *pNodeData,CDataStream& ssSend);
void NET_CheckConnections();
uint64_t NET_Services();
std::string ENT_Edition();
int ENT_EditionNumeric();
int ENT_BuildVersion();
int ENT_MinWalletDatVersion();
void ENT_RPCVerifyEdition(std::string message);
std::string ENT_TextConstant(const char* name);
void ENT_InitRPCHelpMap();
void ENT_MaybeStop();
void LIC_RPCVerifyFeature(uint64_t feature,std::string message);
bool LIC_VerifyFeature(uint64_t feature,std::string& reason);
// bool LIC_VerifyConfirmation(uint160 address,void *confirmation, size_t size,std::string& reason);
// string LIC_LicenseName(void *confirmation, size_t size);
int LIC_VerifyLicenses(int block);
int LIC_VerifyUpdateCoin(int block,mc_Coin *coin,bool is_new);
std::vector <std::string> LIC_LicensesWithStatus(std::string status);
Value LIC_RPCDecodeLicenseRequest(const Array& params);
Value LIC_RPCDecodeLicenseConfirmation(const Array& params);
Value LIC_RPCActivateLicense(const Array& params);
Value LIC_RPCTransferLicense(const Array& params);
Value LIC_RPCListLicenseRequests(const Array& params);
Value LIC_RPCGetLicenseConfirmation(const Array& params);
Value LIC_RPCTakeLicense(const Array& params);
Value LIC_RPCImportLicenseRequest(const Array& params);
} mc_EnterpriseFeatures;
#endif /* MULTICHAIN_COMMUNITY_H */