Skip to content

New Options to cartesi.toml #477

@lynoferraz

Description

@lynoferraz

While working on cartesapp framework I added some extra features that improved the experience and I think could easily be added in the cli too. All the features described here are controlled via the cartesi.toml file.

[machine] block

  • workdir = "path": Sets the workdir on the cartesi-machine cli wiht --workdir=path. Overrides docker WORKDIR command.
  • entrypoint = "command": Sets the entrypoint on the cartesi-machine cli wiht -- command. Overrides docker ENTRYPOINT and CMD commands.
  • envs = ["env1=val1",...]: Additional envs to be set in the env
  • network = "true": enable network to customize the rootfs in shell mode.
  • no_bootargs = "true|false": enable option.
  • no_rollup = "true|false": enable option.
  • init = ["cmd1","cmd2",...]: Additional --append-init options.
  • bootargs = ["cmd1","cmd2",...]: Additional --append-bootargs options.

[drive] block

for format = "ext2"

  • size = "size str": use xgenext2fs --size-in-blocks=blocks option (it should convert first)

for builder = "docker".

  • format = "none": Allows an unchanged format. This allows to create files in a dockerfile step and used it unchanged as a flash drive. Useful for creating state files or drives directly in a docker step.
  • output_type = "none|tar": Set the output type in --output option. "None" type allows to create files in steps of the docker. Default: "tar" (normally it should be converted to sqfs or ext2 to be used by the CM). Note that the none output type normally creates a dir at he the dest= location, so the flash drive itself should be the file inside the location.

for builder = "raw".

  • builder = "raw": create a raw empty drive that simply has length property. E.g. --flash-drive=label:state,mount:false,user:dapp,length:67108864. Useful for state flash drives (like honeypot)
  • length = "size str": option used with builder=raw that should be converted to bytes

for builder = "volume".

  • builder = "volume": mount a local directory (requires directory = "path") option as volume to customize the rootfs in shell mode.

cli

It would be good to allow any cartesi.toml configuration to be customized/overiden when using the cartesi build/cartesi shell commands (e.g. cartesi shell --machine-config "network=true" --machine-config "workdir=/mnt/app" --drive-config "app.mount=/mnt/app").

Metadata

Metadata

Assignees

No one assigned

    Labels

    RFCquestionFurther information is requested

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions