๐ก This article was written based on Nine Chronicles version v100290[1].
This article expects you to read [this][./playing-the-nine-chronicles-main-network-with-the-unity-editor] already and be ready to play Nine Chronicle with the Unity Editor.
How to run a local network โ
Configure clo.json โ
path: /nekoyume/Assets/StreamingAssets/clo.json
json{ "GenesisBlockPath": "https://download.nine-chronicles.com/genesis-block-9c-main", "NoMiner": false, "RpcClient": false }
Now, you can run a local network within the Unity editor. Click the โถ๏ธ button.
A few things to note โ
Blockchain compatibility โ
The local network blockchain is not compatible with the main network blockchain. Your play data will not be available on the local chain.
Transaction Propagation โ
The local node without RPC connections doesnโt propagate transactions.
Unity editor mode play โ
There are many benefits to creating a new character in the Unity editor mode.
- All stages of the worlds have been cleared.
- All equipments, materials and costumes already obtained.
- Additional customization is possible.
Create and use a new genesis block โ
There is a โGenesisBlockPathโ option on clo.json
file. Now weโll create a new genesis block and use it in clo.json
.
Create a new genesis block โ
Without blockchain initialization โ
Click
Tools/Libplanet/Make Genesis Block
menu.Choose path to export the new genesis block.
It should be in the
StreamingAssets
folder with the namegenesis-block
.Then you can find the
genesis-block
file in theStreamingAssets
folder.
With blockchain initialization โ
Just click Tools/Libplanet/Delete All(Editor)...
menu.
Remove the โGenesisBlockPathโ option in clo.json
file โ
If you remove the โGenesisBlockPathโ option like below, the initialization logic will load the genesis block from /nekoyume/Assets/StreamingAssets/genesis-block
.
{
"NoMiner": false,
"RpcClient": false
}
Tip: Modify any sheet data โ
There are many sheet data as csv file. These sheets are applied when creating a new genesis block. In other words, the sheet data included in the genesis block can be modified.
Modify max amount of action point(a.k.a. AP) โ
Open
GameConfigSheet.csv
file.path:
/nekoyume/Assets/_Scripts/Lib9c/lib9c/Lib9c/TableCSV/GameConfigSheet.csv
And you can see like below.
csvkey,value ... action_point_max,120 ...
Modify the
action_point_max
value(120) to 200.csvkey,value ... action_point_max,200 ...
Create a new genesis block again.
Ref here.
Conclusion โ
So far, I have introduced how to play Nine Chronicles local network in the Unity editor and edit the Genesis block and sheet data. Iโve introduced the basis for the more complex tasks I use in almost every situation, such as developing and debugging features on a planetarium. Creating a virtual blockchain state and replaying the desired scenario on the client is hugely useful for development. Now, letโs knead the blockchain with more complex manipulations. Although, of course, it is limited to the local network.๐