Skip to content

Commit

Permalink
Merge pull request #5 from coinmetrics/3-finish-code-skeleton
Browse files Browse the repository at this point in the history
Finish Code Skeleton
  • Loading branch information
hayden-yuma authored Dec 3, 2024
2 parents 894afb4 + 4120ea0 commit 442f832
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ repos:
language: system
pass_filenames: false
always_run: true
args: [--branch, main, --branch, staging, --branch, dev]
args: [--branch, master, --branch, staging, --branch, dev]
- id: trailing-whitespace
name: trim trailing whitespace
description: trims trailing whitespace.
Expand Down
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 Opentensor

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
25 changes: 14 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@

| | |
| :-: | :-: |
Badges here?
| **Status** | <img src="https://img.shields.io/github/v/release/coinmetrics/precog?label=Release" height="25"/> <img src="https://img.shields.io/github/actions/workflow/status/coinmetrics/precog/ci.yml?label=Build" height="25"/> <br> <a href="https://github.com/pre-commit/pre-commit" target="_blank"> <img src="https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white&label=Pre-Commit" height="25"/> </a> <a href="https://github.com/psf/black" target="_blank"> <img src="https://img.shields.io/badge/code%20style-black-000000.svg?label=Code%20Style" height="25"/> </a> <br> <img src="https://img.shields.io/github/license/coinmetrics/precog?label=License" height="25"/> |
| **Activity** | <img src="https://img.shields.io/github/commit-activity/m/coinmetrics/precog?label=Commit%20Activity" height="25"/> <img src="https://img.shields.io/github/commits-since/coinmetrics/precog/latest/dev?label=Commits%20Since%20Latest%20Release" height="25"/> <br> <img src="https://img.shields.io/github/release-date/coinmetrics/precog?label=Latest%20Release%20Date" height="25"/> <img src="https://img.shields.io/github/last-commit/coinmetrics/precog/dev?label=Last%20Commit" height="25"/> <br> <img src="https://img.shields.io/github/contributors/coinmetrics/precog?label=Contributors" height="25"/> |
| **Compatibility** | <img src="https://img.shields.io/badge/dynamic/toml?url=https%3A%2F%2Fraw.githubusercontent.com%2Fcoinmetrics%2Fprecog%2Frefs%2Fheads%2Fdev%2Fpyproject.toml&query=%24.tool.poetry.dependencies.python&logo=python&label=Python&logoColor=yellow" height="25"/> <img src="https://img.shields.io/badge/dynamic/toml?url=https%3A%2F%2Fraw.githubusercontent.com%2Fcoinmetrics%2Fprecog%2Frefs%2Fheads%2Fdev%2Fpyproject.toml&query=%24.tool.poetry.dependencies.bittensor&prefix=v&label=Bittensor" height="25"/> <br> <img src="https://img.shields.io/badge/dynamic/toml?url=https%3A%2F%2Fraw.githubusercontent.com%2Fcoinmetrics%2Fprecog%2Frefs%2Fheads%2Fdev%2Fpyproject.toml&query=%24.tool.poetry.dependencies.coinmetrics-api-client&prefix=v&label=coinmetrics-api-client" height="25"/> |
| **Social** | <a href="" target="_blank"> <img src="https://img.shields.io/website?url=https%3A%2F%2Fcharts.coinmetrics.io%2Fcrypto-data%2F&up_message=CoinMetrics&label=Website" height="25"/> </a> |


</div>
Expand All @@ -20,8 +23,8 @@ Badges here?
- [Running a Miner](#running-a-miner)
- [Running a Validator](#running-a-validator)
- [About the Rewards Mechanism](#about-the-rewards-mechanism)
- [Compute Requirements](#compute-requirements)
- [Roadmap](#roadmap)
- [Compute Requirements](#compute-requirements)
- [License](#license)

---
Expand Down Expand Up @@ -56,7 +59,7 @@ cd precog

Create and source a python virtual environment:
```
python3 -m venv
python3 -m venv
source .venv/bin/activate
```

Expand All @@ -75,23 +78,23 @@ Start by editing the Makefile with you wallet and network information.

### Running a Miner
TODO: write this \
Base miner:
Base miner:
1. Run the command:
```
make miner
```
make miner
```
Custom miner:
1. Write a custom forward function stored in precog/miners/your_function.py
1. Write a custom forward function stored in precog/miners/your_function.py
- This function should handle how the miner responds to requests from the validator
- Within the function, synapse.predictions and synapse.interval should be set.
- See [forward.py](https://github.com/coinmetrics/precog/blob/master/precog/miners/forward.py) for an example
- See [forward.py](https://github.com/coinmetrics/precog/blob/master/precog/miners/forward.py) for an example
2. Add a command to Makefile.
- copy the miner command and rename it (e.g. miner_custom) in Makefile
- replace the --forward_function argument with your_function
3. Run the Command:
```
make miner_custom
```
make miner_custom
```
Expand Down Expand Up @@ -119,7 +122,7 @@ TODO: update these
This repository is licensed under the MIT License.
```text
# The MIT License (MIT)
# Copyright © 2024 Foundry Digital LLC
# Copyright © 2024 CoinMetrics LLC
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
# documentation files (the “Software”), to deal in the Software without restriction, including without limitation
Expand Down
8 changes: 8 additions & 0 deletions docs/Release Notes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Release Notes
=============

1.0.0
-----
Release on
- ...
- ...
4 changes: 2 additions & 2 deletions precog/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import json
import importlib.metadata

__version__ = "0.0.0"
__version__ = importlib.metadata.version(__name__ or __package__)
version_split = __version__.split(".")
__spec_version__ = (1000 * int(version_split[0])) + (10 * int(version_split[1])) + (1 * int(version_split[2]))
Empty file added tests/__init__.py
Empty file.
14 changes: 14 additions & 0 deletions tests/test_package.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import unittest

from precog import __version__


class TestPackage(unittest.TestCase):

def setUp(self):
pass

def test_package_version(self):
# Check that version is as expected
# Must update to increment package version successfully
self.assertEqual(__version__, "0.1.0")

0 comments on commit 442f832

Please sign in to comment.