-
Notifications
You must be signed in to change notification settings - Fork 25
Fix examples, add valid keys case #56
base: docs
Are you sure you want to change the base?
Changes from 5 commits
a005277
bc33718
78197f0
cc2aa64
bad2fd5
f7f8caa
815cf46
a62411e
3672eac
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,11 +38,11 @@ message Amount { | |
"account_id": "test@test", | ||
"asset_id": "coin#test", | ||
"amount": { | ||
"value": string, | ||
"precision": int | ||
"value": "200", | ||
"precision": 2 | ||
} | ||
} | ||
], … | ||
] | ||
} | ||
``` | ||
|
||
|
@@ -84,10 +84,10 @@ message Peer { | |
"command_type": "AddPeer", | ||
"peer": { | ||
"address": "192.168.1.1:50001", | ||
"peer_key": string(64) | ||
"peer_key": "407e57f50ca48969b08ba948171bb2435e035d82cec417e18e4a38f5fb113f83" | ||
} | ||
}, | ||
], … | ||
} | ||
] | ||
} | ||
``` | ||
|
||
|
@@ -123,9 +123,9 @@ message AddSignatory { | |
{ | ||
"command_type": "AddSignatory", | ||
"account_id": "test@test", | ||
"public_key": string(64) | ||
"public_key": "407e57f50ca48969b08ba948171bb2435e035d82cec417e18e4a38f5fb113f83" | ||
} | ||
], … | ||
] | ||
} | ||
``` | ||
|
||
|
@@ -166,7 +166,7 @@ message AppendRole { | |
"account_id": "takemiya@test", | ||
"role_name": "Administrator" | ||
} | ||
], … | ||
] | ||
} | ||
``` | ||
|
||
|
@@ -203,9 +203,9 @@ message CreateAccount { | |
"command_type": "CreateAccount", | ||
"account_name": "makoto.takemiya", | ||
"domain_id": "test", | ||
"main_pubkey": string | ||
"main_pubkey": "407e57f50ca48969b08ba948171bb2435e035d82cec417e18e4a38f5fb113f83" | ||
} | ||
], … | ||
] | ||
} | ||
``` | ||
|
||
|
@@ -243,9 +243,9 @@ message CreateAsset { | |
"command_type": "CreateAsset", | ||
"asset_name": "usd", | ||
"domain_id": "test", | ||
"precision": "2" | ||
"precision": 2 | ||
} | ||
], … | ||
] | ||
} | ||
``` | ||
|
||
|
@@ -282,7 +282,7 @@ message CreateDomain { | |
"domain_id": "test2", | ||
"default_role": "User" | ||
} | ||
], … | ||
] | ||
} | ||
``` | ||
|
||
|
@@ -319,11 +319,10 @@ message CreateRole { | |
"command_type": "CreateRole", | ||
"role_name": "MoneyCreator", | ||
"permissions": [ | ||
"CanAddAssetQuantity", | ||
… | ||
"CanAddAssetQuantity" | ||
] | ||
} | ||
], … | ||
] | ||
} | ||
``` | ||
|
||
|
@@ -357,9 +356,9 @@ message DetachRole { | |
{ | ||
"command_type": "DetachRole", | ||
"account_id": "test@test", | ||
"role_name": "user" | ||
"role_name": "User" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Role should be in lower case |
||
} | ||
], … | ||
] | ||
} | ||
``` | ||
|
||
|
@@ -395,7 +394,7 @@ message GrantPermission { | |
"account_id": "takemiya@soramitsu", | ||
"permission_name": "CanAddAssetQuantity" | ||
} | ||
], … | ||
] | ||
} | ||
``` | ||
|
||
|
@@ -429,9 +428,9 @@ message RemoveSignatory { | |
{ | ||
"command_type": "RemoveSignatory", | ||
"account_id": "takemiya@test", | ||
"public_key": string(64) | ||
"public_key": "407e57f50ca48969b08ba948171bb2435e035d82cec417e18e4a38f5fb113f83" | ||
} | ||
], … | ||
] | ||
} | ||
``` | ||
|
||
|
@@ -471,7 +470,7 @@ message RevokePermission { | |
"account_id": "takemiya@soramitsu", | ||
"permission_name": "CanAddAssetQuantity" | ||
} | ||
], … | ||
] | ||
} | ||
``` | ||
|
||
|
@@ -508,7 +507,7 @@ message SetAccountDetail{ | |
"key": "position", | ||
"value": "Co-CEO" | ||
} | ||
], … | ||
] | ||
} | ||
``` | ||
|
||
|
@@ -546,7 +545,7 @@ message SetAccountQuorum { | |
"account_id": "takemiya@test", | ||
"quorum": 5 | ||
} | ||
], … | ||
] | ||
} | ||
``` | ||
|
||
|
@@ -599,11 +598,11 @@ message Amount { | |
"account_id": "test@test", | ||
"asset_id": "coin#test", | ||
"amount": { | ||
"value": string, | ||
"precision": int | ||
"value": "200", | ||
"precision": 2 | ||
} | ||
} | ||
], … | ||
] | ||
} | ||
``` | ||
|
||
|
@@ -651,7 +650,7 @@ message TransferAsset { | |
"precision": 0 | ||
} | ||
} | ||
], … | ||
] | ||
} | ||
``` | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -81,10 +81,10 @@ message GetAccount { | |
{ | ||
"signature": | ||
{ | ||
"pubkey": "…", | ||
"signature": "…" | ||
"pubkey": "407e57f50ca48969b08ba948171bb2435e035d82cec417e18e4a38f5fb113f83", | ||
"signature": "81744e004555970ad114a2b8f7a0d1bb087e26c6e009a6147781a5042dbbf8e00f1fd5a4d4ddb123c1c0813f00d633b7295e482a43001edbe7f51dd4d32aef05" | ||
}, | ||
"created_ts": …, | ||
"created_ts": 1517560129182, | ||
"creator_account_id": "admin@test", | ||
"query_counter": 1, | ||
"query_type" : "GetAccount", | ||
|
@@ -145,10 +145,10 @@ message GetSignatories { | |
{ | ||
"signature": | ||
{ | ||
"pubkey": "…", | ||
"signature": "…" | ||
"pubkey": "407e57f50ca48969b08ba948171bb2435e035d82cec417e18e4a38f5fb113f83", | ||
"signature": "81744e004555970ad114a2b8f7a0d1bb087e26c6e009a6147781a5042dbbf8e00f1fd5a4d4ddb123c1c0813f00d633b7295e482a43001edbe7f51dd4d32aef05" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why all of the signatures are the same? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is just an example, don't worry |
||
}, | ||
"created_ts": …, | ||
"created_ts": 1517560129182, | ||
"creator_account_id": "admin@test", | ||
"query_counter": 1, | ||
"query_type" : "GetSignatories", | ||
|
@@ -197,10 +197,10 @@ message GetAccountTransactions { | |
{ | ||
"signature": | ||
{ | ||
"pubkey": "…", | ||
"signature": "…" | ||
"pubkey": "407e57f50ca48969b08ba948171bb2435e035d82cec417e18e4a38f5fb113f83", | ||
"signature": "81744e004555970ad114a2b8f7a0d1bb087e26c6e009a6147781a5042dbbf8e00f1fd5a4d4ddb123c1c0813f00d633b7295e482a43001edbe7f51dd4d32aef05" | ||
}, | ||
"created_ts": …, | ||
"created_ts": 1517560129182, | ||
"creator_account_id": "admin@test", | ||
"query_counter": 1, | ||
"query_type" : "GetAccountTransactions", | ||
|
@@ -251,10 +251,10 @@ message GetAccountAssetTransactions { | |
{ | ||
"signature": | ||
{ | ||
"pubkey": "…", | ||
"signature": "…" | ||
"pubkey": "407e57f50ca48969b08ba948171bb2435e035d82cec417e18e4a38f5fb113f83", | ||
"signature": "81744e004555970ad114a2b8f7a0d1bb087e26c6e009a6147781a5042dbbf8e00f1fd5a4d4ddb123c1c0813f00d633b7295e482a43001edbe7f51dd4d32aef05" | ||
}, | ||
"created_ts": …, | ||
"created_ts": 1517560129182, | ||
"creator_account_id": "admin@test", | ||
"query_counter": 1, | ||
"query_type" : "GetAccountAssetTransactions", | ||
|
@@ -305,14 +305,14 @@ message GetTransactions { | |
{ | ||
"signature": | ||
{ | ||
"pubkey": "…", | ||
"signature": "…" | ||
"pubkey": "407e57f50ca48969b08ba948171bb2435e035d82cec417e18e4a38f5fb113f83", | ||
"signature": "81744e004555970ad114a2b8f7a0d1bb087e26c6e009a6147781a5042dbbf8e00f1fd5a4d4ddb123c1c0813f00d633b7295e482a43001edbe7f51dd4d32aef05" | ||
}, | ||
"created_ts": …, | ||
"created_ts": 1517560129182, | ||
"creator_account_id": "admin@test", | ||
"query_counter": 1, | ||
"query_type" : "GetTransactions", | ||
"tx_hashes": [string(64),…] | ||
"tx_hashes": [bf6edb882d53f5532cb416455834878db7af08fb814f8c95d6867a6d9eea4057] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure if this is valid, since other hex strings are enclosed in |
||
} | ||
``` | ||
|
||
|
@@ -359,15 +359,15 @@ message GetAccountAssets { | |
{ | ||
"signature": | ||
{ | ||
"pubkey": "…", | ||
"signature": "…" | ||
"pubkey": "407e57f50ca48969b08ba948171bb2435e035d82cec417e18e4a38f5fb113f83", | ||
"signature": "81744e004555970ad114a2b8f7a0d1bb087e26c6e009a6147781a5042dbbf8e00f1fd5a4d4ddb123c1c0813f00d633b7295e482a43001edbe7f51dd4d32aef05" | ||
}, | ||
"created_ts": …, | ||
"created_ts": 1517560129182, | ||
"creator_account_id": "admin@test", | ||
"query_counter": 1, | ||
"query_type" : "GetAccountAssets", | ||
"account_id": "test@test", | ||
"asset_id": "coin#test", | ||
"asset_id": "coin#test" | ||
} | ||
``` | ||
|
||
|
@@ -421,14 +421,14 @@ message GetAssetInfo { | |
{ | ||
"signature": | ||
{ | ||
"pubkey": "…", | ||
"signature": "…" | ||
"pubkey": "407e57f50ca48969b08ba948171bb2435e035d82cec417e18e4a38f5fb113f83", | ||
"signature": "81744e004555970ad114a2b8f7a0d1bb087e26c6e009a6147781a5042dbbf8e00f1fd5a4d4ddb123c1c0813f00d633b7295e482a43001edbe7f51dd4d32aef05" | ||
}, | ||
"created_ts": …, | ||
"created_ts": 1517560129182, | ||
"creator_account_id": "admin@test", | ||
"query_counter": 1, | ||
"query_type" : "GetAssetInfo", | ||
"asset_id": "coin#test", | ||
"asset_id": "coin#test" | ||
} | ||
``` | ||
|
||
|
@@ -480,13 +480,13 @@ message GetRoles { | |
{ | ||
"signature": | ||
{ | ||
"pubkey": "…", | ||
"signature": "…" | ||
"pubkey": "407e57f50ca48969b08ba948171bb2435e035d82cec417e18e4a38f5fb113f83", | ||
"signature": "81744e004555970ad114a2b8f7a0d1bb087e26c6e009a6147781a5042dbbf8e00f1fd5a4d4ddb123c1c0813f00d633b7295e482a43001edbe7f51dd4d32aef05" | ||
}, | ||
"created_ts": …, | ||
"created_ts": 1517560129182, | ||
"creator_account_id": "admin@test", | ||
"query_counter": 1, | ||
"query_type" : "GetRoles", | ||
"query_type" : "GetRoles" | ||
} | ||
``` | ||
|
||
|
@@ -527,14 +527,14 @@ message GetRolePermissions { | |
{ | ||
"signature": | ||
{ | ||
"pubkey": "…", | ||
"signature": "…" | ||
"pubkey": "407e57f50ca48969b08ba948171bb2435e035d82cec417e18e4a38f5fb113f83", | ||
"signature": "81744e004555970ad114a2b8f7a0d1bb087e26c6e009a6147781a5042dbbf8e00f1fd5a4d4ddb123c1c0813f00d633b7295e482a43001edbe7f51dd4d32aef05" | ||
}, | ||
"created_ts": …, | ||
"created_ts": 1517560129182, | ||
"creator_account_id": "admin@test", | ||
"query_counter": 1, | ||
"query_type" : "GetRolePermissions", | ||
"role_id" : "MoneyCreator", | ||
"role_id" : "MoneyCreator" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Again role |
||
} | ||
``` | ||
|
||
|
@@ -554,4 +554,4 @@ message RolePermissionsResponse { | |
|
||
Field | Description | Constraint | ||
-------------- | -------------- | -------------- | ||
Permissions | array of permissions related to the role | string of permissions related to the role | ||
Permissions | array of permissions related to the role | string of permissions related to the role |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,11 +11,16 @@ message Transaction { | |
```json | ||
{ | ||
/* Transaction */ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Such comments are not valid JSON syntax, consider removing. |
||
"signatures": array of objects, | ||
"created_ts": int(13), | ||
"creator_account_id": string(?), | ||
"tx_counter": int, | ||
"commands": array of objects | ||
"signatures": [ | ||
{ | ||
"pubkey": "407e57f50ca48969b08ba948171bb2435e035d82cec417e18e4a38f5fb113f83", | ||
"signature": "81744e004555970ad114a2b8f7a0d1bb087e26c6e009a6147781a5042dbbf8e00f1fd5a4d4ddb123c1c0813f00d633b7295e482a43001edbe7f51dd4d32aef05" | ||
} | ||
], | ||
"created_ts": 1517560129182, | ||
"creator_account_id": "admin@test", | ||
"tx_counter": 1, | ||
"commands": [] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Transactions with no commands are currently invalid, consider adding a small command, such as |
||
} | ||
``` | ||
|
||
|
@@ -53,13 +58,12 @@ message Payload { | |
{ | ||
"commands": [ | ||
{ | ||
"command_type": string(?), | ||
/* other command-specific fields */ | ||
/* command-specific fields */ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Such comments are invalid JSON syntax. Also empty commands are not currently accepted, consider adding a small command such as There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The example for the valid transaction is provided above, this is used for explanation. Is it necessary to complicate it, as it might hurt the explanation? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Concern is that person can just try to copy and paste the example and try to run it with iroha-cli. Maybe this explanation can be done in text, and not in JSON? |
||
} | ||
], | ||
"creator_account_id": string(?), | ||
"tx_counter": int, | ||
"created_ts": int(13) | ||
"creator_account_id": "admin@test", | ||
"tx_counter": 1, | ||
"created_ts": 1517560129182 | ||
} | ||
``` | ||
|
||
|
@@ -75,10 +79,10 @@ message Signature { | |
{ | ||
"signatures": [ | ||
{ | ||
"pubkey": string(64), | ||
"signature": string(128), | ||
"pubkey": "407e57f50ca48969b08ba948171bb2435e035d82cec417e18e4a38f5fb113f83", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Space looks redundant, maybe run some JSON beautifier on examples? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. thanks! |
||
"signature": "81744e004555970ad114a2b8f7a0d1bb087e26c6e009a6147781a5042dbbf8e00f1fd5a4d4ddb123c1c0813f00d633b7295e482a43001edbe7f51dd4d32aef05" | ||
} | ||
], … | ||
] | ||
} | ||
``` | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was changed to
can_add_asset_quantity
at hyperledger-iroha/iroha@999a1c7