planet-node is a .NET CLI application as example for Libplanet. This application was developed as an example of blockchain node configuration using Libplanet, and is not suitable for production environment operation.
You need to install .NET SDK 6+. Read and follow the instruction to install .NET SDK on the .NET download page.
$ git submodule update --init --recursive
$ dotnet build
TODO: Docker build
$ dotnet run --project PlanetNode
Currently, planet-node produces and uses storage and settings via
appsettings.json
and PN_
prefixed environment variables. if you want to
change settings, please edit that files or set environment variables.
$ PN_StorePath="/tmp/planet-node" dotnet run --project PlanetNode
planet-node runs GraphQL server and GraphQL Playground automatically. (backed by GraphQL.NET) you can check the current chain status on playground. (default endpoint is http://localhost:38080/ui/playground)
The following query is a GraphQL query that returns the last 10 blocks and transactions.
query
{
explorer
{
blockQuery
{
blocks (limit: 10 desc: true)
{
index
hash
timestamp
transactions
{
id
actions
{
inspection
}
}
}
}
}
}
Also, you can find supported GraphQL query in playground as like bellow.
See the Libplanet.Explorer project for more details.
Also, if you want to try scenario based tutorial, please check the TUTORIAL.md
.
If you want to pack this project, use dotnet publish
as below.
$ dotnet publish -c Release --self-contained -r linux-x64
$ ls -al PlanetNode/bin/Release/net6.0/linux-x64/publish/