In the context of adding a new child chain, you probably enabled the new child chain from height 0 and this caused difference in the genesis block generation signature
Thank you, how can I solve this problem
look this picture
Did it means i need a public_key to start up a new childchain( for the genesis blocks)
You must not change the PUBLIC_KEY.json or any other jsons. Just add the 2 JSONs for the balances of your new child chain. You can specify the public keys in the keys of the balance jsons (instead of account IDs). See how it's done for MPG
for the 2.2.6 code of coal ,there is no public_key code above
after we init the DUSD childchain , the error comes out .
if this means the DUSDtestnet.json has some error with the signature?
if we do not init the DUSD childchain ,after delete the database ,it goes well.
the childchain code as below:
public static final ChildChain DUSD = new ChildChainBuilder(7, "DUSD")
.setTotalAmount(100_000_000_000_000000L)
.setPermissionPolicy(CHILD_CHAIN)
.setMasterAdminAccounts(defaultAdminAccounts)
.setTotalAmount(1_000_000_000_00000000L)
.setDisabledTransactionTypes(
ShufflingTransactionType.SHUFFLING_CREATION, DigitalGoodsTransactionType.LISTING,
MonetarySystemTransactionType.CURRENCY_ISSUANCE, MonetarySystemTransactionType.CURRENCY_DELETION,
MonetarySystemTransactionType.CURRENCY_MINTING, MonetarySystemTransactionType.CURRENCY_TRANSFER,
MonetarySystemTransactionType.PUBLISH_EXCHANGE_OFFER, MonetarySystemTransactionType.EXCHANGE_BUY,
MonetarySystemTransactionType.EXCHANGE_SELL, MonetarySystemTransactionType.RESERVE_INCREASE,
MonetarySystemTransactionType.RESERVE_CLAIM, TaggedDataTransactionType.TAGGED_DATA_UPLOAD,
AliasTransactionType.ALIAS_ASSIGNMENT)
.setDisabledAPITags(APITag.SHUFFLING, APITag.DGS, APITag.MS, APITag.DATA, APITag.ALIASES)
.setIsEnabled(() -> Nxt.getBlockchain().getHeight() >= 145645)
.build();
it happened from here,
delete database means the genesisblock should be added
the UST is ok, but DUSD which we added will get errors
As I said earlier the problem with the generation signature is that you are loading the DUSD chain at height 0. You must enable it after some height in the future. I see you try this
.setIsEnabled(() -> Nxt.getBlockchain().getHeight() >= 145645)
Not sure how it compiles because in Ardor 2.2.6 there is no setIsEnabled
method. Probably you have some additional changes over 2.2.6? Here is how MPG is enabled there:
@Override
public boolean isEnabled() {
return Nxt.getBlockchain().getHeight() >= Constants.MPG_BLOCK;
}
Debug why childChain.isEnabled()
returns true
in Genesis.importBalances
we use this, but the childchain build not happend(when height is more than 145645)
.setIsEnabled(() -> Nxt.getBlockchain().getHeight() >= 145645)
but below will happed
.setIsEnabled(() -> Nxt.getBlockchain().getHeight() >= 0)
we checked about isEnabled() function
ardor and coal is the same
private ChildChainBuilder setIsEnabled(BooleanSupplier isEnabled) {
this.isEnabled = isEnabled;
return this;
}
Is the source of this generationSignature provided by you?
Do I need to modify the generationSignature to add a child chain?
No, if you change the generation signature you will create a new blockchain which is incompatible with current coalculus
as you said we should not modified the signature, can we modifiled not to verify?
we found the testnet.json only used in the start after we delete database, it will never used after it
No. What you must do is to make sure isEnabled of your new child chain returns false during the genesis apply.
More generally: Genesis.apply
must do exactly the same operations after your changes like before your changes. Check why this is not happening. If it's doing the same operations you will not get "invalid generation signature"
we found there is no code for the childchain or hardfork .
can you give the functions on your ardor code which you suggest will happened when childchain changes to enabled?
I don't understand your question
It is not trivial to add another child chain without also upgrading to the latest Ardor version. Upgrading is a complicated task which is better done by us. So the Jelurida management will send a proposal to Coalculus.