REST APIs
APIs to manage projects and Forks
The instructions on how to get the API Key, Fork ID, RPC_ID, Project ID, and FORK_RPC can be found in this document.
We use API_KEY, FORK_ID, RPC_ID, PROJECT_ID, and FORK_RPC
in the following to denote the concrete value.
Users can create their Forks under a project; each fork must belong to a project. After registering, a default project named 'default' will be made. Subsequently, users can create additional projects of their own.
Request and Response Format
The requested data is packed in the data
field of the body. The response is in JSON format, with the following standard structure.
code
:Integer
. Error code.0
: No error.other
: Error occurs.
message
:String
If the
code
is not 0, this field denotes the detailed error information.
data
:JSON
This is the detailed response data.
Project Related APIs
Create a new project.
POST
https://api.phalcon.blocksec.com/v1/project
Create a new project.
Headers
Body
Get project list
GET
https://api.phalcon.blocksec.com/v1/projects
Get the project list.
Headers
Response
projectId
:String
. The ID of the created Project. This ID is used to manipulate a Project (e.g., delete a Project or create a Fork in this project).name
:String
. The name of the Project.createTime
:String
. The time of the project was created.
Get a project's detailed information.
GET
https://api.phalcon.blocksec.com/v1/project/$projectId
Get a project's details, including the collaborators, forked created, and usage information.
Headers
Request
PROJECT_ID:
String
. The ID of the Project that is to be queried ($PROJECT_ID
)
Response
projectId
:String
. The ID of the created Project. This ID is used to manipulate a Project (e.g., delete a Project or create a Fork in this project).name
:String
. The name of the Project.createTime
:String
. The time of the project was created.stats
:Json
. The statistics of the simulated transactions for this project.dailyTransactionQuantity
:Integer.
Daily usage statistics (UTC)monthlyTransactionQuantity
:Integer
.Monthly usage statistics from 1st of the month until now).
fokDetail
:Json
. The detailed information on this project's forks.forkId
:String
. The id of the created Fork. This id is used to manipulate a Fork (e.g., delete a Fork).chainId
:Integer
. The id of the chain that is forked. It should be the same as thechainId
passed in the request.name
:String
. The name of the Fork. It should be the same as thename
passed in the request.rpc
:String
. The RPC of this Fork.
collaboratorDetail
:Json
. The detailed information of this project's collaborators.collaboratorNum
:Integer.
The number of collaboratorscollaborators
:Json
. The collaborator information includes their nickname and email address.
Delete a Project
DELETE
https://api.phalcon.blocksec.com/v1/project/delete/$PROJECT_ID
Delete a project.
Headers
Request
PROJECT_ID:
String
. The ID of the Project that is to be deleted.
Fork Related APIs
Create a Fork
POST
https://api.phalcon.blocksec.com/v1/project/$PROJECT_ID/fork
Create a Fork inside the project specified by $PROJECT_ID
.
Headers
Request
chainId
:Integer
. Following the IDs used in this website.height
: It specifies the block height from which the chain is forked. It accepts the following options.HEX String
- an integer block numberString "safe"
- for the latest safe head block
position
:Integer
. The position in the block (specified byheight
) that the Forked chain starts. Read more about the height and position.name
:String
. The name of the created Fork.`antiReplay`:
Boolean
. It specifies whether the anti-replay feature is enabled for this Fork.
Response
forkId
:String
. The id of the created Fork. This id is used to manipulate a Fork (e.g., delete a Fork).chainId
:Integer
. The id of the chain that is forked. It should be the same as thechainId
passed in the request.name
:String
. The name of the Fork. It should be the same as thename
passed in the request.snapshotId
:String
. The ID of the default snapshot of this Fork.rpc
:String
. The RPC of this Fork.
Delete a Fork
DELETE
https://api.phalcon.blocksec.com/v1/project/$PROJECT_ID/fork/$FORK_ID
Delete a Fork
Headers
Request
PROJECT_ID: String
. The ID of the project that contains the Fork is to be deleted.FORK_ID
:String
. The ID of the Fork is to be deleted.
Get Fork List
GET
https://api.phalcon.blocksec.com/v1/project/$PROJECT_ID/forks
Get a list of Forks inside the project specified by $PROJECT_ID
.
Headers
Request
PROJECT_ID: String
. The ID of the project.
Response
forkId
:String
. The id of the Fork. This ID is used to manipulate a Fork (e.g., delete a Fork).chainId
:Integer
. The id of the chain that is forked. It should be the same as thechainId
passed in the request.name
:String
. The name of the Fork. It should be the same as thename
passed in the request.rpc
:String
. The RPC of this Fork.
Get Fork Information
GET
https://api.phalcon.blocksec.com/v1/project/$PROJECT_ID/fork/$FORK_ID
Given a FORK_ID
, return the Fork information.
Headers
Request
PROJECT_ID: String
. The ID of the project.FORK_ID
:String
. The ID of the Fork.
Response
forkId
:String
. The id of the Fork. This ID is used to manipulate a Fork (e.g., delete a Fork).chainId
:Integer
. The id of the chain that is forked. It should be the same as thechainId
passed in the request.name
:String
. The name of the Fork. It should be the same as thename
passed in the request.rpc
:String
. The RPC of this Fork.
Last updated