Skip to content

installers.db.cometbft #

cometbft

To get started



import incubaid.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 list #

fn list(args ArgsList) ![]&CometBFT

if fromdb set: load from filesystem, and not from mem, will also reset what is in mem

fn new #

fn new(args ArgsGet) !&CometBFT

fn play #

fn play(mut plbook PlayBook) !

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 = 'default'
	fromdb bool // will load from filesystem
	create bool // default will not create if not exist
}

///////FACTORY

struct ArgsList #

@[params]
struct ArgsList {
pub mut:
	fromdb bool // will load from filesystem
}

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 InstallArgs #

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