Docs
chromia.com

chain_context

The chain_context namespace provides access to blockchain configuration and module arguments. For complete API documentation, see the chain_context reference in the Standard Library.

The chain_context.args field contains the module arguments specified in the chromia.yml configuration file. module_args field must be defined as a user-defined struct within the entry point module named module_name. Access to the args field is only possible if the module_args struct is defined.

Example of module_args:

Rell
struct module_args {
    name: text;
    age: integer;
}

Corresponding module configuration:

YAML
blockchains:
  module-args-example:
    module: example
    moduleArgs:
      example:
        name: Alice
        age: 46

Code that reads module_args:

Rell
function f() {
    print(chain_context.args.name);
    print(chain_context.args.age);
}

Every module can have its own module_args. Reading chain_context.args returns the args for the current module, and the type of chain_context.args is different for different modules: it's the module_args struct defined in that module.