blockchain

Sawtooth Transaction error: “Tried to set unauthorized address”

两盒软妹~` 提交于 2021-02-19 05:28:19
问题 I am trying to write my custom Transaction processor. I am writing for simple Account class class Account: def __init__(self, name, ac_number, balance): self.name = name self.ac_number = ac_number self.balance = balance My TP is working fine for a single account. Now I want to improve it for multiple accounts. To get a different state for each account number I have changed _'_get_account_address_' function. I am following @danintel 's Cookiejar and XO_python projects. I am following xo code

Sawtooth Transaction error: “Tried to set unauthorized address”

跟風遠走 提交于 2021-02-19 05:28:10
问题 I am trying to write my custom Transaction processor. I am writing for simple Account class class Account: def __init__(self, name, ac_number, balance): self.name = name self.ac_number = ac_number self.balance = balance My TP is working fine for a single account. Now I want to improve it for multiple accounts. To get a different state for each account number I have changed _'_get_account_address_' function. I am following @danintel 's Cookiejar and XO_python projects. I am following xo code

How to call a Smart Contract function using Python and web3.py

别等时光非礼了梦想. 提交于 2021-02-19 04:59:10
问题 I have a contract deployed on Ethereum test network which has some functions in it and they all happen to work while using the Remix interface. When trying to call those functions using web3.py in Python, I'm able to call only for public functions and that part works fine. The problem is calling a function with a "restriction" such as having an "owner requirement", meaning only the address which created the contract can call that specific function. I've Googled it but no luck. I'm guessing

FISCO-BCOS区块链开源平台部署步骤(3)

风格不统一 提交于 2021-02-16 19:23:30
第三章 部署系统合约 cd /mydata/FISCO-BCOS/systemcontractv2 #初始化npm包,仅运行一次即可 cnpm i # 修改其中的 proxy变量,更改期中的IP和端口对应fisco-bcos运行的IP和端口,端口见config.json中rpcport vim config.js #开始部署 node deploy.js #在输出的 SystemProxy的合约地址配置到config.json中的 systemproxyaddress "systemproxyaddress":"XXX" #重启节点 cd /mydata/nodedata-1/ chmod +x *.sh ./stop.sh ./start.sh #执行此步骤后不断刷出打包信息,表明重启成功 第四章 创建普通节点 所有节点的genesis.json与根证书ca.crt必须保持一致 4.1 初始化节点 # 假设在nodedata-2目录中进行操作 mkdir -p /mydata/nodedata-2/data/ #存放节点的各种文件 mkdir -p /mydata/nodedata-2/log/ #存放日志 mkdir -p /mydata/nodedata-2/keystore/ #存放账户秘钥 #拷贝创世节点相关文件 cd /mydata/nodedata-1/ cp

How to find the REST API parameters to a site that doesn't have the data within the HTML?

為{幸葍}努か 提交于 2021-02-11 17:36:09
问题 This is sort of a follow up question to my previous post here for reference: Webscraping Blockchain data seemingly embedded in Javascript through Python, is this even the right approach? Basically, I would receive an output and want to scrape some more features from it. In this case, the final link would be located at https://tracker.icon.foundation/address/hx4ae18d8f72200dc564673a0ae7206d862992753c where I'm trying to retrieve the balance of 3,570.5434 ICX in the middle of the page. I'm

Regular, repeating, interaction between an oracle and a smart contract

青春壹個敷衍的年華 提交于 2021-02-11 12:27:09
问题 This is just an example. I'm building this dapp where I have a start date and an end date and every day I want to get a random number from an oracle. If at some point the sum of the numbers I get every day exceeds a threshold then an OK message returns to my backend. Let's assume we have a range of 7 days. Day 1: My backend sends a request to the "smart contract Number" and calls the requestOk () method. The smart contract Number calls the gethNumber () method of the oracle smart contract and

Regular, repeating, interaction between an oracle and a smart contract

醉酒当歌 提交于 2021-02-11 12:25:59
问题 This is just an example. I'm building this dapp where I have a start date and an end date and every day I want to get a random number from an oracle. If at some point the sum of the numbers I get every day exceeds a threshold then an OK message returns to my backend. Let's assume we have a range of 7 days. Day 1: My backend sends a request to the "smart contract Number" and calls the requestOk () method. The smart contract Number calls the gethNumber () method of the oracle smart contract and

How do I notify the client application when a chaincode is invoked?

前提是你 提交于 2021-02-10 07:53:22
问题 When a chaincode is invoked, is there a way to call a REST API (external) so that the client application can be notified on the new transaction. Apart from REST, is there any other option? 回答1: It's better to use events https://github.com/hyperledger/fabric/blob/master/docs/protocol-spec.md#35-events Validating peers and chaincodes can emit events on the network that applications may listen for and take actions on. There is a set of pre-defined events, and chaincodes can generate custom

Webscraping Blockchain data seemingly embedded in Javascript through Python, is this even the right approach?

怎甘沉沦 提交于 2021-01-29 20:11:13
问题 I'm referencing this url: https://tracker.icon.foundation/block/29562412 If you scroll down to "Transactions", it shows 2 transactions with separate links, that's essentially what I'm trying to grab. If I try a simple pd.read_csv(url) command, it clearly omits the data I'm looking for, so I thought it might be JavaScript based and tried the following code instead: from requests_html import HTMLSession session = HTMLSession() r = session.get('https://tracker.icon.foundation/block/29562412') r