Skip to content
This repository has been archived by the owner on Jan 18, 2019. It is now read-only.

Fix examples, add valid keys case #56

Open
wants to merge 9 commits into
base: docs
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 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
57 changes: 28 additions & 29 deletions source/includes/_commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ message Amount {
"account_id": "test@test",
"asset_id": "coin#test",
"amount": {
"value": string,
"precision": int
"value": "200",
"precision": 2
}
}
], …
]
}
```

Expand Down Expand Up @@ -84,10 +84,10 @@ message Peer {
"command_type": "AddPeer",
"peer": {
"address": "192.168.1.1:50001",
"peer_key": string(64)
"peer_key": "407e57f50ca48969b08ba948171bb2435e035d82cec417e18e4a38f5fb113f83"
}
},
], …
}
]
}
```

Expand Down Expand Up @@ -123,9 +123,9 @@ message AddSignatory {
{
"command_type": "AddSignatory",
"account_id": "test@test",
"public_key": string(64)
"public_key": "407e57f50ca48969b08ba948171bb2435e035d82cec417e18e4a38f5fb113f83"
}
], …
]
}
```

Expand Down Expand Up @@ -166,7 +166,7 @@ message AppendRole {
"account_id": "takemiya@test",
"role_name": "Administrator"
}
], …
]
}
```

Expand Down Expand Up @@ -203,9 +203,9 @@ message CreateAccount {
"command_type": "CreateAccount",
"account_name": "makoto.takemiya",
"domain_id": "test",
"main_pubkey": string
"main_pubkey": "407e57f50ca48969b08ba948171bb2435e035d82cec417e18e4a38f5fb113f83"
}
], …
]
}
```

Expand Down Expand Up @@ -243,9 +243,9 @@ message CreateAsset {
"command_type": "CreateAsset",
"asset_name": "usd",
"domain_id": "test",
"precision": "2"
"precision": 2
}
], …
]
}
```

Expand Down Expand Up @@ -282,7 +282,7 @@ message CreateDomain {
"domain_id": "test2",
"default_role": "User"
}
], …
]
}
```

Expand Down Expand Up @@ -319,11 +319,10 @@ message CreateRole {
"command_type": "CreateRole",
"role_name": "MoneyCreator",
"permissions": [
"CanAddAssetQuantity",
"CanAddAssetQuantity"
Copy link

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

]
}
], …
]
}
```

Expand Down Expand Up @@ -357,9 +356,9 @@ message DetachRole {
{
"command_type": "DetachRole",
"account_id": "test@test",
"role_name": "user"
"role_name": "User"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Role should be in lower case

}
], …
]
}
```

Expand Down Expand Up @@ -395,7 +394,7 @@ message GrantPermission {
"account_id": "takemiya@soramitsu",
"permission_name": "CanAddAssetQuantity"
}
], …
]
}
```

Expand Down Expand Up @@ -429,9 +428,9 @@ message RemoveSignatory {
{
"command_type": "RemoveSignatory",
"account_id": "takemiya@test",
"public_key": string(64)
"public_key": "407e57f50ca48969b08ba948171bb2435e035d82cec417e18e4a38f5fb113f83"
}
], …
]
}
```

Expand Down Expand Up @@ -471,7 +470,7 @@ message RevokePermission {
"account_id": "takemiya@soramitsu",
"permission_name": "CanAddAssetQuantity"
}
], …
]
}
```

Expand Down Expand Up @@ -508,7 +507,7 @@ message SetAccountDetail{
"key": "position",
"value": "Co-CEO"
}
], …
]
}
```

Expand Down Expand Up @@ -546,7 +545,7 @@ message SetAccountQuorum {
"account_id": "takemiya@test",
"quorum": 5
}
], …
]
}
```

Expand Down Expand Up @@ -599,11 +598,11 @@ message Amount {
"account_id": "test@test",
"asset_id": "coin#test",
"amount": {
"value": string,
"precision": int
"value": "200",
"precision": 2
}
}
], …
]
}
```

Expand Down Expand Up @@ -651,7 +650,7 @@ message TransferAsset {
"precision": 0
}
}
], …
]
}
```

Expand Down
66 changes: 33 additions & 33 deletions source/includes/_queries.md
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -145,10 +145,10 @@ message GetSignatories {
{
"signature":
{
"pubkey": "",
"signature": ""
"pubkey": "407e57f50ca48969b08ba948171bb2435e035d82cec417e18e4a38f5fb113f83",
"signature": "81744e004555970ad114a2b8f7a0d1bb087e26c6e009a6147781a5042dbbf8e00f1fd5a4d4ddb123c1c0813f00d633b7295e482a43001edbe7f51dd4d32aef05"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why all of the signatures are the same?

Copy link
Contributor

Choose a reason for hiding this comment

The 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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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]
Copy link

Choose a reason for hiding this comment

The 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 "".

}
```

Expand Down Expand Up @@ -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"
}
```

Expand Down Expand Up @@ -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"
}
```

Expand Down Expand Up @@ -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"
}
```

Expand Down Expand Up @@ -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"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again role

}
```

Expand All @@ -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
30 changes: 17 additions & 13 deletions source/includes/_transactions.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,16 @@ message Transaction {
```json
{
/* Transaction */
Copy link

Choose a reason for hiding this comment

The 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": []
Copy link

Choose a reason for hiding this comment

The 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 AddPeer.

}
```

Expand Down Expand Up @@ -53,13 +58,12 @@ message Payload {
{
"commands": [
{
"command_type": string(?),
/* other command-specific fields */
/* command-specific fields */
Copy link

Choose a reason for hiding this comment

The 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 AddPeer.

Copy link
Author

Choose a reason for hiding this comment

The 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?

Copy link

Choose a reason for hiding this comment

The 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
}
```

Expand All @@ -75,10 +79,10 @@ message Signature {
{
"signatures": [
{
"pubkey": string(64),
"signature": string(128),
"pubkey": "407e57f50ca48969b08ba948171bb2435e035d82cec417e18e4a38f5fb113f83",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Space looks redundant, maybe run some JSON beautifier on examples?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

"signature": "81744e004555970ad114a2b8f7a0d1bb087e26c6e009a6147781a5042dbbf8e00f1fd5a4d4ddb123c1c0813f00d633b7295e482a43001edbe7f51dd4d32aef05"
}
], …
]
}
```

Expand Down