Examples: query, "exact match", wildcard*, wild?ard, wild*rd
Fuzzy search: cake~ (finds cakes, bake)
Term boost: "red velvet"^4, chocolate^2
Field grouping: tags:(+work -"fun-stuff")
Escape special characters +-&|!(){}[]^"~*?:\ - e.g. \+ \* \!
Range search: properties.timestamp:[1587729413488 TO *] (inclusive), properties.title:{A TO Z}(excluding A and Z)
Combinations: chocolate AND vanilla, chocolate OR vanilla, (chocolate OR vanilla) NOT "vanilla pudding"
Field search: properties.title:"The Title" AND text
Back to post

Revisions 2

6 months ago
Convert public key of validator to correct format
Convert public key of validator to correct format
I don't have any experience dealing with Validator configuration, but I can share with you the idea for the Public Key we use in TON and how it interacts with smart contracts. ```typescript import { randomBytes } from "crypto"; import { keyPairFromSeed } from "ton-crypto"; let keypair = keyPairFromSeed(randomBytes(32)); let public_key_hex = keypair.publicKey.toString("hex"); let public_key_int = BigInt("0x" + public_key_hex); let public_key_cell = beginCell().storeUint(public_key_int, 256).endCell(); console.log(keypair.publicKey); console.log(public_key_hex); console.log(public_key_int); console.log(public_key_cell); ``` You will get: ``` <Buffer 3b 19 27 24 86 4a 6a 7b fa 02 5f 4e b6 20 c9 fb 51 1e 31 b6 5f 9f 4f 72 8f cc d8 ac dd ea 12 c1> 3b192724864a6a7bfa025f4eb620c9fb511e31b65f9f4f728fccd8acddea12c1 26730899395840241403219970071225489010060933487521107827084323612022786364097n x{3B192724864A6A7BFA025F4EB620C9FB511E31B65F9F4F728FCCD8ACDDEA12C1} ``` As you can see, these four lines of results are all the Public Keys I generated, but they look different. This is why you got the error that the format was incorrect. I think you need to pass the Public Key as an Unsigned Integer with 256 bits to try out. In TON, or TVM, we only pass the Cell datatype to the smart contract. That is why I need to convert my `uint` Public Key to the Cell data type there!
I don't have any expereince deal with Validator config, but I can share with you the idea for the Public Key we use in TON and interacting with smart contract. ```typescript import { randomBytes } from "crypto"; import { keyPairFromSeed } from "ton-crypto"; let keypair = keyPairFromSeed(randomBytes(32)); let public_key_hex = keypair.publicKey.toString("hex"); let public_key_int = BigInt("0x" + public_key_hex); let public_key_cell = beginCell().storeUint(public_key_int, 256).endCell(); console.log(keypair.publicKey); console.log(public_key_hex); console.log(public_key_int); console.log(public_key_cell); ``` You will get: ``` <Buffer 3b 19 27 24 86 4a 6a 7b fa 02 5f 4e b6 20 c9 fb 51 1e 31 b6 5f 9f 4f 72 8f cc d8 ac dd ea 12 c1> 3b192724864a6a7bfa025f4eb620c9fb511e31b65f9f4f728fccd8acddea12c1 26730899395840241403219970071225489010060933487521107827084323612022786364097n x{3B192724864A6A7BFA025F4EB620C9FB511E31B65F9F4F728FCCD8ACDDEA12C1} ``` In TON, or TVM, we only passing the Cell datatype to the smart contract. That is why I need to turn my `uint` Public Key to the Cell data type there!
6 months ago
Original
Convert public key of validator to correct format

I don't have any expereince deal with Validator config, but I can share with you the idea for the Public Key we use in TON and interacting with smart contract. ```typescript import { randomBytes } from "crypto"; import { keyPairFromSeed } from "ton-crypto"; let keypair = keyPairFromSeed(randomBytes(32)); let public_key_hex = keypair.publicKey.toString("hex"); let public_key_int = BigInt("0x" + public_key_hex); let public_key_cell = beginCell().storeUint(public_key_int, 256).endCell(); console.log(keypair.publicKey); console.log(public_key_hex); console.log(public_key_int); console.log(public_key_cell); ``` You will get: ``` <Buffer 3b 19 27 24 86 4a 6a 7b fa 02 5f 4e b6 20 c9 fb 51 1e 31 b6 5f 9f 4f 72 8f cc d8 ac dd ea 12 c1> 3b192724864a6a7bfa025f4eb620c9fb511e31b65f9f4f728fccd8acddea12c1 26730899395840241403219970071225489010060933487521107827084323612022786364097n x{3B192724864A6A7BFA025F4EB620C9FB511E31B65F9F4F728FCCD8ACDDEA12C1} ``` In TON, or TVM, we only passing the Cell datatype to the smart contract. That is why I need to turn my `uint` Public Key to the Cell data type there!