Skip to content

installers.db.cometbft #

cometbft

To get started



import freeflowuniverse.herolib.installers.db.cometbft as cometbft_installer

heroscript:='
!!cometbft.configure name:'test'
    password: '1234'
    port: 7701

!!cometbft.start name:'test' reset:1 
'

cometbft_installer.play(heroscript=heroscript)!

//or we can call the default and do a start with reset
//mut installer:= cometbft_installer.get()!
//installer.start(reset:true)!

example heroscript

!!cometbft.configure
    homedir: '/home/user/cometbft'
    username: 'admin'
    password: 'secretpassword'
    title: 'Some Title'
    host: 'localhost'
    port: 8888

Constants #

const version = '0.0.0'

fn delete #

fn delete(args_ ArgsGet) !

fn exists #

fn exists(args_ ArgsGet) !bool

does the config exists?

fn get #

fn get(args_ ArgsGet) !&CometBFT

fn heroscript_dumps #

fn heroscript_dumps(obj CometBFT) !string

///////////NORMALLY NO NEED TO TOUCH

fn heroscript_loads #

fn heroscript_loads(heroscript string) !CometBFT

fn play #

fn play(args_ PlayArgs) !

fn set #

fn set(o CometBFT) !

register the config for the future

fn switch #

fn switch(name string)

switch instance to be used for cometbft

struct ArgsGet #

@[params]
struct ArgsGet {
pub mut:
	name string
}

///////FACTORY

struct CometBFT #

@[heap]
struct CometBFT {
pub mut:
	name string = 'default'
	// homedir    string
	// configpath string
	// username   string
	// password   string @[secret]
	// title      string
	// host       string
	// port       int
}

THIS THE THE SOURCE OF THE INFORMATION OF THIS FILE, HERE WE HAVE THE CONFIG OBJECT CONFIGURED AND MODELLED

fn (CometBFT) build #

fn (mut self CometBFT) build() !

fn (CometBFT) destroy #

fn (mut self CometBFT) destroy() !

fn (CometBFT) install #

fn (mut self CometBFT) install(args InstallArgs) !

fn (CometBFT) install_start #

fn (mut self CometBFT) install_start(args InstallArgs) !

fn (CometBFT) reload #

fn (mut self CometBFT) reload() !

load from disk and make sure is properly intialized

fn (CometBFT) restart #

fn (mut self CometBFT) restart() !

fn (CometBFT) running #

fn (mut self CometBFT) running() !bool

fn (CometBFT) start #

fn (mut self CometBFT) start() !

fn (CometBFT) stop #

fn (mut self CometBFT) stop() !

struct DefaultConfigArgs #

@[params]
struct DefaultConfigArgs {
	instance string = 'default'
}

helpers

struct InstallArgs #

@[params]
struct InstallArgs {
pub mut:
	reset bool
}

struct PlayArgs #

@[params]
struct PlayArgs {
pub mut:
	heroscript string // if filled in then plbook will be made out of it
	plbook     ?playbook.PlayBook
	reset      bool
}