Skip to content

Commit 8c246c0

Browse files
committed
Merge remote-tracking branch 'origin-ssh/dev' into dev
2 parents 932ada2 + cb643d9 commit 8c246c0

File tree

6 files changed

+11
-285
lines changed

6 files changed

+11
-285
lines changed

README.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,6 @@ Mytonctrl's documentation can be found at https://docs.ton.org/participate/run-n
5858
- [x] Show offers
5959
- [x] Vote for the proposal
6060
- [x] Automatic voting for previously voted proposals
61-
- [x] Domain management
62-
- [x] Rent a new domain
63-
- [x] Show rented domains
64-
- [x] Show domain status
65-
- [x] Delete domain
66-
- [ ] Automatic domain renewal
6761
- [x] Controlling the validator
6862
- [x] Participate in the election of a validator
6963
- [x] Return bet + reward

mytoncore/functions.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -384,12 +384,6 @@ def Offers(local, ton):
384384
ton.VoteOffer(offer_hash)
385385
# end define
386386

387-
388-
def Domains(local, ton):
389-
pass
390-
# end define
391-
392-
393387
def Telemetry(local, ton):
394388
sendTelemetry = local.db.get("sendTelemetry")
395389
if sendTelemetry is not True:
@@ -565,7 +559,6 @@ def General(local):
565559
local.start_cycle(Complaints, sec=t, args=(local, ton, ))
566560
local.start_cycle(Slashing, sec=t, args=(local, ton, ))
567561

568-
local.start_cycle(Domains, sec=600, args=(local, ton, ))
569562
local.start_cycle(Telemetry, sec=60, args=(local, ton, ))
570563
local.start_cycle(OverlayTelemetry, sec=7200, args=(local, ton, ))
571564
local.start_cycle(ScanLiteServers, sec=60, args=(local, ton,))

mytoncore/models.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,6 @@ def __init__(self, workchain, addr):
4141
#end class
4242

4343

44-
class Domain(dict):
45-
def __init__(self):
46-
self["name"] = None
47-
self["adnlAddr"] = None
48-
self["walletName"] = None
49-
#end define
50-
#end class
51-
52-
5344
class Block():
5445
def __init__(self, str=None):
5546
self.workchain = None

mytoncore/mytoncore.py

Lines changed: 0 additions & 120 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
from mytoncore.models import (
2020
Wallet,
2121
Account,
22-
Domain,
2322
Block,
2423
Trans,
2524
Message,
@@ -390,48 +389,6 @@ def GetComment(self, body):
390389
return result
391390
#end define
392391

393-
def GetDomainAddr(self, domainName):
394-
cmd = "dnsresolve {domainName} -1".format(domainName=domainName)
395-
result = self.liteClient.Run(cmd)
396-
if "not found" in result:
397-
raise Exception("GetDomainAddr error: domain \"{domainName}\" not found".format(domainName=domainName))
398-
resolver = parse(result, "next resolver", '\n')
399-
buff = resolver.replace(' ', '')
400-
buffList = buff.split('=')
401-
fullHexAddr = buffList[0]
402-
addr = buffList[1]
403-
return addr
404-
#end define
405-
406-
def GetDomainEndTime(self, domainName):
407-
self.local.add_log("start GetDomainEndTime function", "debug")
408-
buff = domainName.split('.')
409-
subdomain = buff.pop(0)
410-
dnsDomain = ".".join(buff)
411-
dnsAddr = self.GetDomainAddr(dnsDomain)
412-
413-
cmd = "runmethodfull {addr} getexpiration \"{subdomain}\"".format(addr=dnsAddr, subdomain=subdomain)
414-
result = self.liteClient.Run(cmd)
415-
result = parse(result, "result:", '\n')
416-
result = parse(result, "[", "]")
417-
result = result.replace(' ', '')
418-
result = int(result)
419-
return result
420-
#end define
421-
422-
def GetDomainAdnlAddr(self, domainName):
423-
self.local.add_log("start GetDomainAdnlAddr function", "debug")
424-
cmd = "dnsresolve {domainName} 1".format(domainName=domainName)
425-
result = self.liteClient.Run(cmd)
426-
lines = result.split('\n')
427-
for line in lines:
428-
if "adnl address" in line:
429-
adnlAddr = parse(line, "=", "\n")
430-
adnlAddr = adnlAddr.replace(' ', '')
431-
adnlAddr = adnlAddr
432-
return adnlAddr
433-
#end define
434-
435392
def GetLocalWallet(self, walletName, version=None, subwallet=None):
436393
self.local.add_log("start GetLocalWallet function", "debug")
437394
if walletName is None:
@@ -2898,76 +2855,6 @@ def GetItemFromDict(self, data, search):
28982855
return None
28992856
#end define
29002857

2901-
def GetDomainFromAuction(self, walletName, addr):
2902-
wallet = self.GetLocalWallet(walletName)
2903-
bocPath = self.local.buffer.my_temp_dir + "get_dns_data.boc"
2904-
bocData = bytes.fromhex("b5ee9c7241010101000e0000182fcb26a20000000000000000f36cae4d")
2905-
with open(bocPath, 'wb') as file:
2906-
file.write(bocData)
2907-
resultFilePath = self.SignBocWithWallet(wallet, bocPath, addr, 0.1)
2908-
self.SendFile(resultFilePath, wallet)
2909-
#end define
2910-
2911-
def NewDomain(self, domain):
2912-
self.local.add_log("start NewDomain function", "debug")
2913-
domainName = domain["name"]
2914-
buff = domainName.split('.')
2915-
subdomain = buff.pop(0)
2916-
dnsDomain = ".".join(buff)
2917-
dnsAddr = self.GetDomainAddr(dnsDomain)
2918-
wallet = self.GetLocalWallet(domain["walletName"])
2919-
expireInSec = 700000 # fix me
2920-
catId = 1 # fix me
2921-
2922-
# Check if domain is busy
2923-
domainEndTime = self.GetDomainEndTime(domainName)
2924-
if domainEndTime > 0:
2925-
raise Exception("NewDomain error: domain is busy")
2926-
#end if
2927-
2928-
fileName = self.tempDir + "dns-msg-body.boc"
2929-
args = ["auto-dns.fif", dnsAddr, "add", subdomain, expireInSec, "owner", wallet.addrB64, "cat", catId, "adnl", domain["adnlAddr"], "-o", fileName]
2930-
result = self.fift.Run(args)
2931-
resultFilePath = parse(result, "Saved to file ", ')')
2932-
resultFilePath = self.SignBocWithWallet(wallet, resultFilePath, dnsAddr, 1.7)
2933-
self.SendFile(resultFilePath, wallet)
2934-
self.AddDomain(domain)
2935-
#end define
2936-
2937-
def AddDomain(self, domain):
2938-
if "domains" not in self.local.db:
2939-
self.local.db["domains"] = list()
2940-
#end if
2941-
self.local.db["domains"].append(domain)
2942-
self.local.save()
2943-
#end define
2944-
2945-
def GetDomains(self):
2946-
domains = self.local.db.get("domains", list())
2947-
for domain in domains:
2948-
domainName = domain.get("name")
2949-
domain["endTime"] = self.GetDomainEndTime(domainName)
2950-
return domains
2951-
#end define
2952-
2953-
def GetDomain(self, domainName):
2954-
domain = dict()
2955-
domain["name"] = domainName
2956-
domain["adnlAddr"] = self.GetDomainAdnlAddr(domainName)
2957-
domain["endTime"] = self.GetDomainEndTime(domainName)
2958-
return domain
2959-
#end define
2960-
2961-
def DeleteDomain(self, domainName):
2962-
domains = self.local.db.get("domains")
2963-
for domain in domains:
2964-
if (domainName == domain.get("name")):
2965-
domains.remove(domain)
2966-
self.local.save()
2967-
return
2968-
raise Exception("DeleteDomain error: Domain not found")
2969-
#end define
2970-
29712858
def GetAutoTransferRules(self):
29722859
autoTransferRules = self.local.db.get("autoTransferRules")
29732860
if autoTransferRules is None:
@@ -3030,13 +2917,6 @@ def WriteBookmarkData(self, bookmark):
30302917
data = "empty"
30312918
else:
30322919
data = account.balance
3033-
elif type == "domain":
3034-
domainName = bookmark.get("addr")
3035-
endTime = self.GetDomainEndTime(domainName)
3036-
if endTime == 0:
3037-
data = "free"
3038-
else:
3039-
data = timestamp2datetime(endTime, "%d.%m.%Y")
30402920
else:
30412921
data = "null"
30422922
bookmark["data"] = data

0 commit comments

Comments
 (0)