@@ -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 := lndservices .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.
@@ -500,16 +551,11 @@ func genServerConfig(cfg *Config, cfgLogger btclog.Logger,
500
551
ProofCourierDispatcher : proofCourierDispatcher ,
501
552
ProofWatcher : reOrgWatcher ,
502
553
ErrChan : mainErrChan ,
554
+ BurnCommitter : supplyCommitManager ,
555
+ DelegationKeyChecker : addrBook ,
503
556
},
504
557
)
505
558
506
- auxLeafSigner := tapchannel .NewAuxLeafSigner (
507
- & tapchannel.LeafSignerConfig {
508
- ChainParams : & tapChainParams ,
509
- Signer : assetWallet ,
510
- },
511
- )
512
- channelFunder := lndservices .NewLndPbstChannelFunder (lndServices )
513
559
auxFundingController := tapchannel .NewFundingController (
514
560
tapchannel.FundingControllerCfg {
515
561
HeaderVerifier : headerVerifier ,
@@ -581,49 +627,6 @@ func genServerConfig(cfg *Config, cfgLogger btclog.Logger,
581
627
},
582
628
)
583
629
584
- // Parse the universe public access status.
585
- universePublicAccess , err := tap .ParseUniversePublicAccessStatus (
586
- cfg .Universe .PublicAccess ,
587
- )
588
- if err != nil {
589
- return nil , fmt .Errorf ("unable to parse universe public " +
590
- "access status: %w" , err )
591
- }
592
-
593
- // Construct the supply commit manager, which is used to
594
- // formulate universe supply commitment transactions.
595
- //
596
- // Construct database backends for the supply commitment state machines.
597
- supplyCommitDb := tapdb .NewTransactionExecutor (
598
- db , func (tx * sql.Tx ) tapdb.SupplyCommitStore {
599
- return db .WithTx (tx )
600
- },
601
- )
602
- supplyCommitStore := tapdb .NewSupplyCommitMachine (supplyCommitDb )
603
-
604
- // Construct the supply tree database backend.
605
- supplyTreeDb := tapdb .NewTransactionExecutor (
606
- db , func (tx * sql.Tx ) tapdb.BaseUniverseStore {
607
- return db .WithTx (tx )
608
- },
609
- )
610
- supplyTreeStore := tapdb .NewSupplyTreeStore (supplyTreeDb )
611
-
612
- // Create the supply commitment state machine manager, which is used to
613
- // manage the supply commitment state machines for each asset group.
614
- supplyCommitManager := supplycommit .NewMultiStateMachineManager (
615
- supplycommit.MultiStateMachineManagerCfg {
616
- TreeView : supplyTreeStore ,
617
- Commitments : supplyCommitStore ,
618
- Wallet : walletAnchor ,
619
- KeyRing : keyRing ,
620
- Chain : chainBridge ,
621
- DaemonAdapters : lndFsmDaemonAdapters ,
622
- StateLog : supplyCommitStore ,
623
- ChainParams : * tapChainParams .Params ,
624
- },
625
- )
626
-
627
630
return & tap.Config {
628
631
DebugLevel : cfg .DebugLevel ,
629
632
RuntimeID : runtimeID ,
@@ -645,6 +648,8 @@ func genServerConfig(cfg *Config, cfgLogger btclog.Logger,
645
648
Universe : universeFederation ,
646
649
ProofWatcher : reOrgWatcher ,
647
650
UniversePushBatchSize : defaultUniverseSyncBatchSize ,
651
+ MintSupplyCommitter : supplyCommitManager ,
652
+ DelegationKeyChecker : addrBook ,
648
653
},
649
654
ChainParams : tapChainParams ,
650
655
ProofUpdates : proofArchive ,
0 commit comments