Skip to content

Commit

Permalink
Clean commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Kahtaf committed May 30, 2024
0 parents commit 9db9887
Show file tree
Hide file tree
Showing 24 changed files with 6,610 additions and 0 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
poetry.lock
6 changes: 6 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
OPENAI_API_KEY=""
REDIS_HOST=us1-primary-bream-38096.upstash.io
REDIS_PORT=38096
REDIS_PASSWORD=""
REDIS_PERSONAL_NS="kahtaf:"
PRIVATE_FILE_ENCRYPTION_PUBLIC_KEY_BASE64=""
163 changes: 163 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
.idea/

# Temporary file used to communicate with a validator via API
cli.json
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "opendata"]
path = opendata
url = https://github.com/vana-com/vana-framework.git
18 changes: 18 additions & 0 deletions Dockerfile.validator
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM python:3.11-slim-buster

ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
ENV PIP_NO_CACHE_DIR=1

WORKDIR /app
COPY . /app

RUN apt-get update && \
apt-get install -y --no-install-recommends gnupg && \
apt-get install -y vim && \
rm -rf /var/lib/apt/lists/*
RUN pip install poetry --no-cache-dir
RUN poetry config virtualenvs.create false
RUN poetry install --no-interaction --no-ansi

CMD poetry run python -m chatgpt.nodes.validator
124 changes: 124 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
<div align="center">

# **ChatGPT Data Liquidity Pool** <!-- omit in toc -->
[![Discord Chat](https://img.shields.io/discord/308323056592486420.svg)](https://discord.gg/xx98TSE8)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

---

### The first decentralized network for user-owned data <!-- omit in toc -->

[Discord](https://discord.gg/xx98TSE8)[Network](https://satori.vanascan.io)

</div>

We believe in an open internet where users own their data and the AI models they contribute to.

AI models should be created more like open source software: iteratively by a community. To make this possible, researchers need access to the world's best datasets that are held captive across walled gardens. Users can break down these walled gardens by exporting their own data.

We are building towards a user-owned foundation model, trained by 100M users who contribute their data and compute.

## Getting Started

To get started with Vana, follow these steps:

1. Clone the repository:
```shell
git clone https://github.com/vana-com/vana-network.git
```

2. Install the required dependencies using poetry:
```shell
poetry install
```
3. Configure the environment variables by copying and modifying the `.env.example` file:

4. Run the application:
```shell
poetry run python -m chatgpt.nodes.validator
```

# Wallets

Wallets are the core ownership and identity technology around which all functions on Vana are carried out.
Vana wallets consists of a coldkey and hotkey where the coldkey may contain many hotkeys, while each hotkey can only belong to a single coldkey.
Coldkeys store funds securely, and operate functions such as transfers and staking, while hotkeys are used for all online operations such as signing queries, running miners and validating.


```bash
$ poetry run python -m opendata.cli --no_version_checking wallet --help

usage: vanacli <command> <command args> wallet [-h] {balance,create,new_hotkey,new_coldkey,regen_coldkey,regen_coldkeypub,regen_hotkey,update,history} ...

positional arguments:
{balance,create,new_hotkey,new_coldkey,regen_coldkey,regen_coldkeypub,regen_hotkey,update,history}
Commands for managing and viewing wallets.
balance Checks the balance of the wallet.
create Creates a new coldkey (for containing balance) under the specified path.
new_hotkey Creates a new hotkey (for running a miner) under the specified path.
new_coldkey Creates a new coldkey (for containing balance) under the specified path.
regen_coldkey Regenerates a coldkey from a passed value
regen_coldkeypub Regenerates a coldkeypub from the public part of the coldkey.
regen_hotkey Regenerates a hotkey from a passed mnemonic
update Updates the wallet security using NaCL instead of ansible vault.
history Fetch transfer history associated with the provided wallet

options:
-h, --help show this help message and exit
```

You should be able to view your keys by navigating to ~/.opendata/wallets or viewed by running ```vanacli wallet list```
```bash
$ tree ~/.opendata/
.opendata/ # Root directory.
wallets/ # The folder containing all opendata wallets.
default/ # The name of your wallet, "default"
coldkey # You encrypted coldkey.
coldkeypub.txt # Your coldkey public address
hotkeys/ # The folder containing all of your hotkeys.
default # You unencrypted hotkey information.
```
Your default wallet ```Wallet (default, default, ~/.opendata/wallets/)``` is always used unless you specify otherwise.
Be sure to store your mnemonics safely.
If you lose your password to your wallet, or the access to the machine where the wallet is stored, you can always regenerate the coldkey using the mnemonic you saved from above.
```bash
$ poetry run python -m opendata.cli --no_version_checking wallet regen_coldkey --mnemonic **** *** **** **** ***** **** *** **** **** **** ***** *****
```

## Using the cli
The Opendata command line interface (`opendata.cli`) is the primary command line tool for interacting with the Vana network.
It can be used to deploy nodes, manage wallets, stake/unstake, nominate, transfer tokens, and more.

### Basic Usage

To get the list of all the available commands and their descriptions, you can use:

```bash
poetry run python -m opendata.cli --help

usage: vanacli <command> <command args>

vana cli v0.0.1

positional arguments:
{root,r,roots,wallet,w,wallets,stake,st,stakes,sudo,su,sudos,info,i}
root (r, roots) Commands for managing and viewing the root network.
wallet (w, wallets)
Commands for managing and viewing wallets.
stake (st, stakes) Commands for staking and removing stake from hotkey accounts.
sudo (su, sudos) Commands for DLP management
info (i) Instructions for enabling autocompletion for the CLI.

options:
-h, --help show this help message and exit
--print-completion {bash,zsh,tcsh}
Print shell tab completion script
```
## License
The MIT License (MIT)

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.
23 changes: 23 additions & 0 deletions chatgpt/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# The MIT License (MIT)
# Copyright © 2024 Corsali, Inc. dba Vana

# 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.

from dotenv import load_dotenv

load_dotenv()

__dlp_vana_contract__ = "0xf9215f0f774b6dBcd0209e24Df3aE182E9813fd7"
__dlp_base_sepolia_contract__ = "0x575dBF6B355B32B7ef94570572965EABA210CcBB"
Loading

0 comments on commit 9db9887

Please sign in to comment.