@@ -476,6 +476,57 @@ func genServerConfig(cfg *Config, cfgLogger btclog.Logger,
476
476
return nil , err
477
477
}
478
478
479
+ auxLeafSigner := tapchannel .NewAuxLeafSigner (
480
+ & tapchannel.LeafSignerConfig {
481
+ ChainParams : & tapChainParams ,
482
+ Signer : assetWallet ,
483
+ },
484
+ )
485
+ channelFunder := tap .NewLndPbstChannelFunder (lndServices )
486
+
487
+ // Parse the universe public access status.
488
+ universePublicAccess , err := tap .ParseUniversePublicAccessStatus (
489
+ cfg .Universe .PublicAccess ,
490
+ )
491
+ if err != nil {
492
+ return nil , fmt .Errorf ("unable to parse universe public " +
493
+ "access status: %w" , err )
494
+ }
495
+
496
+ // Construct the supply commit manager, which is used to
497
+ // formulate universe supply commitment transactions.
498
+ //
499
+ // Construct database backends for the supply commitment state machines.
500
+ supplyCommitDb := tapdb .NewTransactionExecutor (
501
+ db , func (tx * sql.Tx ) tapdb.SupplyCommitStore {
502
+ return db .WithTx (tx )
503
+ },
504
+ )
505
+ supplyCommitStore := tapdb .NewSupplyCommitMachine (supplyCommitDb )
506
+
507
+ // Construct the supply tree database backend.
508
+ supplyTreeDb := tapdb .NewTransactionExecutor (
509
+ db , func (tx * sql.Tx ) tapdb.BaseUniverseStore {
510
+ return db .WithTx (tx )
511
+ },
512
+ )
513
+ supplyTreeStore := tapdb .NewSupplyTreeStore (supplyTreeDb )
514
+
515
+ // Create the supply commitment state machine manager, which is used to
516
+ // manage the supply commitment state machines for each asset group.
517
+ supplyCommitManager := supplycommit .NewMultiStateMachineManager (
518
+ supplycommit.MultiStateMachineManagerCfg {
519
+ TreeView : supplyTreeStore ,
520
+ Commitments : supplyCommitStore ,
521
+ Wallet : walletAnchor ,
522
+ KeyRing : keyRing ,
523
+ Chain : chainBridge ,
524
+ DaemonAdapters : lndFsmDaemonAdapters ,
525
+ StateLog : supplyCommitStore ,
526
+ ChainParams : * tapChainParams .Params ,
527
+ },
528
+ )
529
+
479
530
// For the porter, we'll make a multi-notifier comprised of all the
480
531
// possible proof file sources to ensure it can always fetch input
481
532
// proofs.
@@ -499,16 +550,11 @@ func genServerConfig(cfg *Config, cfgLogger btclog.Logger,
499
550
ProofCourierDispatcher : proofCourierDispatcher ,
500
551
ProofWatcher : reOrgWatcher ,
501
552
ErrChan : mainErrChan ,
553
+ BurnCommitter : supplyCommitManager ,
554
+ DelegationKeyChecker : addrBook ,
502
555
},
503
556
)
504
557
505
- auxLeafSigner := tapchannel .NewAuxLeafSigner (
506
- & tapchannel.LeafSignerConfig {
507
- ChainParams : & tapChainParams ,
508
- Signer : assetWallet ,
509
- },
510
- )
511
- channelFunder := lndservices .NewLndPbstChannelFunder (lndServices )
512
558
auxFundingController := tapchannel .NewFundingController (
513
559
tapchannel.FundingControllerCfg {
514
560
HeaderVerifier : headerVerifier ,
@@ -580,49 +626,6 @@ func genServerConfig(cfg *Config, cfgLogger btclog.Logger,
580
626
},
581
627
)
582
628
583
- // Parse the universe public access status.
584
- universePublicAccess , err := tap .ParseUniversePublicAccessStatus (
585
- cfg .Universe .PublicAccess ,
586
- )
587
- if err != nil {
588
- return nil , fmt .Errorf ("unable to parse universe public " +
589
- "access status: %w" , err )
590
- }
591
-
592
- // Construct the supply commit manager, which is used to
593
- // formulate universe supply commitment transactions.
594
- //
595
- // Construct database backends for the supply commitment state machines.
596
- supplyCommitDb := tapdb .NewTransactionExecutor (
597
- db , func (tx * sql.Tx ) tapdb.SupplyCommitStore {
598
- return db .WithTx (tx )
599
- },
600
- )
601
- supplyCommitStore := tapdb .NewSupplyCommitMachine (supplyCommitDb )
602
-
603
- // Construct the supply tree database backend.
604
- supplyTreeDb := tapdb .NewTransactionExecutor (
605
- db , func (tx * sql.Tx ) tapdb.BaseUniverseStore {
606
- return db .WithTx (tx )
607
- },
608
- )
609
- supplyTreeStore := tapdb .NewSupplyTreeStore (supplyTreeDb )
610
-
611
- // Create the supply commitment state machine manager, which is used to
612
- // manage the supply commitment state machines for each asset group.
613
- supplyCommitManager := supplycommit .NewMultiStateMachineManager (
614
- supplycommit.MultiStateMachineManagerCfg {
615
- TreeView : supplyTreeStore ,
616
- Commitments : supplyCommitStore ,
617
- Wallet : walletAnchor ,
618
- KeyRing : keyRing ,
619
- Chain : chainBridge ,
620
- DaemonAdapters : lndFsmDaemonAdapters ,
621
- StateLog : supplyCommitStore ,
622
- ChainParams : * tapChainParams .Params ,
623
- },
624
- )
625
-
626
629
return & tap.Config {
627
630
DebugLevel : cfg .DebugLevel ,
628
631
RuntimeID : runtimeID ,
@@ -644,6 +647,8 @@ func genServerConfig(cfg *Config, cfgLogger btclog.Logger,
644
647
Universe : universeFederation ,
645
648
ProofWatcher : reOrgWatcher ,
646
649
UniversePushBatchSize : defaultUniverseSyncBatchSize ,
650
+ MintCommitter : supplyCommitManager ,
651
+ DelegationKeyChecker : addrBook ,
647
652
},
648
653
ChainParams : tapChainParams ,
649
654
ProofUpdates : proofArchive ,
0 commit comments