@@ -23,6 +23,7 @@ module Testnet.Defaults
23
23
, defaultDelegatorStakeKeyPair
24
24
, defaultNodeName
25
25
, defaultNodeDataDir
26
+ , defaultP2PTopology
26
27
, defaultSpoColdKeyPair
27
28
, defaultSpoColdVKeyFp
28
29
, defaultSpoColdSKeyFp
@@ -56,8 +57,19 @@ import qualified Cardano.Ledger.Core as Ledger
56
57
import qualified Cardano.Ledger.Plutus as Ledger
57
58
import qualified Cardano.Ledger.Shelley as Ledger
58
59
import Cardano.Ledger.Shelley.Genesis
59
- import Cardano.Node.Configuration.Topology
60
+ import Cardano.Network.PeerSelection.Bootstrap (UseBootstrapPeers (.. ))
61
+ import Cardano.Network.PeerSelection.PeerTrustable (PeerTrustable (.. ))
62
+ import qualified Cardano.Node.Configuration.Topology as Topology
63
+ import Cardano.Node.Configuration.Topology (RemoteAddress (.. ))
64
+ import qualified Cardano.Node.Configuration.TopologyP2P as P2P
65
+ import Cardano.Node.Configuration.TopologyP2P (LocalRootPeersGroups (.. ),
66
+ LocalRootPeersGroup (.. ), NetworkTopology (.. ), PublicRootPeers (.. ),
67
+ RootConfig (.. ))
60
68
import Cardano.Tracing.Config
69
+ import Ouroboros.Network.NodeToNode (DiffusionMode (.. ), PeerAdvertise (.. ))
70
+ import Ouroboros.Network.PeerSelection.LedgerPeers.Type (UseLedgerPeers (.. ))
71
+ import Ouroboros.Network.PeerSelection.State.LocalRootPeers (HotValency (.. ),
72
+ WarmValency (.. ))
61
73
62
74
import Prelude
63
75
@@ -428,14 +440,14 @@ mkProtVer (majorProtVer, minorProtVer) =
428
440
ppProtocolVersionL' :: Lens' (PParams Ledger. ShelleyEra ) ProtVer
429
441
ppProtocolVersionL' = Ledger. ppLens . Ledger. hkdProtocolVersionL @ Ledger. ShelleyEra @ Identity
430
442
431
- defaultMainnetTopology :: NetworkTopology RemoteAddress
443
+ defaultMainnetTopology :: Topology. NetworkTopology RemoteAddress
432
444
defaultMainnetTopology =
433
445
let single = RemoteAddress
434
446
{ raAddress = " relays-new.cardano-mainnet.iohk.io"
435
447
, raPort = 3_001
436
448
, raValency = 2
437
449
}
438
- in RealNodeTopology [single]
450
+ in Topology. RealNodeTopology [single]
439
451
440
452
defaultGenesisFilepath :: CardanoEra a -> FilePath
441
453
defaultGenesisFilepath era =
@@ -557,3 +569,30 @@ plutusV2StakeScript :: Text
557
569
plutusV2StakeScript =
558
570
"{ \"type\": \"PlutusScriptV2\", \"description\": \"\", \"cborHex\": \"5907655907620100003232323232323232323232323232332232323232322232325335320193333573466e1cd55cea80124000466442466002006004646464646464646464646464646666ae68cdc39aab9d500c480008cccccccccccc88888888888848cccccccccccc00403403002c02802402001c01801401000c008cd4050054d5d0a80619a80a00a9aba1500b33501401635742a014666aa030eb9405cd5d0a804999aa80c3ae501735742a01066a02803e6ae85401cccd54060081d69aba150063232323333573466e1cd55cea801240004664424660020060046464646666ae68cdc39aab9d5002480008cc8848cc00400c008cd40a9d69aba15002302b357426ae8940088c98c80b4cd5ce01701681589aab9e5001137540026ae854008c8c8c8cccd5cd19b8735573aa004900011991091980080180119a8153ad35742a00460566ae84d5d1280111931901699ab9c02e02d02b135573ca00226ea8004d5d09aba2500223263202933573805405204e26aae7940044dd50009aba1500533501475c6ae854010ccd540600708004d5d0a801999aa80c3ae200135742a004603c6ae84d5d1280111931901299ab9c026025023135744a00226ae8940044d5d1280089aba25001135744a00226ae8940044d5d1280089aba25001135744a00226ae8940044d55cf280089baa00135742a004601c6ae84d5d1280111931900b99ab9c018017015101613263201633573892010350543500016135573ca00226ea800448c88c008dd6000990009aa80a911999aab9f0012500a233500930043574200460066ae880080508c8c8cccd5cd19b8735573aa004900011991091980080180118061aba150023005357426ae8940088c98c8050cd5ce00a80a00909aab9e5001137540024646464646666ae68cdc39aab9d5004480008cccc888848cccc00401401000c008c8c8c8cccd5cd19b8735573aa0049000119910919800801801180a9aba1500233500f014357426ae8940088c98c8064cd5ce00d00c80b89aab9e5001137540026ae854010ccd54021d728039aba150033232323333573466e1d4005200423212223002004357426aae79400c8cccd5cd19b875002480088c84888c004010dd71aba135573ca00846666ae68cdc3a801a400042444006464c6403666ae7007006c06406005c4d55cea80089baa00135742a00466a016eb8d5d09aba2500223263201533573802c02a02626ae8940044d5d1280089aab9e500113754002266aa002eb9d6889119118011bab00132001355012223233335573e0044a010466a00e66442466002006004600c6aae754008c014d55cf280118021aba200301213574200222440042442446600200800624464646666ae68cdc3a800a40004642446004006600a6ae84d55cf280191999ab9a3370ea0049001109100091931900819ab9c01101000e00d135573aa00226ea80048c8c8cccd5cd19b875001480188c848888c010014c01cd5d09aab9e500323333573466e1d400920042321222230020053009357426aae7940108cccd5cd19b875003480088c848888c004014c01cd5d09aab9e500523333573466e1d40112000232122223003005375c6ae84d55cf280311931900819ab9c01101000e00d00c00b135573aa00226ea80048c8c8cccd5cd19b8735573aa004900011991091980080180118029aba15002375a6ae84d5d1280111931900619ab9c00d00c00a135573ca00226ea80048c8cccd5cd19b8735573aa002900011bae357426aae7940088c98c8028cd5ce00580500409baa001232323232323333573466e1d4005200c21222222200323333573466e1d4009200a21222222200423333573466e1d400d2008233221222222233001009008375c6ae854014dd69aba135744a00a46666ae68cdc3a8022400c4664424444444660040120106eb8d5d0a8039bae357426ae89401c8cccd5cd19b875005480108cc8848888888cc018024020c030d5d0a8049bae357426ae8940248cccd5cd19b875006480088c848888888c01c020c034d5d09aab9e500b23333573466e1d401d2000232122222223005008300e357426aae7940308c98c804ccd5ce00a00980880800780700680600589aab9d5004135573ca00626aae7940084d55cf280089baa0012323232323333573466e1d400520022333222122333001005004003375a6ae854010dd69aba15003375a6ae84d5d1280191999ab9a3370ea0049000119091180100198041aba135573ca00c464c6401866ae700340300280244d55cea80189aba25001135573ca00226ea80048c8c8cccd5cd19b875001480088c8488c00400cdd71aba135573ca00646666ae68cdc3a8012400046424460040066eb8d5d09aab9e500423263200933573801401200e00c26aae7540044dd500089119191999ab9a3370ea00290021091100091999ab9a3370ea00490011190911180180218031aba135573ca00846666ae68cdc3a801a400042444004464c6401466ae7002c02802001c0184d55cea80089baa0012323333573466e1d40052002200723333573466e1d40092000212200123263200633573800e00c00800626aae74dd5000a4c2400292010350543100122002112323001001223300330020020011\" }"
559
571
572
+ defaultP2PTopology :: [adr ] -> P2P. NetworkTopology adr
573
+ defaultP2PTopology addresses = P2P. RealNodeTopology
574
+ { ntLocalRootPeersGroups = LocalRootPeersGroups
575
+ { groups = [
576
+ LocalRootPeersGroup
577
+ { localRoots = RootConfig
578
+ { rootAccessPoints = addresses
579
+ , rootAdvertise = DoNotAdvertisePeer
580
+ }
581
+ , hotValency = HotValency 1
582
+ , warmValency = WarmValency 1
583
+ , trustable = IsTrustable
584
+ , rootDiffusionMode = InitiatorAndResponderDiffusionMode
585
+ }
586
+ ]
587
+ }
588
+ , ntPublicRootPeers =
589
+ [ PublicRootPeers
590
+ RootConfig
591
+ { rootAccessPoints = []
592
+ , rootAdvertise = DoNotAdvertisePeer
593
+ }
594
+ ]
595
+ , ntUseLedgerPeers = DontUseLedgerPeers
596
+ , ntUseBootstrapPeers = DontUseBootstrapPeers
597
+ , ntPeerSnapshotPath = Nothing
598
+ }
0 commit comments