Skip to content

Commit

Permalink
updated README
Browse files Browse the repository at this point in the history
  • Loading branch information
frol committed Aug 13, 2020
1 parent bc614e0 commit d04dab9
Show file tree
Hide file tree
Showing 3 changed files with 112 additions and 5 deletions.
23 changes: 19 additions & 4 deletions chain/rosetta-rpc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,21 @@ Rosetta RPC is built into nearcore and it happily co-exist with JSON RPC.
* [Rosetta API Specification](https://github.com/coinbase/rosetta-specifications)
* [Rosetta Tooling](https://github.com/coinbase/rosetta-cli)

You can view Rosetta API specification in [OpenAPI (Swagger) UI](https://petstore.swagger.io/)
passing the link to Rosetta OpenAPI specification:

```
https://raw.githubusercontent.com/coinbase/rosetta-specifications/master/api.json
```

Also, Rosetta implementation in nearcore exposes auto-generated OpenAPI
specification that has some extra comments regarding to the particular
implementation, and you can always access it from the running node:

```
http://localhost:3040/api/spec
```

Supported Features
------------------

Expand Down Expand Up @@ -47,8 +62,8 @@ transactions to a blockchain network.
To verify the API compliance use:

```
rosetta-cli check:data --configuration-file=rosetta.cfg
rosetta-cli check:construction --configuration-file=rosetta.cfg
rosetta-cli check:data --configuration-file=./rosetta.cfg
rosetta-cli check:construction --configuration-file=./rosetta.cfg
```

How to Run
Expand All @@ -58,8 +73,8 @@ Follow [the standard nearcore procedures to run a node compiled from the source
enabling `rosettarpc` feature:

```
cargo run --release --package neard --bin neard --features rosettarpc -- init
cargo run --release --package neard --bin neard --features rosettarpc -- run
cargo run --release --package neard --bin neard --features rosetta_rpc -- init
cargo run --release --package neard --bin neard --features rosetta_rpc -- run
```

By default, Rosetta RPC is available on port TCP/3040.
92 changes: 92 additions & 0 deletions chain/rosetta-rpc/rosetta.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
{
"network": {
"blockchain": "nearprotocol",
"network": "testnet"
},
"online_url": "http://localhost:3040",
"data_directory": "",
"http_timeout": 10,
"retry_elapsed_time": 60,
"sync_concurrency": 8,
"transaction_concurrency": 16,
"tip_delay": 300,
"disable_memory_limit": false,
"log_configuration": false,
"construction": {
"offline_url": "http://localhost:3040",
"currency": {
"symbol": "yoctoNEAR",
"decimals": 0
},
"minimum_balance": "0",
"maximum_fee": "5000000000000000",
"curve_type": "secp256k1",
"accounting_model": "account",
"scenario": [
{
"operation_identifier": {
"index": 0
},
"type": "transfer",
"status": "",
"account": {
"address": "{{ SENDER }}"
},
"amount": {
"value": "{{ SENDER_VALUE }}",
"currency": null
}
},
{
"operation_identifier": {
"index": 1
},
"related_operations": [
{
"index": 0
}
],
"type": "transfer",
"status": "",
"account": {
"address": "{{ RECIPIENT }}"
},
"amount": {
"value": "{{ RECIPIENT_VALUE }}",
"currency": null
}
}
],
"confirmation_depth": 10,
"stale_depth": 30,
"broadcast_limit": 3,
"ignore_broadcast_failures": false,
"change_scenario": null,
"clear_broadcasts": false,
"broadcast_behind_tip": false,
"block_broadcast_limit": 5,
"rebroadcast_all": false,
"new_account_probability": 0.5,
"max_addresses": 200
},
"data": {
"start_index": 12140933,
"active_reconciliation_concurrency": 16,
"inactive_reconciliation_concurrency": 4,
"inactive_reconciliation_frequency": 250,
"log_blocks": false,
"log_transactions": false,
"log_balance_changes": false,
"log_reconciliations": false,
"ignore_reconciliation_error": false,
"exempt_accounts": "",
"bootstrap_balances": "",
"historical_balance_disabled": false,
"interesting_accounts": "",
"reconciliation_disabled": false,
"inactive_discrepency_search_disabled": false,
"balance_tracking_disabled": false,
"coin_tracking_disabled": false,
"results_output_file": ""
}
}
2 changes: 1 addition & 1 deletion chain/rosetta-rpc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ async fn mempool(
/// actually be included in a block.
///
/// NOTE: The mempool is short-lived, so this method does not make a lot of
/// sense to implement.
/// sense to be implemented.
async fn mempool_transaction(
_client_addr: web::Data<Addr<ClientActor>>,
_body: Json<models::MempoolTransactionRequest>,
Expand Down

0 comments on commit d04dab9

Please sign in to comment.