Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add docs for freeze transactions #1656

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions docs/source/auth_rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,15 @@
<td><sub>1 TRUSTEE OR 1 STEWARD OR 1 NETWORK_MONITOR</sub></td>
<td><sub>Getting validator_info from pool</sub></td>
</tr>
<tr>
<td><sub>LEDGERS_FREEZE</sub></td>
<td><sub>EDIT</sub></td>
<td><sub><code>*</code></sub></td>
<td><sub><code>*</code></sub></td>
<td><sub><code>*</code></sub></td>
<td><sub>3 TRUSTEE</sub></td>
<td><sub>Freeze specific ledgers</sub></td>
</tr>
</table>


Expand Down Expand Up @@ -729,6 +738,11 @@
<td><sub>N/A</sub></td>
</tr>

<tr>
<td><sub>LEDGERS_FREEZE</sub></td>
<td><sub>EDIT</sub></td>
<td><sub>N/A</sub></td>
</tr>

</table>

Expand Down
116 changes: 116 additions & 0 deletions docs/source/requests-new.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
* [NODE](#node)
* [POOL_UPGRADE](#pool_upgrade)
* [POOL_CONFIG](#pool_config)
* [LEDGERS_FREEZE](#ledgers_freeze)

* [Read Requests](#read-requests)

Expand All @@ -24,6 +25,7 @@
* [GET_SCHEMA](#get_schema)
* [GET_CLAIM_DEF](#get_claim_def)
* [GET_TXN](#get_txn)
* [GET_FROZEN_LEDGERS](#get_frozen_ledgers)

This doc is about supported client"s Request (both write and read ones).
If you are interested in transactions and their representation on the Ledger (that is internal one),
Expand Down Expand Up @@ -1386,6 +1388,64 @@ Command to change Pool's configuration
}
```

### LEDGERS_FREEZE

Disable specific legders. System completely ignore frozen ledgers. After freeze you can delete frozen ledger via [remove_ledger.py] (https://github.com/hyperledger/indy-node/blob/master/scripts/remove_ledger.py).
Toktar marked this conversation as resolved.
Show resolved Hide resolved

*Request Example*:
```
{
"operation": {
"type": "9",
"ledgers_ids": [1,2,3,4]
},
"identifier": "21BPzYYrFzbuECcBV3M1FH",
"reqId": 311348486,
"protocolVersion": 2,
"signature": "3YVzDtSxxnowVwAXZmxCG2fz1A38j1qLrwKmGEG653GZw7KJRBX57Stc1oxQZqqu9mCqFLa7aBzt4MKXk4MeunVj",
}
```

*Reply Example*:
```
{
"op":"REPLY",
"result":{
"txn":{
"type":"9",
"data":{
"ledgers_ids":[1,2,3,4]
},
"protocolVersion":2,
"metadata":{
"reqId":311348486,
"payloadDigest":"09a3ccedf806e224beb56b547e967b442f3ee3181d5c87623f063742df7a692e",
"from":"M9BJDuS24bqbJNvBRsoGg3",
"digest":"dfdc6c5b77181953b4e32f975b0c5e64b25dc3e3061716aca1baae4cbe0ce494"
}
},
"ver":"1",
"auditPath":[
"DDwrSsKwpFkfGVqp7AxzRMusUuT9D5RmidCmnr8phTWD"
],
"txnMetadata":{
"txnTime":1613735420,
"seqNo":3
},
"reqSignature":{
"type":"ED25519",
"values":[
{
"value":"bSMfwJraLXzBAmdZKQUC1XfoVb3YWygc6UCQAmrTNKDr9beXta7MFyNZnQtbmNoRurjicSHLo3sW7qv7ZTWcZJa",
"from":"M9BJDuS24bqbJNvBRsoGg3"
}
]
},
"rootHash":"E27ssC3LK8azpgxxtBY4ETLXvDLGtfmeSjngc6jrV1Qt"
}
}
```

## Read Requests

### GET_NYM
Expand Down Expand Up @@ -1898,3 +1958,59 @@ A generic request to get a transaction from Ledger by its sequence number.
}
```


### GET_FROZEN_LEDGERS

Get whole list of frozen ledgers. Reply has follow format data: `<ledger_id>: {ledger: <ledger_root_hash>, state: <state_root_hash>, seq_no: <last_seq_no>}`.
Toktar marked this conversation as resolved.
Show resolved Hide resolved

*Request Example*:
```
{
Toktar marked this conversation as resolved.
Show resolved Hide resolved
"operation":{
"type":"10"
},
"reqId":783857061,
"protocolVersion":2,
"identifier":"M9BJDuS24bqbJNvBRsoGg3"
}
```

*Reply Example*:
```
{
"result":{
"seqNo":3,
"type":"10",
"state_proof":{
"root_hash":"HUv35b31eqncHZ1R8xMQW9pJnCBqAaUVrfCA8AeTtx6u",
"multi_signature":{
"value":{
"pool_state_root_hash":"4bCEk76QsB6p3yCiDntMedpeZmiQtdH9NRpcFyvaLHhc",
"state_root_hash":"HUv35b31eqncHZ1R8xMQW9pJnCBqAaUVrfCA8AeTtx6u",
"timestamp":1613736202,
"ledger_id":2,
"txn_root_hash":"BY6PV9SrV1dgQgxy2kpeTLESQfazTYoLdLZfjzVmcLeV"
},
"signature":"R8FRHVg51YiY5nS8Hh8iXNa1ZPKjrQMmurnrGek2A7QMKq79Pws4DLhgcVgf66PSJGEPjmyASYxFziEnubY1RFHQiE7ZToLZqW4oJt11hhL1XgXwrdswyqTQjuyxx5nzjyE4AzyTvs3BywD54s3w3mUhLG3QWwBp1uTX8agLEKZDkK",
"participants":[
"Gamma",
"Delta",
"Beta"
]
},
"proof_nodes":"+L74vJEgNDpGUk9aRU5fTEVER0VSU7io+Ka4pHsibHNuIjozLCJsdXQiOjE2MTM3MzYyMDIsInZhbCI6eyI5MDkiOnsibGVkZ2VyIjoiR0tvdDVoQnNkODFrTXVwTkNYSGFxYmh2M2h1RWJ4QUZNTG5wY1gyaG5pd24iLCJzZXFfbm8iOjAsInN0YXRlIjoiRGZOTG1INERBSFRLdjYzWVBGSnp1UmRlRXRWd0Y1UnRWbnZLWUhkOGlMRUEifX19"
},
"txnTime":1613736202,
"reqId":666493618,
"data":{
"909":{
"seq_no":0,
"state":"DfNLmH4DAHTKv63YPFJzuRdeEtVwF5RtVnvKYHd8iLEA",
"ledger":"GKot5hBsd81kMupNCXHaqbhv3huEbxAFMLnpcX2hniwn"
}
},
"identifier":"M9BJDuS24bqbJNvBRsoGg3"
},
"op":"REPLY"
}
```
123 changes: 123 additions & 0 deletions docs/source/requests.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
* [TRANSACTION_AUTHOR_AGREEMENT](#transaction_author_agreement)
* [TRANSACTION_AUTHOR_AGREEMENT_AML](#transaction_author_agreement_AML)
* [TRANSACTION_AUTHOR_AGREEMENT_DISABLE](#transaction_author_agreement_disable)
* [LEDGERS_FREEZE](#ledgers_freeze)


* [Read Requests](#read-requests)
Expand All @@ -43,6 +44,7 @@
* [GET_CONTEXT](#get_context)
* [GET_RICH_SCHEMA](#get_rich_schema)
* [GET_TXN](#get_txn)
* [GET_FROZEN_LEDGERS](#get_frozen_ledgers)

* [Action Requests](#action-requests)

Expand Down Expand Up @@ -2953,7 +2955,64 @@ A new Agreement needs to be sent instead.
}
```

### LEDGERS_FREEZE

Freeze deprecated ledgers (base ledgers POOL, CONFIG, AUDIT and DOMAIN can't be frozen). System completely ignore frozen ledgers. Frozen ledgers can't be unfreeze. After freeze you can delete frozen ledger via [remove_ledger.py] (https://github.com/hyperledger/indy-node/blob/master/scripts/remove_ledger.py).
esplinr marked this conversation as resolved.
Show resolved Hide resolved

The request has static and dynamic validations. Static validation check for base ledgers (pool, audit, domain and config) than doesn't freeze them. Dynamic validation check existence of ledgers before freeze. Authorize check permission for freeze request (only trustee can freeze ledgers).

*Request Example*:
```
{
"operation": {
"type": "9",
"ledgers_ids": [1,2,3,4]
},
"identifier": "21BPzYYrFzbuECcBV3M1FH",
"reqId": 311348486,
"protocolVersion": 2,
"signature": "3YVzDtSxxnowVwAXZmxCG2fz1A38j1qLrwKmGEG653GZw7KJRBX57Stc1oxQZqqu9mCqFLa7aBzt4MKXk4MeunVj",
}
```

*Reply Example*:
```
{
"op":"REPLY",
"result":{
"txn":{
"type":"9",
"data":{
"ledgers_ids":[ ]
},
"protocolVersion":2,
"metadata":{
"reqId":311348486,
"payloadDigest":"09a3ccedf806e224beb56b547e967b442f3ee3181d5c87623f063742df7a692e",
"from":"M9BJDuS24bqbJNvBRsoGg3",
"digest":"dfdc6c5b77181953b4e32f975b0c5e64b25dc3e3061716aca1baae4cbe0ce494"
}
},
"ver":"1",
"auditPath":[
"DDwrSsKwpFkfGVqp7AxzRMusUuT9D5RmidCmnr8phTWD"
],
"txnMetadata":{
"txnTime":1613735420,
"seqNo":3
},
"reqSignature":{
"type":"ED25519",
"values":[
{ "value":"bSMfwJraLXzBAmdZKQUC1XfoVb3YWygc6UCQAmrTNKDr9beXta7MFyNZnQtbmNoRurjicSHLo3sW7qv7ZTWcZJa",
"from":"M9BJDuS24bqbJNvBRsoGg3"
}
]
},
"rootHash":"E27ssC3LK8azpgxxtBY4ETLXvDLGtfmeSjngc6jrV1Qt"
}
}
```

## Read Requests

Expand Down Expand Up @@ -4184,6 +4243,70 @@ A generic request to get a transaction from Ledger by its sequence number.
}
```

### GET_FROZEN_LEDGERS
Toktar marked this conversation as resolved.
Show resolved Hide resolved

Get whole list of frozen ledgers. Reply has follow state format data:

```
<ledger_id>: {
ledger: <ledger_root_hash>,
state: <state_root_hash>,
seq_no: <last_seq_no>
}
```

*Request Example*:
```
{
"operation":{
"type":"10"
},
"reqId":783857061,
"protocolVersion":2,
"identifier":"M9BJDuS24bqbJNvBRsoGg3"
}
```

*Reply Example*:
```
{
"result":{
"seqNo":3,
"type":"10",
"state_proof":{
"root_hash":"HUv35b31eqncHZ1R8xMQW9pJnCBqAaUVrfCA8AeTtx6u",
"multi_signature":{
"value":{
"pool_state_root_hash":"4bCEk76QsB6p3yCiDntMedpeZmiQtdH9NRpcFyvaLHhc",
"state_root_hash":"HUv35b31eqncHZ1R8xMQW9pJnCBqAaUVrfCA8AeTtx6u",
"timestamp":1613736202,
"ledger_id":2,
"txn_root_hash":"BY6PV9SrV1dgQgxy2kpeTLESQfazTYoLdLZfjzVmcLeV"
},
"signature":"R8FRHVg51YiY5nS8Hh8iXNa1ZPKjrQMmurnrGek2A7QMKq79Pws4DLhgcVgf66PSJGEPjmyASYxFziEnubY1RFHQiE7ZToLZqW4oJt11hhL1XgXwrdswyqTQjuyxx5nzjyE4AzyTvs3BywD54s3w3mUhLG3QWwBp1uTX8agLEKZDkK",
"participants":[
"Gamma",
"Delta",
"Beta"
]
},
"proof_nodes":"+L74vJEgNDpGUk9aRU5fTEVER0VSU7io+Ka4pHsibHNuIjozLCJsdXQiOjE2MTM3MzYyMDIsInZhbCI6eyI5MDkiOnsibGVkZ2VyIjoiR0tvdDVoQnNkODFrTXVwTkNYSGFxYmh2M2h1RWJ4QUZNTG5wY1gyaG5pd24iLCJzZXFfbm8iOjAsInN0YXRlIjoiRGZOTG1INERBSFRLdjYzWVBGSnp1UmRlRXRWd0Y1UnRWbnZLWUhkOGlMRUEifX19"
},
"txnTime":1613736202,
"reqId":666493618,
"data":{
"909":{
"seq_no":0,
"state":"DfNLmH4DAHTKv63YPFJzuRdeEtVwF5RtVnvKYHd8iLEA",
"ledger":"GKot5hBsd81kMupNCXHaqbhv3huEbxAFMLnpcX2hniwn"
}
},
"identifier":"M9BJDuS24bqbJNvBRsoGg3"
},
"op":"REPLY"
}
```

## Action Requests

### POOL_RESTART
Expand Down
38 changes: 38 additions & 0 deletions docs/source/transactions.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
* [TRANSACTION_AUTHOR_AGREEMENT](#transaction_author_agreement)
* [TRANSACTION_AUTHOR_AGREEMENT_AML](#transaction_author_agreement_AML)
* [TRANSACTION_AUTHOR_AGREEMENT_DISABLE](#transaction_author_agreement_disable)
* [LEDGERS_FREEZE](#ledgers_freeze)


## General Information
Expand Down Expand Up @@ -2093,3 +2094,40 @@ A new Agreement needs to be sent instead.
}
```

#### LEDGERS_FREEZE

Disable specific legders. System completely ignore frozen ledgers. After freeze you can delete frozen ledger via [remove_ledger.py] (https://github.com/hyperledger/indy-node/blob/master/scripts/remove_ledger.py).
Toktar marked this conversation as resolved.
Show resolved Hide resolved

**Example:**
```
{
"ver": 1,
"txn": {
"type":9,
"protocolVersion":2,

"data": {
"ver": 1,
"ledgers_ids": [1,2,3,4],
},

"metadata": {
"reqId":1513945121191691,
"from":"L5AD5g65TDQr1PPHHRoiGf",
"digest":"6cee82226c6e276c983f46d03e3b3d10436d90b67bf33dc67ce9901b44dbc97c",
"payloadDigest": "21f0f5c158ed6ad49ff855baf09a2ef9b4ed1a8015ac24bccc2e0106cd905685",
},
},
"txnMetadata": {
"txnTime":1577836799,
"seqNo": 10,
},
"reqSignature": {
"type": "ED25519",
"values": [{
"from": "L5AD5g65TDQr1PPHHRoiGf",
"value": "4X3skpoEK2DRgZxQ9PwuEvCJpL8JHdQ8X4HDDFyztgqE15DM2ZnkvrAh9bQY16egVinZTzwHqznmnkaFM4jjyDgd"
}]
}
}
```