Skip to content

Commit

Permalink
[doc] updating README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
tavakyan committed Jul 30, 2024
1 parent 9645ded commit 641bc0e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 deletions.
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,12 @@ To generate a wallet for deposits:
2. To generate a wallet:
- Execute `solana-keygen new --no-outfile` or `solana-keygen new --outfile my-wallet.json`.
3. Copy the public key from the output, which should resemble `6g8wB6cJbodeYaEb5aD9QYqhdxiS8igfcHpz36oHY7p8`.
## Installation

## Installation (via npm)

TODO

## Installation (via GitHub)

1. Clone this repository:
```bash
Expand All @@ -43,26 +48,21 @@ To generate a wallet for deposits:

1. Run the CLI tool with the necessary options:
```bash
eclipse-deposit deposit -k <path_to_private_key> -d <solana_destination_address> -a <amount_in_ether> --mainnet|--sepolia [-r <rpc_url>]
node bin/cli.js -k <path_to_private_key> -d <solana_destination_address> -a <amount_in_ether> --mainnet|--sepolia
```

For example:

**Mainnet Deposit:**
```bash
eclipse-deposit deposit -k /path/to/private-key.txt -d 6g8wB6cJbodeYaEb5aD9QYqhdxiS8igfcHpz36oHY7p8 -a 0.01 --mainnet
node bin/cli.js -k private-key.txt -d 6g8wB6cJbodeYaEb5aD9QYqhdxiS8igfcHpz36oHY7p8 -a 0.002 --mainnet
```

**Sepolia Testnet Deposit:**
```bash
eclipse-deposit deposit -k /path/to/private-key.txt -d 6g8wB6cJbodeYaEb5aD9QYqhdxiS8igfcHpz36oHY7p8 -a 0.01 --sepolia
node bin/cli.js -k private-key.txt -d 6g8wB6cJbodeYaEb5aD9QYqhdxiS8igfcHpz36oHY7p8 -a 0.002 --sepolia
```

**With Custom RPC URL:**
```bash
eclipse-deposit deposit -k /path/to/private-key.txt -d 6g8wB6cJbodeYaEb5aD9QYqhdxiS8igfcHpz36oHY7p8 -a 0.01 --mainnet -r https://custom-rpc-url
```

-
- The `-k, --key-file` option specifies the path to the Ethereum private key file.
- The `-d, --destination` option specifies the Solana destination address on the rollup (base58 encoded).
- The `-a, --amount` option specifies the amount of Ether to deposit.
Expand Down
13 changes: 7 additions & 6 deletions bin/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@
* Script to deposit funds to the Eclipse rollup.
*
* Usage:
* node deposit.js [Solana Address] [EtherBridge Address] [Amount in Gwei] [Private Key] [JSON RPC URL]
* # To deposit on Sepolia
* node bin/cli.js --address [Solana Address] --amount [Amount Ether] --key-file [Private Key File] --sepolia
*
* Example on Anvil devnode:
* node deposit.js EAjFK3iWqYdRbCAuDhfCNHo2EMj3S7eg5QrU7DMcNEXD 0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0 1500000 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 http://localhost:8545
* # To deposit on Mainnet
* node bin/cli.js --address [Solana Address] --amount [Amount Ether] --key-file [Private Key File] --mainnet
*
* Example on EtherBridge (0x11b8db6bb77ad8cb9af09d0867bb6b92477dd68e) on Sepolia test network:
* node deposit.js 6g8wB6cJbodeYaEb5aD9QYqhdxiS8igfcHpz36oHY7p8 0x11b8db6bb77ad8cb9af09d0867bb6b92477dd68e 1500000 <use-your-sepolia-private-key> https://rpc2.sepolia.org
* Transaction hash: 0x335c067c7280aa3bd2d688cd4c8695c86b3f7fe785be5379c5d98731db0269cf
* Example on Sepolia:
* > node bin/cli.js --address EAjFK3iWqYdRbCAuDhfCNHo2EMj3S7eg5QrU7DMcNEXD --amount 0.002 --key-file private-key.txt --sepolia
* > Transaction hash: 0x335c067c7280aa3bd2d688cd4c8695c86b3f7fe785be5379c5d98731db0269cf
*/
import { Command } from 'commander';
import { runDeposit } from '../src/lib.js'; // Note the `.js` extension
Expand Down

0 comments on commit 641bc0e

Please sign in to comment.