佛薩奇2.0開發原理丨佛薩奇2.0智慧合約系統開發詳情版丨(原始碼部署)

Tg_StPv888發表於2023-02-23

  The reason why smart contracts can be perfectly applied on Ethereum is that Ethereum provides a nearly Turing complete computing environment on its blockchain.As long as the programming language can realize the calculation,it can support it,which also lays a solid foundation for the application of smart contracts in a broader environment.


  一、什麼是forsage(佛薩奇)?


  forsage(佛薩奇),是基於全球第二的加密貨幣以太坊的公鏈開發的一個智慧合約,系統開發:I8O佛薩奇2857軟體8624、百分百開源,百分百去中心化,一旦執行,不可篡改。


  接下來幾個基礎步驟,使用以下程式碼段更新您的pallet程式碼(如果您不想使用模板程式碼,請跳過此步驟):


  Log("輸出引數",arrParams,"#FF0000")


  while True:


  nowTime=time.localtime(time.time())


  nowHour=nowTime.tm_hour


  nowMin=nowTime.tm_min


  nowSec=nowTime.tm_sec


  tbl={


  "type":"table",


  "title":"msg",


  "cols":["id","begin","end","今天是否執行過啟動","今天是否執行過停止"],


  "rows":[]


  }


  for i in range(len(arrParams)):


  tbl["rows"].append([arrParams<i>["id"],json.dumps(arrParams<i>["begin"]),json.dumps(arrParams<i>["end"]),arrParams<i>["isProcessOpenThisDay"],arrParams<i>["isProcessCloseThisDay"]])


  if nowDay!=nowTime.tm_mday:


  arrParams<i>["isProcessOpenThisDay"]=False


  arrParams<i>["isProcessCloseThisDay"]=False


  if arrParams<i>["isProcessOpenThisDay"]==False:


  if nowTime.tm_hour==arrParams<i>["begin"]["hour"]and nowTime.tm_min&gt;=arrParams<i>["begin"]["min"]and nowTime.tm_sec&gt;=arrParams<i>["begin"]["sec"]:


  ret=api('RestartRobot',int(arrParams<i>["id"]))


  arrParams<i>["isProcessOpenThisDay"]=True


  Log("機器人ID:",arrParams<i>["id"],"執行啟動,請登入平臺檢查是否啟動成功","擴充套件API返回值:",ret,strPush)


  if arrParams<i>["isProcessCloseThisDay"]==False:


  if nowTime.tm_hour==arrParams<i>["end"]["hour"]and nowTime.tm_min&gt;=arrParams<i>["end"]["min"]and nowTime.tm_sec&gt;=arrParams<i>["end"]["sec"]:


  ret=api('StopRobot',int(arrParams<i>["id"]))


  arrParams<i>["isProcessCloseThisDay"]=True


  Log("機器人ID:",arrParams<i>["id"],"執行停止,請登入平臺檢查是否停止成功","擴充套件API返回值:",ret,strPush)


  if nowDay!=nowTime.tm_mday:


  nowDay=nowTime.tm_mday


  LogStatus(_D(),nowTime,"n`"+json.dumps(tbl)+"`")


  Sleep(500)


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/70016646/viewspace-2936734/,如需轉載,請註明出處,否則將追究法律責任。

相關文章