Skip to content

Commit 5c2c171

Browse files
committed
init: Initialize the project
0 parents  commit 5c2c171

File tree

13 files changed

+2736
-0
lines changed

13 files changed

+2736
-0
lines changed

.gitignore

Lines changed: 216 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,216 @@
1+
# Byte-compiled / optimized / DLL files
2+
**/__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
*.pyc
6+
7+
# Remove notebooks.
8+
*.ipynb
9+
10+
# weigths and biases
11+
wandb/
12+
13+
*.csv
14+
*.torch
15+
*.pt
16+
*.log
17+
18+
# runs/data/models/logs/~
19+
data/
20+
**/data/
21+
22+
# C extensions
23+
*.so
24+
25+
# IDE
26+
*.idea/
27+
28+
# VSCODE
29+
.vscode/
30+
31+
# Distribution / packaging
32+
.Python
33+
build/
34+
develop-eggs/
35+
dist/
36+
downloads/
37+
eggs/
38+
.eggs/
39+
lib/
40+
lib64/
41+
parts/
42+
sdist/
43+
var/
44+
wheels/
45+
share/python-wheels/
46+
*.egg-info/
47+
.installed.cfg
48+
*.egg
49+
MANIFEST
50+
51+
# PyInstaller
52+
# Usually these files are written by a python script from a template
53+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
54+
*.manifest
55+
*.spec
56+
57+
# Installer logs
58+
pip-log.txt
59+
pip-delete-this-directory.txt
60+
61+
# Unit test / coverage reports
62+
htmlcov/
63+
.tox/
64+
.nox/
65+
.coverage
66+
.coverage.*
67+
.cache
68+
nosetests.xml
69+
coverage.xml
70+
*.cover
71+
*.py,cover
72+
.hypothesis/
73+
.pytest_cache/
74+
cover/
75+
76+
# Translations
77+
*.mo
78+
*.pot
79+
80+
# Django stuff:
81+
*.log
82+
local_settings.py
83+
db.sqlite3
84+
db.sqlite3-journal
85+
86+
# Flask stuff:
87+
instance/
88+
.webassets-cache
89+
90+
# Scrapy stuff:
91+
.scrapy
92+
93+
# Sphinx documentation
94+
docs/_build/
95+
96+
# PyBuilder
97+
.pybuilder/
98+
target/
99+
100+
# Jupyter Notebook
101+
.ipynb_checkpoints
102+
103+
# IPython
104+
profile_default/
105+
ipython_config.py
106+
107+
# pyenv
108+
# For a library or package, you might want to ignore these files since the code is
109+
# intended to run in multiple environments; otherwise, check them in:
110+
# .python-version
111+
112+
# pipenv
113+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
114+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
115+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
116+
# install all needed dependencies.
117+
#Pipfile.lock
118+
119+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
120+
__pypackages__/
121+
122+
# Celery stuff
123+
celerybeat-schedule
124+
celerybeat.pid
125+
126+
# SageMath parsed files
127+
*.sage.py
128+
129+
# Environments
130+
.env
131+
.venv
132+
env/
133+
venv/
134+
ENV/
135+
env.bak/
136+
venv.bak/
137+
138+
# Spyder project settings
139+
.spyderproject
140+
.spyproject
141+
142+
# Rope project settings
143+
.ropeproject
144+
145+
# mkdocs documentation
146+
/site
147+
148+
# mypy
149+
.mypy_cache/
150+
.dmypy.json
151+
dmypy.json
152+
153+
# Pyre type checker
154+
.pyre/
155+
156+
# pytype static type analyzer
157+
.pytype/
158+
159+
# Cython debug symbols
160+
cython_debug/
161+
# Generated by Cargo
162+
# will have compiled files and executables
163+
**/target/
164+
# These are backup files generated by rustfmt
165+
**/*.rs.bk
166+
167+
.DS_Store
168+
169+
# The cache for docker container dependency
170+
.cargo
171+
172+
# The cache for chain data in container
173+
.local
174+
175+
# State folder for all neurons.
176+
**/data/*
177+
!data/.gitkeep
178+
179+
# misc
180+
.DS_Store
181+
.env.local
182+
.env.development.local
183+
.env.test.local
184+
.env.production.local
185+
186+
# PIPY Stuff
187+
hetu_pycli.egg-info
188+
hetu_pycli*.egg
189+
bdist.*
190+
191+
npm-debug.log*
192+
yarn-debug.log*
193+
yarn-error.log*
194+
195+
**/build/*
196+
**/dist/*
197+
**/runs/*
198+
**/env/*
199+
**/data/*
200+
**/.data/*
201+
**/tmp/*
202+
203+
**/.bash_history
204+
**/*.xml
205+
**/*.pstats
206+
**/*.png
207+
208+
# Replicate library
209+
**/.replicate
210+
replicate.yaml
211+
**/run.sh
212+
213+
# Notebooks
214+
*.ipynb
215+
216+
tests/zombienet/bin/**/*

LICENSE

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
The MIT License (MIT)
2+
Copyright © 2021 Hetu project
3+
4+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
5+
documentation files (the “Software”), to deal in the Software without restriction, including without limitation
6+
the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
7+
and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
8+
9+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of
10+
the Software.
11+
12+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
13+
THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
14+
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
15+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
16+
DEALINGS IN THE SOFTWARE.

Makefile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
SHELL:=/bin/bash
2+
3+
init-venv:
4+
python3 -m venv venv && source ./venv/bin/activate
5+
6+
clean-venv:
7+
source ./venv/bin/activate && \
8+
pip freeze > make_venv_to_uninstall.txt && \
9+
pip uninstall -r make_venv_to_uninstall.txt && \
10+
rm make_venv_to_uninstall.txt
11+
12+
clean:
13+
rm -rf dist/ && \
14+
rm -rf build/ && \
15+
rm -rf hetu_pycli.egg-info/ && \
16+
rm -rf .pytest_cache/ && \
17+
rm -rf lib/
18+
19+
install:
20+
python3 -m pip install .
21+
22+
install-dev:
23+
python3 -m pip install '.[dev]'

README.md

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
<div align="center">
2+
3+
# Hetu Chain CLI <!-- omit in toc -->
4+
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5+
[![Twitter](https://img.shields.io/badge/Twitter-@hetu_protocol-1DA1F2?logo=twitter&logoColor=white)](https://x.com/hetu_protocol)
6+
<!-- [![PyPI version](https://badge.fury.io/py/hetu_pycli.svg)](https://badge.fury.io/py/hetu_pycli) -->
7+
8+
---
9+
10+
### Causality Graph Future In Web3
11+
12+
[SDK](https://github.com/hetu-project/hetu-pysdk)[Chain](https://github.com/hetu-project/hetu-chain)[Research](https://docsend.com/v/jt55f/hetu_litepaper)
13+
14+
15+
</div>
16+
17+
---
18+
19+
The Hetu CLI, `hetucli`, is a powerful command line tool for interacting with the Hetu blockchain. You can use it on any macOS, Linux, or WSL terminal to manage wallets, transfer HETU, query balances, interact with smart contracts, and more. Help information can be invoked for every command and option with `--help`.
20+
21+
## Documentation
22+
23+
Installation steps are described below. For full documentation on how to use `hetucli`, see the [Hetu CLI section](https://github.com/hetu-project/hetu-pycli#readme) on the developer documentation site.
24+
25+
---
26+
27+
## Features
28+
- Wallet management (create, query balance, export private key)
29+
- HETU transfer, signing, send transaction
30+
- Query on-chain balance
31+
- Contract call (read-only)
32+
- Command line powered by Typer
33+
34+
---
35+
36+
## Install on macOS and Linux
37+
38+
You can install `hetucli` on your local machine directly from source or PyPI. **Make sure you verify your installation after you install**:
39+
40+
### Install from [PyPI](https://pypi.org/project/hetu-pycli/)
41+
42+
Run
43+
```bash
44+
pip install -U hetu-pycli
45+
```
46+
47+
### Install from source
48+
49+
1. Clone the Hetu CLI repo.
50+
51+
```bash
52+
git clone https://github.com/hetu-project/hetu-pycli.git
53+
```
54+
55+
2. `cd` into `hetu-pycli` directory.
56+
57+
```bash
58+
cd hetu-pycli
59+
```
60+
61+
3. Create and activate a virtual environment.
62+
63+
```bash
64+
make init-venv
65+
```
66+
4. Install dependencies and the CLI:
67+
68+
Using Poetry
69+
```bash
70+
pip install -U pip setuptools poetry
71+
poetry install
72+
```
73+
74+
Or, using Pip:
75+
```bash
76+
pip install .
77+
```
78+
79+
80+
---
81+
82+
## Usage
83+
84+
You can invoke the CLI using the following command:
85+
86+
```bash
87+
python -m hetu_pycli.cli --help
88+
```
89+
90+
Or, if installed as a script:
91+
92+
```bash
93+
hetucli --help
94+
```
95+
96+
### Wallet management
97+
```bash
98+
hetucli wallet create
99+
hetucli wallet balance <address> --rpc <rpc_url>
100+
```
101+
102+
### Transfer
103+
```bash
104+
hetucli tx send --private-key <key> --to <address> --value <hetu> --rpc <rpc_url>
105+
```
106+
107+
### Contract call
108+
```bash
109+
hetucli contract call --address <contract_addr> --abi-path <abi.json> --function <fn> --args "1,2,3" --rpc <rpc_url>
110+
```
111+
112+
---
113+
114+
## License
115+
116+
This project is licensed under the MIT License.

0 commit comments

Comments
 (0)