icon-project / icon-bridge

The centralized bridge of ICON
Apache License 2.0
21 stars 15 forks source link

story(deployment): script to link new chain to existing env #733

Closed manishbista28 closed 2 years ago

manishbista28 commented 2 years ago

Overview

The deployment scripts currently available will deploy an icon-bridge where new set of contracts are deployed for a pair of chains and they get linked with each other. If we are to link a third chain (e.g. arctic) to existing environment (e.g. icon-bsc mainnet deployment), then the script will need rework. The script must deploy contracts for the new chain only and then link it to ICON.

Story

An existing deployment includes:

  1. smart contract address (e.g. address of bmc, bts)
  2. keystore files of the deployer account
  3. build artifacts (jar files and node modules relating to existing deployment)

A script that links a new chain to this existing deployment should work with these parameters. For example, it needs to use existing bmc address of ICON using icon deployer account (icon.god.wallet.json) to call addLink method. However, it should not re-use existing build artifacts (e.g. node modules used by BSC chain as it includes deployment information as well)

Proposed Solution

Existing script (deploysc.sh) includes the following modules:

  1. Deploy and configure bmc, bts contracts to ICON chain
  2. Deploy and configure bmc, bts contracts to second chain
  3. Link two chains.

A new script should run step 2 and 3 above. Example: running the new script will deploy arctic contracts, use javascore contract addresses prepared in icon-bsc deployment, and use it to link arctic-icon. How this differs from existing script (deploysc.sh) is we have not deployed a new set of ICON's bmc and bts contracts instead used existing..