Skip to content

Commit 68979f6

Browse files
committed
refactor: porting to torus
1 parent f2cac8a commit 68979f6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+922
-2731
lines changed

.vscode/settings.json

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,23 @@
11
{
2-
"cSpell.words": [
3-
"COMAI",
4-
"communex",
5-
"dmap",
6-
"fastapi",
7-
"keypair",
8-
"netuid",
9-
"openai",
10-
"PKCS",
11-
"pydantic",
12-
"substrateinterface",
13-
"typer",
14-
"unstake",
15-
"uvicorn"
16-
]
2+
"cSpell.words": [
3+
"COMAI",
4+
"torus",
5+
"dmap",
6+
"fastapi",
7+
"keypair",
8+
"netuid",
9+
"openai",
10+
"PKCS",
11+
"pydantic",
12+
"torustrateinterface",
13+
"typer",
14+
"unstake",
15+
"uvicorn"
16+
],
17+
// "python.analysis.extraPaths": ["./sources"],
18+
19+
"python.analysis.extraPaths": ["/home/manjairo/tcheco/torustrate-interface"],
20+
"python.autoComplete.extraPaths": [
21+
"/home/manjairo/tcheco/torustrate-interface"
22+
]
1723
}

Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,17 @@ test_slow:
3838
pytest -k "slow"
3939

4040
docs_run:
41-
@echo "URL: http://localhost:8080/communex"
42-
pdoc -n --docformat google ./src/communex
41+
@echo "URL: http://localhost:8080/torus"
42+
pdoc -n --docformat google ./src/torus
4343

4444
docs_generate:
45-
pdoc communex \
45+
pdoc torus \
4646
--docformat google \
4747
--output-directory ./docs/_build \
4848
--logo assets/logo.png \
4949
--favicon assets/favicon.ico \
50-
--logo-link https://github.com/agicommies/communex \
51-
--edit-url communex=https://github.com/agicommies/communex/blob/main/src/communex/
50+
--logo-link https://github.com/agicommies/torus \
51+
--edit-url torus=https://github.com/agicommies/torus/blob/main/src/torus/
5252

5353
docs_copy_assets:
5454
mkdir -p ./docs/_build/assets

README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
44
[![Discord Chat](https://img.shields.io/badge/discord-join%20chat-blue.svg)](https://go.agicommies.org/commune-discord)
5-
[![PyPI version](https://badge.fury.io/py/communex.svg)](https://pypi.org/project/communex/)
5+
[![PyPI version](https://badge.fury.io/py/torus.svg)](https://pypi.org/project/torus/)
66

7-
- [Why CommuneX](#why-communex)
7+
- [Why CommuneX](#why-torus)
88
- [Installation with `pip`](#installation-with-pip)
99
- [Installation with Nix](#installation-with-nix)
1010
- [Features](#features)
@@ -20,27 +20,27 @@
2020
CommuneX serves as an alternative library/SDK to the original [Commune
2121
Ai](https://github.com/commune-ai/commune) codebase, offering a streamlined and
2222
user-friendly experience. It is designed for simplicity and scalable
23-
development. To learn more [visit docs](https://docs.communex.ai/communex)
23+
development. To learn more [visit docs](https://docs.torus.ai/torus)
2424

2525
## Installation with `pip`
2626

2727
Requirements: Python 3.10+
2828

29-
Install the `communex` Python package directly with `pip`:
29+
Install the `torus` Python package directly with `pip`:
3030

3131
```sh
32-
pip install communex
32+
pip install torus
3333
```
3434

3535
Or add it to your Poetry project with:
3636

3737
```sh
38-
poetry add communex
38+
poetry add torus
3939
```
4040

4141
## Installation with Nix
4242

43-
To install `communex` the communex cli with Nix
43+
To install `torus` the torus cli with Nix
4444
```sh
4545
nix profile install .
4646
```
@@ -176,16 +176,16 @@ it can [require some enviroment-specific binaries to be installed][ruff-installa
176176

177177
## Commune compatibility
178178

179-
Yes, `communex` is compatible with the `commune` library/CLI. However, there are
180-
important considerations to note. `communex` verifies the integrity of your
179+
Yes, `torus` is compatible with the `commune` library/CLI. However, there are
180+
important considerations to note. `torus` verifies the integrity of your
181181
keys, which means that mixing certain types of keys is not permissible.
182182
Specifically, if you possess node keys or other similar types that are not
183183
designed to receive tokens, you to relocate them outside of the key
184184
directory.
185185

186186
---
187187

188-
[open an issue on GitHub]: https://github.com/agicommies/communex/issues/new/choose
189-
[CommuneX Discord channel]: https://go.agicommies.org/communex-channel
190-
[GitHub discussions page]: https://github.com/agicommies/communex/discussions
188+
[open an issue on GitHub]: https://github.com/agicommies/torus/issues/new/choose
189+
[CommuneX Discord channel]: https://go.agicommies.org/torus-channel
190+
[GitHub discussions page]: https://github.com/agicommies/torus/discussions
191191
[ruff-installation]: https://docs.astral.sh/ruff/installation/

docs/modules/miner.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,20 @@ The `comx module serve` command is a powerful tool that allows you to effortless
99
To install the Communex CLI, run the following command:
1010

1111
```sh
12-
pip install communex
12+
pip install torus
1313
```
1414

1515
## Usage
1616

1717
To serve a Python module, ensure that it's a class inheriting from our `Module` class. Then, use our `endpoint` decorator on the methods that you want to expose as endpoints. You can refer to the `example` folder to see this being done.
1818

19-
With a class that inherits from `Module` and the communex CLI installed, you can simply run:
19+
With a class that inherits from `Module` and the torus CLI installed, you can simply run:
2020

2121
```
2222
comx module serve <qualified_path> <key>
2323
```
2424

25-
- `qualified_path`: The dotted path to the class that should be served. For example, `communex.module.example.openai.OpenAI`.
25+
- `qualified_path`: The dotted path to the class that should be served. For example, `torus.module.example.openai.OpenAI`.
2626
- `port`: The port that the API should run on your computer.
2727
- `key`: The name of the key file of your module.
2828
- `subnets`: The subnets that your module will serve. Calls from keys of any other subnet will be refused.
@@ -44,7 +44,7 @@ export OPENAI_API_KEY=your_openai_api_key
4444
Then run the following command:
4545

4646
```sh
47-
comx module serve communex.module.example.gpt.OpenAIModule <key>
47+
comx module serve torus.module.example.gpt.OpenAIModule <key>
4848
```
4949

5050
To run module using pm2, install it globally:
@@ -56,7 +56,7 @@ npm install -g pm2
5656
Then run the following command:
5757

5858
```sh
59-
pm2 start "comx module serve communex.module.example.gpt.OpenAIModule <key>" --name "openai"
59+
pm2 start "comx module serve torus.module.example.gpt.OpenAIModule <key>" --name "openai"
6060
```
6161

6262
## Communication

docs/running_a_node/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ wget https://github.com/agicommies/subspace/raw/current/specs/main.json
4444
You can currently get the bootnodes list with:
4545

4646
```sh
47-
wget https://github.com/agicommies/communex/raw/main/docs/bootnodes.txt
47+
wget https://github.com/agicommies/torus/raw/main/docs/bootnodes.txt
4848
```
4949

5050
## Deploying the config

flake.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@
3434
];
3535
};
3636
packages = rec {
37-
communex = p2n.mkPoetryApplication {
37+
torus = p2n.mkPoetryApplication {
3838
projectDir = ./.;
3939
python = python;
4040
overrides = p2n-overrides;
4141
};
42-
default = communex;
42+
default = torus;
4343
};
4444
});
4545
}

nix/poetry2nix-overrides.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ let
44
lib = pkgs.lib;
55

66
pypkgs-build-requirements = {
7-
communex = [ "poetry-core" ];
7+
torus = [ "poetry-core" ];
88
keylimiter = [ "poetry-core" ];
99
scalecodec = [ "setuptools" ];
1010
streamlit = [ "setuptools" ];

0 commit comments

Comments
 (0)