Skip to content

Commit

Permalink
[json-rpc] rename docs
Browse files Browse the repository at this point in the history
Xiao Li authored and bors-libra committed Dec 9, 2020
1 parent 3b1f9bc commit b2ac20c
Showing 8 changed files with 28 additions and 28 deletions.
10 changes: 5 additions & 5 deletions json-rpc/API-CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -30,20 +30,20 @@ This allows to create verifying clients that do not need to blindly trust the fu

## 2020-10-15 Add `accumulator_root_hash` to `get_metadata` method response

- [See PR #6536](https://github.com/libra/libra/pull/6536)
- [See PR #6536](https://github.com/diem/diem/pull/6536)


## 2020-10-05 Rename `upgradeevent` to `admintransaction` event
- Changed the name and structure for `upgradeevent`
- [See PR #6449](https://github.com/libra/libra/pull/6449)
- [See PR #6449](https://github.com/diem/diem/pull/6449)


## 2020-10-08 Decode transaction script as name, code, arguments and type_arguments

- Transaction [Script](docs/type_transaction.md#type-script) is fulfilled with known script name as type, code, arguments and type_arguments. Similar with on-chain transaction [Script](https://developers.diem.com/docs/rustdocs/diem_types/transaction/struct.Script.html) type.
- Renamed type `peer_to_peer_transaction` to `peer_to_peer_with_metadata`, which is consistent with stdlib transaction script name.
- Removed `mint_transaction`, it is never rendered because of a bug, and the script does not exist anymore.
- [See PR #6453](https://github.com/libra/libra/pull/6453)
- [See PR #6453](https://github.com/diem/diem/pull/6453)


## 2020-10-07 Add `diem_version` field to `get_metadata` response
@@ -83,7 +83,7 @@ See [doc](docs/type_metadata.md) for more details.

- In `KeptVMStatus`, `VerificationError` and `DeserializationError` were merged into `MiscellaneousError`
- This merger was reflected in `VMStatusView`
- [See PR #5798](https://github.com/libra/libra/pull/5798)
- [See PR #5798](https://github.com/diem/diem/pull/5798)

## 2020-09-02 Add `address` to `get_account` response.
- Adding address field to get_account response.
@@ -109,4 +109,4 @@ See [doc](docs/type_metadata.md) for more details.

## Before 2020-08-05

Please refer to [JSON-RPC SPEC before 2020-08-05](https://github.com/libra/libra/blob/888e6cd688a8c9b5805978ab509acdc3c35025ab/json-rpc/json-rpc-spec.md) document for the API spec snapshot.
Please refer to [JSON-RPC SPEC before 2020-08-05](https://github.com/diem/diem/blob/888e6cd688a8c9b5805978ab509acdc3c35025ab/json-rpc/json-rpc-spec.md) document for the API spec snapshot.
2 changes: 1 addition & 1 deletion json-rpc/README.md
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@ There are two types of clients, and thus two types of APIs:

## Usage and versioning

Refer to the [specification](https://github.com/libra/libra/blob/master/json-rpc/json-rpc-spec.md).
Refer to the [specification](https://github.com/diem/diem/blob/master/json-rpc/json-rpc-spec.md).

## Security Concerns

18 changes: 9 additions & 9 deletions json-rpc/docs/client_checklist.md
Original file line number Diff line number Diff line change
@@ -44,7 +44,7 @@ This file is a checklist of requirement & technical details for a Diem client SD
- [ ] Send request with "client sdk name / version" as HTTP User-Agent: this is for server to recognize client sdk version.
- [ ] Decode transaction script bytes: it is possible we may add new transaction script without upgrading server, hence client decoding logic is important for client to recognize all transaction scripts.
By upgrading client side move stdlib scripts (binary and generated type information code), we can decode latest move stdlib scripts executed on-chain.
- [ ] Create transaction hash from signed transaction: hex-encode(sha3-256([]byte("DIEM::Transaction")) + []byte(0) + signed transaction bytes) ([implementation example](https://github.com/libra/client-sdk-go/blob/master/diemtypes/hash.go#L27))
- [ ] Create transaction hash from signed transaction: hex-encode(sha3-256([]byte("DIEM::Transaction")) + []byte(0) + signed transaction bytes) ([implementation example](https://github.com/diem/client-sdk-go/blob/master/diemtypes/hash.go#L27))
- [ ] Client interface should prefer to use AccountAddress type instead of string address.


@@ -102,7 +102,7 @@ See [doc][5] for above concepts.

# Examples

- [ ] [p2p transfer examples](https://github.com/libra/lip/blob/master/lips/lip-4.md#transaction-examples)
- [ ] [p2p transfer examples](https://github.com/diem/lip/blob/master/lips/lip-4.md#transaction-examples)
- [ ] refund p2p transfer example
- [ ] create childVASP example
- [ ] Intent identifier encoding, decoding example
@@ -112,10 +112,10 @@ See [doc][5] for above concepts.
- [ ] Async client
- [ ] CLI connects to testnet for trying out features.

[1]: https://github.com/libra/libra/blob/master/json-rpc/json-rpc-spec.md "Diem JSON-RPC SPEC"
[2]: https://github.com/libra/lip/blob/master/lips/lip-5.md "LIP-5"
[3]: https://github.com/libra/libra/blob/master/language/stdlib/transaction_scripts/doc/peer_to_peer_with_metadata.md "P2P Transafer"
[4]: https://github.com/libra/libra/tree/master/language/stdlib/transaction_scripts/doc "Move Stdlib scripts"
[5]: https://github.com/libra/libra/blob/master/client/diem-dev/README.md "Diem Client Dev Doc"
[6]: https://github.com/libra/libra/blob/master/json-rpc/docs/service_testnet_faucet.md "Faucet service"
[7]: https://github.com/libra/lip/blob/master/lips/lip-4.md "Transaction Metadata Specification"
[1]: https://github.com/diem/diem/blob/master/json-rpc/json-rpc-spec.md "Diem JSON-RPC SPEC"
[2]: https://github.com/diem/lip/blob/master/lips/lip-5.md "LIP-5"
[3]: https://github.com/diem/diem/blob/master/language/stdlib/transaction_scripts/doc/peer_to_peer_with_metadata.md "P2P Transafer"
[4]: https://github.com/diem/diem/tree/master/language/stdlib/transaction_scripts/doc "Move Stdlib scripts"
[5]: https://github.com/diem/diem/blob/master/client/diem-dev/README.md "Diem Client Dev Doc"
[6]: https://github.com/diem/diem/blob/master/json-rpc/docs/service_testnet_faucet.md "Faucet service"
[7]: https://github.com/diem/lip/blob/master/lips/lip-4.md "Transaction Metadata Specification"
2 changes: 1 addition & 1 deletion json-rpc/docs/client_implementation_guide.md
Original file line number Diff line number Diff line change
@@ -82,7 +82,7 @@ cargo run -p swiss-knife -- generate-test-ed25519-keypair

```

> To run this by yourself, clone https://github.com/libra/libra.git, and run `./scripts/dev_setup.sh` to setup dev env.
> To run this by yourself, clone https://github.com/diem/diem.git, and run `./scripts/dev_setup.sh` to setup dev env.
> You can run the command in the above example at the root directory of diem codebase.

2 changes: 1 addition & 1 deletion json-rpc/docs/type_transaction.md
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@ A transaction on the blockchain.

Note:
* For the gas_used, internally within the VM we scale the gas units down by 1000 in order to allow granularity of costing for instruction, but without having to use floating point numbers, but we do round-up the gas used to the nearest "1" when we convert back out.
* Formula to create hash for a signed transaction before it is executed: hex-encode(sha3-256([]byte("DIEM::Transaction")) + []byte(0) + signed transaction bytes) ([implementation example](https://github.com/libra/client-sdk-go/blob/master/diemtypes/hash.go#L27))
* Formula to create hash for a signed transaction before it is executed: hex-encode(sha3-256([]byte("DIEM::Transaction")) + []byte(0) + signed transaction bytes) ([implementation example](https://github.com/diem/client-sdk-go/blob/master/diemtypes/hash.go#L27))


### Example
6 changes: 3 additions & 3 deletions json-rpc/json-rpc-spec.md
Original file line number Diff line number Diff line change
@@ -20,9 +20,9 @@ List of released stable methods (unless specifically mentioned, all parameters a
## Official Client SDKs

* [Go] (https://github.com/libra/client-sdk-go)
* [Java] (https://github.com/libra/client-sdk-java)
* [Python] (https://github.com/libra/client-sdk-python)
* [Go] (https://github.com/diem/client-sdk-go)
* [Java] (https://github.com/diem/client-sdk-java)
* [Python] (https://github.com/diem/client-sdk-python)


## JSON-RPC specification
10 changes: 5 additions & 5 deletions json-rpc/types/src/constants.rs
Original file line number Diff line number Diff line change
@@ -3,10 +3,10 @@

//! Defines constants for enum type values
//! See the following Diem JSON-RPC response type documents for more details:
//! * https://github.com/libra/libra/blob/master/json-rpc/docs/type_account.md#type-account
//! * https://github.com/libra/libra/blob/master/json-rpc/docs/type_event.md#event-data
//! * https://github.com/libra/libra/blob/master/json-rpc/docs/type_transaction.md#type-vmstatus
//! * https://github.com/libra/libra/blob/master/json-rpc/docs/type_transaction.md#type-transactiondata
//! * https://github.com/diem/diem/blob/master/json-rpc/docs/type_account.md#type-account
//! * https://github.com/diem/diem/blob/master/json-rpc/docs/type_event.md#event-data
//! * https://github.com/diem/diem/blob/master/json-rpc/docs/type_transaction.md#type-vmstatus
//! * https://github.com/diem/diem/blob/master/json-rpc/docs/type_transaction.md#type-transactiondata
// AccountRole#type field values
pub const ACCOUNT_ROLE_UNKNOWN: &str = "unknown";
@@ -45,5 +45,5 @@ pub const TRANSACTION_DATA_USER: &str = "user";
pub const TRANSACTION_DATA_UNKNOWN: &str = "unknown";

// Script#type field values, only set unknown type here,
// other types, plese see https://github.com/libra/libra/blob/master/language/stdlib/transaction_scripts/doc/transaction_script_documentation.md for all available script names.
// other types, plese see https://github.com/diem/diem/blob/master/language/stdlib/transaction_scripts/doc/transaction_script_documentation.md for all available script names.
pub const SCRIPT_UNKNOWN: &str = "unknown";
6 changes: 3 additions & 3 deletions json-rpc/types/src/proto/jsonrpc.proto
Original file line number Diff line number Diff line change
@@ -24,9 +24,9 @@
// response#result is an array, you need use the parser deserialize object in the
// array and then collect them as array.
//
// May checkout python implementation as example: https://github.com/libra/libra-client-sdk-python/blob/master/src/diem/jsonrpc/client.py#L474
// May checkout python implementation as example: https://github.com/diem/client-sdk-python/blob/master/src/diem/jsonrpc/client.py#L474
//
// For each data type detail document, please checkout https://github.com/libra/libra/blob/master/json-rpc/json-rpc-spec.md.
// For each data type detail document, please checkout https://github.com/diem/diem/blob/master/json-rpc/json-rpc-spec.md.


syntax = "proto3";
@@ -258,7 +258,7 @@ message TransactionData {

message Script {
/**
* Name of the script code, see https://github.com/libra/libra/blob/master/language/stdlib/transaction_scripts/doc/transaction_script_documentation.md for all available script names.
* Name of the script code, see https://github.com/diem/diem/blob/master/language/stdlib/transaction_scripts/doc/transaction_script_documentation.md for all available script names.
* Type is set as "unknown" if script code can't be recognized, or transaction payload is not a script.
* It is possible server side does not know the code and the code is valid.
*/

0 comments on commit b2ac20c

Please sign in to comment.