From 110eaf3e30c6a8e24f36dface3ae26f24499b938 Mon Sep 17 00:00:00 2001 From: Andy Oknen Date: Mon, 25 Nov 2024 13:32:39 +0800 Subject: [PATCH] locale ru --- docs/.vuepress/config.ts | 32 +-- docs/.vuepress/configs/navbar/en.ts | 34 +-- docs/.vuepress/configs/navbar/ru.ts | 60 ++++- docs/.vuepress/configs/sidebar/ru.ts | 56 ++++ docs/dev/node/get-started.md | 33 ++- docs/ru/dev/node/building.md | 243 ++++++++++++++++++ .../{get-started-ru.md => get-started.md} | 8 +- 7 files changed, 411 insertions(+), 55 deletions(-) create mode 100644 docs/ru/dev/node/building.md rename docs/ru/dev/node/{get-started-ru.md => get-started.md} (95%) diff --git a/docs/.vuepress/config.ts b/docs/.vuepress/config.ts index 814724f..5159c98 100644 --- a/docs/.vuepress/config.ts +++ b/docs/.vuepress/config.ts @@ -78,30 +78,30 @@ export default defineUserConfig({ // navbar navbar: navbarRu, selectLanguageName: 'Русский', - selectLanguageText: '选择语言', - selectLanguageAriaLabel: '选择语言', + selectLanguageText: 'Выбрать язык', + selectLanguageAriaLabel: 'Выбрать язык', // sidebar sidebar: sidebarRu, // page meta - editLinkText: '在 GitHub 上编辑此页', - lastUpdatedText: '上次更新', - contributorsText: '贡献者', + editLinkText: 'Редактировать эту страницу на GitHub', + lastUpdatedText: 'Последнее обновление', + contributorsText: 'Участники', // custom containers - tip: '提示', - warning: '注意', - danger: '警告', + tip: 'Совет', + warning: 'Предупреждение', + danger: 'Опасность', // 404 page notFound: [ - '这里什么都没有', - '我们怎么到这来了?', - '这是一个 404 页面', - '看起来我们进入了错误的链接', + 'Здесь ничего нет', + 'Как мы сюда попали?', + 'Это страница 404', + 'Похоже, мы перешли по неправильной ссылке', ], - backToHome: '返回首页', + backToHome: 'Вернуться на главную', // a11y - openInNewWindow: '在新窗口打开', - toggleColorMode: '切换颜色模式', - toggleSidebar: '切换侧边栏', + openInNewWindow: 'Открыть в новом окне', + toggleColorMode: 'Переключить цветовой режим', + toggleSidebar: 'Переключить боковую панель', }, }, diff --git a/docs/.vuepress/configs/navbar/en.ts b/docs/.vuepress/configs/navbar/en.ts index dcf7b4a..6143bdf 100644 --- a/docs/.vuepress/configs/navbar/en.ts +++ b/docs/.vuepress/configs/navbar/en.ts @@ -8,15 +8,15 @@ export const navbarEn: NavbarOptions = [ { text: 'Get Started', children: [ - '/guide/getting-started.md', - '/guide/easy-node/', - '/guide/full-node/', + 'guide/getting-started.md', + 'guide/easy-node/', + 'guide/full-node/', ], }, { text: 'Monetization', children: [ - '/guide/monetization/', + 'guide/monetization/', ], }, ], @@ -34,29 +34,29 @@ export const navbarEn: NavbarOptions = [ { text: 'Blockchain Node', children: [ - '/dev/node/get-started.md', - '/dev/node/source.md', - '/dev/node/building.md', - '/dev/node/usage.md', - '/dev/node/rpc.md', + 'dev/node/get-started.md', + 'dev/node/source.md', + 'dev/node/building.md', + 'dev/node/usage.md', + 'dev/node/rpc.md', ], }, { text: 'Proxy & API', children: [ - '/dev/api/introduction.md', - '/dev/api/get-started.md', - '/dev/api/rpc.md', - '/dev/api/miniapps.md', + 'dev/api/introduction.md', + 'dev/api/get-started.md', + 'dev/api/rpc.md', + 'dev/api/miniapps.md', ], }, { text: 'Applications', children: [ - '/dev/apps/introduction.md', - '/dev/apps/get-started.md', - '/dev/apps/mini-apps.md', - '/dev/apps/barteron-app.md', + 'dev/apps/introduction.md', + 'dev/apps/get-started.md', + 'dev/apps/mini-apps.md', + 'dev/apps/barteron-app.md', ], }, ], diff --git a/docs/.vuepress/configs/navbar/ru.ts b/docs/.vuepress/configs/navbar/ru.ts index 133327d..d0a8d71 100644 --- a/docs/.vuepress/configs/navbar/ru.ts +++ b/docs/.vuepress/configs/navbar/ru.ts @@ -2,5 +2,63 @@ import type { NavbarOptions } from '@vuepress/theme-default' import { VERSION } from '../meta.js' export const navbarRu: NavbarOptions = [ - + { + text: 'User Center', + children: [ + { + text: 'Get Started', + children: [ + 'guide/getting-started.md', + 'guide/easy-node/', + 'guide/full-node/', + ], + }, + { + text: 'Monetization', + children: [ + 'guide/monetization/', + ], + }, + ], + }, + { + text: 'Developer Docs', + children: [ + { + text: 'Platform Overview', + children: [ + 'dev/introduction.md', + 'dev/CONTRIBUTING.md', + ], + }, + { + text: 'Blockchain Node', + children: [ + 'dev/node/get-started.md', + 'dev/node/source.md', + 'dev/node/building.md', + 'dev/node/usage.md', + 'dev/node/rpc.md', + ], + }, + { + text: 'Proxy & API', + children: [ + 'dev/api/introduction.md', + 'dev/api/get-started.md', + 'dev/api/rpc.md', + 'dev/api/miniapps.md', + ], + }, + { + text: 'Applications', + children: [ + 'dev/apps/introduction.md', + 'dev/apps/get-started.md', + 'dev/apps/mini-apps.md', + 'dev/apps/barteron-app.md', + ], + }, + ], + }, ] as NavbarOptions diff --git a/docs/.vuepress/configs/sidebar/ru.ts b/docs/.vuepress/configs/sidebar/ru.ts index e54d410..d5fab7a 100644 --- a/docs/.vuepress/configs/sidebar/ru.ts +++ b/docs/.vuepress/configs/sidebar/ru.ts @@ -1,5 +1,61 @@ import type { SidebarOptions } from '@vuepress/theme-default' export const sidebarRu: SidebarOptions = { + '/ru/guide/': [ + { + text: 'Users', + children: [ + 'guide/getting-started.md', + 'guide/monetization/', + 'guide/easy-node/', + 'guide/full-node/', + ], + }, + ], + + '/ru/dev/': [ + { + text: 'Developers', + children: [ + 'introduction.md', + 'CONTRIBUTING.md', + ], + }, + ], + '/ru/dev/node': [ + { + text: 'Blockchain Node', + children: [ + 'get-started.md', + 'source.md', + 'building.md', + 'usage.md', + 'rpc.md', + ], + }, + ], + '/ru/dev/api': [ + { + text: 'Proxy & API', + children: [ + 'todo.md', + 'introduction.md', + 'get-started.md', + 'rpc.md', + 'miniapps.md', + ], + }, + ], + '/ru/dev/apps': [ + { + text: 'Applications', + children: [ + 'introduction.md', + 'get-started.md', + 'mini-apps.md', + 'barteron-app.md', + ], + }, + ], } diff --git a/docs/dev/node/get-started.md b/docs/dev/node/get-started.md index ce61dd9..e48e494 100644 --- a/docs/dev/node/get-started.md +++ b/docs/dev/node/get-started.md @@ -1,31 +1,30 @@ -# Начало работы +# Getting Started -Добро пожаловать в документацию по проекту Pocketnet Core. Этот документ предназначен для ознакомления с работой над кодом узла блокчейна для сети Pocketnet. Pocketnet Core в основном написан на C++ и является форком Bitcoin, что определяет наличие множества параллелей с ним. +Welcome to the documentation for the Pocketnet Core project. This document is intended to familiarize you with the blockchain node code for the Pocketnet network. Pocketnet Core is primarily written in C++ and is a fork of Bitcoin, which means there are many parallels with it. -## Что такое наша сеть? +## What is the Pocketnet Network? -Pocketnet представляет собой одноранговую сеть, которая поддерживает работу блокчейна с возможностью хранения открытых данных внутри блокчейна для создания отказоустойчивого хранилища. Узлы в сети Pocketnet называются Pocketnet Core и являются своего рода точками входа в сеть. Каждый узел хранит полную копию данных и выполняет функции базы данных, валидатора и веб-сервера. Основное назначение такой сети — хранение данных, защищенных стандартными механизмами шифрования, применяемыми в блокчейне Биткоин для защиты транзакций. Данные в сети не шифруются на уровне узла, но подписаны ключом автора и защищены от подделки. +Pocketnet is a peer-to-peer network that supports blockchain operations with the ability to store open data within the blockchain to create a fault-tolerant storage. Nodes in the Pocketnet network are called Pocketnet Core and serve as entry points to the network. Each node stores a full copy of the data and functions as a database, validator, and web server. The main purpose of such a network is to store data protected by standard encryption mechanisms used in the Bitcoin blockchain to secure transactions. Data in the network is not encrypted at the node level but is signed with the author's key and protected from tampering. -В качестве альтернатив, решающих аналогичные задачи, можно привести следующие проекты: +Alternative projects that solve similar tasks include: - [BitTorrent](https://www.bittorrent.com/) - [IPFS](https://ipfs.tech/) - [FileCoin](https://filecoin.io/) -Каждый из этих проектов имеет свои преимущества и недостатки, Pocketnet отличается следующими особенностями: -- Сеть Pocketnet обладает механизмами хранения небольших объемов данных, защищенных шифрованием, что гарантирует пользователю их подлинность. -- Узлы Pocketnet оснащены встроенным RPC веб-сервером, который позволяет работать с данными так, как если бы они хранились на классическом веб-сервере. -- Узлы Pocketnet не требуют авторизации для доступа к данным, необходим только приватный ключ — привет интернету web3. -- Транзакции в сети делятся на "денежные", плата за которые определяется динамически в зависимости от размера, и "социальные", плата за которые фиксирована и составляет 1 минимальную единицу койна (1 сатоши), что позволяет строить разнообразные приложения, не требуя существенной платы за использование. +Each of these projects has its advantages and disadvantages, and Pocketnet is distinguished by the following features: +- The Pocketnet network has mechanisms for storing small amounts of data protected by encryption, ensuring their authenticity for the user. +- Pocketnet nodes are equipped with a built-in RPC web server, allowing data to be accessed as if it were stored on a classic web server. +- Pocketnet nodes do not require authorization to access data; only a private key is needed — welcome to the web3 internet. +- Transactions in the network are divided into "monetary," for which the fee is determined dynamically based on size, and "social," for which the fee is fixed at 1 minimum coin unit (1 satoshi), allowing for the creation of various applications without requiring significant usage fees. +## Source Code -## Исходный код +Pocketnet is based on the [Bitcoin](https://github.com/bitcoin/bitcoin) code, so most of the mechanisms and logic of Bitcoin are applied in Pocketnet. More details about the project structure and source code are described in the [Source Code](source.md) section. -Pocketnet базируется на коде [Bitcoin](https://github.com/bitcoin/bitcoin), поэтому большая часть механизмов и логики Биткоин применяется и в Pocketnet. Более подробно о структуре проекта и исходном коде описано в разделе [Исходный Код](/dev/node/source.md) +## Building and Environment Setup -## Сборка и настройка окружение +Various compilation options, release processes, and IDE setup instructions are described in the [Building](building.md) section. -Разнообразные варианты компиляции, процессы выпуска релизов, а также инструкции по настройке IDE, описаны в разделе [Building](/dev/node/building.md). +## Usage -## Использование - -Загрузка, запуск и работа с узлами PocketnetCore подробно описаны в разделе [Usage](/dev/node/usage.md). \ No newline at end of file +Loading, launching, and working with PocketnetCore nodes are detailed in the [Usage](usage.md) section. \ No newline at end of file diff --git a/docs/ru/dev/node/building.md b/docs/ru/dev/node/building.md new file mode 100644 index 0000000..2783c75 --- /dev/null +++ b/docs/ru/dev/node/building.md @@ -0,0 +1,243 @@ +# Building + +## Introduction + +This guide describes various ways to compile the PocketnetCore node or its individual components. By following the instructions in this document, you can obtain the following binary files and installation packages: + +- `pocketcoind` - the node daemon, which: + - Runs the node in headless mode + - Is managed through the `pocketcoin.conf` configuration file + - Provides an RPC API for external interaction + +- `pocketcoin-qt` - the GUI client, which: + - Includes the full functionality of the daemon + - Provides a wallet interface + - Contains developer tools (RPC console, peer management) + - Allows configuring node parameters through a graphical interface + +- `pocketcoin-cli` - a console utility for: + - Interacting with the node via RPC + - Managing the wallet + - Retrieving statistics + - Configuring logging + +The build can be performed for individual components or as a complete package. Installation packages are supported: +- `NSIS` for Windows +- `DEB` for Debian/Ubuntu +- `DMG` for macOS + +This guide describes two main approaches to building: +1. For development (using CMake) +2. For release versions (using GNU Make) + +## Getting Started + +### System Requirements + +- Minimum 4 GB RAM (8 GB recommended) +- 50 GB free disk space +- Processor with 64-bit instruction support +- Operating system: + - Linux (Ubuntu 22.04 or newer) + - Windows 10/11 + - macOS 11 or newer + +### Prerequisites + +Before starting the build, make sure you have installed: + +- Git +- C++ compiler (GCC 9+ for Linux, MSVC for Windows, Clang for macOS) +- CMake 3.20 or newer (for building with CMake) +- Python 3.8 or newer +- Administrator rights in the system to install dependencies + +### Development Recommendations + +- It is recommended to use Docker for development environment isolation +- Use version control system (git) to track changes +- For development, it is preferable to use CMake and modern IDEs (VSCode, CLion) +- When encountering dependency issues, check library versions in `depends/` + +### Important Notes + +- Build can take significant time (30-60 minutes depending on the system) +- When building for release, use tags from the main repository +- It is recommended to start with a debug build for development +- Document all code changes and update tests when necessary + +## Usage Docker Container + +[Docker](https://www.docker.com/) provides powerful tools for application development and deployment, offering the following advantages: + +- Isolation of development environment from the host operating system +- Guaranteed environment reproducibility across different machines +- Easy dependency management and configuration +- Quick switching between different environment versions +- Resource efficiency compared to virtual machines +- Convenient scaling and deployment + +While using Docker is not mandatory for building the project, it helps avoid dependency issues during operation. Due to the minimum version requirement of `cmake v3.20+`, the Linux version in the Docker container must be at least `ubuntu:22.04`. This restriction does not apply when building with `make`. + +## Clone Repository + +Download the project from the official repository (git installation required). The main branch is valid for working in the Main network but may include commits that belong to the BETA stage. It is recommended to switch the repository to the latest tag. + +```sh +apt-get update +apt-get install git +git clone https://github.com/pocketnetteam/pocketnet.core +cd pocketnet.core/ +# Checkout latest stable tag +git checkout $(git describe --tags "$(git rev-list --tags --max-count=1)") +``` + +## Preparing Dependency Packages + +The next stage involves preparing the environment and installing the minimum set of packages needed to start project compilation. Depending on the target OS, the set of additional packages and process varies slightly. + +### Installing System Requirements + +#### Linux x64 + +```sh +apt-get update +apt-get install make automake cmake curl bzip2 g++-multilib pkg-config \ + python3 bison +``` + +#### Linux arm64 + +```sh +# TODO : implement +``` + +#### Windows x64 + +```sh +# TODO : implement +``` + +#### MacOS x64 (intel) + +```sh +# TODO : implement +``` + +#### MacOS arm64 (mX) + +```sh +# TODO : implement +``` + +### Building Dependencies + +The `depends/` directory contains all necessary packages for building, which allow compiling code for different platforms. + +```sh +cd depends/ +make +cd .. +``` + +To build dependencies for another platform (cross-compilling), you need to pass the `HOST` argument to the `make` compiler specifying the target platform. + +```sh +host_platform="x86_64-pc-linux-gnu" +make HOST=$host_platform +``` + +Common tested `host_platform` for cross compilation are: +- `x86_64-pc-linux-gnu` for Linux (64-bit) +- `x86_64-w64-mingw32` for Windows (64-bit) +- `x86_64-apple-darwin16` for macOS (64-bit) +- `arm64-apple-darwin` for ARM macOS (64-bit) + + +## Configuration and Compilation + +### `cmake` + +:::tip +This type of build is in testing phase and not intended for production use. +::: + +```sh +mkdir build && cd build +cmake -DCMAKE_PREFIX_PATH=$PWD/../depends/$host_platform .. +cmake --build . --config Debug -j 8 +``` + +The following files will be compiled as a result: +``` +└─ build/ + └─ src/ + └─ qt/ + │ └─ pocketcoin-qt + ├─ pocketcoind + ├─ pocketcoin-cli +``` + +### `make` + +The main method for building executables and installation packages. + +```sh +./autogen.sh +CONFIG_SITE=$PWD/depends/$host_platform/share/config.site ./configure --prefix=/usr/local +make +``` + +The following files will be compiled as a result: +``` +└─ src/ + └─ qt/ + │ └─ pocketcoin-qt + ├─ pocketcoind + └─ pocketcoin-cli +``` + +### `make deploy` + +Final versions (Releases) are compiled using `make`, installation packages are built using `make deploy`: + +```sh +make deploy +``` + +The following files will be compiled as a result: +``` +└─ src/ + ├─ pocketnetcore_X.Y.Z_linux_x64_setup.deb + └─ pocketnetcore_X.Y.Z_linux_x64.tar.gz +``` + +:::tip +The version of the final files is determined by the `./share/version.sh` script and depends on the current GIT commit. For releases, tags in the format `X.Y.Z` are used. +::: + +## Usage VSCode + +When using the `CMake` extension, you can manage project configuration and compilation using VSCode tools. To do this, you need to create a configuration file `.vscode/settings.json` and specify the full path to the dependencies directory: + +```sh +mkdir .vscode +touch .vscode/settings.json +``` + +CMake control parameters in `.vscode/settings.json` file: + +```json +{ + ... + "cmake.configureArgs": [ + "-DCMAKE_PREFIX_PATH=/full/path/project/depends/host_platform" + ], + "cmake.parallelJobs": 8, + ... +} +``` + +## Usage JetBrains CLion + +TODO : implement \ No newline at end of file diff --git a/docs/ru/dev/node/get-started-ru.md b/docs/ru/dev/node/get-started.md similarity index 95% rename from docs/ru/dev/node/get-started-ru.md rename to docs/ru/dev/node/get-started.md index ce61dd9..07267fe 100644 --- a/docs/ru/dev/node/get-started-ru.md +++ b/docs/ru/dev/node/get-started.md @@ -2,7 +2,7 @@ Добро пожаловать в документацию по проекту Pocketnet Core. Этот документ предназначен для ознакомления с работой над кодом узла блокчейна для сети Pocketnet. Pocketnet Core в основном написан на C++ и является форком Bitcoin, что определяет наличие множества параллелей с ним. -## Что такое наша сеть? +## Что такое сеть Pocketnet? Pocketnet представляет собой одноранговую сеть, которая поддерживает работу блокчейна с возможностью хранения открытых данных внутри блокчейна для создания отказоустойчивого хранилища. Узлы в сети Pocketnet называются Pocketnet Core и являются своего рода точками входа в сеть. Каждый узел хранит полную копию данных и выполняет функции базы данных, валидатора и веб-сервера. Основное назначение такой сети — хранение данных, защищенных стандартными механизмами шифрования, применяемыми в блокчейне Биткоин для защиты транзакций. Данные в сети не шифруются на уровне узла, но подписаны ключом автора и защищены от подделки. @@ -20,12 +20,12 @@ Pocketnet представляет собой одноранговую сеть, ## Исходный код -Pocketnet базируется на коде [Bitcoin](https://github.com/bitcoin/bitcoin), поэтому большая часть механизмов и логики Биткоин применяется и в Pocketnet. Более подробно о структуре проекта и исходном коде описано в разделе [Исходный Код](/dev/node/source.md) +Pocketnet базируется на коде [Bitcoin](https://github.com/bitcoin/bitcoin), поэтому большая часть механизмов и логики Биткоин применяется и в Pocketnet. Более подробно о структуре проекта и исходном коде описано в разделе [Исходный Код](source.md) ## Сборка и настройка окружение -Разнообразные варианты компиляции, процессы выпуска релизов, а также инструкции по настройке IDE, описаны в разделе [Building](/dev/node/building.md). +Разнообразные варианты компиляции, процессы выпуска релизов, а также инструкции по настройке IDE, описаны в разделе [Building](building.md). ## Использование -Загрузка, запуск и работа с узлами PocketnetCore подробно описаны в разделе [Usage](/dev/node/usage.md). \ No newline at end of file +Загрузка, запуск и работа с узлами PocketnetCore подробно описаны в разделе [Usage](usage.md). \ No newline at end of file