Add command to send ETH to given address

This commit is contained in:
Shreerang Kale 2024-10-23 16:48:59 +05:30
parent 9ea7154094
commit e14e84baef
2 changed files with 41 additions and 24 deletions

View File

@ -1,6 +1,8 @@
# Nitro Token Ops
## Setup
## Deploy and transfer custom tokens
### Setup
* Go to the directory where `nitro-contracts-deployment` is present:
@ -8,7 +10,7 @@
cd /srv/bridge
```
## Deploy new token
### Deploy new token
* To deploy another token:
@ -48,7 +50,7 @@
* 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:
@ -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"
```
## 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
```
* 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 ETH](./ops/nitro-token-ops.md#transfer-eth)
* Check balance of your tokens once they are transferred:
```bash
# Note: Account address should be without "0x"
export ACCOUNT_ADDRESS="<account-address>"
export GETH_CHAIN_ID="1212"
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_2=$(jq -r --arg chainId "$GETH_CHAIN_ID" '.[$chainId][0].contracts.TestToken2.address' assets.json)
@ -107,11 +111,12 @@
```bash
# Set absolute path to desired deployments directory (under your user)
# Example: /home/dev/nitro-node-deployments
...
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
@ -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:
```bash
cd testnet-ops/nitro-nodes-setup
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:
```bash
DEPLOYMENTS_DIR=<path-to-deployments-dir>
cd $DEPLOYMENTS_DIR/nitro-node
cd <path-to-deployments-dir>
# Check the logs, ensure that the nodes are running
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:
```bash
DEPLOYMENTS_DIR=<path-to-deployments-dir>
cd $DEPLOYMENTS_DIR/nitro-node
cd <path-to-deployments-dir>
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:
```bash
DEPLOYMENTS_DIR=<path-to-deployments-dir>
cd $DEPLOYMENTS_DIR/nitro-node
cd <path-to-deployments-dir>
```
* 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:
```bash
DEPLOYMENTS_DIR=<path-to-deployments-dir>
cd $DEPLOYMENTS_DIR/nitro-node
cd <path-to-deployments-dir>
```
* 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:
```bash
cd $DEPLOYMENTS_DIR/nitro-node
cd <path-to-deployments-dir>
```
* 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:
```bash
cd $DEPLOYMENTS_DIR/nitro-node
cd <path-to-deployments-dir>
laconic-so deployment --dir l1-nitro-deployment stop
```