Skip to content

Commit

Permalink
Merge branch 'main' of github.com:ton-community/ton-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
sansx committed Aug 30, 2024
2 parents 83a05ac + 65a37fa commit f8fc0b9
Show file tree
Hide file tree
Showing 27 changed files with 1,003 additions and 51 deletions.
13 changes: 8 additions & 5 deletions docs/contribute/localization-program/how-it-works.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,17 @@ The `dev` branch runs GitHub Actions to handle synchronization tasks. You can fi
- **`sync-fork.yml`**: This workflow synchronizes documentation from the upstream repository. It runs daily at 00:00.
- **`sync-translations.yml`**: This workflow synchronizes updated translations to the respective language branches for preview purposes on the corresponding language websites.

#### 2. `localization`
#### 2. `main`
This branch stays in sync with the upstream repository through GitHub Actions running on the `dev` branch. It is also used for updating certain codes that we intend to propose to the original repository.

#### 3. `l10n_localization`
This branch includes all changes from the `localization` branch and translations from Crowdin. All modifications in this branch are committed to the upstream repository.
#### 3. `l10n_main`
This branch includes all changes from the `main` branch and translations from Crowdin. All modifications in this branch are periodically committed to the upstream repository by using a new sub-branch named `l10n_main_[some data]`.

#### 4. `[lang]_localization`
These branches are designated for specific language previews, such as `ko_localization` for Korean and `ja_localization` for Japanese. They allow us to preview the website in different languages.
#### 4. `l10n_feat` or `l10n_feat_[specific functions]`
This branch will include changes to code or documentation related to the translation system. Once all content is finalized, the changes in this branch will be merged into `l10_main`.

#### 5. `[lang]_preview`
These branches are designated for specific language previews, such as `ko_preview` for Korean and `ja_preview` for Japanese. They allow us to preview the website in different languages.

By maintaining these branches and using GitHub Actions, we efficiently manage the synchronization of our documentation and translation updates, ensuring that our multilingual content is always up to date.

Expand Down
11 changes: 11 additions & 0 deletions docs/contribute/localization-program/how-to-contribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,17 @@ All tasks are performed in **side-by-side** mode in the Crowdin Editor. To enabl
![create-tasks](/img/localizationProgramGuideline/create-tasks.png)

### Developer
- **Update Footer Configuration for Your Language :**
1. Fork our [**repository**](https://github.com/TownSquareXYZ/ton-docs/tree/i18n_feat).
2. Locate the file [**`src/theme/Footer/config.ts`**](https://github.com/TownSquareXYZ/ton-docs/blob/main/src/theme/Footer/config.ts).
3. Copy the value of the variable **`FOOTER_COLUMN_LINKS_EN`** to **`FOOTER_COLUMN_LINKS_[YOUR_LANG]`**.
4. Translate the values of the keys **`headerLangKey`** and **`langKey`** to your language, as we did for Mandarin in **`FOOTER_COLUMN_LINKS_CN`**.
5. Add a new property to **`FOOTER_LINKS_TRANSLATIONS`**:
- Set **the key** as your [**ISO language code**](https://www.andiamo.co.uk/resources/iso-language-codes/) (**two letters**, **lowercase**).
- **The value** should be the new variable you just created for your language.
6. Run the command **`yarn start:local [YOUR_IOS_LANG_CODE]`** to preview the new footer in your language.
(e.g., **`yarn start:local ru`** for a preview of the **Russian** footer)
7. If everything looks good, create a pull request to the **`i18n_feat`** branch.
- **Upload files**
- **Edit translatable text**
- **Connect integrations** (e.g., add GitHub integration)
Expand Down
1 change: 1 addition & 0 deletions docs/develop/companies/auditors.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Test your software with the following quality assurance providers.

* [certik.com](certik.com)
* [quantstamp.com](https://quantstamp.com/)
* [ton.tech](https://ton.tech/)
* [trailofbits.com](https://www.trailofbits.com/)
* [zellic.io](https://www.zellic.io/)

Expand Down
2 changes: 1 addition & 1 deletion docs/develop/dapps/apis/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

### Toncoin rate APIs

* https://tonapi.io/v2/rates?tokens=ton&currencies=ton%2Cusd%2Crub
* https://docs.tonconsole.com/tonapi/rest-api/rates
* https://coinmarketcap.com/api/documentation/v1/
* https://apiguide.coingecko.com/getting-started

Expand Down
1 change: 1 addition & 0 deletions docs/develop/dapps/apis/toncenter.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ There are different ways to connect to blockchain:

## RPC Nodes

* [Tatum](https://docs.tatum.io/reference/rpc-ton) — Access TON RPC nodes and powerful developer tools in one simple-to-use platform.
* [GetBlock Nodes](https://getblock.io/nodes/ton/) — connect and test your dApps using GetBlocks Nodes
* [TON Access](https://www.orbs.com/ton-access/) - HTTP API for The Open Network (TON).
* [Toncenter](https://toncenter.com/api/v2/) — community-hosted project for Quick Start with API. (Get an API key [@tonapibot](https://t.me/tonapibot))
Expand Down
4 changes: 4 additions & 0 deletions docs/develop/dapps/asset-processing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,10 @@ main();
7. Service should regularly poll the [getTransactions](https://toncenter.com/api/v2/#/transactions/get_transactions_getTransactions_get) method for the `wallet` contract. Matching confirmed transactions with the outgoing payments by (`destination_address`, `value`, `comment`) allows to mark payments as finished; detect and show the user the corresponding transaction hash and lt (logical time).
8. Requests to `v3` of `high-load` wallets have an expiration time equal to 60 seconds by default. After that time unprocessed requests can be safely resent to the network (see steps 3-6).

:::caution
If `value` attached is too small transaction can get aborted with error `cskip_no_gas`. In this case Toncoins will be transferred successfully but no logic on other side will be executed (TVM won't even launch). About gas limits you can read more [here](/develop/howto/blockchain-configs#param-20-and-21).
:::

### Get transaction id

It can be unclear that to get more information on transaction user must scan blockchain through [getTransactions](https://toncenter.com/api/v2/#/transactions/get_transactions_getTransactions_get) function.
Expand Down
6 changes: 4 additions & 2 deletions docs/develop/dapps/asset-processing/jettons.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ the `Jetton master contract` provides the get method `get_wallet_address(slice o
<Tabs groupId="retrieve-wallet-address">
<TabItem value="api" label="API">

> Run `get_wallet_address(slice owner_address)` through `/runGetMethod` method from the [Toncenter API](https://toncenter.com/api/v3/#/default/run_get_method_api_v3_runGetMethod_post).
> Run `get_wallet_address(slice owner_address)` through `/runGetMethod` method from the [Toncenter API](https://toncenter.com/api/v3/#/default/run_get_method_api_v3_runGetMethod_post). In real cases (not test ones) it is important to always check that wallet indeed is attributed to desired Jetton Master. Check code example for more.
</TabItem>
<TabItem value="js" label="js">
Expand Down Expand Up @@ -238,6 +238,8 @@ To send **comment** you need setup `forward payload`. Set **first 32 bits to 0x0

Finally, to retrieve `Excess` message you must set up `response destination`.

Sometimes you may encounter a `709` error when sending jetton. It says that the value of the toncoin attached to the message is not enough to send it. Make sure that `Toncoin > to_nano(TRANSFER_CONSUMPTION) + forward_ton_amount`. `TRANSFER_CONSUMPTION` in most cases may be 0.037 if the `forward_payload` is not too large. Also don't forget to attach enough `forward_ton_amount` or you can encounter a `cskip_no_gas` error if attached value too small.


:::tip
Check [best practices](/develop/dapps/asset-processing/jettons#best-practices) for _"send jettons with comments"_ example.
Expand Down Expand Up @@ -1199,4 +1201,4 @@ You can find a list of SDKs for various languages (js, python, golang, C#, Rust,

* [Payments Processing](/develop/dapps/asset-processing/)
* [NFT processing on TON](/develop/dapps/asset-processing/nfts)
* [Metadata parsing on TON](/develop/dapps/asset-processing/metadata)
* [Metadata parsing on TON](/develop/dapps/asset-processing/metadata)
2 changes: 1 addition & 1 deletion docs/develop/dapps/asset-processing/usdt.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Button from '@site/src/components/button'

## Tether

Stablecoins are a type of cryptocurrency whose value is 1:1 pegged to another asset, such as a fiat currency or gold, to maintain a stable price. Until recently, there was a jUSDT token, which is a wrapped ERC-20 from the Ethereum token bridged with [bridge.ton.org](bridge.ton.org). But on [18.04.2023](https://t.me/toncoin/824) the public launch of **native** USD₮ token issued by the company [Tether](https://tether.to/en/) was happened. After launching USD₮, the jUSDT has moved to the second priority token but is still used in services as an alternative or addition to USD₮.
Stablecoins are a type of cryptocurrency whose value is 1:1 pegged to another asset, such as a fiat currency or gold, to maintain a stable price. Until recently, there was a jUSDT token, which is a wrapped ERC-20 from the Ethereum token bridged with <a href="https://bridge.ton.org" target="_blank">bridge.ton.org</a>. But on [18.04.2023](https://t.me/toncoin/824) the public launch of **native** USD₮ token issued by the company <a href="https://tether.to/en/" target="_blank">Tether</a> was happened. After launching USD₮, the jUSDT has moved to the second priority token but is still used in services as an alternative or addition to USD₮.

In TON Blockchain USD₮ supported as a [Jetton Asset](/develop/dapps/asset-processing/jettons).

Expand Down
43 changes: 42 additions & 1 deletion docs/develop/dapps/cookbook.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -311,14 +311,15 @@ Most SDKs provide the following process for sending messages from your wallet:
- After that, you can form messages you want and send them. You can also send up to 4 messages per request, as described in an [advanced manual](/develop/smart-contracts/tutorials/wallet#sending-multiple-messages-simultaneously).

<Tabs groupId="code-examples">
<TabItem value="js-ton" label="JS (@ton)">
<TabItem value="js-ton-v4" label="JS (@ton) for Wallet V4">

```js
import { TonClient, WalletContractV4, internal } from "@ton/ton";
import { mnemonicNew, mnemonicToPrivateKey } from "@ton/crypto";

const client = new TonClient({
endpoint: 'https://testnet.toncenter.com/api/v2/jsonRPC',
apiKey: 'your-api-key', // Optional, but note that without api-key you need to send requests once per second, and with 0.25 seconds
});

// Convert mnemonics to private key
Expand All @@ -345,6 +346,46 @@ await contract.sendTransfer({

</TabItem>

<TabItem value="js-ton-v5" label="JS (@ton) for Wallet V5">

```js
import { TonClient, WalletContractV5R1, internal, SendMode } from "@ton/ton";
import { mnemonicToPrivateKey } from "@ton/crypto";

const client = new TonClient({
endpoint: 'https://testnet.toncenter.com/api/v2/jsonRPC',
apiKey: 'your-api-key', // Optional, but note that without api-key you need to send requests once per second, and with 0.25 seconds
});

// Convert mnemonics to private key
let mnemonics = "word1 word2 ...".split(" ");
let keyPair = await mnemonicToPrivateKey(mnemonics);

// Create wallet contract
let wallet = WalletContractV5R1.create({
publicKey: keyPair.publicKey,
workChain: 0, // Usually you need a workchain 0
});
let contract = client.open(wallet);

// Create a transfer
let seqno: number = await contract.getSeqno();
await contract.sendTransfer({
secretKey: keyPair.secretKey,
seqno,
sendMode: SendMode.PAY_GAS_SEPARATELY,
messages: [
internal({
to: 'EQCD39VS5jcptHL8vMjEXrzGaRcCVYto7HUn4bpAOg8xqB2N',
value: '0.05',
body: 'Example transfer body',
}),
],
});
```

</TabItem>

<TabItem value="ton-kotlin" label="ton-kotlin">

```kotlin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ More detailed and accurate description on the [Transaction Layout](/develop/data

### Transaction outcome

There is a [TVM exit code](/learn/tvm-instructions/tvm-exit-codes) for transaction which had compute phase, if it is >1 then there was an error.
There is a [TVM exit code](/learn/tvm-instructions/tvm-exit-codes) for transaction which had compute phase, if it is not 0 or 1 then there was an error.
Also TVM [compute phase may be skipped](/learn/tvm-instructions/tvm-overview#compute-phase-skipped) for some reasons like absence of funds or state.

:::info
:::info for toncenter api v3
To determine successful transaction one should use tx.description.action.success && tx.description.compute_ph.success:
:::
```json
Expand All @@ -87,8 +87,12 @@ To determine successful transaction one should use tx.description.action.success
Transaction may have one of three results:

- Success, exit code 0 or 1
- Fail, `aborted: true`
- Fail, [exit code >= 2 ](https://testnet.tonviewer.com/transaction/5889803bb1e0f58fdee381382fe1e38f74f3ea002a700441f8a21d52f7234ef8), `aborted: true`
- Fail, `aborted: true` without execution
- Fail, [exit code](/learn/tvm-instructions/tvm-exit-codes), `aborted: true`

:::info for toncenter api v3
`aborted: true` is a toncenter field, transaction has no such field
:::

## What is a Logical time?

Expand Down
2 changes: 2 additions & 0 deletions docs/learn/academy/academy-overview.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import Button from '@site/src/components/button'

# Educational Resources

### TON Speedrun
Expand Down
10 changes: 10 additions & 0 deletions docs/participate/run-nodes/archive-node.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,16 @@ Have question or need help? Please ask in the [TON dev chat](https://t.me/tondev
:::


## Tips & Tricks

### Force archive node not to store blocks

To force node not to store archive blocks use the value 86400. Check [set_node_argument section](/participate/run-nodes/mytonctrl#set_node_argument) for more.

```bash
installer set_node_argument --archive-ttl 86400
```

## See Also

* [TON Node Types](/participate/nodes/node-types)
Expand Down
10 changes: 8 additions & 2 deletions docs/participate/run-nodes/enable-liteserver-node.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ MyTonCtrl> enable_mode liteserver

## Check the firewall settings

First, verify the Liteserver port specified in your `config.json` file. This port changes with each new installation of `MyTonCtrl`. It is located in the `port` field:
First, verify the Liteserver port specified in your `/var/ton-work/db/config.json` file. This port changes with each new installation of `MyTonCtrl`. It is located in the `port` field:

```json
{
Expand Down Expand Up @@ -119,7 +119,13 @@ This way, you can open the port in the firewall settings of your server.

## Interaction with Liteserver (Lightclient)

0. Create an empty project on your machine and paste `config.json` in the project directory.
0. Create an empty project on your machine and paste `config.json` in the project directory. This config can be obtained by following command:

```bash
installer clcf # in mytonctrl
```

It will create `/usr/bin/ton/local.config.json` on your machine where mytonctrl is installed. Check [mytonctrl documentation for more](/participate/run-nodes/mytonctrl#clcf).

1. Install libraries.

Expand Down
1 change: 1 addition & 0 deletions docs/participate/run-nodes/full-node.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ This will reduce synchronization time by several times.
* `-c <path>` - If you want to use not public liteservers for synchronization. _(not required)_
* `-i` - Ignore minimum requirements, use it only if you want to check compilation process without real node usage.
* `-m` - Mode, can be `validator` or `liteserver`.
* `-t` - Disable telemetry.

**To use testnet**, `-c` flag should be provided with `https://ton.org/testnet-global.config.json` value.

Expand Down
Loading

0 comments on commit f8fc0b9

Please sign in to comment.