Add steps to deploy l1 nitro contracts
This commit is contained in:
parent
db67b2fe3b
commit
d71a481db3
@ -24,6 +24,12 @@
|
|||||||
ansible --version
|
ansible --version
|
||||||
```
|
```
|
||||||
|
|
||||||
|
* Clone the `cerc-io/testnet-ops` repository:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git clone git@git.vdb.to:cerc-io/testnet-ops.git
|
||||||
|
```
|
||||||
|
|
||||||
<details open>
|
<details open>
|
||||||
<summary>L2 Optimism</summary>
|
<summary>L2 Optimism</summary>
|
||||||
|
|
||||||
@ -51,15 +57,18 @@
|
|||||||
|
|
||||||
### Setup
|
### Setup
|
||||||
|
|
||||||
* Clone the `cerc-io/testnet-ops` repository:
|
* Following commands have to be executed in `testnet-ops/l2-setup` directory
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd /srv
|
|
||||||
git clone git@git.vdb.to:cerc-io/testnet-ops.git
|
|
||||||
|
|
||||||
cd testnet-ops/l2-setup
|
cd testnet-ops/l2-setup
|
||||||
```
|
```
|
||||||
|
|
||||||
|
* Copy the `l2-vars-example.yml` vars file
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cp l2-vars-example.yml l2-vars.yml
|
||||||
|
```
|
||||||
|
|
||||||
* Edit `l2-vars.yml` with required values:
|
* Edit `l2-vars.yml` with required values:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
@ -157,6 +166,93 @@
|
|||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
|
<details open>
|
||||||
|
<summary>L1 nitro contracts deployment</summary>
|
||||||
|
|
||||||
|
## L1 nitro contracts deployment
|
||||||
|
|
||||||
|
* Stack: <https://git.vdb.to/cerc-io/nitro-stack>
|
||||||
|
|
||||||
|
* Source repos: <https://github.com/cerc-io/go-nitro>
|
||||||
|
|
||||||
|
* Target dir: `/srv/bridge/nitro-contracts-deployment`
|
||||||
|
|
||||||
|
* Cleanup an existing deployment if required:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd /srv/bridge
|
||||||
|
|
||||||
|
# Stop the deployment
|
||||||
|
laconic-so deployment --dir nitro-contracts-deployment stop --delete-volumes
|
||||||
|
|
||||||
|
# Remove the deployment dir
|
||||||
|
sudo rm -rf nitro-contracts-deployment
|
||||||
|
|
||||||
|
### Setup
|
||||||
|
|
||||||
|
* Following commands have to be executed in `testnet-ops/nitro-contracts-setup` directory
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd testnet-ops/nitro-contracts-setup
|
||||||
|
```
|
||||||
|
|
||||||
|
* Copy the `contract-vars-example.yml` vars file
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cp contract-vars-example.yml contract-vars.yml
|
||||||
|
```
|
||||||
|
|
||||||
|
* Edit [`contract-vars.yml`](./contract-vars.yml) and fill in the following values
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# L1 RPC endpoint
|
||||||
|
geth_url: "https://sepolia.laconic.com"
|
||||||
|
|
||||||
|
# L1 chain ID (Sepolia: 11155111)
|
||||||
|
geth_chain_id: "11155111"
|
||||||
|
|
||||||
|
# Private key for a funded account on L1 to use for contracts deployment on L1
|
||||||
|
geth_deployer_pk: ""
|
||||||
|
|
||||||
|
# Custom L1 token to be deployed
|
||||||
|
token_name: "LaconicNetworkToken"
|
||||||
|
token_symbol: "LNT"
|
||||||
|
intial_token_supply: "129600"
|
||||||
|
```
|
||||||
|
|
||||||
|
* Update the target dir in `setup-vars.yml`:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sed -i 's|^nitro_directory:.*|nitro_directory: /srv/bridge|' vars.yml
|
||||||
|
|
||||||
|
# Will create deployment at /srv/bridge/nitro-contracts-deployment
|
||||||
|
```
|
||||||
|
|
||||||
|
### Run
|
||||||
|
|
||||||
|
* To deploy nitro contracts locally, execute the `deploy-contracts.yml` Ansible playbook:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
LANG=en_US.utf8 ansible-playbook deploy-contracts.yml --extra-vars='{ "target_host": "localhost"}' --user $USER -kK
|
||||||
|
```
|
||||||
|
|
||||||
|
* For skipping container build, set `"skip_container_build" : true` in the `--extra-vars` parameter:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
LANG=en_US.utf8 ansible-playbook deploy-contracts.yml --extra-vars='{"target_host" : "localhost", "skip_container_build": true}' --user $USER -kK
|
||||||
|
```
|
||||||
|
|
||||||
|
* Check logs for deployments:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd /srv/bridge
|
||||||
|
|
||||||
|
# Check the l1 nitro contract deployments
|
||||||
|
laconic-so deployment --dir nitro-contracts-deployment logs nitro-contracts -f
|
||||||
|
```
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
<details open>
|
<details open>
|
||||||
<summary>Nitro Bridge</summary>
|
<summary>Nitro Bridge</summary>
|
||||||
|
|
||||||
@ -182,14 +278,9 @@
|
|||||||
|
|
||||||
### Setup
|
### Setup
|
||||||
|
|
||||||
* Clone the `cerc-io/testnet-ops` repository:
|
* Following commands have to be executed in `testnet-ops/nitro-bridge-setup` directory
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd /srv
|
|
||||||
|
|
||||||
# Can be skipped if repo already exists
|
|
||||||
git clone git@git.vdb.to:cerc-io/testnet-ops.git
|
|
||||||
|
|
||||||
cd testnet-ops/nitro-bridge-setup
|
cd testnet-ops/nitro-bridge-setup
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -101,7 +101,7 @@
|
|||||||
* Check status:
|
* Check status:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd $DEPLOYMENTS_DIR
|
cd $DEPLOYMENTS_DIR/nitro-node
|
||||||
|
|
||||||
# Check the logs, ensure that the nodes are running
|
# Check the logs, ensure that the nodes are running
|
||||||
laconic-so deployment --dir l1-nitro-deployment logs nitro-node -f
|
laconic-so deployment --dir l1-nitro-deployment logs nitro-node -f
|
||||||
@ -115,12 +115,12 @@
|
|||||||
* Set required variables:
|
* Set required variables:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd $DEPLOYMENTS_DIR
|
cd $DEPLOYMENTS_DIR/nitro-node
|
||||||
|
|
||||||
# Fetch the required Nitro node config
|
# Fetch the required Nitro node config
|
||||||
wget https://git.vdb.to/cerc-io/testnet-laconicd-stack/raw/branch/main/ops/stage2/nitro-node-config.yml
|
wget https://git.vdb.to/cerc-io/testnet-laconicd-stack/raw/branch/main/ops/stage2/nitro-node-config.yml
|
||||||
|
|
||||||
export BRIDGE_NITRO_ADDRESS=$(yq eval '.bridge_contract_address' nitro-node-config.yml)
|
export BRIDGE_NITRO_ADDRESS=$(yq eval '.bridge_nitro_address' nitro-node-config.yml)
|
||||||
export L1_ASSET_ADDRESS=$(yq eval '.l1_asset_address' nitro-node-config.yml)
|
export L1_ASSET_ADDRESS=$(yq eval '.l1_asset_address' nitro-node-config.yml)
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -243,7 +243,7 @@
|
|||||||
* Stop the deployment:
|
* Stop the deployment:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd $DEPLOYMENTS_DIR
|
cd $DEPLOYMENTS_DIR/nitro-node
|
||||||
|
|
||||||
laconic-so deployment --dir l1-nitro-deployment stop
|
laconic-so deployment --dir l1-nitro-deployment stop
|
||||||
```
|
```
|
||||||
|
Loading…
Reference in New Issue
Block a user