# Manage using marlinctl

This page assumes that marlinctl is installed already. See here if you have not installed it.

#### Command tree

The marlinctl command subtree for managing Polkadot gateways resides under marlinctl gateway dot. As with all marlinctl commands, the subtree can be incrementally discovered with the --help parameter.

$sudo marlinctl gateway dot --help Polkadot Gateway Usage: marlinctl gateway dot [command] Available Commands: config Configurations of project set on disk create Create gateway for polkadot blockchain destroy Destroy gateway for polkadot blockchain logs Tail logs for running gateway (polkadot) instances recreate Recreate end to end gateway (polkadot) instances restart Restart services for gateway (polkadot) instances status Show status of currently running gateway (polkadot) instances versions Show available versions for use Flags: -h, --help help for dot Global Flags: --config string config file (default is$HOME/.marlin/ctl/state.yaml)
--forceful-registry-sync   forceful registry sync. Do not use if you don't know what this is for.
--loglevel string          marlinctl loglevel (default is INFO) (default "info")
--skip-registry-sync       skip registry sync during run
--skip-update-check        skip update check during run



#### Create a gateway

Gateways can be created using the create command.

$sudo marlinctl gateway dot create --help Create gateway for polkadot blockchain Usage: marlinctl gateway dot create [flags] Flags: -b, --bootstrap-addr string Bridge bootstrap address -a, --chain-identity string Gateway's keystore path (default "gateway_dot.key") -c, --contracts string mainnet/kovan (default "mainnet") -d, --discovery-addr string Bridge discovery address (default "0.0.0.0:20702") -h, --help help for create -i, --instance-id string instance-id of spawned up resource (default "001") -l, --internal-listen-address string Bridge listen address (default "127.0.0.1:20901") -y, --keystore-pass-path string Keystore pass path -k, --keystore-path string Keystore Path -g, --listen-addr string Address on which gateway listens for connections from peer (default "/ip4/0.0.0.0/tcp/20900") -p, --pubsub-addr string Bridge pubsub address (default "0.0.0.0:20700") -r, --runtime-args stringToString runtime arguments while starting up (default []) -s, --skip-checksum skip checksum verification while starting up binaries -x, --version string runtime version override Global Flags: --config string config file (default is$HOME/.marlin/ctl/state.yaml)
--forceful-registry-sync   forceful registry sync. Do not use if you don't know what this is for.
--loglevel string          marlinctl loglevel (default is INFO) (default "info")
--skip-registry-sync       skip registry sync during run
--skip-update-check        skip update check during run
##### Primary flags

While the following flags are optional for testing the connection between the gateway and the polkadot node, they are required parameters for interacting with the Marlin network.

• --bootstrap-addr - Address of the bootstrap server used for discovering other nodes in the network.
• --keystore-path - Path to keystore file. Serves as the identity of the gateway.
• --keystore-pass-path - Path to text file containing passphrase that can unlock the above keystore file.
##### Secondary flags
• --contracts - Contract set used by the gateway for fetching on-chain data. Enables choosing the network that the gateway is a part of (e.g. separate networks for testing or new upgrades). Especially important in the initial phases of the network, where it's expected that clusters will work on a testnet first before transitioning to mainnet upon maturity.
• --chain-identity - Path to a polkadot key file which the gateway uses as its identity. Useful to give the gateway a deterministic identity on the polkadot side so deployments can be automated.

The following flags are useful for customizing the socket addresses used by the gateway in order to prevent any conflicts with other programs on the same system.

• --listen-addr - Address where the gateway listens for incoming connections from your polkadot nodes.
• --discovery-addr - Address used for the discovery protocol to find peers in the Marlin network.
• --pubsub-addr - Address used for the pubsub protocol, to send and receive message from the Marlin network.
• --internal-listen-addr - Address used for internal communication between components of the gateway.

#### See logs

Logs can be tailed using the logs command.

$sudo marlinctl gateway dot logs --help Tail logs for running gateway (polkadot) instances Usage: marlinctl gateway dot logs [flags] Flags: -h, --help help for logs -i, --instance-id string instance-id of resource to log (default "001") -n, --last int number of last lines to tail in logfile (default 100) Global Flags: --config string config file (default is$HOME/.marlin/ctl/state.yaml)
--forceful-registry-sync   forceful registry sync. Do not use if you don't know what this is for.
--loglevel string          marlinctl loglevel (default is INFO) (default "info")
--skip-registry-sync       skip registry sync during run
--skip-update-check        skip update check during run
##### Primary flags
• --last - Number of lines from the end to tail

#### Destroy a gateway

Gateways can be destroyed using the destroy command.

$sudo marlinctl gateway dot destroy --help Destroy gateway for polkadot blockchain Usage: marlinctl gateway dot destroy [flags] Flags: -h, --help help for destroy -i, --instance-id string instance-id of resource to destroy (default "001") Global Flags: --config string config file (default is$HOME/.marlin/ctl/state.yaml)
--forceful-registry-sync   forceful registry sync. Do not use if you don't know what this is for.
--loglevel string          marlinctl loglevel (default is INFO) (default "info")
--skip-registry-sync       skip registry sync during run
--skip-update-check        skip update check during run