diff --git a/ops/nitro-token-ops.md b/ops/nitro-token-ops.md index f09790b..c5967c7 100644 --- a/ops/nitro-token-ops.md +++ b/ops/nitro-token-ops.md @@ -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="" + + laconic-so deployment --dir fixturenet-eth-deployment exec foundry "cast send $TO_ADDRESS --value 1ether --from $FUNDED_ADDRESS --private-key $FUNDED_PK" + ``` diff --git a/testnet-nitro-node.md b/testnet-nitro-node.md index a96da50..11f61ee 100644 --- a/testnet-nitro-node.md +++ b/testnet-nitro-node.md @@ -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="" + export GETH_CHAIN_ID="1212" export GETH_CHAIN_URL="https://fixturenet-eth.laconic.com" - export 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: ... - # Will create deployments at /nitro-node/l1-nitro-deployment and /nitro-node/l2-nitro-deployment + # Will create deployments at /l1-nitro-deployment and /l2-nitro-deployment ``` ## Run Nitro Nodes @@ -120,10 +125,9 @@ 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 - ``` + ```bash + cp ../hosts.example.ini hosts.ini + ``` * Edit the [`hosts.ini`](./hosts.ini) file to run the playbook on a remote machine: @@ -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= - - cd $DEPLOYMENTS_DIR/nitro-node + cd # 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= - - cd $DEPLOYMENTS_DIR/nitro-node + cd 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= - - cd $DEPLOYMENTS_DIR/nitro-node + cd ``` * 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= - - cd $DEPLOYMENTS_DIR/nitro-node + cd ``` * 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 ``` * 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 laconic-so deployment --dir l1-nitro-deployment stop ```