Nervos CKB Rosetta Node Implementation

CKB Rosetta Node | How to Deploy a CKB Rosetta Node?

Overview

Here we lay out the procedure one needs to follow to deploy an CKB node that adheres to Rosetta’s blockchain specifications.

ckb-rosetta-sdk implement the Rosetta specifications for CKB.

ckb-rosetta-docker is a separate dockerfile to combine CKB nodes and ckb rosetta service.

Environment Setup

Before running any of the commands specified below, please ensure that you are running the latest version of Docker.

If you don’t have it installed on your system already, please follow this link to download Docker.

First clone the CKB rosetta docker source code using the following command:

git clone https://github.com/nervosnetwork/ckb-rosetta-docker.git

Now we will be building the mainnet node and rosetta server from the source code.

The Dockerfile already contains all the necessary config and dependencies. Within the directory, run the following command to build the docker image:

docker build -t ckb-rosetta-docker .

Startup rosetta service

First, we should create new directory for store node and indexer data.

mkdir data

Next, run the ckb-rosetta-docker image the command specified below.

docker run --name ckb-rosetta-docker -d -p 8117:8117 -v "$PWD/data":/data ckb-rosetta-docker

API Reference

Based on the Rosetta specification, CKB rosetta-compliant nodes make the following Restful APIs available.

Network

Fetch the list of available networks

Method: POST

URL: /network/list

Fetch network options

Method: POST

URL: /network/options

Fetch the network status

Method: POST

URL: /network/status

Account

Fetch account balance

Method: POST

URL: /account/balance

Block

Fetch block details

Method: POST

URL: /block

Fetch transaction information from a block

Method: POST

URL: /block/transaction

I have some confusions, How about the Construction APIs, as I know these Apis works for withdraw and deposit, If you don’t complete the implementation, how people can interact with Coinbase?

Any advice are appreciated.

1 Like

:wave: @ray.wu!

As of 7/30, this implementation does not yet contain the Construction APIs. The Nervos team is actively working on completing them now.

You are totally correct that without the Construction API, it would not be possible to create transactions (unless we used some network-specific SDK).

We followed the v1.3.x Rosetta standard, but in the recent version, it includes new Construction API. We are working on the Construction API, and will update the implementation soon.

2 Likes

It’s clear, thank you for your relay

ok, get it, hope everything goes well

Cant wait to see this completed, I think CKB is a great project

We already completed rosetta contruction API integrated.

Construction

Create Network Transaction from Signatures

Method: POST
URL: /construction/combine

Derive an Address from a PublicKey

Method: POST
URL: /construction/derive

Get the Hash of a Signed Transaction

Method: POST
URL: /construction/hash

Get Metadata for Transaction Construction

Method: POST
URL: /construction/metadata

Parse a Transaction

Method: POST
URL: /construction/parse

Generate an Unsigned Transaction and Signing Payloads

Method: POST
URL: /construction/payloads

Create a Request to Fetch Metadata

Method: POST
URL: /construction/preprocess

Submit a Signed Transaction

Method: POST
URL: /construction/submit

2 Likes