UNPKG

ethereumos

Version:

CLI for interacting with the Ethereum OS

205 lines (148 loc) 4.88 kB
# Ethos CLI A command-line interface (CLI) for interacting with the Ethereum OS platform. --- ## Installation Install the Ethos CLI globally using npm: ```bash npm install -g ethos ```` ----- ## Configuration ### Initialize Configuration Set up the CLI with your private key: ```bash ethos init --private-key your_private_key_here ``` This creates a configuration file at `~/.ethos/config.json`. **Do not share this file\!** ----- ## Command Reference Here is a quick reference for all available commands. | Command | Description | | :--- | :--- | | `ethos init --private-key <key>` | Initializes and saves your private key to the config file. | | `ethos private-key --set <key>` | Updates the configuration with a new private key. | | `ethos private-key --delete` | Deletes the private key from the configuration file. | | `ethos rpc` | Lists available RPC endpoints. | | `ethos rpc --select <index>` | Selects a default RPC endpoint from the list by its index. | | `ethos rpc --add <url>` | Adds a new custom RPC endpoint to the list. | | `ethos gm` | Sends a "GM" transaction to stay active. | | `ethos claim` | Claims your pending $AIR token rewards. | | `ethos stats` | Displays key stats like APY, your balance, and token price. | | `ethos buy <amount_in_eth>` | Buys a specified amount of $AIR tokens using ETH. | | `ethos sell <amount_of_air>` | Sells a specified amount of your $AIR tokens for ETH. | ----- ## Usage - **Say GM**: ```bash ethos gm ``` Sends a "GM" transaction to keep your account active in the Ethereum OS. - **Claim Pending $AIR Tokens**: ```bash ethos claim ``` Claims pending $AIR tokens based on the ponzi rewards APY. - **Display Stats**: ```bash ethos stats ``` Displays Ethereum OS stats: total GM, current APY, your balance,and token price. - **Buy $AIR Tokens**: ```bash ethos buy <amount_in_eth> ``` Buys a specified amount of $AIR tokens using ETH. For example, to buy 0.1 ETH worth of $AIR: `ethos buy 0.1` - **Sell $AIR Tokens**: ```bash ethos sell <amount_of_air> ``` Sells a specified amount of your $AIR tokens for ETH. For example, to sell 1000 $AIR: `ethos sell 1000` ----- ## Example Outputs - **Initialize**: ```bash ethos init --private-key your_private_key_here ``` Output: ``` Initializing configuration... ┏━┳━━┳┓┏┓┏━┳━━┓ ┃┳┻┓┏┫┗┛┃┃┃┃━━┫ ┃┻┓┃┃┃┏┓┃┃┃┣━━┃ ┗━┛┗┛┗┛┗┛┗━┻━━┛ Configuration saved to: ~/.ethos/config.json WARNING: Do not share your config file or private key with anyone! Ethos CLI is ready! Use 'ethos --help' to explore commands. ``` - **Say GM**: ```bash ethos gm ``` Output: ``` Connecting to RPC... Using account: 0xYourAccountAddress Preparing to say GM... Checking account status... Account is active Checking gas balance... Gas balance sufficient Saying GM... Sending transaction... Transaction sent: 0x123...abc Waiting for confirmation... Transaction confirmed in block: 567890 Success: GM successfully said! Don't forget to say GM every day! ``` - **Claim Tokens**: ```bash ethos claim ``` Output: ``` Connecting to RPC... Using account: 0xYourAccountAddress Preparing to claim $AIR tokens... Checking pending $AIR tokens... Pending $AIR tokens: 50 Checking gas balance... Gas balance sufficient Claiming $AIR tokens for account 0xYourAccountAddress... Sending transaction... Transaction sent: 0x123...abc Waiting for confirmation... Transaction confirmed in block: 567890 Success: Claimed 50 $AIR tokens. Current balance: 1000 $AIR. ``` - **Display Stats**: ```bash ethos stats ``` Output: ``` Connecting to RPC... Using account: 0xYourAccountAddress Fetching Ethereum OS stats... Fetching total GM... Fetching current APY... Fetching your balance... Fetching token price from Moralis... Token price fetched successfully Ethereum OS Stats: Total GM: 15295 Current APY: 12%/day Your Balance: 0.0 $AIR Price: 0.006530834029666094 USD on Uniswap v2 24hr Price Change: -0.0005671457331588997 USD ``` ----- ## Security - Do not share your private key or `~/.ethos/config.json`. - Remove the configuration file with `rm -rf ~/.ethos` when not in use. - Ensure your account has enough ETH for gas fees on mainnet. ----- ## Notes - The CLI uses default RPC endpoints automatically. - RPC selection prompt appears only if the connection fails. - Contract address: `0x8164B40840418C77A68F6f9EEdB5202b36d8b288` (mainnet). <!-- end list -->