pnscan-cloud is the fork of 9cscan-cloud from tx0x. 9cscan-cloud is the serverless backend of 9cscan, most popular block explorer for Nine Chronicles
pnscan and pnscan-cloud's have same purpose (i.e., block explorer for the network built by Libplanet), but it has been elimiated Nine Chronicles-specific features and relies APIs provided by Libplanet.Explorer
only, to suggest the reference block explorer implementation for production.
At this moment, it assumes PlanetNode as target implementation. but since relying only Libplanet.Explorer
API, it can be compatible with any other chain using that APIs (even Nine Chronicles).
[APIGateway] -> [Lambda] -> [Dynamodb]
Provides a rest API that can inquire blocks and transactions.
[EventBridge] -> [StepFunction] -> [Lambda] -> [Dynamodb]
Synchronize the Nine Chronicles chain data to dynamodb.
[DynamoStream] -> [Lambda] -> [APIGateway]
When a new block is created, it is broadcast through WebSocket.
/bootstrap/iam/policy.json
https://console.aws.amazon.com/iamv2/home#/policies/bootstrap/iam/role-trust.json
https://console.aws.amazon.com/iamv2/home#/rolesnpm install
{
// Required.
"region": "ap-northeast-2",
// Required. AccessKey of user you created (1.3)
"credentials": {
"accessKeyId": "",
"secretAccessKey": ""
},
// Required. Arn of role you created (1.2)
"iamRoleArn": "",
//Required. PlanetNode graphql endpoints
"graphqlEndpoints": [
"http://your-host1/graphql/",
"http://your-host2/graphql/"
],
//Required.
"namespace": "prod",
//Required.
"s3WebBucketName": "pnscan-bucket"
}
npm run create-s3
------------------------------
SUCCESS : https://your-s3-endpoint/index.html
Before proceeding, make sure that the endpoint is working.
npm run create-db
------------------------------
Dynamodb : create table Prod.Account
SUCCESS : Prod.Account : arn:aws:dynamodb
Dynamodb : create table Prod.AccountTransaction
SUCCESS : Prod.AccountTransaction : arn:aws:dynamodb
Dynamodb : create table Prod.Action
SUCCESS : Prod.Action : arn:aws:dynamodb
Dynamodb : create table Prod.Block
SUCCESS : Prod.Block : arn:aws:dynamodb
Dynamodb : create table Prod.Cache
SUCCESS : Prod.Cache : arn:aws:dynamodb
Dynamodb : create table Prod.LatestBlocks
SUCCESS : Prod.LatestBlocks : arn:aws:dynamodb
Dynamodb : create table Prod.Transaction
SUCCESS : Prod.Transaction : arn:aws:dynamodb
Dynamodb : create table Prod.WebsocketConnection
SUCCESS : Prod.WebsocketConnection : arn:aws:dynamodb
npm run create-api
npm run create-sync
npm run create-ws
npm run deploy-api
npm run deploy-sync
npm run deploy-ws
npm run check-api
...
GET /blocks api response
...
npm run check-ws
...
Subscribe new block event
...
npm run check-s3
...
Get index.html
...
For the web client, use the following project:
https://github.com/planetarium/pnscan-frontend
Apache 2.0