Skip to content

Commit 2b2727a

Browse files
authored
Merge pull request #29 from tonlabs/0.28.0-rc
Version 0.28.0
2 parents 25a80a8 + 483519e commit 2b2727a

20 files changed

+729
-87
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
# Release Notes
22
All notable changes to this project will be documented in this file.
33

4+
## 0.28.0 May 15, 2021
5+
### New
6+
- Predeployed [SafeMultisigWallet](contracts/safe_multisig) contract with 1 million tokens.
7+
- [Improved logging. Added TVM log (tvm.log file)](README.md#how-to-work-with-logs).
8+
### Fixed
9+
- Contract freezing on receiving bounceable message when balance is zero.
10+
- Crashes of logging in docker.
11+
412
## 0.27.2 Apr 28, 2021
513
### Fixed
614
- Transaction could be lost if it was created near the end of block producing interval. Again

README.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# TON OS Startup Edition
2+
23
Local blockchain for Free TON DApp development and testing.
34

45
**Have a question? Get quick help in our channel:**
@@ -13,13 +14,15 @@ Local blockchain for Free TON DApp development and testing.
1314
- [Instal via TONDEV Development Environment](#instal-via-tondev-development-environment)
1415
- [Install via docker command](#install-via-docker-command)
1516
- [How to change the blockchain configuration](#how-to-change-the-blockchain-configuration)
17+
- [How to work with logs](#how-to-work-with-logs)
1618
- [How to connect to TON OS SE Graphql API from SDK](#how-to-connect-to-ton-os-se-graphql-api-from-sdk)
1719
- [TON OS SE components](#ton-os-se-components)
1820
- [TON Live explorer](#ton-live-explorer)
1921
- [How to build docker image locally](#how-to-build-docker-image-locally)
2022
- [Linux/Mac:](#linuxmac)
2123
- [Windows:](#windows)
2224

25+
2326
## What is TON OS Startup Edition?
2427

2528
TON OS Startup Edition (SE) is a local blockchain that developer can run on their machine in one click.
@@ -31,17 +34,22 @@ See the [TON Labs TON OS SE documentation](https://docs.ton.dev/86757ecb2/p/19d8
3134

3235

3336
## Use-cases
37+
3438
- Test your applications locally
3539
- Test your contracts
3640
- Run TON OS remotely on a server and test your application from different devices
3741

42+
3843
## How to install
44+
3945
### Pre-requisites
46+
4047
- Latest [Docker](https://www.docker.com/get-started) installed
4148

4249
**Attention!** [Docker daemon](https://www.docker.com/get-started) must be running.
4350

4451
### Instal via TONDEV Development Environment
52+
4553
If you have [TONDEV installed globally on your machine](https://github.com/tonlabs/tondev), run this command
4654

4755
```commandline
@@ -50,6 +58,7 @@ $ tondev se start
5058
[Checkout other TON OS SE commands accessible from TONDEV](https://docs.ton.dev/86757ecb2/p/54722f-tonos-se).
5159
You can also access these commands from [TONDEV VS Code Extension](https://github.com/tonlabs/tondev-vscode).
5260

61+
5362
### Install via docker command
5463

5564
Run this command
@@ -66,6 +75,7 @@ If you specified another port then add it to the local url http://0.0.0.0:port/g
6675
[Find out more about GraphQL API](https://docs.ton.dev/86757ecb2/p/793337-graphql-api).
6776

6877
## How to change the blockchain configuration
78+
6979
TON OS SE loads the blockchain configuration (config params) during its start from the configuration file
7080
[blockchain.conf.json](docker/ton-node/blockchain.conf.json) instead of special smart contract, which stores
7181
various config params in the real networks.
@@ -84,12 +94,52 @@ $ docker run -d --name local-node -e USER_AGREEMENT=yes -p80:80 \
8494
tonlabs/local-node
8595
```
8696

97+
## How to work with logs
98+
99+
By default, TON OS SE logs the most of the information to the console, which is accessible by the next command:
100+
```commandline
101+
$ docker logs local-node
102+
```
103+
104+
More verbose logging is configured to `/ton-node/log/` directory inside the running docker container.
105+
By default, there are two files: `ton-node.log` for all logging and `tvm.log` for tracing of TVM execution:
106+
code, stack, control registers, gas, etc.
107+
108+
Logging configuration is stored in `/ton-node/log_cfg.yml` file. In order to change the default logging verbosity of
109+
other parameters, you can configure logging in several ways:
110+
1. In the running container by changing `/ton-node/log_cfg.yml` file:
111+
112+
```commandline
113+
$ docker exec -it local-node bash
114+
bash-5.0# vi /ton-node/log_cfg.yml
115+
```
116+
(in order to exit from VI editor with saving changes press the `ESC` key, then type `:wq` and press the `ENTER` key)
117+
118+
Note: `log_cfg.yml` file is normally scanned for changes every 30 seconds, so all changes made to this file in running
119+
container will be applied only after the scan.
120+
121+
Note: after recreation of the container, all changes made in its files will be lost, so use the second way, if you need
122+
to keep them.
123+
124+
2. Before starting of the container, download and edit a copy of [log_cfg.yml](./docker/ton-node/log_cfg.yml) file, then
125+
mount this file to container's file system in `docker run` command:
126+
```commandline
127+
$ docker run -d --name local-node -e USER_AGREEMENT=yes -p80:80 \
128+
-v /home/user/log_cfg.yml:/ton-node/log_cfg.yml \
129+
tonlabs/local-node
130+
```
131+
After starting of TON OS SE, you can edit this file in your file system without restart.
132+
133+
More information about log4rs configuration [in the log4rs documentation](https://docs.rs/log4rs/1.0.0/log4rs/).
134+
135+
87136
## How to connect to TON OS SE Graphql API from SDK
88137

89138
**Attention** at the moment there are a few [differences in SE behaviour comparing with a real TON blockchain](https://docs.ton.dev/86757ecb2/p/683279-difference-in-behaviour). Read about them before you start implemennting. Please note that we plan to upgrade the SE behaviour in the next releases so that it will work the same way as a real network.
90139

91140
To connect to local blockchain from your application [specify localhost in SDK Client network config](https://docs.ton.dev/86757ecb2/p/5328db-tonclient).
92141

142+
93143
## TON OS SE components
94144

95145
* [TON Labs implementation of TON VM written in Rust](https://github.com/tonlabs/ton-labs-vm)
@@ -98,6 +148,7 @@ To connect to local blockchain from your application [specify localhost in SDK C
98148
* [TON-live explorer](https://ton.live)
99149
* [Pre-deployed high-performance Giver, ABI v2](contracts)
100150

151+
101152
## TON Live explorer
102153

103154
TON Live explorer runs on the same IP and port as TON OS SE, just open http://ip_address:port (e.g. http://127.0.0.1)
@@ -108,12 +159,15 @@ TON Live explorer runs on the same IP and port as TON OS SE, just open http://ip
108159
In order to build and use TON OS Startup Edition you need Docker.
109160
To build docker image, run from the repository root:
110161

162+
111163
### Linux/Mac:
164+
112165
```commandline
113166
./build.sh
114167
```
115168

116169
### Windows:
170+
117171
```commandline
118172
build.cmd
119173
```

contracts/README.md

Lines changed: 3 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,5 @@
1-
# Giver v2
1+
# Smart Contracts, used in TON OS SE
2+
* [Giver v2](giver_v2)
3+
* [SafeMultisig Wallet](safe_multisig)
24

3-
This directory contains Giver v2 (ABI v2) contract. This giver is recommended over Giver v1.
45

5-
In TON OS SE this giver is predeployed at `0:b5e9240fc2d2f1ff8cbb1d1dee7fb7cae155e5f6320e585fcc685698994a19a5` address
6-
and its initial balance is about 5 billion tokens.
7-
8-
## Keys:
9-
* Public: `2ada2e65ab8eeab09490e3521415f45b6e42df9c760a639bcf53957550b25a16`
10-
* Secret: `172af540e43a524763dd53b26a066d472a97c4de37d5498170564510608250c3`
11-
12-
## Usage
13-
Method: `sendTransaction`
14-
15-
parameters:
16-
* `dest`: `address` - destination address;
17-
* `value`: `uint128` - amount to send, in nanotokens;
18-
* `bounce`: `bool` - bounce flag of the message.
19-
20-
### Using tonos-cli:
21-
```commandline
22-
tonos-cli call 0:b5e9240fc2d2f1ff8cbb1d1dee7fb7cae155e5f6320e585fcc685698994a19a5 \
23-
sendTransaction '{"dest":"<address>","value":<nanotokens>,"bounce":false}' \
24-
--abi GiverV2.abi.json \
25-
--sign GiverV2.keys.json
26-
```
27-
28-
29-
## Files
30-
* ABI: [GiverV2.abi.json](GiverV2.abi.json)
31-
* Keypair: [GiverV2.keys.json](GiverV2.keys.json)
32-
* TVC file: [GiverV2.tvc](GiverV2.tvc)
33-
* Source code: [GiverV2.sol](GiverV2.sol)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

contracts/giver_v2/README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Giver v2
2+
3+
This directory contains Giver v2 (ABI v2) contract. This giver is recommended over Giver v1.
4+
5+
In TON OS SE this giver is predeployed at `0:b5e9240fc2d2f1ff8cbb1d1dee7fb7cae155e5f6320e585fcc685698994a19a5` address
6+
and its initial balance is about 5 billion tokens.
7+
8+
## Keys:
9+
* Public: `2ada2e65ab8eeab09490e3521415f45b6e42df9c760a639bcf53957550b25a16`
10+
* Secret: `172af540e43a524763dd53b26a066d472a97c4de37d5498170564510608250c3`
11+
12+
## Usage
13+
Method: `sendTransaction`
14+
15+
parameters:
16+
* `dest`: `address` - destination address;
17+
* `value`: `uint128` - amount to send, in nanotokens;
18+
* `bounce`: `bool` - bounce flag of the message.
19+
20+
### Using tonos-cli:
21+
```commandline
22+
tonos-cli call 0:b5e9240fc2d2f1ff8cbb1d1dee7fb7cae155e5f6320e585fcc685698994a19a5 \
23+
sendTransaction '{"dest":"<address>","value":<nanotokens>,"bounce":false}' \
24+
--abi GiverV2.abi.json \
25+
--sign GiverV2.keys.json
26+
```
27+
28+
29+
## Files
30+
* ABI: [GiverV2.abi.json](GiverV2.abi.json)
31+
* Keypair: [GiverV2.keys.json](GiverV2.keys.json)
32+
* TVC file: [GiverV2.tvc](GiverV2.tvc)
33+
* Source code: [GiverV2.sol](GiverV2.sol)

contracts/safe_multisig/README.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# SafeMultisig Wallet
2+
3+
This directory contains SafeMultisig Wallet contract for testing purposes.
4+
5+
In TON OS SE this contract is predeployed at `0:d5f5cfc4b52d2eb1bd9d3a8e51707872c7ce0c174facddd0e06ae5ffd17d2fcd` address
6+
with one single custodian and its initial balance is about 1 million tokens.
7+
8+
## Custodian Keys:
9+
* Public: `99c84f920c299b5d80e4fcce2d2054b05466ec9df19532a688c10eb6dd8d6b33`
10+
* Secret: `73b60dc6a5b1d30a56a81ea85e0e453f6957dbfbeefb57325ca9f7be96d3fe1a`
11+
* Seed Phrase: `"fan harsh baby section father problem person void depth already powder chicken"`
12+
13+
14+
## Basic Usage
15+
Method: `submitTransaction`
16+
17+
Sends transaction to the specified address.
18+
19+
Parameters:
20+
* `dest`: `address` - destination address;
21+
* `value`: `uint128` - amount to send, in nanotokens;
22+
* `bounce`: `bool` - bounce flag of the message;
23+
* `allBalance`: `bool` - if true, all wallet's balance will be sent;
24+
* `payload`: `cell` - payload to send with transaction.
25+
26+
### Using tonos-cli:
27+
```commandline
28+
tonos-cli call 0:d5f5cfc4b52d2eb1bd9d3a8e51707872c7ce0c174facddd0e06ae5ffd17d2fcd \
29+
submitTransaction '{"dest":"<raw_address>","value":<nanotokens>,"bounce":false,"allBalance":false,"payload":""}' \
30+
--abi SafeMultisigWallet.abi.json \
31+
--sign SafeMultisigWallet.keys.json
32+
```
33+
34+
For more information about `SafeMultisigWallet` contract and `tonos-cli` usage see in
35+
[documentation](https://docs.ton.dev/86757ecb2/p/94921e-multisignature-wallet-management-in-tonos-cli).
36+
37+
## Files
38+
* ABI: [SafeMultisigWallet.json](SafeMultisigWallet.abi.json)
39+
* Keypair: [SafeMultisigWallet.keys.json](SafeMultisigWallet.keys.json)
40+
* TVC file: [SafeMultisigWallet.tvc](SafeMultisigWallet.tvc)
41+
* Source code: [SafeMultisigWallet.sol](SafeMultisigWallet.sol)
Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
{
2+
"ABI version": 2,
3+
"header": ["pubkey", "time", "expire"],
4+
"functions": [
5+
{
6+
"name": "constructor",
7+
"inputs": [
8+
{"name":"owners","type":"uint256[]"},
9+
{"name":"reqConfirms","type":"uint8"}
10+
],
11+
"outputs": [
12+
]
13+
},
14+
{
15+
"name": "acceptTransfer",
16+
"inputs": [
17+
{"name":"payload","type":"bytes"}
18+
],
19+
"outputs": [
20+
]
21+
},
22+
{
23+
"name": "sendTransaction",
24+
"inputs": [
25+
{"name":"dest","type":"address"},
26+
{"name":"value","type":"uint128"},
27+
{"name":"bounce","type":"bool"},
28+
{"name":"flags","type":"uint8"},
29+
{"name":"payload","type":"cell"}
30+
],
31+
"outputs": [
32+
]
33+
},
34+
{
35+
"name": "submitTransaction",
36+
"inputs": [
37+
{"name":"dest","type":"address"},
38+
{"name":"value","type":"uint128"},
39+
{"name":"bounce","type":"bool"},
40+
{"name":"allBalance","type":"bool"},
41+
{"name":"payload","type":"cell"}
42+
],
43+
"outputs": [
44+
{"name":"transId","type":"uint64"}
45+
]
46+
},
47+
{
48+
"name": "confirmTransaction",
49+
"inputs": [
50+
{"name":"transactionId","type":"uint64"}
51+
],
52+
"outputs": [
53+
]
54+
},
55+
{
56+
"name": "isConfirmed",
57+
"inputs": [
58+
{"name":"mask","type":"uint32"},
59+
{"name":"index","type":"uint8"}
60+
],
61+
"outputs": [
62+
{"name":"confirmed","type":"bool"}
63+
]
64+
},
65+
{
66+
"name": "getParameters",
67+
"inputs": [
68+
],
69+
"outputs": [
70+
{"name":"maxQueuedTransactions","type":"uint8"},
71+
{"name":"maxCustodianCount","type":"uint8"},
72+
{"name":"expirationTime","type":"uint64"},
73+
{"name":"minValue","type":"uint128"},
74+
{"name":"requiredTxnConfirms","type":"uint8"}
75+
]
76+
},
77+
{
78+
"name": "getTransaction",
79+
"inputs": [
80+
{"name":"transactionId","type":"uint64"}
81+
],
82+
"outputs": [
83+
{"components":[{"name":"id","type":"uint64"},{"name":"confirmationsMask","type":"uint32"},{"name":"signsRequired","type":"uint8"},{"name":"signsReceived","type":"uint8"},{"name":"creator","type":"uint256"},{"name":"index","type":"uint8"},{"name":"dest","type":"address"},{"name":"value","type":"uint128"},{"name":"sendFlags","type":"uint16"},{"name":"payload","type":"cell"},{"name":"bounce","type":"bool"}],"name":"trans","type":"tuple"}
84+
]
85+
},
86+
{
87+
"name": "getTransactions",
88+
"inputs": [
89+
],
90+
"outputs": [
91+
{"components":[{"name":"id","type":"uint64"},{"name":"confirmationsMask","type":"uint32"},{"name":"signsRequired","type":"uint8"},{"name":"signsReceived","type":"uint8"},{"name":"creator","type":"uint256"},{"name":"index","type":"uint8"},{"name":"dest","type":"address"},{"name":"value","type":"uint128"},{"name":"sendFlags","type":"uint16"},{"name":"payload","type":"cell"},{"name":"bounce","type":"bool"}],"name":"transactions","type":"tuple[]"}
92+
]
93+
},
94+
{
95+
"name": "getTransactionIds",
96+
"inputs": [
97+
],
98+
"outputs": [
99+
{"name":"ids","type":"uint64[]"}
100+
]
101+
},
102+
{
103+
"name": "getCustodians",
104+
"inputs": [
105+
],
106+
"outputs": [
107+
{"components":[{"name":"index","type":"uint8"},{"name":"pubkey","type":"uint256"}],"name":"custodians","type":"tuple[]"}
108+
]
109+
}
110+
],
111+
"data": [
112+
],
113+
"events": [
114+
{
115+
"name": "TransferAccepted",
116+
"inputs": [
117+
{"name":"payload","type":"bytes"}
118+
],
119+
"outputs": [
120+
]
121+
}
122+
]
123+
}

0 commit comments

Comments
 (0)