pub struct CreateBacktestSessionRequestV1 {
pub request: CreateSessionParams,
pub parallel: bool,
pub name: Option<String>,
pub create_token: Option<CreateToken>,
}Expand description
The params of createBacktestSession when you name the session or split it into parallel
sessions. The CreateSessionParams fields sit at the same level as these.
use simulator_api::{
BacktestRequest, CreateBacktestSessionRequestV1, CreateSessionParams,
session_name::CreateToken,
};
let request = CreateBacktestSessionRequestV1 {
request: CreateSessionParams::builder()
.start_slot(380_000_000)
.end_slot(380_000_099)
.send_summary(true)
.capacity_wait_timeout_secs(900)
.disconnect_timeout_secs(300)
.build(),
parallel: false,
name: Some("sol-usdc-baseline".to_string()),
// Keep this request: resending it after a reconnect reclaims the name.
create_token: Some(CreateToken::random()),
};
let message = serde_json::to_string(&BacktestRequest::CreateBacktestSession(request.into()))?;Fields§
§request: CreateSessionParamsThe session parameters, flattened into this object on the wire.
parallel: boolSplit the range into one session per available bundle and run them in parallel, as
split_range splits it. The server replies sessionsCreatedV2. Default false.
name: Option<String>The session’s name, or the whole parallel run’s when parallel is set; the server picks one
when unset. 1 to 100 letters, digits, -, _ or ., starting and ending with a letter
or digit. Case-insensitive: it is stored lowercased. Names are never reused, so a taken
one fails with BacktestError::SessionNameTaken. See
SessionName.
create_token: Option<CreateToken>Wire name createToken. Identifies this create request, so resending the same request
after a reconnect reclaims its name instead of failing with
BacktestError::SessionNameTaken. Make one with
CreateToken::random and reuse it only for
resends of this request.