TON Дев Чат
// Specify your own collection base uri
"https://thainik.galaxyonline.io/" constant collection_base
// Specify your own collection metadata uri
"https://thainik.galaxyonline.io/collection.json" constant collection_json
msg_body.store_slice("hello TON.")
;; storage#_ owner_address:MsgAddress next_item_index:uint64
;; ^[collection_content:^Cell common_content:^Cell]
<b
collection_base offchain-token-data ref, // Storing collection base data ref
collection_json offchain-token-data ref, // Storing common ref
b> ref, // content cell
<b collection_base $>B B, b>
collection_base offchain-token-data ref,
[ 1][t 0][2022-10-14 14:31:02.133929676][fift-main.cpp:204] Error interpreting file `/tmp/tmpy7ewc7jf.fif`: collection-data.fif:58: b>,:-?
<b
collection_json offchain-token-data ref, // Storing common ref
<b collection_base $>B B, b> ref,
b> ref, // content cell
37 - Not enough TONs. Message sends too much TON (or there is no enough TONs after deducting fees).
CMake Warning at /opt/homebrew/Cellar/cmake/3.24.2/share/cmake/Modules/Platform/Darwin-Initialize.cmake:303 (message):
Ignoring CMAKE_OSX_SYSROOT value:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk
because the directory does not exist.
cmake -DOPENSSL_ROOT_DIR=/opt/homebrew/opt/openssl@3 -DCMAKE_BUILD_TYPE=Debug ..
INFO: Test [__test_example] status: [FAIL], code: [2] Total gas used (including testing code): [3804]
[ 2][t 6][2022-10-16 19:12:06.278753025][TonlibClient.cpp:2369][!tonlibclient][&!config->ignore_cache_] Unknown LastBlockState: [Error : 0 : Unknown key]
[ 0][t 6][2022-10-16 19:12:06.288697437][Status.h:571][!adnldb][&status_.is_ok()] [Error : 0 : IO error: While lock file: ./adnl/LOCK: Resource temporarily unavailable]
[pid 43211] [time 1665947526] Signal: 6
mintable?
EQCtiv7PrMJImWiF2L5oJCgPnzp-VML2CAt5cbn1VsKAxLiE
вопрос могут ли тебе придти деньги с другого кошелька
raw.getTransactionsV2
как работает параметр try_decode_messages
?
docker run --rm -it \
> -v ~/Dev/lesson:/code \
> toncli-local run_tests
INFO:
🌈 Start tests
/root/.config/toncli/test-libs/bad_messages_generator.func:19:16: error: undefined function `generate_internal_address`, defining a global function of unknown type
slice ssrc = generate_internal_address();
^
/root/.config/toncli/test-libs/bad_messages_generator.func:43:16: error: undefined function `generate_external_address`, defining a global function of unknown type
slice ssrc = generate_external_address(256);
^
INFO:
🥌 Build successfully, check out ./build
[ 1][t 0][2022-10-18 08:00:30.116274297][Fift.cpp:67] top: include
level 1: <text interpreter continuation>
[ 1][t 0][2022-10-18 08:00:30.116313714][fift-main.cpp:204] Error interpreting file `/tmp/tmp3r6voahb.fif`: tmp3r6voahb.fif:47: cond:cannot locate file `/code/fift/data.fif`
NFO:
🌈 Start tests
/root/.config/toncli/test-libs/bad_messages_generator.func:19:16: error: undefined function `generate_internal_address`, defining a global function of unknown type
slice ssrc = generate_internal_address();
^
/root/.config/toncli/test-libs/bad_messages_generator.func:43:16: error: undefined function `generate_external_address`, defining a global function of unknown type
slice ssrc = generate_external_address(256);
^
INFO:
🥌 Build successfully, check out ./build
[ 3][t 0][2022-10-18 08:15:41.835947928][vm.cpp:558] steps: 179 gas: used=10053, max=1000000000, limit=1000000000, credit=0
INFO: Test [__test_example] status: [SUCCESS] Test result: [[ 2797 ]] Total gas used (including testing code): [10053]
fatal: cannot compile lvalue expression with unknown constructor
Traceback (most recent call last):
File "/usr/local/bin/toncli", line 8, in <module>
sys.exit(main())
File "/toncli/src/toncli/main.py", line 65, in main
CommandsExecuter(command, string_kwargs, parser)
File "/toncli/src/toncli/modules/utils/commands/commands_executer.py", line 39, in __init__
self.command_mapper[command](self)
File "/toncli/src/toncli/modules/utils/commands/commands_executer.py", line 79, in func_or_fc_or_build_command
return FuncOrFcOrBuildCommand(self.command, self.string_kwargs, self.parser)
File "/toncli/src/toncli/modules/utils/commands/command_classes/func_or_fc_or_build_command.py", line 25, in __init__
func.run()
File "/toncli/src/toncli/modules/utils/func/func.py", line 40, in run
self.build()
File "/toncli/src/toncli/modules/utils/func/func.py", line 81, in build
fift_build(getcwd(), cwd=getcwd())
File "/toncli/src/toncli/modules/utils/func/commands.py", line 39, in build
build_files(contract.func_files_locations, contract.to_save_location, func_args, cwd))
File "/toncli/src/toncli/modules/utils/func/commands.py", line 63, in build_files
get_output = check_output(build_command,
File "/usr/lib/python3.8/subprocess.py", line 415, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File "/usr/lib/python3.8/subprocess.py", line 516, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/usr/local/bin/func', '-o', '/code/build/contract.fif', '-SPA', '/root/.config/toncli/func-libs/math.func', '/root/.config/toncli/func-libs/error_codes.func', '/root/.config/toncli/func-libs/stdlib.func', '/code/func/game.fc']' returned non-zero exit status 1.
now(), ;; unixtime
^
/Users/eugene/Library/Application Support/toncli/func-libs/tests-helpers.func:20:35: error: undefined function `null`, defining a global function of unknown type
unsafe_tuple([1000000000, null()]), ;; balance_remaining
^
/Users/eugene/Library/Application Support/toncli/func-libs/tests-helpers.func:21:9: error: undefined function `my_address`, defining a global function of unknown type
my_address(), ;; myself
^
/Users/eugene/Library/Application Support/toncli/func-libs/stdlib.func:29:22: error: function `null` was already declared as an ordinary function
forall X -> X null() asm "PUSHNULL";
fwd_val = lump_price + (((bits + init_state_bits) * bit_price + (cells + init_state_cells) * cell_price + 65535) >> 16)Я могу быть уверен, что, отправив столько монет, сообщение 100% придет получателю, несмотря на количество блоков и шардчейнов, которое оно преодолеет? Если нет, то возможно ли посчитать эту сумму onchain и как это сделать?
try_decode_message == false
, то в data сообщений будет возвращаться в виде msg.dataRaw
. Если true, то тонлиб пытается их декодировать и расшифровать (если зашифровано и дан private key) и может вернуть в любом виде - msg.dataRaw
, msg.dataText
, msg.dataDecryptedText
, msg.dataEncryptedText
.
// msg_fwd_fees = (lump_price + ceil((bit_price * msg.bits + cell_price * msg.cells)/2^16)) nanogramsМой вопрос о том, покрывает ли она все траты (застой в блоке, прыжки между shard'ами) или их дополнительно каким-то образом(?) нужно вычислять?
// ihr_fwd_fees = ceil((msg_fwd_fees * ihr_price_factor)/2^16) nanograms
// bits in the root cell of a message are not included in msg.bits (lump_price pays for them)
msg_forward_prices#ea lump_price:uint64 bit_price:uint64 cell_price:uint64
ihr_price_factor:uint32 first_frac:uint16 next_frac:uint16 = MsgForwardPrices;
^(0|-1):([a-f0-9]{64}|[A-F0-9]{64})$
, а он как понимаю для адресов в raw формате предназначен
project.yaml
есть специальная директива:`data`.data: fift/collection-data.fif
.vl
, это по факту то же самое что и getconfig 34
, но в более читабельном виде)
./rldp-http-proxy -a 77.73.131.103:3333 -L '*' -C global.config.json -A ucchtxg5cvfuwi43rnfknzqjkfepworzd5jef2k3jnlkv7jqjflrce2 -d -l tonsite.log
[ 2][t 6][2022-10-22 09:45:41.676572381][TonlibClient.cpp:2369][!tonlibclient][&!config->ignore_cache_] Unknown LastBlockState: [Error : 0 : Unknown key]
cell get_subcontract_code() asm "B{B5EE9C720101030100AB000114FF00F4A413F4BCF2C80B0101F8D301D0D3033071B08E3E31ED44D0D31F02D31F03D33F3003D33F5215BA5224B913B08E195B708010C8CB0502FA403012CF1621FA02CB6AC98100A0FB00E06C12C8CB1FCB3FC9ED54E001820AFAF080B9F2D064843FF81170208018C8CB0504D401D015CF168209312D00FA02CB6ACB1F5210CB3FC970FB007170801802003AC8CB0504D430D014CF168209312D00FA0213CB6A12CB1FCB3FC970FB00} B>boc";
variable items dictnew items !
variable items# 0 items# !
{
<b
….. b> <s items# @ dup 250 >= abort"more than 250 nfts"
items @ 64 udict!+ not abort"cannot add nft to dictionary"
items ! items# 1+!
} : add-item
[ 1][t 0][2022-10-22 15:57:38.774491444][http-connection.cpp:81][!outconn] loop() failed: [PosixError : Connection refused : 111 : Error on [fd:22]]
[ 1][t 0][2022-10-22 15:59:30.079936531][TcpListener.cpp:62][!TcpListener[port:8080]] Accept
[ 3][t 2][2022-10-22 15:59:30.236030257][rldp-http-proxy.cpp:1149][!proxymain] got HTTP request over rldp from UeB3PTfb3dGSrH/RCDWxCxdHv0Jgpz19d/kfw7Pkweo=
[ 3][t 2][2022-10-22 15:59:30.236357239][rldp-http-proxy.cpp:1236][!proxymain] starting HTTP over RLDP request
[ 3][t 2][2022-10-22 15:59:30.236536058][rldp-http-proxy.cpp:179][!HttpPayloadReceiver(R)] HttpPayloadReceiver: sent=false completed=true ready=0 watermark=32768
[ 1][t 0][2022-10-22 15:59:30.236829936][http-connection.cpp:81][!outconn] loop() failed: [PosixError : Connection refused : 111 : Error on [fd:21]]
[ 3][t 2][2022-10-22 15:59:30.236998516][rldp-http-proxy.cpp:838][!inboundreq] aborting http over rldp query: [Error : 0 : Lost promise]
[pid 11251] [time 1666454370] Signal: 11
------- Stack Backtrace -------
toncli
lc saveaccountdata ./build/boc/c4.boc EQAIv1arSMqe7trl8zkgcq_wwxwb-AWXpnfz9t1oWP2mIe3j
toncli
lc saveaccountdata ./build/boc/c4.boc EQAIv1arSMqe7trl8zkgcq_wwxwb-AWXpnfz9t1oWP2mIe3j --net mainnet
toncli-local run fift/load_c4.fif --build
fatal: no source files, no output
execute SETCP 0
execute DICTPUSHCONST 19 (xC_,1)
execute DICTIGETJMPZ
execute DROP
handling exception code 2: stack underflow
default exception handler, terminating vm with exit code 2
[ 3][t 0][2022-10-22 18:10:26.629073427][vm.cpp:558] steps: 5 gas: used=454, max=9223372036854775807, limit=9223372036854775807, credit=0
🙀 Seqno of wallet: 0
init?
изначально 0
.if (~ init?) {Тут вижу проверку на то, что сообщение пришло от контакта-коллекции. Вот только не могу найти в коде контракта-коллекции место, где он отправляет сообщение, при обработке которого выполнится приведённый выше код.
throw_unless(405, equal_slices(collection_address, sender_address));
store_data(index, collection_address, in_msg_body~load_msg_addr(), in_msg_body~load_ref());
return ();
}
"mode = 64 is used for messages that carry all the remaining value of the inbound message in addition to the value initially indicated in the new message (if bit 0 is not set, the gas fees are deducted from this amount);"Я правильно понял, что если отправить из контракта мэсседж с модом 64, то он отправит на адрес назначения всю сумму, которая пришла в контракт в входящем месседже, за вычетом комиссии?
fullPrice
на адрес sale address происходит ошибка с ExitCode=9 (ожидаемое поверение)fullPrice
на адрес marketplace address происходит ошибка с ExitCode=401 (просто тестирую, так как 1). не работает)vl
внутри утилиты mytonctrl
- он отобразит список валидаторов с их кошельками
toncli run_transaction -f 0 <lt> <base64-hash> <address> -n mainnet
VarUInteger 16
16 u,
пусть бросит в меня камень!
INFO: Test [__test_1] status: [FAIL], code: [2] Total gas used (including testing code): [4569]Можно ли как-то увидеть подробности ошибки? Как-то exit code не помогает...
TonApi.java
по гайду тут https://github.com/ton-blockchain/tonlib-java. Вроде подготовил все верно, сабмодули подтянул, но при выполнении cmake --build . --target prepare_cross_compiling
на этапе Generate common tl source files
вылетает ошибка из-за ассерта /ton/tl/generate/tl_writer_jni_cpp.cpp:244: virtual std::string td::TD_TL_writer_jni_cpp::gen_field_fetch(int, const td::tl::arg&, std::vector<td::tl::var_description>&, bool, int) const: Assertion 'a.var_num == -1' failed.
, ну и компиляция прерывается. В чем тут может быть проблема?
https://github.com/legaii/ton
ветка generate_java
not a cell
и название функции.ERROR: [Errno 13] Permission denied: '/usr/local/bin/func'
WARNING: 😅 Path is not correct, please double check it
WARNING: 🤖 Can't find executable for func, please specify it, e.g.: /usr/bin/func
Path:
выше писали, что такое происходит когда с бинарниками проблема
--no-experimental-fetch
, мне помогло
error: cannot apply function set_seed : () -> int to argument
set_seed(hash);
vl past
<--> el past
)