{"id":19121131,"url":"https://github.com/maticnetwork/matic-cli","last_synced_at":"2025-04-05T18:08:25.681Z","repository":{"id":37581875,"uuid":"226282221","full_name":"maticnetwork/matic-cli","owner":"maticnetwork","description":"A CLI to setup Matic network","archived":false,"fork":false,"pushed_at":"2025-03-27T12:32:26.000Z","size":3211,"stargazers_count":82,"open_issues_count":1,"forks_count":62,"subscribers_count":29,"default_branch":"master","last_synced_at":"2025-03-29T17:09:16.514Z","etag":null,"topics":["blockchain","ethereum","matic","web3"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/maticnetwork.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-12-06T08:33:44.000Z","updated_at":"2025-03-27T12:32:31.000Z","dependencies_parsed_at":"2023-02-16T09:31:18.095Z","dependency_job_id":"e828722a-55a1-4148-a9e9-bcf2809125a4","html_url":"https://github.com/maticnetwork/matic-cli","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maticnetwork%2Fmatic-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maticnetwork%2Fmatic-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maticnetwork%2Fmatic-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maticnetwork%2Fmatic-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maticnetwork","download_url":"https://codeload.github.com/maticnetwork/matic-cli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247378143,"owners_count":20929296,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blockchain","ethereum","matic","web3"],"created_at":"2024-11-09T05:16:11.069Z","updated_at":"2025-04-05T18:08:25.658Z","avatar_url":"https://github.com/maticnetwork.png","language":"JavaScript","readme":"# Testing Toolkit\n\n🏗 A set of CLIs, tools and tests to set up, manage and operate Polygon devnets.\n\nThe **Testing Toolkit** is built on top of `express-cli`, an extension of `matic-cli` which uses `terraform` to deploy,\ntest and monitor any devnet on AWS/GCP stacks from any local system.\n\nIt currently supports **only** devnets running `v0.3.x` stacks.\n\nThe `express-cli` interacts with `terraform` to create a fully working setup on AWS/GCP.\nIn case the infrastructure already exists, `matic-cli` can be used as a standalone tool to deploy Polygon stacks on\npre-configured VMs.\n\nPlease, refer to the section of this file you are more interested in (`express-cli` or `matic-cli`)\n\n## Table of contents\n\n- [`express-cli`](#express-cli)\n- [`matic-cli`](#matic-cli)\n\n## `express-cli`\n\n### Requirements\n\nTo use the `express-cli` you have to execute the following steps.\n\n- [install aws cli](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html) or [install gcloud tool](https://cloud.google.com/sdk/docs/install)\n- [install terraform](https://learn.hashicorp.com/tutorials/terraform/install-cli) on your local machine\n- use [nvm](https://github.com/nvm-sh/nvm#installing-and-updating) to switch to the proper `node` version, `v18.19.0`,\n  by running `nvm use` from the root folder\n- install `express-cli` and `matic-cli` locally with command `npm i`\n- generate a keypair on AWS EC2 (in the same region being used, currently `eu-west-1` by default and download its certificate locally (`.pem` file). If you are on GCP, you can use your existing keypair or use `ssh-keygen` to generate. Check the [GCP guide](./docs/gcp_dev_guide.md).\n- copy `secret.tfvars.example` to `secret.tfvar` with command `cp secret.tfvars.example secret.tfvars` and check the commented file for details\n- **If you are a Polygon employee**, connect to the company VPN\n- modify `secret.tfvar` with addresses of the allowed IPs (as specified in `secret.tfvars.example` file)\n- copy `.env.example` to `.env` with command `cp .env.example .env` and check the heavily commented file for details. If you're using GCP, you can ignore AWS specific terraform variables and vice versa.\n- make sure `PEM_FILE_PATH` points to a correct AWS key certificate, the one you downloaded in the previous steps\n- define the number of nodes (`TF_VAR_VALIDATOR_COUNT` and `TF_VAR_SENTRY_COUNT`) and adjust the `DEVNET_BOR_USERS`\n  accordingly\n- use `TF_VAR_DOCKERZIED=no` to have one VM per node, otherwise the stack will run on one VM only in a dockerized environment\n- (optional) replace `TF_VAR_VM_NAME` with your own identifier (it can be any string, default is \"polygon-user\")\n- (optional) replace `TF_VAR_DISK_SIZE_GB` with your preferred disk size in GB (default is 100 GB)\n- `VERBOSE=true` prints logs from the remote machines. If set to `false`, only `express-cli` and `matic-cli` logs will\n  be shown\n\n### Auth Configuration\n\nAs a prerequisite, you need to configure authentication on `aws`\nThis will create the folder `~/.aws` in your system\nTo do so, please run\n\n```bash\naws configure sso\n```\n\nThis command will interactively ask for some configs\n**If you are a Polygon employee**, please use the following\n\n- SSO session name: leave empty\n- SSO start URL: https://0xpolygon.awsapps.com/start/#/\n- SSO region: eu-west-1\n\nThe browser will open and authorize your request. Please allow it.\n\nIn case there are multiple accounts available to you, please select\n\n\u003e posv1-devnet\n\nThen, the command will ask for other configs, please use\n\n- CLI default client Region: eu-west-1\n- CLI default output format: json\n- CLI profile name: default\n\nNote that it's **mandatory** to use `CLI profile name: default`, as used by `terraform` in `express-cli` (for more context see [this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs))\n\nHere an output example\n\n```bash\nSSO session name (Recommended):\nWARNING: Configuring using legacy format (e.g. without an SSO session).\nConsider re-running \"configure sso\" command and providing a session name.\nSSO start URL [None]: https://0xpolygon.awsapps.com/start/#/\nSSO region [None]: eu-west-1\nAttempting to automatically open the SSO authorization page in your default browser.\nIf the browser does not open or you wish to use a different device to authorize this request, open the following URL:\n\nhttps://device.sso.eu-west-1.amazonaws.com/\n\nThen enter the code:\n\n\u003cCODE-HERE\u003e\n\nThere are 2 AWS accounts available to you.\n\nUsing the account ID \u003cACCOUNT_ID\u003e\nThe only role available to you is: \u003cAWSRole\u003e (\u003cAWS_ROLE_ID\u003e)\nUsing the role name \"\u003cAWS_ROLE\u003e\"\nCLI default client Region [None]: eu-west-1\nCLI default output format [None]: json\nCLI profile name [\u003cPROFILE_NAME_AND_ID\u003e]: default\n\nTo use this profile, specify the profile name using --profile, as shown:\n\naws s3 ls --profile default\n```\n\nNow you can log into aws by running the following command. It needs to be executed every time the token expires.\n\n```bash\naws sso login\n```\n\nCongrats! You're all set to use `express-cli` commands.\n\nIf you are using Google cloud platform, you need to configure authentication on `gcloud`.\n\nIf you have downloaded the service account credentials, you can use the `GOOGLE_APPLICATION_CREDENTIALS` environment variable to provide the location of that credential JSON file.\n\n```bash\ngcloud auth application-default login\n\n# OR\n\nexport GOOGLE_APPLICATION_CREDENTIALS='/absolute/path/to/sa/creds.json'\n```\n\n### Commands\n\nInstructions to run `express-cli`.\nFor the list of commands, please run `express-cli --help`\nFirst off, you need to `--init` terraform on your local machine, by executing the following command.\n\n- `./bin/express-cli.js --init \u003caws|gcp\u003e`\n\n  - Initializes a new devnet folder with terraform and creates some git-ignored files locally. This step is mandatory\n    before running any other command. The new devnet folder created will be `devnet-\u003cid\u003e` where `id` is a monotonically\n    increasing count for the devnets. Once created, you can `cd deployments/devnet-\u003cid\u003e` and run the other commands.\n    This allows you to work with multiple devnets at once.\n    Then, a remote devnet can be created with the `--start` command, as follows.\n  - You should specify the cloud provider. Currently the supported values are `aws` and `gcp`.\n\n- `../../bin/express-cli.js --start`\n\n  - Creates the desired remote setup, based on the preferences defined in the `.env.devnet\u003cid\u003e` file\n  - `--start` command can be used also to target an existing AWS setup. If changes to `.env.devnet\u003cid\u003e` file are detected, the\n    previous devnet will be destroyed and a new one created, reusing the same AWS VMs\n    To destroy the remote devnet, you can execute the `--destroy` command.\n\n- `../../bin/express-cli.js --destroy`\n\n  - Destroys the remote setup and delete the dedicated VMs\n\nThe `express-cli` also comes with additional utility commands, listed below. Some of them are only available for non-dockerized devnets.\n\n- `../../bin/express-cli.js --update-all [index]`\n\n  - Fetches `heimdall`,`bor` and `erigon` branches defined as `HEIMDALL_BRANCH`, `BOR_BRANCH` and `ERIGON_BRANCH` in `.env. devnet\u003cid\u003e` file, pulls relative changes and restarts those services on the remote machines. If an integer `index` is used, the job will be performed only on the VM corresponding to that index. For example if the devnet consists of 2 bor and erigon nodes, then the indices for bor machines would be 0 and 1 and for erigon it'll be 2 and 3.\n\n- `../../bin/express-cli.js --update-bor [index]`\n\n  - Fetches `bor` branch defined as `BOR_BRANCH` in `.env.devnet\u003cid\u003e` file, pulls relative changes and restarts it on\n    the remote machines. If an integer `index` is used, the job will be performed only on the VM corresponding to that index.\n\n- `../../bin/express-cli.js --update-erigon [index]`\n\n  - Fetches `erigon` branch defined as `ERIGON_BRANCH` in `.env.devnet\u003cid\u003e` file, pulls relative changes and restarts it on\n    the remote machines. If an integer `index` is used, the job will be performed only on the VM corresponding to that index. For example, if the devnet consists of 2 bor and erigon nodes and you want to target the first erigon node, `index` will be 2.\n\n- `../../bin/express-cli.js --update-heimdall [index]`\n\n  - Fetches `heimdall` branch defined as `HEIMDALL_BRANCH` in `.env.devnet\u003cid\u003e` file, pulls relative changes and restarts it on\n    the remote machines. If an integer `index` is used, the job will be performed only on the VM corresponding to that\n    index. For example if the devnet consists of 2 bor and erigon nodes, then the indices for bor machines would be 0 and 1 and for erigon it'll be 2 and 3.\n\n- `../../bin/express-cli.js --restart-all [index]`\n\n  - Restarts `bor`, `erigon` and `heimdall` on all the remote machines. If an integer `index` is used, the job will be performed\n    only on the VM corresponding to that index. For example if the devnet consists of 2 bor and erigon nodes, then the indices for bor machines would be 0 and 1 and for erigon it'll be 2 and 3.\n\n- `../../bin/express-cli.js --restart-bor [index]`\n\n  - Restarts `bor` on all the remote machines. If an integer `index` is used, the job will be performed only on the VM\n    corresponding to that index.\n\n- `../../bin/express-cli.js --restart-erigon [index]`\n\n  - Restarts `erigon` on all the remote machines. If an integer `index` is used, the job will be performed only on the VM\n    corresponding to that index. For example if the devnet consists of 2 bor and erigon nodes and you wanted to target the first erigon node, `index` will be 2.\n\n- `../../bin/express-cli.js --restart-heimdall [index]`\n\n  - Restarts `heimdall` on all the remote machines. If an integer `index` is used, the job will be performed only on\n    the VM corresponding to that index. For example if the devnet consists of 2 bor and erigon nodes, then the indices for bor machines would be 0 and 1 and for erigon it'll be 2 and 3.\n\n- `../../bin/express-cli.js --cleanup`\n\n  - Cleans up `anvil`, `bor`, `heimdall` and `bridge`, redeploys all the contracts and restarts all the services\n    The `express-cli` also provides additional testing commands, listed here.\n\n- `../../bin/express-cli.js --send-state-sync`\n\n  - Create a `state-sync` transaction on the remote network\n\n- `../../bin/express-cli.js --send-staked-event [validatorID]`\n\n  - Create a `Staked` transaction on the remote network and adds a new validator.\n\n- `../../bin/express-cli.js --send-stakeupdate-event [validatorID]`\n\n  - Create a `StakeUpdate` transaction on the remote network and increase stake of 1st validator by 100 MATIC.\n\n- `../../bin/express-cli.js --send-signerchange-event [validatorID]`\n\n  - Create a `SignerChange` transaction on the remote network and changes the signer of the 1st validator.\n\n- `../../bin/express-cli.js --send-topupfee-event [validatorID]`\n\n  - Create a `TopUpFee` transaction on the remote network and adds balance/heimdallFee for the first validator on Heimdall.\n\n- `../../bin/express-cli.js --send-unstakeinit-event [validatorID]`\n\n  - Create a `UnstakeInit` transaction on the remote network and removes the validator from validator-set. `validatorID` can be used to specify the validator to be removed. If not specified, the first validator will be removed.\n\n- ` ../../bin/express-cli.js --monitor [exit]`\n\n  - Monitors the reception of state-syncs and checkpoints to make sure the whole network is in a healthy state.\n    If `--send-state-sync` hasn't been used before, only checkpoints will be detected. Monitor the setup.\n    If `exit` string is passed the process terminates when at least one `stateSync` and one `checkpoint` are detected.\n\n- ` ../../bin/express-cli.js --instances-stop`\n\n  - Stop the cloud VM instances associated with the deployed devnet.\n\n- ` ../../bin/express-cli.js --instances-start`\n\n  - Start the (previously stopped) VM instances associated with the deployed devnet. Also, it starts all services, such as anvil, heimdall, and bor\n\n- `../../bin/express-cli.js --stress [fund]`\n\n  - Runs the stress tests on remote nodes. The string `fund` is needed when stress tests are ran for the first time,\n    to fund the accounts\n\n- `../../bin/express-cli.js --setup-datadog`\n\n  - Sets up datadog on the nodes and gets them ready to send metrics to Datadog Dashboard. `DD_API_KEY` env var is required for this.\n\n- `../../bin/express-cli.js --setup-ethstats`\n\n  - Sets up ethstats on the nodes and gets them ready to send metrics to Ethstats Backend which can be queried from Hasura Console and displayed on Reorgs Frontend.\n\n- `../../bin/express-cli.js --chaos [intensity]`\n\n  - Adds dedicated chaos(de-peering) to the network. The `intensity` parameter is optional and can be set from `1` to `10`. If not set, `5` is used.\n\n- `../../bin/express-cli.js --rewind [numberOfBlocks]`\n\n  - Rewinds the chain by a defined number of blocks (not greater than `128`). Default `numberOfBlocks` value is `100`.\n\n- `../../bin/express-cli.js --eip-1559-test [index]`\n\n  - Executes a test to send EIP 1559 tx. In case of a non-dockerized devnet, if an integer [index] is specified, it will use\n    that VM to send the tx. Otherwise, it will target the first VM.\n\n- `../../bin/express-cli.js --ssh-key-add`\n\n  - Generates an additional ssh key-pair remotely and stores it locally in the devnet folder. The public key is added to the ssh authorized keys of the devnet's machines. The key can be shared - on a secure channel! - with other devs to grant them access to the remote devnet.\n\n- `../../bin/express-cli.js --ssh-key-des [keyName]`\n\n  - Destroys an ssh key-pair given its `keyName`. The key gets deleted remotely from `aws` or `gcp`, cancelled from the authorized ssh keys of the devnet's machines and removed from local devnet folder.\n\n- `../../bin/express-cli.js --reorg-start [split]`\n\n  - Reorg the chain by creating two clusters in the network, where [split] param represents the number of nodes that one of the clusters will have (with other being [total number of nodes - split])\n\n- `../../bin/express-cli.js --reorg-stop`\n\n  - Stops the reorg previously created by reconnecting all the nodes\n\n- `../../bin/express-cli.js --shadow-fork [blockNumber]`\n\n  - Run (mumbai/mainnet) nodes in shadow mode. Please note that there might be an offset of ~3-4 blocks from [block] number\n    specified when restarting the (shadow) node. Currently only works with remote setup (no docker support).\n\n- `../../bin/express-cli.js --rpc-test`\n\n  - Requires both `RPC_URL` and `MNEMONIC` set\n    - `MNEMONIC` need funds on its first derivation account (m/44'/60'/0'/0/0) to deploy a small contract\n  - Execute a suite of RPC tests against the provided RPC URL, agnostic to the environment. The tests are capable of running on any network, including devnet, testnet (e.g., Amoy/Mumbai), and mainnet, with the only requirement being that the necessary funds are available in the corresponding account on the network\n\n- `../../bin/express-cli.js --relay`\n\n  - Relay transactions from testnet or mainnet to shadow node running in the devnet.\n\n- `../../bin/express-cli.js --fund-anvil-accounts`\n  - Transfers 10 eth to all the anvil accounts.\n\nNote: to allow `express-cli` to clone private repos, make sure the git configs in the `.env` file looks like the following (example for `BOR_REPO`)\n\n```shell\n# BOR_REPO=\"https://\u003cusername\u003e:\u003ctoken\u003e@github.com/\u003cusername\u003e/\u003crepo\u003e.git\" # example of private repo URL\n```\n\n## `Milestone tests`\n\nThe `express-cli` can also be used to perform few simulation based tests for the upcoming milestone feature. Please refer to the steps and requirements mentioned over [here](./docs/milestones.md) for running the tests.\n\n## `matic-cli`\n\n`matic-cli` has to be installed on a `ubuntu` VM (_host_) and - through a config file - it will point to\nother VMs' IPs (_remotes_).\n\n- Host machine will run a Polygon node (`bor` and `heimdall`) and a layer 1 node (`anvil`)\n- Remote machines will only run a Polygon node each\n\n### Requirements\n\nPlease, make sure to install the following software/packages on the VMs.\n\n#### **Ubuntu**\n\n- Build Essentials (_host_ and _remotes_)\n\n  ```bash\n  sudo apt update --yes \u0026\u0026 sudo apt install --yes build-essential\n  ```\n\n- Go 1.18+ (_host_ and _remotes_)\n\n  ```bash\n  wget https://raw.githubusercontent.com/maticnetwork/node-ansible/master/go-install.sh \\\n    \u0026\u0026 bash go-install.sh --remove \\\n    \u0026\u0026 bash go-install.sh\n  ```\n\n- Rabbitmq (_host_ and _remotes_)\n\n  ```bash\n  sudo apt install --yes rabbitmq-server\n  ```\n\n- Docker (_host_ and _remotes_, only needed in case of a docker setup)\n\n  - https://docs.docker.com/engine/install/ubuntu/\n  - https://docs.docker.com/engine/install/linux-postinstall/)\n\n- Node v18.19.0 (only _host_)\n\n  ```bash\n  curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash \\\n    \u0026\u0026 source ~/.bashrc \\\n    \u0026\u0026 nvm install 18.19.0 \\\n    \u0026\u0026 node --version\n  ```\n\n- Npm (only _host_)\n\n  ```bash\n  sudo apt update --yes \u0026\u0026 sudo apt install --yes npm\n  ```\n\n- Python 3 (only _host_)\n\n  ```bash\n  sudo apt install python3 python3-pip --yes \u0026\u0026 alias python=\"/usr/bin/python3\"\n  ```\n\n- Solc v0.5.17 and 0.6.12 (only _host_)\n\n  ```bash\n  sudo pip install solc-select\n  solc-select install 0.5.17\n  solc-select install 0.6.12\n  solc-select use 0.5.17\n  ```\n\n- Anvil CLI (only _host_)\n\n  ```bash\n   curl -L https://foundry.paradigm.xyz | bash \u0026\u0026 export PATH=\"$HOME/.foundry/bin:$PATH\" \u003e\u003e ~/.bashrc \u0026\u0026 source ~/.bashrc \u0026\u0026 foundryup\n  ```\n\n#### **MacOS**\n\n- Build Essentials (_host_ and _remotes_)\n\n  ```zsh\n  xcode-select --install\n  ```\n\n- Go 1.18+ (_host_ and _remotes_)\n\n  ```zsh\n  curl -O https://raw.githubusercontent.com/maticnetwork/node-ansible/master/go-install.sh\n  bash go-install.sh --remove\n  bash go-install.sh\n  ```\n\n- Rabbitmq (_host_ and _remotes_)\n\n  ```zsh\n  brew install rabbitmq\n  ```\n\n- Docker (_host_ and _remotes_, only needed in case of a docker setup)\n\n  https://docs.docker.com/desktop/install/mac-install/\n\n- Node v18.19.0 (only _host_)\n\n  ```zsh\n  curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash \\\n  \u0026\u0026 nvm install 18.19.0 \\\n  \u0026\u0026 node --version\n  ```\n\n- Python 3 (only _host_)\n\n  ```zsh\n  brew install pyenv\n  pyenv install 3.13.2\n  pyenv global 3.13.2\n  python3 --version\n  pyenv exec python3 -m ensurepip --default-pip\n  python -m pip install --upgrade pip\n  ```\n\n- Solc v0.5.17 and 0.6.12 (only _host_)\n\n  ```zsh\n  pip3 install solc-select\n  solc-select install 0.5.17\n  solc-select install 0.6.12\n  solc-select use 0.5.17\n  ```\n\n- Anvil CLI (only _host_)\n\n  ```zsh\n  curl -L https://foundry.paradigm.xyz | bash \u0026\u0026 export PATH=\"$HOME/.foundry/bin:$PATH\" \u003e\u003e ~/.bashrc \u0026\u0026 source ~/.bashrc \u0026\u0026 foundryup\n  ```\n\n### Usage\n\nOn the _host_ machine, please run\n\n```bash\ncd \\\n  \u0026\u0026 git clone https://github.com/maticnetwork/matic-cli.git \\\n  \u0026\u0026 cd matic-cli \\\n  \u0026\u0026 npm install\n```\n\n#### Local dockerized network\n\nAdjust the [docker configs](configs/devnet/docker-setup-config.yaml) based on your setup, and run\n\n```bash\nmkdir devnet \\\n  \u0026\u0026 cd devnet \\\n  \u0026\u0026 ../bin/matic-cli.js setup devnet --config ../configs/devnet/docker-setup-config.yaml | tee setup.log\n```\n\nThis will create and spin up the devnet.\nThe process will take some time, until this log shows up\n\n```\nDONE Devnet is ready\n```\n\nOnce the setup is done, use the aggregated script for local docker deployment\n\n```bash\nbash ../util-scripts/docker/devnet_setup.sh\n```\n\nTo verify the deployment, run the smoke test to ensure everything is working properly. The script usually takes around 6mins to complete.\n\n```bash\nbash ../util-scripts/docker/smoke_test.sh\n```\n\nTo add funds to the signer's account, note that this step is optional. All existing signers already have sufficient funds.\n\n```bash\nbash ../util-scripts/docker/fund_anvil_accounts.sh\n```\n\nLogs will be stored under `logs/` folder\n\nNote: in case of docker setup, we have provided [some additional scripts](src/setup/devnet/templates/docker/README.md) which might be helpful.\n\n#### Remote network\n\nAdjust the [remote configs](configs/devnet/remote-setup-config.yaml) and run\n\n```bash\n../bin/matic-cli.js setup devnet --config ../configs/devnet/remote-setup-config.yaml | tee setup.log\n```\n\nAlternatively, this step can be executed interactively with\n\n```bash\n../bin/matic-cli.js setup devnet --interactive\n```\n\nOnce the setup is done, follow these steps for remote deployment\nIn this case, the stack is already running, you would just need to deploy/sync some contracts, as follows:\n\n- Move to devnet folder\n  ```bash\n  cd matic-cli/devnet\n  ```\n- Deploy contracts on Child chain\n\n  ```bash\n  bash anvil-deployment-bor.sh\n  ```\n\n- Sync contract addresses to Main chain\n  ```bash\n  bash anvil-deployment-sync.sh\n  ```\n\n#### Clean setup\n\nStop all services, remove the `matic-cli/devnet` folder, and you can start the process once again\n\n#### Notes\n\nInstall the required software on your machine (see [Requirements](#requirements-1)).\n\nAdjust the [docker configs](configs/devnet/docker-setup-config.yaml) based on your setup, and run\n\n1. The anvil URL hostname will be used for anvil `http://\u003chost-machine-ip\u003e:9545`\n2. Make sure that the _host_ machine has access to remote machines for transferring the data\n   To persist ssh key for remote access, please run:\n   ```bash\n   eval \"$(ssh-agent -s)\"\n   ssh-add `\u003c.pem file\u003e`\n   ```\n3. We have provided the default config values [here](configs/devnet) to ensure smooth functioning of the process\n   Please check the relative [README](configs/README.md) for more accurate description of such configs\n   These files are used as templates and dynamically modified by `express-cli`, hence they should not be deleted nor any modification remotely pushed\n   Therefore, they are under `.gitignore`, and in case you do not want those changes to be reflected in your local `git`,\n   you can use the commands\n\n```bash\ngit update-index --assume-unchanged configs/devnet/remote-setup-config.yaml\ngit update-index --assume-unchanged configs/devnet/docker-setup-config.yaml\n```\n\nto undo, please use\n\n```bash\n  git update-index --no-assume-unchanged configs/devnet/remote-setup-config.yaml\n  git update-index --no-assume-unchanged configs/devnet/docker-setup-config.yaml\n```\n\n## License\n\nMIT\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaticnetwork%2Fmatic-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaticnetwork%2Fmatic-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaticnetwork%2Fmatic-cli/lists"}