---
# System prepended metadata

title: Untitled

---

#### running stake script with args
RUST_NET_ENABLE=yes
VALIDATOR_NAME=my_validator
SDK_URL=rustnet.ton.dev
SDK_ENDPOINT_URL_LIST=rustnet1.ton.dev,rustnet2.ton.dev
ELECTOR_TYPE=solidity
STAKE=1800000
`*/5 * * * *  root  /ton-node/scripts/validator.sh ${STAKE} >>/ton-node/logs/validator.log 2>&1`


#### Vars and running normal node
TON_NODE_ROOT_DIR="/ton-node"
TON_NODE_CONFIGS_DIR="${TON_NODE_ROOT_DIR}/configs"
TON_NODE_SCRIPTS_DIR="${TON_NODE_ROOT_DIR}/scripts"
TON_NODE_LOGS_DIR="${TON_NODE_ROOT_DIR}/logs"    

echo "INFO: R-Node startup..."

echo "INFO: NETWORK_TYPE = ${NETWORK_TYPE}"
echo "INFO: DEPLOY_TYPE = ${DEPLOY_TYPE}"
echo "INFO: CONFIGS_PATH = ${CONFIGS_PATH}"
echo "INFO: \$1 = $1"
echo "INFO: \$2 = $2"


`curl -sS "https://raw.githubusercontent.com/tonlabs/rustnet.ton.dev/main/configs/ton-global.config.json" -o "${TON_NODE_CONFIGS_DIR}/ton-global.config.json"`


exec ${NODE_EXEC}_compression --configs "${CONFIGS_PATH}" ${TON_NODE_EXTRA_ARGS} >>${TON_NODE_LOGS_DIR}/stdout.log \
2>>${TON_NODE_LOGS_DIR}/stderr.log

###### то есть так
`/ton-node/ton_node_no_kafka_compression --configs /ton-node/configs
`


#### sending tokens before stake (validator.log)
/ton-node/tools/tonos-cli call -1:84f814c83fcfb69d31c4f3b354063f4c12f68aa9619c006660fce053747015e9 submitTransaction '{"dest":"-1:3333333333333333333333333333333333333333333333333333333333333333","value":"1800000000000000","bounce":true,"allBalance":false,"payload":"te6ccgEBAgEAmQABqE5zdEsAAAAAYPava2r0zS+NBCY2REH9YbKupu4UikoeLcAh4NJ2xj7oi+3sYPbD0wADAAChcWUVdeqPB0ltyviMEQU1KjicOwwZ7gMCEvRTuPpkiAEAgP48hc8/r0zWdMb652HlHYUT5qmBIggDd2KbfNnWJKYVCKwGaRISdvWxU58MBQZu0VfBSTWm26ji56H9wj/tuAc="}' --abi /ton-node/configs/SafeMultisigWallet.abi.json --sign /ton-node/configs/keys/msig.keys.json

###### and answer if success
Input arguments:
 address: -1:84f814c83fcfb69d31c4f3b354063f4c12f68aa9619c006660fce053747015e9
  method: submitTransaction
  params: {"dest":"-1:3333333333333333333333333333333333333333333333333333333333333333","value":"1800000000000000","bounce":true,"allBalance":false,"payload":"te6ccgEBAgEAmQABqE5zdEsAAAAAYPava2r0zS+NBCY2REH9YbKupu4UikoeLcAh4NJ2xj7oi+3sYPbD0wADAAChcWUVdeqPB0ltyviMEQU1KjicOwwZ7gMCEvRTuPpkiAEAgP48hc8/r0zWdMb652HlHYUT5qmBIggDd2KbfNnWJKYVCKwGaRISdvWxU58MBQZu0VfBSTWm26ji56H9wj/tuAc="}
     abi: /ton-node/configs/SafeMultisigWallet.abi.json
    keys: /ton-node/configs/keys/msig.keys.json
lifetime: None
  output: None
Connecting to rustnet.ton.dev
Generating external inbound message...

MessageId: f3fe82756efde22cc06cf203cabfdc57f861f0b53bea59c74c6d1230dbbaf440
Expire at: Tue, 20 Jul 2021 14:12:46 +0300
Processing... 
Succeeded.
Result: {
  "transId": "0"
}
+ echo 'INFO: tonos-cli submitTransaction attempt... PASS'
INFO: tonos-cli submitTransaction attempt... PASS
+ date '+INFO: %F %T prepared for elections 1626784723'
INFO: 2021-07-20 14:12:39 prepared for elections 1626784723
+ echo 1626784723
+ set +x
INFO: script exited (exit code: 0, script line: 576)
INFO: validator.sh END 1626779559 / Tue Jul 20 14:12:39 MSK 2021





##### check account
`ton-node/tools/tonos-cli account -1:84f814c83fcfb69d31c4f3b354063f4c12f68aa9619c006660fce053747015e9
`
#### get stake params 
/ton-node/tools/tonos-cli getconfig 17
+ TONOS_CLI_OUTPUT='Config: /ton-node/tools/tonos-cli.conf.json
Input arguments:
   index: 17
Connecting to rustnet.ton.dev
Config p17: {
  "min_stake": "10000000000000",
  "max_stake": "10000000000000000",
  "min_total_stake": "100000000000000",
  "max_stake_factor": 196608
}'


###### converting tokens
`++ /ton-node/tools/tonos-cli convert tokens 1800000
++ tail -1
+ NANOSTAKE=1800000000000000
+ echo 'INFO: NANOSTAKE = 1800000000000000 nanotokens'
INFO: NANOSTAKE = 1800000000000000 nanotokens
+ '[' -z 1800000000000000 ']'`

###### start elections
`/ton-node/tools/tonos-cli run -1:3333333333333333333333333333333333333333333333333333333333333333 compute_returned_stake '{"wallet_addr":"0x84f814c83fcfb69d31c4f3b354063f4c12f68aa9619c006660fce053747015e9"}' --abi /ton-node/configs/Elector.abi.json
`
###### elections status
`/ton-node/tools/console -C /ton-node/configs/console.json -c 'election-bid 1626784723 1626809123'`






#### validator events in output.log

### slashing activity
`2021-07-20 12:04:58.667152451 INFO [validator] 139620788463360: Use slashing report function 'report' with id=A6694B2B
`

#### initializing validator, checking last applied block
`2021-07-20 12:04:58.667420884 INFO [validator] 139620788463360: Validator manager initialization: last applied block: (-1:8000000000000000, 104199, rh 09075d48dfd11af0cdbb49b84772f9a7186cd39de29a0e4641681ec6e81e5542, fh 0e1531e55ce001202
7756820d4fef3ebaa9f6ab88bf9ad4d3c40120355ac71b1), no last rotation block`

#### current validator list
`2021-07-20 12:04:58.673288358 INFO [validator] 139620788463360: Updating current validator list (id 92bf7726e7246eac834a308dfbf1b474b6514fd543a347cd9c65398b09b79e63)
`
#### single mode validator output
`2021-07-20 15:10:39.492688277 INFO [validator] 140574480922368: pk: aded337b67e4d9059d74303a11826840f22f0f0a859b673d0cd9d8cb7c48911d, pk_id: 5ac2882722cdf61c780b4cfda6b17953c8c7319d64b2cf072039c2e45d21f01c, andl_id: 2000ada6ca3f1c981d5f607f576709b05a1d2498ac1b2ffaccde246dbdeca4f9

#### non active valida`tor output
`2021-07-20 15:10:39.492893231 INFO [validator] 140574480922368: session id                       st round shard
2021-07-20 15:10:39.492927800 INFO [validator] 140574480922368:   
`
#### validator events if validation disabled
`2021-07-20 15:10:39.492729859 INFO [validator] 140574480922368: Local node is not a next validator`

`2021-07-20 15:10:39.492791192 INFO [ton_node::validator::validator_manager] 140574480922368: Current validator list is empty, validation is disabled.
2021-07-20 15:10:39.492857192 INFO [validator] 140574480922368: All sessions were removed, validation disabled`




#### blocks info
`2021-07-18 16:44:54.086106259 INFO [boot] 140525989895168: cold boot start: init_block_id=(-1:8000000000000000, 0, rh 228f05e8bcb11defb070f7803fb544efe389a801a0564e3bc7539ba43d20d2bf, fh 8c0ae21dbfd57b600a074c53b2a1ee9c8ac4c396559cb797d630e1897883ac7a)`

`2021-07-19 09:18:38.344113951 INFO [boot] 139986062158848: cold boot start: init_block_id=(-1:8000000000000000, 0, rh 228f05e8bcb11defb070f7803fb544efe389a801a0564e3bc7539ba43d20d2bf, fh 8c0ae21dbfd57b600a074c53b2a1ee9c8ac4c396559cb797d630e1897883ac7a)`

`2021-07-19 15:20:04.507347523 INFO [boot] 139986062158848: download_next_key_blocks_ids (-1:8000000000000000, 0, rh 228f05e8bcb11defb070f7803fb544efe389a801a0564e3bc7539ba43d20d2bf, fh 8c0ae21dbfd57b600a074c53b2a1ee9c8ac4c396559cb797d630e1897883ac7a)`

`2021-07-19 15:20:04.602496705 INFO [boot] 139986062158848: last key block is (-1:8000000000000000, 5290, rh f133b5afdcd4a21f043c85c18fbf46a6f68890e042095b0a2189f17e2dfb8bf7, fh 865d18c736325d75d900a6ad18f8d1e3741ac823f9312124f6e0390a0018b93b)`

`2021-07-19 15:20:05.670187219 INFO [boot] 139986062158848: download_next_key_blocks_ids (-1:8000000000000000, 5290, rh f133b5afdcd4a21f043c85c18fbf46a6f68890e042095b0a2189f17e2dfb8bf7, fh 865d18c736325d75d900a6ad18f8d1e3741ac823f9312124f6e0390a0018b93b)`

`2021-07-19 15:20:55.732387747 INFO [boot] 139986062158848: key block candidate: seqno=115804 is_persistent=false ttl=1626798467 syncbefore=0`


#### time issue
`2021-07-20 16:16:51.395764587 WARN [ton_node::internal_db] 140574569875200: store_shard_state_dynamic (0:8400000000000000, 146007, rh fc9a67fb8ab85610e12a9ffca82753acb3f8ea1a38e4da28aabc0ca045841cdf, fh c61afe467b03f08a7cdb9abb69617db193d449ec741b78fe216e26e0d81ccda3) - finished too slow, TIME: 2241ms, expected: 100ms`

`2021-07-20 16:17:49.930853904 INFO [ton_node::engine] 140574569875200: Applied block (0:cc00000000000000, 145912, rh 9a9f8218ecfa0f7ce3cad940a6f3f050181baf8fabb0848da27c1f048cfd79a5, fh fcc0326e7fabf9aa70c20b7aae4d5e0df35c23f994f5e8cc47c7ddfdcedd53d1) ref_mc_block: 104786, 304660 seconds old`





#### Multisig wallet generator
export TON_NODE_ROOT_DIR="/ton-node"
export TON_NODE_CONFIGS_DIR="${TON_NODE_ROOT_DIR}/configs"
export TON_NODE_KEYS_DIR="${TON_NODE_CONFIGS_DIR}/keys"
export TON_NODE_TOOLS_DIR="${TON_NODE_ROOT_DIR}/tools"
export TON_NODE_LOGS_DIR="${TON_NODE_ROOT_DIR}/logs"

mkdir -p "${TON_NODE_KEYS_DIR}"

apt update >/dev/null 2>&1 && apt install -y wget >/dev/null 2>&1

if [ ! -f "${TON_NODE_CONFIGS_DIR}/SafeMultisigWallet.abi.json" ]; then
    cd ${TON_NODE_CONFIGS_DIR} && wget https://raw.githubusercontent.com/tonlabs/ton-labs-contracts/master/solidity/safemultisig/SafeMultisigWallet.abi.json
fi

if [ ! -f "${TON_NODE_CONFIGS_DIR}/SafeMultisigWallet.tvc" ]; then
    cd ${TON_NODE_CONFIGS_DIR} && wget https://github.com/tonlabs/ton-labs-contracts/raw/master/solidity/safemultisig/SafeMultisigWallet.tvc
fi

cd ${TON_NODE_TOOLS_DIR}
TONOS_CLI_OUTPUT=$("${TON_NODE_TOOLS_DIR}/tonos-cli" genaddr "${TON_NODE_CONFIGS_DIR}/SafeMultisigWallet.tvc" \
    "${TON_NODE_CONFIGS_DIR}/SafeMultisigWallet.abi.json" --genkey "${TON_NODE_KEYS_DIR}/msig.keys.json" --wc -1)
RAW_ADDRESS=$(echo "${TONOS_CLI_OUTPUT}" | grep "Raw address" | cut -d ' ' -f 3)
SEED_PHRASE=$(echo "${TONOS_CLI_OUTPUT}" | grep "Seed phrase" | sed -e 's/Seed phrase: //' | tr -d '"')
echo "${RAW_ADDRESS}" >"${TON_NODE_CONFIGS_DIR}/${VALIDATOR_NAME}.addr"
echo "INFO: Raw address = ${RAW_ADDRESS}"
echo "INFO: Seed phrase = ${SEED_PHRASE}"




### Check node synchronization
`docker exec -it rnode /ton-node/tools/console -C /ton-node/configs/console.json --cmd getstats`
tonlabs console 0.1.1
COMMIT_ID: ba620f2290068b5413d059b997b90d9ed7f25ad2
BUILD_DATE: 2021-07-18 16:11:49 +0300
COMMIT_DATE: 2021-07-16 00:00:16 +0300
GIT_BRANCH: master
{
        "masterchainblocktime": 1626483194,
        "masterchainblocknumber":       104973,
        "timediff":     306287,
        "in_current_vset_p34":  false,
        "in_next_vset_p36":     false
}


If the timediff parameter equals a few seconds, synchronization is complete.




#### Depool events

``./tonos-cli depool --addr -1:84f814c83fcfb69d31c4f3b354063f4c12f68aa9619c006660fce053747015e9 events 
Config: /ton-node/tools/tonos-cli.conf.json
Input arguments:
  depool: -1:84f814c83fcfb69d31c4f3b354063f4c12f68aa9619c006660fce053747015e9
   since: None
Connecting to rustnet.ton.dev
8 events found
event ca747ee5e36d32e890069b593e4abb516b4e70e847ddbf381c57c19a5575e92f
unknown 1626779553 (2021-07-20 11:12:33.000)
{}`

`event 48dca965d8409f8f66be0a15c3ced60a8388b3aebca2d9b55cddfcea03cd9a75
unknown 1626772205 (2021-07-20 09:10:05.000)
{}`

`event 6128cebe65b747a0e54ba3a7d707e8972251ae1486625d574589f3961947f53f
unknown 1626757588 (2021-07-20 05:06:28.000)
{}`

`event d8c1664494355b0d9f89383cb5af6a88d3f8cb17fc43928686e2f0caa832579d
unknown 1626684070 (2021-07-19 08:41:10.000)
{}`

`event 2fe401332133130718075265fde4831ce6d9e7b0352109078faaf54178693aec
unknown 1626672119 (2021-07-19 05:21:59.000)
{}`

`event 8c71079dc189968222c9e774407b821e8534574c823e76d62630da39df9b9e48
unknown 1626455402 (2021-07-16 17:10:02.000)
{}`

`event 6e6d3e032cd558a0b4ab56db6f9f37a117749d8d73b38d3f26a9656c659ba4a2
unknown 1626433816 (2021-07-16 11:10:16.000)
{}`

`event 67922d5f548c0600a3f981416625ecd24407b7eeba824ba3e61fb0d9727a36f1
unknown 1626424083 (2021-07-16 08:28:03.000)
{}`



##### Last masterchain seq number for sync
`2021-07-20 18:35:27.037566752 INFO [sync] 140574580648960: Last MC seq_no for sync = 105073 (MC = (-1:8000000000000000, 105073, rh b0a69b0d0a9795758e338e8d3d1d416164e4062ebf35a5beba0771980cf3ebb1, fh 85ccda720ae467d4371c50fe11525eb9bc7bae4138ffaea7eec66bf19e1bc4da), SC = (-1:8000000000000000, 105073, rh b0a69b0d0a9795758e338e8d3d1d416164e4062ebf35a5beba0771980cf3ebb1, fh 85ccda720ae467d4371c50fe11525eb9bc7bae4138ffaea7eec66bf19e1bc4da))
`

###### Record block to DB
`2021-07-20 17:46:07.982325862 WARN [ton_node::internal_db] 140574580648960: store_shard_state_dynamic (-1:8000000000000000, 105073, rh b0a69b0d0a9795758e338e8d3d1d416164e4062ebf35a5beba0771980cf3ebb1, fh 85ccda720ae467d4371c50fe11525eb9bc7bae4138ffaea7eec66bf19e1bc4da) - finished too slow, TIME: 646ms, expected: 100ms`


##### Apply block
2021-07-20 17:46:07.990763400 INFO [ton_node::engine] 140574580648960: Applied block (-1:8000000000000000, 105073, rh b0a69b0d0a9795758e338e8d3d1d416164e4062ebf35a5beba0771980cf3ebb1, fh 85ccda720ae467d4371c50fe11525eb9bc7bae4138ffaea7eec66bf19e1bc4da), 308745 seconds old

##### Load block
2021-07-20 18:02:03.210351694 WARN [ton_node::internal_db] 140574561482496: load_shard_state_dynamic (-1:8000000000000000, 105073, rh b0a69b0d0a9795758e338e8d3d1d416164e4062ebf35a5beba0771980cf3ebb1, fh 85ccda720ae467d4371c50fe11525eb9bc7bae4138ffaea7eec66bf19e1bc4da) - finished too slow, TIME: 12ms, expected: 10ms


##### Load block handle
`2021-07-20 18:35:26.602010318 WARN [ton_node::internal_db] 140574580648960: load_block_handle (-1:8000000000000000, 105073, rh b0a69b0d0a9795758e338e8d3d1d416164e4062ebf35a5beba0771980cf3ebb1, fh 85ccda720ae467d4371c50fe11525eb9bc7bae4138ffaea7eec66bf19e1bc4da) - finished too slow, TIME: 79ms, expected: 10ms`


##### Check stake
`/ton-node/tools/tonos-cli run -1:3333333333333333333333333333333333333333333333333333333333333333 compute_returned_stake '{"wallet_addr":"0x84f814c83fcfb69d31c4f3b354063f4c12f68aa9619c006660fce053747015e9"}' --abi /ton-node/configs/El
ector.abi.json`





Done

