everx-labs / debot-is-consortium Goto Github PK
View Code? Open in Web Editor NEWDeBot Interface Specifications (IS) Consortium. IS a place where community defines interfaces every DeBot browser should support.
DeBot Interface Specifications (IS) Consortium. IS a place where community defines interfaces every DeBot browser should support.
cd UserInfo/examples
bash debot-run.sh
Log:
13:00:40 [DEBUG] (1) ton_client::debot::dengine: running getRequiredInterfaces, addr 0:336c16a88352dbb1b71222e0257d7ff05587b21455af2b2557d3dc69bcc682d0
13:00:40 [DEBUG] (1) ton_client::debot::dengine: running getDebotInfo, addr 0:336c16a88352dbb1b71222e0257d7ff05587b21455af2b2557d3dc69bcc682d0
13:00:40 [DEBUG] (1) ton_client::debot::dengine: run_debot_external getDebotOptions, args: {}
13:00:40 [DEBUG] (1) ton_client::debot::dengine: running getDebotOptions, addr 0:336c16a88352dbb1b71222e0257d7ff05587b21455af2b2557d3dc69bcc682d0
13:00:40 [DEBUG] (1) ton_client::debot::dengine: run_debot_external fetch, args: {}
13:00:40 [DEBUG] (1) ton_client::debot::dengine: running fetch, addr 0:336c16a88352dbb1b71222e0257d7ff05587b21455af2b2557d3dc69bcc682d0
13:00:40 [ERROR] Create run message failed: Invalid name: fetch
13:00:40 [DEBUG] (1) ton_client::debot::dengine: switching to 0
13:00:40 [DEBUG] (1) tonos_cli::debot::callbacks: switched to ctx 0
13:00:40 [DEBUG] (1) ton_client::debot::dengine: run_action: start
13:00:40 [DEBUG] (1) ton_client::debot::dengine: run_debot_external start, args: {}
13:00:40 [DEBUG] (1) ton_client::debot::dengine: running start, addr 0:336c16a88352dbb1b71222e0257d7ff05587b21455af2b2557d3dc69bcc682d0
13:00:40 [DEBUG] (1) ton_client::debot::dengine: Interface call
13:00:40 [DEBUG] (1) ton_client::debot::dinterface: interface a56115147709ed3437efb89460b94a120b7fe94379c795d1ebb0435a847ee580 call
13:00:40 [DEBUG] (1) ton_client::debot::dinterface: interface a56115147709ed3437efb89460b94a120b7fe94379c795d1ebb0435a847ee580 not implemented
13:00:40 [DEBUG] (1) ton_client::debot::dengine: Interface call
13:00:40 [DEBUG] (1) ton_client::debot::dinterface: interface a56115147709ed3437efb89460b94a120b7fe94379c795d1ebb0435a847ee580 call
13:00:40 [DEBUG] (1) ton_client::debot::dinterface: interface a56115147709ed3437efb89460b94a120b7fe94379c795d1ebb0435a847ee580 not implemented
13:00:40 [DEBUG] (1) ton_client::debot::dengine: Interface call
13:00:40 [DEBUG] (1) ton_client::debot::dinterface: interface a56115147709ed3437efb89460b94a120b7fe94379c795d1ebb0435a847ee580 call
13:00:40 [DEBUG] (1) ton_client::debot::dinterface: interface a56115147709ed3437efb89460b94a120b7fe94379c795d1ebb0435a847ee580 not implemented
13:00:40 [DEBUG] (1) ton_client::debot::dengine: instant_switch = false, state_to = 0
13:00:40 [DEBUG] (1) ton_client::debot::dinterface: interface a56115147709ed3437efb89460b94a120b7fe94379c795d1ebb0435a847ee580 call
13:00:40 [DEBUG] (1) tonos_cli::debot::term_browser: response: 1924829813 ({"value":"0:c3da3e141096b5bb518b3479b8fe36163c191e2aaffa5c603b85b62335c91201"})
13:00:40 [DEBUG] (1) ton_client::debot::dengine: Interface call
13:00:40 [DEBUG] (1) ton_client::debot::dinterface: interface 8796536366ee21852db56dccb60bc564598b618c865fc50c8b1ab740bba128e3 call
13:00:40 [DEBUG] (1) ton_client::debot::dinterface: interface 8796536366ee21852db56dccb60bc564598b618c865fc50c8b1ab740bba128e3 not implemented
13:00:40 [DEBUG] (1) ton_client::debot::dinterface: interface a56115147709ed3437efb89460b94a120b7fe94379c795d1ebb0435a847ee580 call
13:00:40 [DEBUG] (1) tonos_cli::debot::term_browser: response: 965659587 ({"value":"0xf869eb226d1d3eda3b9863e3121b66b351cbf8c6ce7f4fd4dba45901b97155d7"})
13:00:40 [DEBUG] (1) ton_client::debot::dengine: Interface call
13:00:40 [DEBUG] (1) ton_client::debot::dinterface: interface 8796536366ee21852db56dccb60bc564598b618c865fc50c8b1ab740bba128e3 call
13:00:40 [DEBUG] (1) ton_client::debot::dinterface: interface 8796536366ee21852db56dccb60bc564598b618c865fc50c8b1ab740bba128e3 not implemented
13:00:40 [DEBUG] (1) ton_client::debot::dinterface: interface a56115147709ed3437efb89460b94a120b7fe94379c795d1ebb0435a847ee580 call
13:00:40 [DEBUG] (1) tonos_cli::debot::term_browser: response: 261024939 ({"handle":2})
13:00:40 [DEBUG] (1) ton_client::debot::dengine: Interface call
13:00:40 [DEBUG] (1) ton_client::debot::dinterface: interface 8796536366ee21852db56dccb60bc564598b618c865fc50c8b1ab740bba128e3 call
13:00:40 [DEBUG] (1) ton_client::debot::dinterface: interface 8796536366ee21852db56dccb60bc564598b618c865fc50c8b1ab740bba128e3 not implemented
13:00:40 [DEBUG] (1) ton_client::debot::dinterface: interface 8796536366ee21852db56dccb60bc564598b618c865fc50c8b1ab740bba128e3 call
User account 0:c3da3e141096b5bb518b3479b8fe36163c191e2aaffa5c603b85b62335c91201
13:00:40 [DEBUG] (1) ton_client::debot::dinterface: interface 8796536366ee21852db56dccb60bc564598b618c865fc50c8b1ab740bba128e3 call
User public key 112360728228972547836743944487000110014042219676732296757809302185935662831063
13:00:40 [DEBUG] (1) ton_client::debot::dinterface: interface 8796536366ee21852db56dccb60bc564598b618c865fc50c8b1ab740bba128e3 call
Signing box handle 2
13:00:40 [DEBUG] (1) tonos_cli::debot::callbacks: no more actions, exit loop
MOTIVATION:
I want to to create a debot, it's a simple quiz, that asks few questions to a user and generate a single message with answers. I want to have an ability to store the message somewhere. In theory I can store it in blockchain, but it requires to create a storage contract and deploy it for every user, also to save the message I need to send a transaction. But in Surf we already have a contract, that we create and deploy for a new account, so I can just create a new account for the debot and use it. If I send a regular message to such account I mustn't create a transaction even though it would be encrypted, that is actually perfect.
ADDITIONAL CASES:
SOLUTION:
Create a new interface, something like:
sendToChat(address: string, message: string)
That will send a message to any address via chat.
ISSUES:
I think a progress indicator would be very useful on debots.
Instead of some mundane "working..." message, you'd be able to show circular progress indicator, or an ascii equivalent on cli.
the intefrace may also contain progress bar:)
What do you think?
pragma ton-solidity >= 0.57.3;
pragma AbiHeader expire;
pragma AbiHeader time;
pragma AbiHeader pubkey;
interface IContract {
function foo() external responsible pure returns (string);
}
contract Example {
function foo() external responsible pure returns (string) {
return "foo42";
}
// minimal DeBot
string s_dabi;
function setABI(string dabi) public {
require(tvm.pubkey() == msg.pubkey(), 100);
tvm.accept();
s_dabi = dabi;
}
function getDebotOptions() public view returns (
uint8 options, string debotAbi, string targetAbi, address targetAddr
) {
debotAbi = s_dabi;
targetAbi = "";
targetAddr = address(0);
options = 1;
}
function onFoo(string data) public pure {
tvm.log(format("onFoo: {}", data));
}
function start() public pure {
tvm.log("start");
IContract(address(this)).foo{
callback: onFoo
}();
// FIXME IContract(address(this)).foo().await;
tvm.log("end");
}
function getDebotInfo() public functionID(0xDEB) view returns(
string name, string version, string publisher, string caption, string author,
address support, string hello, string language, string dabi, bytes icon
) {
tvm.log("getDebotInfo");
name = "Example";
version = "1.0.0-alpha.0";
publisher = "Everscale";
caption = "My first DeBot";
author = "Everscale";
support = address.makeAddrStd(0, 0x0);
hello = "Hello first user!";
language = "en";
dabi = s_dabi;
icon = "";
}
}
Run log:
19:31:10 [DEBUG] (1) ton_client::debot::dengine: running getRequiredInterfaces, addr 0:3aee4ccbf6411dc31e48c610ff78ce0e480e1f156d20c04ec88c690657dd0a45
19:31:10 [DEBUG] (1) ton_client::debot::dengine: running getDebotInfo, addr 0:3aee4ccbf6411dc31e48c610ff78ce0e480e1f156d20c04ec88c690657dd0a45
19:31:10 [INFO] getDebotInfo
19:31:10 [DEBUG] (1) ton_client::debot::dengine: run_debot_external getDebotOptions, args: {}
19:31:10 [DEBUG] (1) ton_client::debot::dengine: running getDebotOptions, addr 0:3aee4ccbf6411dc31e48c610ff78ce0e480e1f156d20c04ec88c690657dd0a45
19:31:10 [DEBUG] (1) ton_client::debot::dengine: run_debot_external fetch, args: {}
19:31:10 [DEBUG] (1) ton_client::debot::dengine: running fetch, addr 0:3aee4ccbf6411dc31e48c610ff78ce0e480e1f156d20c04ec88c690657dd0a45
19:31:10 [ERROR] Create run message failed: Invalid name: fetch
19:31:10 [DEBUG] (1) ton_client::debot::dengine: switching to 0
19:31:10 [DEBUG] (1) tonos_cli::debot::callbacks: switched to ctx 0
19:31:10 [DEBUG] (1) ton_client::debot::dengine: run_action: start
19:31:10 [DEBUG] (1) ton_client::debot::dengine: run_debot_external start, args: {}
19:31:10 [DEBUG] (1) ton_client::debot::dengine: running start, addr 0:3aee4ccbf6411dc31e48c610ff78ce0e480e1f156d20c04ec88c690657dd0a45
19:31:10 [INFO] start
19:31:10 [INFO] end
19:31:10 [DEBUG] (1) ton_client::debot::dengine: Invoke call
19:31:10 [DEBUG] (1) ton_client::debot::dengine: instant_switch = false, state_to = 0
19:31:10 [DEBUG] (1) ton_client::debot::dengine: Invoke call
19:31:10 [INFO] onFoo: foo42
19:31:10 [DEBUG] (1) tonos_cli::debot::callbacks: no more actions, exit loop
If use IContract(address(this)).foo().await;
run log:
19:38:12 [DEBUG] (1) ton_client::debot::dengine: running getRequiredInterfaces, addr 0:7aa981052eeb3022d5752567b593ed9bb260e926f5dc105f0daeb2646d73689a
19:38:12 [DEBUG] (1) ton_client::debot::dengine: running getDebotInfo, addr 0:7aa981052eeb3022d5752567b593ed9bb260e926f5dc105f0daeb2646d73689a
19:38:12 [INFO] getDebotInfo
19:38:12 [DEBUG] (1) ton_client::debot::dengine: run_debot_external getDebotOptions, args: {}
19:38:12 [DEBUG] (1) ton_client::debot::dengine: running getDebotOptions, addr 0:7aa981052eeb3022d5752567b593ed9bb260e926f5dc105f0daeb2646d73689a
19:38:12 [DEBUG] (1) ton_client::debot::dengine: run_debot_external fetch, args: {}
19:38:12 [DEBUG] (1) ton_client::debot::dengine: running fetch, addr 0:7aa981052eeb3022d5752567b593ed9bb260e926f5dc105f0daeb2646d73689a
19:38:12 [ERROR] Create run message failed: Invalid name: fetch
19:38:12 [DEBUG] (1) ton_client::debot::dengine: switching to 0
19:38:12 [DEBUG] (1) tonos_cli::debot::callbacks: switched to ctx 0
19:38:12 [DEBUG] (1) ton_client::debot::dengine: run_action: start
19:38:12 [DEBUG] (1) ton_client::debot::dengine: run_debot_external start, args: {}
19:38:12 [DEBUG] (1) ton_client::debot::dengine: running start, addr 0:7aa981052eeb3022d5752567b593ed9bb260e926f5dc105f0daeb2646d73689a
19:38:12 [INFO] start
19:38:12 [DEBUG] (1) ton_client::debot::dengine: Invoke call
19:38:12 [DEBUG] (1) ton_client::debot::dengine: instant_switch = false, state_to = 0
Error: Debot failed: Contract execution was terminated with error: Unknown error, exit code: 75.
Tip: For more information about exit code check the contract source code or ask the contract developer
Error: 1
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.