种树游戏系统开发(详情及规则)丨区块链DAPP种树游戏系统开发(方案及项目)/源码版
从学术角度来解释,区块链是分布式数据存储、点对点传输、共识机制、加密算法等计算机技术的新型应用模式。
区块链本质上是一个去中心化的数据库。
The blockchain system verifies all data generated during the period every 10 minutes(such as transaction records and records of when the block was edited or created),并将这些数据储存在一个新的区块上,这个区块会与前一个区块连接,从而形成一根链条。每个区块都必须包含前一区块的相关信息才能生效。
#连接一个Kovan测试网上的用来计算支持接口常量值的智能合约
from web3.auto.infura.kovan import w3
#合约ABI。注意,这里所有的true和false要替换成python的True和False
contract_abi=[
{
"constant":True,
"inputs":[
{
"internalType":"string",
"name":"signature",
"type":"string"
}
],
"name":"getSelector",
"outputs":[
{
"internalType":"bytes4",
"name":"",
"type":"bytes4"
}
],
"payable":False,
"stateMutability":"pure",
"type":"function"
},
{
"constant":True,
"inputs":[
{
"internalType":"bytes4[]",
"name":"selectors",
"type":"bytes4[]"
}
],
"name":"getSupportedInterface",
"outputs":[
{
"internalType":"bytes4",
"name":"",
"type":"bytes4"
}
],
"payable":False,
"stateMutability":"pure",
"type":"function"
}
]
#Kovan测试网上合约地址
contract_address='0x07d74Cf0Ce4A1b10Ece066725DB1731515d62b76'
#构造合约对象
CalSelector=w3.eth.contract(address=contract_address,abi=contract_abi)