Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
120 changes: 120 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,124 @@
# Created by .ignore support plugin (hsz.mobi)
### Python template
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class


# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
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/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

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

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

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

#PyCharm
.idea/
.idea/$CACHE_FILE$
.idea/.gitignore
.idea/encodings.xml
.idea/inspectionProfiles/
.idea/misc.xml
.idea/modules.xml
.idea/ton_client.iml
.idea/vcs.xml

*.DS_Store
.idea/
__pycache__/
test.py
.vscode/
venv/
venv38/
sandbox/
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[submodule "mypylib"]
path = mypylib
url = https://github.com/igroman787/mypylib.git
url = https://github.com/igroman787/mypylib
[submodule "mypyconsole"]
path = mypyconsole
url = https://github.com/igroman787/mypyconsole.git
url = https://github.com/igroman787/mypyconsole
File renamed without changes.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,4 +155,4 @@ Ready. A local copy of toncenter is available at `http://<server-ip-address>:800
git: https://github.com/igroman787/pytonv3

# Useful links
* https://docs.ton.org/
* https://docs.ton.org/
2 changes: 1 addition & 1 deletion docs/en/FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,4 @@ If you need to restart your validator, you can do so by running the following co
systemctl restart validator
```

Ensure you have sufficient permissions to execute these commands and make necessary adjustments. Always remember to back up important data before performing operations that could potentially affect your validator.
Ensure you have sufficient permissions to execute these commands and make necessary adjustments. Always remember to back up important data before performing operations that could potentially affect your validator.
5 changes: 1 addition & 4 deletions docs/en/import-wallets.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@ MyTonCtrl supports various types of wallet-like contracts, including wallet-v1,
## Importing Using a Private Key

If you have access to a private key, you can easily import a wallet. Enter the following command into the console:

```
iw <wallet-addr> <wallet-secret-key>
```

Here, `<wallet-secret-key>` is your private key in base64 format.

## Importing Using a Mnemonic Phrase
Expand All @@ -32,5 +30,4 @@ If you have a mnemonic phrase (a sequence of 24 words like `tattoo during ...`),
6. Open the mytonctrl console and list the wallets using the `wl` command.
7. Verify that the wallet has been imported and displays the correct balance.
8. You can now send funds using the `mg` command. Enter `mg` to view the help documentation.

Remember to replace placeholders (words inside `< >`) with your actual values when running commands.
Remember to replace placeholders (words inside `< >`) with your actual values when running commands.
2 changes: 1 addition & 1 deletion docs/en/nominator-pool.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,4 @@ If you're creating a pool for numerous nominators, you might use something like

2. Await the return of both your stakes from the elector.

3. Proceed with the steps under "Running the Validator in Nominator Pool Mode" from the **4th step** onwards.
3. Proceed with the steps under "Running the Validator in Nominator Pool Mode" from the **4th step** onwards.
2 changes: 1 addition & 1 deletion docs/ru/FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,4 @@ Error: expected str, bytes or os.PathLike object, not NoneType
systemctl restart validator
```

Убедитесь, что у вас есть достаточные права для выполнения этих команд и сделайте необходимые корректировки. Всегда помните о резервном копировании важных данных перед выполнением операций, которые могут потенциально повлиять на ваш валидатор.
Убедитесь, что у вас есть достаточные права для выполнения этих команд и сделайте необходимые корректировки. Всегда помните о резервном копировании важных данных перед выполнением операций, которые могут потенциально повлиять на ваш валидатор.
4 changes: 2 additions & 2 deletions docs/ru/import-wallets.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ iw <адрес-кошелька> <секретный-ключ-кошелька>
```
node index.js word1 word2 ... word24 [address]
```
4. Скрипт сгенерирует `wallet.pk` и `wallet.addr`. Переименуйте их в `imported_wallet.pk` и `imported_wallet.addr`.
4. Скрипт сгенерирует `wallet.pk` и `wallet.addr`. Переименуйте их в `imported_wallet.pk` и `imported_wallet.addr`.
5. Скопируйте оба файла в каталог `~/.local/share/mytoncore/wallets/`.
6. Откройте консоль mytonctrl и перечислите кошельки с помощью команды `wl`.
7. Убедитесь, что кошелек был импортирован и отображает правильный баланс.
8. Теперь вы можете отправить средства с помощью команды `mg`. Введите `mg`, чтобы просмотреть справочную документацию.

Помните, что при выполнении команд следует заменить заполнители (слова внутри `< >`) на ваши фактические значения.
Помните, что при выполнении команд следует заменить заполнители (слова внутри `< >`) на ваши фактические значения.
2 changes: 1 addition & 1 deletion docs/ru/nominator-pool.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,4 @@

2. Дождитесь, когда оба ваших депозита вернутся от электора.

3. Следуйте инструкциям "Запуск валидатора в режиме номинантского пула", начиная с **4-го шага**.
3. Следуйте инструкциям "Запуск валидатора в режиме номинантского пула", начиная с **4-го шага**.
2 changes: 1 addition & 1 deletion docs/zh_TW/FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,4 @@ Error: expected str, bytes or os.PathLike object, not NoneType
systemctl restart validator
```

請確保你具有執行這些命令的適當權限,並進行必要的調整。在執行可能影響你的驗證者的操作之前,請始終記得備份重要數據。
請確保你具有執行這些命令的適當權限,並進行必要的調整。在執行可能影響你的驗證者的操作之前,請始終記得備份重要數據。
2 changes: 1 addition & 1 deletion docs/zh_TW/import-wallets.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ iw <wallet-addr> <wallet-secret-key>
7. 確認錢包已經匯入並且餘額正確。
8. 現在你可以使用 `mg` 命令發送金錢(輸入 `mg` 可查看使用說明)。

在執行命令時,記得將尖括號內的佔位符(例如 `<wallet-addr>`、`<wallet-secret-key>`)替換為實際的值。
在執行命令時,記得將尖括號內的佔位符(例如 `<wallet-addr>`、`<wallet-secret-key>`)替換為實際的值。
2 changes: 1 addition & 1 deletion docs/zh_TW/manual-ubuntu.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,4 @@

要檢查 **mytoncrl** 日誌,對於本地用戶,打開 `~/.local/share/mytoncore/mytoncore.log`,對於 Root,打開 `/usr/local/bin/mytoncore/mytoncore.log`。

![logs](https://raw.githubusercontent.com/ton-blockchain/mytonctrl/master/screens/manual-ubuntu_mytoncore-log.png)
![logs](https://raw.githubusercontent.com/ton-blockchain/mytonctrl/master/screens/manual-ubuntu_mytoncore-log.png)
2 changes: 1 addition & 1 deletion docs/zh_TW/nominator-pool.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,4 @@

2. 等待你的兩個賭注從選民那裡返回。

3. 從**第四步**開始,按照"在提名人池模式下運行驗證者"的步驟進行操作。
3. 從**第四步**開始,按照"在提名人池模式下運行驗證者"的步驟進行操作。
4 changes: 4 additions & 0 deletions mytoncore/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from .utils import *
from .mytoncore import *
from mypylib.mypylib import MyPyClass
from mypyconsole.mypyconsole import MyPyConsole
5 changes: 5 additions & 0 deletions mytoncore/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from mytoncore.functions import mytoncore


if __name__ == '__main__':
mytoncore()
27 changes: 27 additions & 0 deletions mytoncore/fift.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import subprocess


class Fift:
def __init__(self, local):
self.local = local
self.appPath = None
self.libsPath = None
self.smartcontsPath = None
#end define

def Run(self, args, **kwargs):
fift_timeout = self.local.db.fift_timeout if self.local.db.fift_timeout else 3
timeout = kwargs.get("timeout", fift_timeout)
for i in range(len(args)):
args[i] = str(args[i])
includePath = self.libsPath + ':' + self.smartcontsPath
args = [self.appPath, "-I", includePath, "-s"] + args
process = subprocess.run(args, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, timeout=timeout)
output = process.stdout.decode("utf-8")
err = process.stderr.decode("utf-8")
if len(err) > 0:
self.local.add_log("args: {args}".format(args=args), "error")
raise Exception("Fift error: {err}".format(err=err))
return output
#end define
#end class
Loading