Skip to content

Commit

Permalink
Merge pull request #10 from vitwit/anil/docs
Browse files Browse the repository at this point in the history
update README
  • Loading branch information
anilcse authored Dec 12, 2024
2 parents f4d66a2 + e202a20 commit 07ecbaa
Showing 1 changed file with 85 additions and 43 deletions.
128 changes: 85 additions & 43 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# CosmoScope

CosmoScope is a command-line portfolio tracker that aggregates balances across multiple blockchain networks, including Cosmos ecosystem and EVM chains.
CosmoScope is a command-line portfolio tracker that aggregates balances across multiple blockchain networks, including Cosmos ecosystem and EVM chains. It automatically fetches network configurations and IBC assets from the Cosmos Chain Registry.

## Features

- Multi-chain portfolio tracking
- Cosmos ecosystem networks
- Cosmos ecosystem networks (auto-configured from Chain Registry)
- EVM networks (Ethereum, Polygon, etc.)
- Balance types supported:
- Wallet balances
- Staked assets
- Unclaimed rewards
- Fixed balances (Exchange/Cold storage)
- IBC token resolution
- Automatic IBC token resolution using Chain Registry
- Spam token filtering
- Real-time USD value calculation
- Detailed and summary views
Expand All @@ -25,17 +25,57 @@ CosmoScope is a command-line portfolio tracker that aggregates balances across m
git clone https://github.com/yourusername/cosmoscope.git
cd cosmoscope

# Install development dependencies
make dev-deps

# Copy and configure settings
cp configs/config_example.json configs/config.json

# Edit the configuration file with your details
vim configs/config.json

# Build the project
go build ./cmd/cosmoscope
make build

# Run tests
make test

# Run the application
make run
```

## Development

### Prerequisites

- Go 1.21 or later
- Make
- golangci-lint (installed via make dev-deps)

### Available Make Commands

```bash
make build # Build the binary
make test # Run tests
make lint # Run linter
make coverage # Generate coverage report
make clean # Clean build artifacts
make dev-deps # Install development dependencies
make deps-update # Update dependencies
make check-tools # Check tool versions
```

### Running Tests

```bash
# Run all tests
make test

# Run tests with coverage
make coverage

# Run
./cosmoscope
# View coverage report in browser
go tool cover -html=coverage.out
```

## Configuration
Expand All @@ -46,27 +86,18 @@ cp configs/config_example.json configs/config.json
```

2. Update configs/config.json with your details:
- Add your network RPC endpoints
- Configure your addresses
- Add your Moralis API key
- Set up fixed balances
- Update IBC assets mapping

Example configuration:
```json
{
"cosmos_networks": [
{
"name": "osmosis",
"api": "https://api.osmosis.zone",
"prefix": "osmo",
"chain_id": "osmosis-1"
}
],
"cosmos_addresses": ["cosmos1..."],
"evm_networks": [
{
"name": "ethereum",
"rpc": "https://eth-mainnet.alchemyapi.io/v2/YOUR-API-KEY",
"rpc": "https://mainnet.infura.io/v3/YOUR_KEY",
"chain_id": 1,
"native_token": {
"symbol": "ETH",
Expand All @@ -75,9 +106,7 @@ Example configuration:
}
}
],
"cosmos_addresses": ["osmo1..."],
"evm_addresses": ["0x..."],
"ibc_assets_file": "configs/ibc_assets.json",
"moralis_api_key": "YOUR-MORALIS-API-KEY",
"fixed_balances": [
{
Expand All @@ -89,6 +118,8 @@ Example configuration:
}
```

Note: Cosmos network configurations are now automatically fetched from the [Cosmos Chain Registry](https://github.com/cosmos/chain-registry).

## Required API Keys

1. Moralis API Key
Expand All @@ -101,29 +132,40 @@ Example configuration:
- Infura: https://infura.io/
- Or other RPC providers

## Usage
## CI/CD

The project uses GitHub Actions for continuous integration and deployment:

- Automated testing and code coverage reporting
- Linting with golangci-lint
- Multi-platform builds (Linux, macOS, Windows)
- Automatic releases on tags
- Coverage reporting with Codecov

### Release Process

To create a new release:

```bash
# Run with default config
./cosmoscope

# Example output:
*******************************************************************************
* *
* BALANCES REPORT (2024-1-2 15:4:5) *
* *
*******************************************************************************

Detailed Balance View:
+------------------+-----------+---------+----------+-----------+
| ACCOUNT | NETWORK | TOKEN | AMOUNT | USD VALUE |
+------------------+-----------+---------+----------+-----------+
| Cold Wallet | Exchange | BTC | 1.000 | $42000.00 |
| osmo1... | osmosis | OSMO | 100.000 | $500.00 |
| 0x... | ethereum | ETH | 1.500 | $3000.00 |
+------------------+-----------+---------+----------+-----------+

Portfolio Summary:
+---------+----------+-----------+----------+
| TOKEN | AMOUNT | USD VALUE | SHARE % |
+---------+----------+-----------+----------
git tag v1.0.0
git push origin v1.0.0
```

This will trigger the CI pipeline to:
1. Run tests and coverage
2. Build binaries for all platforms
3. Create a GitHub release
4. Upload binaries to the release

## Contributing

1. Fork the repository
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
3. Run tests and linting (`make test lint`)
4. Commit your changes (`git commit -m 'Add amazing feature'`)
5. Push to the branch (`git push origin feature/amazing-feature`)
6. Open a Pull Request

## License

This project is licensed under the MIT License - see the LICENSE file for details

0 comments on commit 07ecbaa

Please sign in to comment.