diff --git a/src/Stratis.CirrusDnsD/Program.cs b/src/Stratis.CirrusDnsD/Program.cs index 4ec582b0f1..b3a5fc1d2f 100644 --- a/src/Stratis.CirrusDnsD/Program.cs +++ b/src/Stratis.CirrusDnsD/Program.cs @@ -4,6 +4,7 @@ using Stratis.Bitcoin; using Stratis.Bitcoin.Builder; using Stratis.Bitcoin.Configuration; +using Stratis.Bitcoin.Consensus; using Stratis.Bitcoin.Features.Api; using Stratis.Bitcoin.Features.BlockStore; using Stratis.Bitcoin.Features.Dns; @@ -12,8 +13,10 @@ using Stratis.Bitcoin.Features.SmartContracts; using Stratis.Bitcoin.Features.SmartContracts.PoA; using Stratis.Bitcoin.Features.SmartContracts.Wallet; +using Stratis.Bitcoin.Networks; using Stratis.Bitcoin.Utilities; using Stratis.Features.Collateral; +using Stratis.Features.Collateral.CounterChain; using Stratis.Features.SQLiteWalletRepository; using Stratis.Sidechains.Networks; @@ -67,9 +70,11 @@ public static async Task Main(string[] args) private static IFullNode GetSideChainFullNode(NodeSettings nodeSettings) { - IFullNode node = new FullNodeBuilder() - .UseNodeSettings(nodeSettings) - .UseBlockStore() + DbType dbType = nodeSettings.GetDbType(); + + IFullNodeBuilder nodeBuilder = new FullNodeBuilder() + .UseNodeSettings(nodeSettings, dbType) + .UseBlockStore(dbType) .UseMempool() .AddSmartContracts(options => { @@ -77,16 +82,20 @@ private static IFullNode GetSideChainFullNode(NodeSettings nodeSettings) options.UsePoAWhitelistedContracts(); }) .AddPoAFeature() - .UsePoAConsensus() + .UsePoAConsensus(dbType) .CheckCollateralCommitment() + + // This needs to be set so that we can check the magic bytes during the Strat to Strax changeover. + // Perhaps we can introduce a block height check rather? + .SetCounterChainNetwork(StraxNetwork.MainChainNetworks[nodeSettings.Network.NetworkType]()) + .UseSmartContractWallet() .AddSQLiteWalletRepository() .UseApi() .AddRPC() - .UseDns() - .Build(); + .UseDns(); - return node; + return nodeBuilder.Build(); } private static IFullNode GetDnsNode(NodeSettings nodeSettings) diff --git a/src/Stratis.CirrusDnsD/Stratis.CirrusDnsD.csproj b/src/Stratis.CirrusDnsD/Stratis.CirrusDnsD.csproj index fd8778f4db..dc3e303e15 100644 --- a/src/Stratis.CirrusDnsD/Stratis.CirrusDnsD.csproj +++ b/src/Stratis.CirrusDnsD/Stratis.CirrusDnsD.csproj @@ -23,6 +23,7 @@ +