Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ExtractCmd = &cobra.Command{
Use: "extract",
Short: "Extract chain data to various output formats",
Long: `Extract blockchain data and output it in the specified format.`,
}
View Source
var PostgresCmd = &cobra.Command{ Use: "postgres [address] [flags]", Short: "Extract chain data to a PostgreSQL database", Args: cobra.ExactArgs(1), RunE: PostgresRunE, }
View Source
var PostgresRunE = func(cmd *cobra.Command, args []string) error { extractConfig := config.LoadExtractConfigFromCLI() if err := extractConfig.Validate(); err != nil { return fmt.Errorf("invalid Extract configuration: %w", err) } postgresConfig := config.LoadPostgresConfigFromCLI() if err := postgresConfig.Validate(); err != nil { return fmt.Errorf("invalid PostgreSQL configuration: %w", err) } slog.Debug("Command-line arguments", "extractConfig", extractConfig, "postgresConfig", postgresConfig) _, err := pgxpool.ParseConfig(postgresConfig.ConnString) if err != nil { return fmt.Errorf("failed to parse PostgreSQL connection string: %w", err) } outputHandler, err := postgresql.NewPostgresOutputHandler(postgresConfig.ConnString) if err != nil { return fmt.Errorf("failed to create PostgreSQL output handler: %w", err) } defer outputHandler.Close() return extractor.Extract(args[0], outputHandler, extractConfig) }
View Source
var RootCmd = &cobra.Command{ Use: "yaci", Short: "Extract chain data", Long: `yaci connects to a gRPC server and extracts blockchain data.`, PersistentPreRunE: func(cmd *cobra.Command, args []string) error { logLevel := viper.GetString("logLevel") if err := setLogLevel(logLevel); err != nil { return err } slog.Debug("Application started", "version", Version) return nil }, }
View Source
var Version = "dev"
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.