Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/FSLibrary/FSLibrary.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
<Compile Include="MissionMaxTPSMixed.fs" />
<Compile Include="MissionUpgradeSCPSettings.fs" />
<Compile Include="MissionUpgradeTxClusters.fs" />
<Compile Include="MissionValidatorSetup.fs" />
<Compile Include="StellarMission.fs" />
</ItemGroup>
<ItemGroup>
Expand Down
55 changes: 55 additions & 0 deletions src/FSLibrary/MissionValidatorSetup.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
// Copyright 2019 Stellar Development Foundation and contributors. Licensed
// under the Apache License, Version 2.0. See the COPYING file at the root
// of this distribution or at http://www.apache.org/licenses/LICENSE-2.0

module MissionValidatorSetup

open StellarCoreSet
open StellarCorePeer
open StellarMissionContext
open StellarSupercluster
open StellarFormation
open StellarStatefulSets
open StellarCoreHTTP

// This mission creates a network with validator configurations that closely
// mirror how tier 1 validators are actually configured. It uses both Postgres
// and has history archives enabled. This is a smoke test that spins up the
// network, runs for ~70 ledgers with load generation, verifies history
// publishing works, then spins it down.
let validatorSetup (context: MissionContext) =
let opts =
{ CoreSetOptions.GetDefault context.image with
dbType = Postgres
// Use disk-backed storage like production validators
emptyDirType = DiskBackedEmptyDir
localHistory = true
accelerateTime = true
// Enable maintenance like production validators
performMaintenance = true }

let coreSet = MakeLiveCoreSet "core" opts

let context =
{ context with
numAccounts = 200
genesisTestAccountCount = Some(200)
numTxs = 500
txRate = 10 }

context.Execute
[ coreSet ]
None
(fun (formation: StellarFormation) ->
formation.WaitUntilSynced [ coreSet ]
formation.UpgradeProtocolToLatest [ coreSet ]

// Run load generation to ensure blocks aren't empty
formation.RunLoadgen coreSet context.GeneratePaymentLoad

// Wait for a few more ledgers to ensure publishing happens
let peer = formation.NetworkCfg.GetPeer coreSet 0
peer.WaitForFewLedgers 20

if (peer.GetMetrics().HistoryPublishSuccess.Count = 0) then
failwith "history.publish.success is 0, expected > 0")
4 changes: 3 additions & 1 deletion src/FSLibrary/StellarMission.fs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ open MissionPubnetNetworkLimitsBench
open MissionMixedNominationLeaderElection
open MissionUpgradeSCPSettings
open MissionUpgradeTxClusters
open MissionValidatorSetup

type Mission = (MissionContext -> unit)

Expand Down Expand Up @@ -95,4 +96,5 @@ let allMissions : Map<string, Mission> =
("MixedNominationLeaderElectionWithOldMajority", mixedNominationLeaderElectionWithOldMajority)
("MixedNominationLeaderElectionWithNewMajority", mixedNominationLeaderElectionWithNewMajority)
("UpgradeSCPSettings", upgradeSCPSettings)
("UpgradeTxClusters", upgradeTxClusters) |]
("UpgradeTxClusters", upgradeTxClusters)
("ValidatorSetup", validatorSetup) |]