Skip to content

threefold.grid #

TFGrid Deployments

Create workloads in native low level format, and then use a gridriver go binary to post it to TFChain as well as send it to ZOS.

fn get #

fn get(instance string, cfg Config) !TFGridClient[Config]

fn get_mnemonics #

fn get_mnemonics() !string

fn heroplay #

fn heroplay(mut plbook playbook.PlayBook) !

fn new_deployer #

fn new_deployer(mnemonics string, chain_network ChainNetwork) !Deployer

fn (DeploymentStateDB) set #

fn (db DeploymentStateDB) set(deployment_name string, key string, val string) !

fn (TFGridClient[Config]) config_interactive #

fn (mut self TFGridClient[Config]) config_interactive() !

fn (VMDeployed) builder_node #

fn (vm VMDeployed) builder_node() !&builder.Node

fn (ZDBDeployed) ping #

fn (zdb ZDBDeployed) ping() bool

test zdb is answering

fn (ZDBDeployed) redisclient #

fn (zdb ZDBDeployed) redisclient() !redisclient.Redis

enum ChainNetwork #

enum ChainNetwork {
	dev
	qa
	test
	main
}

struct Config #

@[params]
struct Config {
pub mut:
	mnemonics string @[secret]
	network   string
}

struct Contract #

struct Contract {
pub:
	contract_id     string @[json: contractID]
	deployment_data string @[json: deploymentData]
	state           string
	node_id         u32 @[json: nodeID]
	name            string
}

struct Contracts #

struct Contracts {
pub mut:
	name_contracts []Contract @[json: nameContracts]
	node_contracts []Contract @[json: nodeContracts]
	rent_contracts []Contract @[json: rentContracts]
}

struct Deployer #

struct Deployer {
pub:
	mnemonics     string
	substrate_url string
	twin_id       u32
	relay_url     string
	chain_network ChainNetwork
	env           string
pub mut:
	client griddriver.Client
	logger log.Log
}

fn (Deployer) assign_wg_port #

fn (mut d Deployer) assign_wg_port(node_id u32) !u16

fn (Deployer) delete_deployment #

fn (mut d Deployer) delete_deployment(contract_id u64, node_id u32) !models.Deployment

fn (Deployer) deploy #

fn (mut d Deployer) deploy(node_id u32, mut dl models.Deployment, body string, solution_provider u64) !u64

fn (Deployer) deployment_changes #

fn (mut d Deployer) deployment_changes(node_id u32, contract_id u64) ![]models.Workload

fn (Deployer) get_deployment #

fn (mut d Deployer) get_deployment(contract_id u64, node_id u32) !models.Deployment

fn (Deployer) get_node_pub_config #

fn (mut d Deployer) get_node_pub_config(node_id u32) !models.PublicConfig

fn (Deployer) rmb_deployment_changes #

fn (mut d Deployer) rmb_deployment_changes(dst u32, contract_id u64) !string

Todo: decode/encode the params/result here

fn (Deployer) rmb_deployment_delete #

fn (mut d Deployer) rmb_deployment_delete(dst u32, data string) !string

fn (Deployer) rmb_deployment_deploy #

fn (mut d Deployer) rmb_deployment_deploy(dst u32, data string) !string

fn (Deployer) rmb_deployment_get #

fn (mut d Deployer) rmb_deployment_get(dst u32, data string) !string

fn (Deployer) rmb_deployment_update #

fn (mut d Deployer) rmb_deployment_update(dst u32, data string) !string

fn (Deployer) update_deployment #

fn (mut d Deployer) update_deployment(node_id u32, mut dl models.Deployment, body string) !

fn (Deployer) wait_deployment #

fn (mut d Deployer) wait_deployment(node_id u32, contract_id u64, workload_versions map[string]u32) !

struct GraphQl #

struct GraphQl {
	url string
pub mut:
	logger log.Log
}

fn (GraphQl) list_twin_contracts #

fn (mut g GraphQl) list_twin_contracts(twin_id u32, states []string) !Contracts

contractsList, err := c.ListContractsByTwinID([]string{"Created, GracePeriod"})

fn (GraphQl) get_contract_by_project_name #

fn (mut g GraphQl) get_contract_by_project_name(mut deployer Deployer, project_name string) !Contracts

struct TFGridClient #

struct TFGridClient[T] {
	base.BaseConfig[T]
}