Add ops instructions to setup snowball frontend and backend #32

Merged
nabarun merged 21 commits from deep-stack/testnet-laconicd-stack:ag-snowball-docs into main 2024-10-30 10:16:29 +00:00
2 changed files with 41 additions and 24 deletions
Showing only changes of commit 809eae298f - Show all commits

View File

@ -1,6 +1,8 @@
# Nitro Token Ops # Nitro Token Ops
## Setup ## Deploy and transfer custom tokens
### Setup
* Go to the directory where `nitro-contracts-deployment` is present: * Go to the directory where `nitro-contracts-deployment` is present:
@ -8,7 +10,7 @@
cd /srv/bridge cd /srv/bridge
``` ```
## Deploy new token ### Deploy new token
* To deploy another token: * To deploy another token:
@ -48,7 +50,7 @@
* Check in the generated file at location `ops/stage2/assets.json` within this repository * Check in the generated file at location `ops/stage2/assets.json` within this repository
## Transfer deployed tokens to given address ### Transfer deployed tokens to given address
* To transfer a token to an account: * To transfer a token to an account:
@ -60,3 +62,22 @@
laconic-so deployment --dir nitro-contracts-deployment exec nitro-contracts "cd packages/nitro-protocol && yarn hardhat transfer --contract $ASSET_ADDRESS --to $ACCOUNT --amount 100 --network geth" laconic-so deployment --dir nitro-contracts-deployment exec nitro-contracts "cd packages/nitro-protocol && yarn hardhat transfer --contract $ASSET_ADDRESS --to $ACCOUNT --amount 100 --network geth"
``` ```
## Transfer ETH
* Go to the directory where `fixturenet-eth-deployment` is present:
```bash
cd /srv/fixturenet-eth
```
* To transfer ETH to an account:
```bash
export FUNDED_ADDRESS="0xe6CE22afe802CAf5fF7d3845cec8c736ecc8d61F"
export FUNDED_PK="888814df89c4358d7ddb3fa4b0213e7331239a80e1f013eaa7b2deca2a41a218"
export TO_ADDRESS="<target-account-address>"
laconic-so deployment --dir fixturenet-eth-deployment exec foundry "cast send $TO_ADDRESS --value 1ether --from $FUNDED_ADDRESS --private-key $FUNDED_PK"
```

View File

@ -38,17 +38,21 @@
wget -O assets.json https://git.vdb.to/cerc-io/testnet-laconicd-stack/raw/branch/main/ops/stage2/assets.json wget -O assets.json https://git.vdb.to/cerc-io/testnet-laconicd-stack/raw/branch/main/ops/stage2/assets.json
``` ```
* Ask testnet operator to send L1 tokens to your chain address * Ask testnet operator to send L1 tokens and ETH to your chain address
* [README for transferring tokens](./ops/nitro-token-ops.md#transfer-deployed-tokens-to-given-address) * [README for transferring tokens](./ops/nitro-token-ops.md#transfer-deployed-tokens-to-given-address)
* [README for transferring ETH](./ops/nitro-token-ops.md#transfer-eth)
* Check balance of your tokens once they are transferred: * Check balance of your tokens once they are transferred:
```bash ```bash
# Note: Account address should be without "0x"
export ACCOUNT_ADDRESS="<account-address>"
export GETH_CHAIN_ID="1212" export GETH_CHAIN_ID="1212"
export GETH_CHAIN_URL="https://fixturenet-eth.laconic.com" export GETH_CHAIN_URL="https://fixturenet-eth.laconic.com"
export ACCOUNT_ADDRESS=<account-address> #account address should be without "0x"
export ASSET_ADDRESS_1=$(jq -r --arg chainId "$GETH_CHAIN_ID" '.[$chainId][0].contracts.TestToken.address' assets.json) export ASSET_ADDRESS_1=$(jq -r --arg chainId "$GETH_CHAIN_ID" '.[$chainId][0].contracts.TestToken.address' assets.json)
export ASSET_ADDRESS_2=$(jq -r --arg chainId "$GETH_CHAIN_ID" '.[$chainId][0].contracts.TestToken2.address' assets.json) export ASSET_ADDRESS_2=$(jq -r --arg chainId "$GETH_CHAIN_ID" '.[$chainId][0].contracts.TestToken2.address' assets.json)
@ -107,11 +111,12 @@
```bash ```bash
# Set absolute path to desired deployments directory (under your user) # Set absolute path to desired deployments directory (under your user)
# Example: /home/dev/nitro-node-deployments
... ...
nitro_directory: <path-to-deployments-dir> nitro_directory: <path-to-deployments-dir>
... ...
# Will create deployments at <path-to-deployments-dir>/nitro-node/l1-nitro-deployment and <path-to-deployments-dir>/nitro-node/l2-nitro-deployment # Will create deployments at <path-to-deployments-dir>/l1-nitro-deployment and <path-to-deployments-dir>/l2-nitro-deployment
``` ```
## Run Nitro Nodes ## Run Nitro Nodes
@ -121,7 +126,6 @@ Nitro nodes can be set up on a target machine using Ansible:
* In `testnet-ops/nitro-nodes-setup`, create a new `hosts.ini` file: * In `testnet-ops/nitro-nodes-setup`, create a new `hosts.ini` file:
```bash ```bash
cd testnet-ops/nitro-nodes-setup
cp ../hosts.example.ini hosts.ini cp ../hosts.example.ini hosts.ini
``` ```
@ -166,9 +170,7 @@ Nitro nodes can be set up on a target machine using Ansible:
* Run the following commands on deployment machine: * Run the following commands on deployment machine:
```bash ```bash
DEPLOYMENTS_DIR=<path-to-deployments-dir> cd <path-to-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
@ -203,9 +205,7 @@ Create a ledger channel with the bridge on L1 which is mirrored on L2
* Set required variables: * Set required variables:
```bash ```bash
DEPLOYMENTS_DIR=<path-to-deployments-dir> cd <path-to-deployments-dir>
cd $DEPLOYMENTS_DIR/nitro-node
export BRIDGE_NITRO_ADDRESS=$(yq eval '.bridge_nitro_address' nitro-node-config.yml) export BRIDGE_NITRO_ADDRESS=$(yq eval '.bridge_nitro_address' nitro-node-config.yml)
@ -330,9 +330,7 @@ Perform payments using a virtual payment channel created with another Nitro node
* Switch to the `nitro-node` directory: * Switch to the `nitro-node` directory:
```bash ```bash
DEPLOYMENTS_DIR=<path-to-deployments-dir> cd <path-to-deployments-dir>
cd $DEPLOYMENTS_DIR/nitro-node
``` ```
* Check status of the mirrored channel on L2: * Check status of the mirrored channel on L2:
@ -494,9 +492,7 @@ Perform swaps using a swap channel created with another Nitro node over the mirr
* Switch to the `nitro-node` directory: * Switch to the `nitro-node` directory:
```bash ```bash
DEPLOYMENTS_DIR=<path-to-deployments-dir> cd <path-to-deployments-dir>
cd $DEPLOYMENTS_DIR/nitro-node
``` ```
* Check status of the mirrored channel on L2: * Check status of the mirrored channel on L2:
@ -738,7 +734,7 @@ Perform swaps using a swap channel created with another Nitro node over the mirr
* Switch to deployments dir: * Switch to deployments dir:
```bash ```bash
cd $DEPLOYMENTS_DIR/nitro-node cd <path-to-deployments-dir>
``` ```
* Stop all Nitro services running in the background: * Stop all Nitro services running in the background:
@ -780,7 +776,7 @@ Perform swaps using a swap channel created with another Nitro node over the mirr
* Stop the deployment: * Stop the deployment:
```bash ```bash
cd $DEPLOYMENTS_DIR/nitro-node cd <path-to-deployments-dir>
laconic-so deployment --dir l1-nitro-deployment stop laconic-so deployment --dir l1-nitro-deployment stop
``` ```