-
- Tippy exposes a set of RPCs in JSON-RPC 2.0 protocols for controlling a devchain.
- It also proxies API calls to the active running devchain for transparent CKB interactions.
-
-
-
- The URL of Tippy RPC is http://localhost:5000/api
.
-
-
-
CKB RPCs
-
-
- For CKB RPCs, simply call any API with Tippy API URL. For example:
-
-
-
echo '{
- "id": 2,
- "jsonrpc": "2.0",
- "method": "get_tip_block_number",
- "params": []
-}' \
-| tr -d '\n' \
-| curl -H 'content-type: application/json' -d @@- \
-http://localhost:5000/api
-
-
See CKB JSON-RPC doc for more information.
-
-
Tippy RPCs
-
-
Method create_chain
-
- create_chain({assembler_lock_arg, genesis_issued_cells})
- -
-
- assember_lock_arg
(optional): Lock arg for block assembler (miner address).
- genesis_issued_cells
(optional): An array of genesis issued cells. See example for the structure.
-
-
- - result:
{ id, name }
-
-
Create a devchain and set it as current active chain.
-
Examples
-
Request
-
{
- "id": "1",
- "jsonrpc": "2.0",
- "method": "create_chain",
- "params": [
- {
- "assembler_lock_arg": "0xc8328aabcd9b9e8e64fbc566c4385c3bdeb219d8",
- "genesis_issued_cells": [
- {
- "capacity": "0x5af3107a4000",
- "lock": {
- "code_hash": "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8",
- "args": "0xf2cb132b2f6849ef8abe57e98cddf713bb8d71cb",
- "hash_type": "type"
- }
- }
- ]
- }
- ]
-}
-
-
Response
-
{
- "jsonrpc": "2.0",
- "id": "1",
- "result": {
- "id": 4,
- "name": "CKB devchain"
- }
-}
-
-
Method start_chain
-
- start_chain()
- - result:
"ok"
-
-
Start the current active chain.
-
Examples
-
Request
-
{
- "id": "1",
- "jsonrpc": "2.0",
- "method": "start_chain",
- "params": []
-}
-
Response
-
{
- "jsonrpc": "2.0",
- "id": "1",
- "result": "ok"
-}
-
-
Method stop_chain
-
- stop_chain()
- - result:
"ok"
-
-
Stop the current active chain if it's running.
-
Examples
-
Request
-
{
- "id": "1",
- "jsonrpc": "2.0",
- "method": "stop_chain",
- "params": []
-}
-
Response
-
{
- "jsonrpc": "2.0",
- "id": "1",
- "result": "ok"
-}
-
-
Method mine_blocks
-
- mine_blocks(number_of_blocks)
- - result:
"Wait for blocks to be mined."
-
-
Mine number_of_blocks
blocks at the interval of 1 second.
-
Examples
-
Request
-
{
- "id": "1",
- "jsonrpc": "2.0",
- "method": "mine_blocks",
- "params": [3]
-}
-
Response
-
{
- "jsonrpc": "2.0",
- "id": "1",
- "result": "Wait for blocks to be mined."
-}
-
-
Method revert_blocks
-
- revert_blocks(number_of_blocks)
- - result:
"Reverted blocks."
-
-
Mine number_of_blocks
blocks at the interval of 1 second.
-
Examples
-
Request
-
{
- "id": "1",
- "jsonrpc": "2.0",
- "method": "revert_blocks",
- "params": [3]
-}
-
Response
-
{
- "jsonrpc": "2.0",
- "id": "1",
- "result": "Reverted blocks."
-}
-
-
diff --git a/src/Tippy/Pages/Doc/Api.cshtml.cs b/src/Tippy/Pages/Doc/Api.cshtml.cs
deleted file mode 100644
index 09ad9e6..0000000
--- a/src/Tippy/Pages/Doc/Api.cshtml.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-using System;
-
-namespace Tippy.Pages.Doc
-{
- public class ApiModel : PageModelBase
- {
- public ApiModel(Tippy.Core.Data.TippyDbContext context) : base(context)
- {
- }
-
- public void OnGet()
- {
- }
- }
-}
diff --git a/src/Tippy/Pages/Home/Index.cshtml b/src/Tippy/Pages/Home/Index.cshtml
index 4560be0..bec25af 100644
--- a/src/Tippy/Pages/Home/Index.cshtml
+++ b/src/Tippy/Pages/Home/Index.cshtml
@@ -59,7 +59,7 @@