-
-
Rainbow Bridge CLI
-
-
- OPS tool to Rainbow Bridge, an Ethereum to Near trustless, fully decentralized, bidirectional bridge
-
-
-
-
-
-
-
-
-
-## Table of Contents
-
-- [Pre-requisites](#pre-requisites)
-- [Usage](#usage)
-- [Security](#security)
-- [Gas costs](#gas-costs)
-- [Using Bridge on Testnet](#using-bridge-on-testnet)
-- [Deploying and Using Locally](#deploying-and-using-locally)
-- [Contract Development Workflow](#contract-development-workflow)
-
-## Pre-requisites
-
-The current version of CLI is all-in-one package -- it is used both for production and testing. As a result, even if you
-need CLI only for the token transfer you need to install all testing dependencies. This will be changed in the future.
-
-- Install golang, [see](https://golang.org/dl/).
-- Make sure you are using Node with version >=12 and <=13. We recommend using [nvm](https://github.com/nvm-sh/nvm) for installing node and npm, if you already don't have one. This constraint will be removed soon;
-- yarn
-- docker, for deterministic compile rust contracts
-- bash, for preparation steps (needs to be re-implemented in JS)
-
-### If you want to test with a local near node:
-
-- You would also need to install resources needed to compile nearcore (in the future this will only be required for the testing CLI):
-
-```bash
-curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
-source $HOME/.cargo/env
-rustup default stable
-rustup target add wasm32-unknown-unknown
-```
-
-- Then install dependencies needed for the compilation of nearcore, [see](https://docs.near.org/docs/develop/node/validator/running-a-node#compiling-and-running-a-node-without-docker).
-- python3 pip , for nearup
-
-#### Install nearup
-
-```bash
-pip3 install nearup
-
-```
-
-## Usage
-
-Clone this repo, `yarn install`, then to learn the commands that you can use with the rainbow bridge run:
-
-```
- cli/index.js --help
-```
-
-Parameters of each command can be specified through environment variables, command line arguments, entries in the `~/.rainbow/config.json` config file, or the default value will be used -- in that priority.
-If argument is not provided and there is no default value the program will not execute.
-
-If script successfully executes a command then each parameter provided through the command line argument will be
-written into the config file. Additionally, if scripts generates new parameters (e.g. it deploys a contract to Ethereum
-and obtains its address) will also be written into the config file. Arguments should not be specified multiple times.
-
-Note, you can use environment variables to pass sensitive data which will not lead to it being written into the config file.
-
-## Security
-
-* [Guide](near2eth/watchdog/README.md) on how to quickly configure the watchdog for Mainnet
-
-Bridge is secure as long as majority (1/2) of Etherem mining power is honest and supermajority (2/3) of NEAR stake is honest.
-There are no additional security requirements, except that Ethereum should be able to accept 1 transaction within 4 hour period even in the worst congestion scenario.
-
-## Gas costs
-
-NEAR fees are negligible, both for bridge maintenance and for token transfer.
-Ethereum fees are the following:
-
-- To transfer ERC20 token from ETH to NEAR: Approx 43,989 gas to set allowance and approx 37,407 gas to lock it;
-- To transfer ERC20 token back from NEAR to ETH: Approx 240,531 gas to unlock the token;
-- To submit a NEAR block header: approx 697,140 gas;
-- To challenge a NEAR block header: approx 700k gas.
-
-As of 2020-07-14 (gas price is 40 gwei) the cost of running bridge on NEAR mainnnet and Ethereum mainnet is approx 42 USD/day. The cost of ETH->NEAR transfer of ERC20 token is 1 USD. The cost of NEAR->ETH transfer of ERC20 token is 2 USD.
-
-## Using Bridge on Testnet
-
-### PoA vs PoW Ethereum networks
-
-Rainbow bridge can be deployed either on PoW or PoA networks. However, the main use case of the bridge is Ethereum Mainnet, which makes its design very PoW-centric and it is only trustless and decentralized for PoW networks. Unfortunately, the only popular PoW testnet is Ropsten, which frequently undergoes huge reorgs of more than [16k blocks](https://github.com/near/rainbow-bridge-cli/issues/329), because people test 51% attacks on it. 16k reorgs can wipe out entire contracts and revert days of computations. Overall, Ropsten has the following unfortunate specifics that does not exist with Ethereum Mainnet:
-
-- Extremely long re-orgs;
-- Gas price volatility -- Ropsten blocks might have orders of magnitude different median gas price;
-- Slow block production -- sometimes Ropsten blocks are produced once per several minutes;
-- [Infura is unreliable on Ropsten](https://github.com/near/rainbow-bridge-cli/issues/330)
-
-Therefore we advise users to not use Ropsten for bridge testing. Instead, we recommend using one of Ethereum's PoA testnet. Unfortunately, PoA networks have a differen header format and are also centralized by nature. Therefore when deploying bridge on PoA network please use `--near-client-trusted-signer` parameter. This will force `EthOnNearClient` to not validate Ethereum headers (since PoA headers are not valid PoW headers) and accept them only from the provided authority.
-
-The documenation below assumes Rinkeby testnet.
-
-### Using existing bridge on Rinkeby
-
-This section explains how to use existing bridge with mock ERC20 token that was already deployed. You would need to have some amount of this token on Rinkeby, so reach out to max@near.org if you want to give it a try.
-
-We assume you have two accounts:
-
-- One NEAR account on NEAR testnet with at least 1 NEAR token. We denote it as `