diff --git a/NineChronicles.Headless.Executable/Commands/GenesisCommand.cs b/NineChronicles.Headless.Executable/Commands/GenesisCommand.cs index b4653d034..0cac71bde 100644 --- a/NineChronicles.Headless.Executable/Commands/GenesisCommand.cs +++ b/NineChronicles.Headless.Executable/Commands/GenesisCommand.cs @@ -239,7 +239,7 @@ out List pledgeActions [Command(Description = "Mine a new genesis block")] public void Mine( [Argument("CONFIG", Description = "JSON config path to mine genesis block")] - string configPath) + string configPath = "./config.json") { var options = new JsonSerializerOptions { @@ -275,7 +275,7 @@ public void Mine( initialValidators: initialValidatorSet.ToDictionary( item => new PublicKey(ByteUtil.ParseHex(item.PublicKey)), item => new BigInteger(item.Power)), - actionBases: adminMeads.Concat(initialMeads).Concat(initialPledges), + actionBases: adminMeads.Concat(initialMeads).Concat(initialPledges).Concat(GetAdditionalActionBases()), goldCurrency: currency ); @@ -320,6 +320,19 @@ public void Mine( } } + /// + /// Actions to be appended on end of transaction actions. + /// You can add actions code to this method before generate genesis block. + /// + /// + private static List GetAdditionalActionBases() + { + return new List + { + + }; + } + #pragma warning disable S3459 /// /// Game data to set into genesis block. diff --git a/config.schema.json b/config.schema.json index 98532ec38..746da14eb 100644 --- a/config.schema.json +++ b/config.schema.json @@ -6,20 +6,28 @@ "properties": { "data": { "type": "object", + "description": "Game data to set into genesis block.", "properties": { "tablePath": { - "type": "string" + "type": "string", + "description": "A Path of game data table directory." } } }, "currency": { "type": "object", + "description": "Currency related configurations. Set initial minter(Tx signer) and/or initial currency depositions. If not provided, default values will set.", "properties": { + "allowMint": { + "type": "boolean" + }, "initialMinter": { - "type": "string" + "type": "string", + "description": "Private Key of initial currency minter. If not provided, a new private key will be created and used." }, "initialCurrencyDeposit": { "type": "array", + "description": "Initial currency deposition list. If you leave it empty list or even not provide, the `InitialMinter` will get 10000 currency. You can see newly created deposition info in `initial_deposit.csv` file", "items": { "type": "object", "properties": { @@ -42,15 +50,19 @@ }, "admin": { "type": "object", + "description": "Admin related configurations. If not provided, no admin will be set.", "properties": { "activate": { - "type": "boolean" + "type": "boolean", + "description": "Whether active admin address or not." }, "address": { - "type": "string" + "type": "string", + "description": "Address to give admin privilege. If `Activate` is `true` and no `address` provided, the minter will get admin privilege." }, "validUntil": { - "type": "integer" + "type": "integer", + "description": "The block count to persist admin privilege. After this block, admin will no longer be admin." } } },