mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
64 lines
2.4 KiB
Plaintext
64 lines
2.4 KiB
Plaintext
two types of requests:
|
|
authorized and open request
|
|
|
|
authorized requests use ManageNodeRequest.proto and ManageNodeBody.proto (maybe better name later) which use
|
|
the same strategy like Hedera Transactions with signMap
|
|
Node server check if he knows signer
|
|
signer must put there public key at first in node server config
|
|
|
|
message ManageNodeGroupAdd {
|
|
string group_name = 1;
|
|
string group_alias = 2;
|
|
HederaID hedera_topic_id = 3;
|
|
//string parent_group_alias = 4;
|
|
}
|
|
- add blockchain to node server
|
|
- sync with neigbhor node server
|
|
- discover new neighbor if known neighbor hasn't blockchain
|
|
- ask hedera for last transaction of this topic to know if sync
|
|
|
|
|
|
Open request:
|
|
open for everyone, no need to check sender
|
|
but don't sending personal data like e-mail address (which shouldn't be on blockchain anyway)
|
|
only read access
|
|
access via json-rpc?
|
|
|
|
method: "checkPubkeysBelongToGroup"
|
|
params: {"pubkeys": [<publicKeys>], "groupAlias": "<group alias string>"}
|
|
check for every pubkey in array if user belong to group
|
|
- user belong only to group if he was added to group
|
|
- OR moved into group from another group
|
|
- AND wasn't moved out of group
|
|
return: [<true|false>]
|
|
return array in same order as input with true for every existing pubkey and false for every not existing pubkey
|
|
|
|
method: "getBalance"
|
|
params: {"groupAlias": "<group alias string>", "pubkey": "<user account public key>"}
|
|
return: {"balance":<balance as int, GDD Cent>, deflationTime:<timestamp in seconds>}
|
|
- if user is currently in group
|
|
return current balance from user with deflation calculated on request time
|
|
- if group wasn't known or user public key wasn't know to group at all
|
|
return error
|
|
- if user isn't any longer in group
|
|
return balance with deflation at time of moving out
|
|
|
|
|
|
method: "getTransactions"
|
|
params: {"groupAlias": "<group alias string>", "lastKnownSequenceNumber": <sequence number>}
|
|
return transactions with sequence number bigger as input sequence number
|
|
return: already implemented json dump format
|
|
|
|
|
|
method: "getCreationSum"
|
|
params: {"groupAlias": "<group alias string>", "month": <month 1-12>, "year":<year>, "pubkey": "<user account public key>"}
|
|
return: {"balance": <balance as int, GDD Cent>}
|
|
calculate and return creation sum from all creation transaction from user with targetDate in month and year
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|