Skip to content

Commit

Permalink
Merge pull request #16 from JMPixelPlex/patch-7
Browse files Browse the repository at this point in the history
Patch 7
  • Loading branch information
a-bahdanau authored Nov 29, 2024
2 parents 2fc609c + dd4a2cc commit 423e04b
Show file tree
Hide file tree
Showing 14 changed files with 94 additions and 34,456 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "3rd/tvm-spec"]
path = 3rd/tvm-spec
url = https://github.com/ton-community/tvm-spec.git
1 change: 1 addition & 0 deletions 3rd/tvm-spec
Submodule tvm-spec added at 59ec1a
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,12 @@ Use Gitpod (a free, online VS code-like IDE) for contributing. It will launch a

### Local (default way)

1. Download repository from GitHub
1. Download repository from GitHub with its submodules

```
git clone --recursive https://github.com/ton-community/ton-docs.git
```
2. Install last version [NodeJS LTS](https://nodejs.org/en/download/) to run local build
3. Open Terminal in project directory
4. Install dependencies with command:
Expand Down
2 changes: 1 addition & 1 deletion cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,6 @@
"sidebars",
"i18n",
".husky",
"warnings.txt"
"3rd/*"
]
}
6 changes: 3 additions & 3 deletions docs/v3/documentation/dapps/defi/tokens.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import Button from '@site/src/components/button'

[Distributed TON tokens overview](https://telegra.ph/Scalable-DeFi-in-TON-03-30)

> TON-powered tokens and NFTs do not have a single center and do not create bottlenecks.
> TON-powered tokens and NFTs are decentralized, avoiding single points of failure and bottlenecks.
>
> Each NFT in a given collection is a separate smart contract. The token balance for each user is stored in a separate user wallet.
>
> Smart contracts interact with one another directly, spreading the load on the whole network.
> Smart contracts interact directly with one another, distributing the load across the entire network.
>
> With the growth in user and transaction count, the load will still be even, allowing the network to scale.
> As the number of users and transactions grows, the network maintains an even load, enabling seamless scalability.
## TON Course: Jettons & NFTs

Expand Down
13 changes: 13 additions & 0 deletions docs/v3/documentation/smart-contracts/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,19 @@ Tact by Example

</Button>

### 📗 Tolk

A new language for writing smart contracts in TON. Think of Tolk as the "**next‑generation FunC**"

:::caution
Under active development.
:::

<Button href="/v3/documentation/smart-contracts/tolk/overview" colorType={'primary'} sizeType={'sm'}>

Tolk Overview

</Button>

### 📕 Fift (advanced)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ Saving 1 MB of data for one year on TON will cost 6.01 TON. Note that you usuall

### Is it possible to send a gasless transaction?

At present, this opportunity is not available. We are actively working on its development. Please stay tuned for updates.
In TON, gasless transactions are possible using [wallet v5](/v3/documentation/smart-contracts/contracts-specs/wallet-contracts#preparing-for-gasless-transactions) a relayer that pays the gas fee for transaction.

### How to calculation?

Expand Down
36 changes: 36 additions & 0 deletions docs/v3/guidelines/dapps/apis-sdks/overview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Overview

The purpose of this article is to help you choose the right tools for application development in TON ecosystem.

## TMA development

* Use [Mini Apps SDKs](/v3/guidelines/dapps/tma/overview#mini-apps-sdks) for [Telegram Mini Apps](/v3/guidelines/dapps/tma/overview) development.
* Choose [JS/TS-based SDK](/v3/guidelines/dapps/apis-sdks/sdk#typescript--javascript) for interacting with TON blockchain.

## DApps development

* Use Tolk, FunC or Tact [programming languages](/v3/documentation/smart-contracts/overview#programming-languages) for TON blockchain smart contracts development for your [DApp](/v3/guidelines/dapps/overview) if needed.
* To interacts with TON blockchain and process its data choose listed [SDK](/v3/guidelines/dapps/apis-sdks/sdk). One of the most popular languages for this purpose are:
* [JS/TS](/v3/guidelines/dapps/apis-sdks/sdk#typescript--javascript)
* [Go](/v3/guidelines/dapps/apis-sdks/sdk#go)
* [Python](/v3/guidelines/dapps/apis-sdks/sdk#python)
* To integrate user authentication with their TON Wallets (also payments processing logic) into your DApp use [TON Connect](/v3/guidelines/ton-connect/overview).

## TON Statistics analyzer

You may need fast interaction with TON blockchain or collect and analyze its data. For these purposes it may be helpful to run your own [Ton Node](/v3/documentation/infra/nodes/node-types).

* [Liteserver Node](/v3/guidelines/nodes/running-nodes/liteserver-node) - just for interaction with blockchain.
* [Archive Node](/v3/guidelines/nodes/running-nodes/archive-node) - collecting extended historical data of a blockchain.

Use SDKs with native [ADNL](/v3/documentation/network/protocols/adnl/adnl-tcp) support:
* [Go](https://github.com/xssnick/tonutils-go)
* [Python](https://github.com/yungwine/pytoniq)


## See Also

* [SDKs](/v3/guidelines/dapps/apis-sdks/sdk)
* [TMA Tutorials](/v3/guidelines/dapps/tma/tutorials/step-by-step-guide)
* [TON Connect Tutorials](/v3/guidelines/ton-connect/guidelines/how-ton-connect-works)
* [Payments Processing](/v3/guidelines/dapps/asset-processing/payments-processing)
43 changes: 19 additions & 24 deletions docs/v3/guidelines/nodes/node-maintenance-and-security.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,35 +7,30 @@ This document assumes that a validator is installed using the configuration and

## <a id="maintenance"></a>Maintenance
### <a id="database-grooming"></a>Database grooming
TON Node/Validator keeps it's database within the path specified by `--db` flag of `validator-engine`, usually `/var/ton-work/db`, this directory is created and managed by the node but it is recommended to perform a database grooming/cleanup task once a month to remove some artifacts.
TON Node keeps its database within the path specified by `--db` flag of `validator-engine`, usually `/var/ton-work/db`. To reduce the database size, you can decrease the TTL (time-to-live) of some stored data.

:::caution Do not forget to stop validator process
You **must** stop the validator process before performing the steps outlined below, failure to do that will likely cause database corruption.
:::
Current TTL values can be found in the node service file (default path is `/etc/systemd/system/validator.service`). If you use MyTonCtrl you can use command `installer status`. If some of the values are not set, then the default values are used.

The procedure takes ~5 minutes to complete and will not cause major service disruption.
### archive-ttl

#### Switch to root
```sh
sudo -s
```
#### Stop validator service
```sh
systemctl stop validator
```
#### Verify that validator is not running
```sh
systemctl status validator
```
#### Perform database cleanup
```sh
find /var/ton-work/db -name 'LOG.old*' -exec rm {} +
`archive-ttl` is a parameter that defines the time-to-live for the blocks. The default value is 604800 seconds (7 days). You can decrease this value to reduce the database size.

```bash
MyTonCtrl> installer set_node_argument --archive-ttl <value>
```
#### Start validator service
```sh
systemctl start validator

If you don't use MyTonCtrl then you can edit the node service file.

### state-ttl

`state-ttl` is a parameter that defines the time-to-live for the blocks states. The default value is 86400 seconds (24 hours). You can decrease this value to reduce the database size, but for validators it's highly recommended to use the default value (keep the flag unset).
Also, this value should be more than length of the validation period (the value can be found in [15th config param](https://docs.ton.org/v3/documentation/network/configs/blockchain-configs#param-15)).

```bash
MyTonCtrl> installer set_node_argument --state-ttl <value>
```
Verify that the validator process is running by analysing the processes and log. Validator should re-sync with the network within a few minutes.

If you don't use MyTonCtrl then you can edit the node service file.

### <a id="backups"></a>Backups
The easiest and most efficient way to backup the validator is to copy crucial node configuration files, keys and mytonctrl settings:
Expand Down
10 changes: 8 additions & 2 deletions docs/v3/guidelines/smart-contracts/howto/wallet.md
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ import { TonClient } from '@ton/ton';
import { mnemonicToWalletKey } from '@ton/crypto';

const client = new TonClient({
endpoint: "https://toncenter.com/api/v2/jsonRPC",
endpoint: "https://toncenter.com/api/v2/jsonRPC", // you can replace it on https://testnet.toncenter.com/api/v2/jsonRPC for testnet
apiKey: "put your api key" // you can get an api key from @tonapibot bot in Telegram
});

Expand Down Expand Up @@ -1026,7 +1026,13 @@ log.Println("Contract address:", contractAddress.String()) // Output contract ad
</TabItem>
</Tabs>

Using the State Init, we can now build the message and send it to the blockchain. To carry out this process **a minimum wallet balance of 0.1 TON** (the balance can be less, but this amount is guaranteed to be sufficient) is required. To accomplish this, we’ll need to run the code mentioned earlier in the tutorial, get the correct wallet address and send 0.1 TON to this address.
Using the State Init, we can now build the message and send it to the blockchain.

:::warning
To carry out this process, **a minimum wallet balance of 0.1 TON** is required (the balance can be less, but this amount is guaranteed to be sufficient). To accomplish this, we’ll need to run the code mentioned earlier in the tutorial, obtain the correct wallet address, and send 0.1 TON to this address. Alternatively, you can send this sum manually via your wallet app before sending the deployment message itself.

Deployment by external messages is presented here mostly for educational purposes; in practice, it's much more convenient to [deploy smart contracts via Wallets](/v3/guidelines/smart-contracts/howto/wallet#contract-deployment-via-wallet), which will be described later.
:::

Let’s start with building the message similar to the one we built **in the previous section**:

Expand Down
2 changes: 1 addition & 1 deletion navbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ module.exports = {
label: 'Telegram Mini Apps (TMAs)',
},
{
to: 'v3/guidelines/dapps/apis-sdks/sdk',
to: 'v3/guidelines/dapps/apis-sdks/overview',
label: 'APIs and SDKs',
},
{
Expand Down
1 change: 1 addition & 0 deletions sidebars/guidelines.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ module.exports = [
type: 'category',
label: 'APIs and SDKs',
items: [
'v3/guidelines/dapps/apis-sdks/overview',
'v3/guidelines/dapps/apis-sdks/sdk',
'v3/guidelines/dapps/apis-sdks/api-types',
'v3/guidelines/dapps/apis-sdks/ton-http-apis',
Expand Down
Loading

0 comments on commit 423e04b

Please sign in to comment.