Documentation
¶
Index ¶
- Constants
- Variables
- func Execute() error
- func FixGoModDependencies(verbose bool) error
- func FixMissingCacheDir(verbose bool) error
- func FixProtocolRegistration(verbose bool) error
- func FixSimulatorBinary(verbose bool) error
- func FriendlyPath(path string) string
- func GetCurrentSession() *session.Data
- func IsCancellation(err error) bool
- func IsInterrupted(err error) bool
- func NewDebugCommand(runner simulator.RunnerInterface) *cobra.Command
- func SetCurrentSession(data *session.Data)
- func Verify(log *AuditLog) error
- func VerifyAuditLog(auditLog *AuditLog) (bool, error)
- type AttestationCertificate
- type AuditLog
- type DebugCommand
- type DependencyID
- type DependencyStatus
- type GenerateOptions
- type HardwareAttestation
- type OverrideData
- type Payload
- type ProtocolCheckResult
- type SignedAuditLog
- type VersionInfo
Constants ¶
const ( DirTransactions = "transactions" DirProtocols = "protocols" DirContracts = "contracts" )
const InterruptExitCode = 130
Variables ¶
var ( TimestampFlag int64 WindowFlag int64 ProfileFlag bool ProfileFormatFlag string DeepLinkFlag string VersionFlag bool )
Global flag variables
var ErrInterrupted = stderrors.New("interrupt received")
Functions ¶
func Execute ¶
func Execute() error
Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.
func FixGoModDependencies ¶
FixGoModDependencies runs go mod tidy and go mod download FIXED: Isolated test mode to avoid modifying repo (Issue #4)
func FixMissingCacheDir ¶
FixMissingCacheDir creates the cache directory structure FIXED: Uses isolated temp dir in tests instead of real home (Issue #2)
func FixProtocolRegistration ¶
FixProtocolRegistration initializes protocol registry FIXED: Only creates file when missing; doesn't overwrite existing (Issue #10)
func FixSimulatorBinary ¶
FixSimulatorBinary attempts to build the Soroban simulator FIXED: Handles Windows .exe suffix (Issue #1)
func FriendlyPath ¶
FriendlyPath replaces the user's home directory with ~ for better readability
func GetCurrentSession ¶
GetCurrentSession returns the active session if any
func IsCancellation ¶
func IsInterrupted ¶
func NewDebugCommand ¶
func NewDebugCommand(runner simulator.RunnerInterface) *cobra.Command
NewDebugCommand creates a new debug command with dependencies
func SetCurrentSession ¶
SetCurrentSession stores the active session for later saving
func VerifyAuditLog ¶
VerifyAuditLog verifies the integrity and signature of an AuditLog. It returns true if both the hash and signature are valid.
Types ¶
type AttestationCertificate ¶
type AttestationCertificate struct {
PEM string `json:"pem"`
Subject string `json:"subject"`
Issuer string `json:"issuer"`
Serial string `json:"serial"`
}
AttestationCertificate represents a single X.509 certificate in the hardware attestation chain. Certificates are ordered leaf-to-root.
type AuditLog ¶
type AuditLog struct {
Version string `json:"version"`
Timestamp time.Time `json:"timestamp"`
TransactionHash string `json:"transaction_hash"`
TraceHash string `json:"trace_hash"`
Signature string `json:"signature"`
PublicKey string `json:"public_key"`
Payload Payload `json:"payload"`
HardwareAttestation *HardwareAttestation `json:"hardware_attestation,omitempty"`
}
AuditLog represents the signed audit trail of a transaction simulation
func Generate
deprecated
func Generate(txHash string, envelopeXdr, resultMetaXdr string, events, logs []string, privateKeyHex string, opts *GenerateOptions) (*AuditLog, error)
Generate creates a signed audit log from the simulation results. If opts is non-nil and contains a HardwareAttestation, the attestation chain is embedded and covered by the signature.
Deprecated: prefer GenerateWithSigner which accepts an explicit signer.Signer implementation. This wrapper creates a temporary InMemorySigner from the hex key for backward compatibility.
func GenerateWithSigner ¶
func GenerateWithSigner(txHash string, envelopeXdr, resultMetaXdr string, events, logs []string, s signer.Signer, opts *GenerateOptions) (*AuditLog, error)
GenerateWithSigner creates a signed audit log using the provided Signer implementation. The signer may be an InMemorySigner or a Pkcs11Signer; the private key material is never accessed directly.
type DebugCommand ¶
type DebugCommand struct {
Runner simulator.RunnerInterface
}
DebugCommand holds dependencies for the debug command
type DependencyID ¶
type DependencyID string
DependencyID is a unique identifier for each dependency (Issue #8: type-safe dispatch)
const ( DepGo DependencyID = "go" DepRust DependencyID = "rust" DepCargo DependencyID = "cargo" DepSimulator DependencyID = "simulator" DepCacheDir DependencyID = "cache_dir" DepProtocolRegistry DependencyID = "protocol_registry" DepGoModDependencies DependencyID = "go_mod_dependencies" DepConfigTOML DependencyID = "toml_config" DepRPC DependencyID = "rpc" )
type DependencyStatus ¶
type GenerateOptions ¶
type GenerateOptions struct {
// HardwareAttestation, if non-nil, will be embedded in the signed
// audit log. The attestation data is included in the hash to prevent
// post-signing removal or substitution.
HardwareAttestation *HardwareAttestation
}
GenerateOptions controls optional audit generation behavior
type HardwareAttestation ¶
type HardwareAttestation struct {
Certificates []AttestationCertificate `json:"certificates"`
TokenInfo string `json:"token_info"`
KeyNonExportable bool `json:"key_non_exportable"`
RetrievedAt string `json:"retrieved_at"`
}
HardwareAttestation contains the full attestation chain retrieved from an HSM or hardware security token. When present in an AuditLog it provides cryptographic proof that the signing key resides on a hardware device and is non-exportable.
type OverrideData ¶
type Payload ¶
type Payload struct {
EnvelopeXdr string `json:"envelope_xdr"`
ResultMetaXdr string `json:"result_meta_xdr"`
Events []string `json:"events"`
Logs []string `json:"logs"`
}
Payload contains the actual trace data
type ProtocolCheckResult ¶
ProtocolCheckResult holds the outcome of a protocol registration check.
type SignedAuditLog ¶
Source Files
¶
- abi.go
- audit.go
- audit_sign.go
- auth_debug.go
- cache.go
- canonical.go
- compare.go
- completion.go
- completion_helpers.go
- daemon.go
- dce.go
- debug.go
- doctor.go
- doctor_fixers.go
- dry_run.go
- explain.go
- export.go
- fuzz.go
- init.go
- interrupt.go
- offline.go
- override.go
- profile.go
- protocol.go
- report.go
- resource_lookup.go
- root.go
- rpc.go
- sandbox.go
- search.go
- session.go
- shell.go
- shutdown_hooks.go
- snapshot_diff.go
- snapshot_memory.go
- stats.go
- status.go
- trace.go
- update.go
- upgrade.go
- verify.go
- version.go
- wasm_optimize.go
- wizard.go
- xdr.go