blockchain

How can I initialize a user's balance in a Substrate blockchain?

心已入冬 提交于 2019-12-25 02:12:38
问题 When I start my Substrate blockchain, I want to initialize users with some free balance. How can I achieve this? What if my chain is already running and I do not want to restart it? 回答1: Genesis Configuration The best way to set up your Substrate users with some initial free balance is to update your chain_spec.rs file such that users are given units at the genesis block of your blockchain. This genesis configuration happens through the Balances module: fn testnet_genesis(initial_authorities:

web3.eth.getAccounts() returns empty

狂风中的少年 提交于 2019-12-25 01:48:41
问题 I try implement a simple bank account example (get balance, deposit, withdraw). pragma solidity 0.5.1; contract Bank { int bal; constructor() public { bal = 1; } //get balance function function getBalance () view public returns(int) { return bal; } //withdraw money function withdraw (int amt) public { bal = bal - amt; } //deposit money function deposit (int amt) public { bal = bal + amt; } } I can get the balance of a simple account but I cannot use the deposit/withdraw functions as web3.eth

Does Hyperledger support running multi-channels in one peer?

谁说我不能喝 提交于 2019-12-25 01:48:10
问题 Same as the topic, is it possible to run 2 or more channels on a same peer container? I have been reading the docs for days about how to configure the MSP to allow such doing so? 回答1: Yes, you can run on one peer multiple chains, all you need is to produce configuration for each one of them and make peer to join it. Basically the flow works as following: You need to provide chain configuration within configtx.yaml . Use configtxgen to produce create channel transaction and updates for anchor

How to prevent third party to seeing the data on same channel in Hyperledger Fabric?

為{幸葍}努か 提交于 2019-12-24 20:54:32
问题 So basically in Hyperledger Fabric the third party information provider have to be a part of the channel and once they become the part of the channel they get to see all the information on the channel which can be data security breach. Is there a way we can prevent them seeing the whole data but still give us the required information. example - Market data provider for a trading system when two banks are trading each other do they need to share that trade information with the market data

Where is Hyperledger fabric chaincode store location?

安稳与你 提交于 2019-12-24 19:55:28
问题 I used peer commond in cli container on chancode install. chaincode name + varsion file was made on peer containers. (location is /var/hyperledger/production/chaincodes) What is this? chaincode? I am looking for chaincode after install. 回答1: The chaincode package which is installed on the peer is technically the serialized bytes of a protobuf message. The protobuf in a ChainDeploymentSpec message, which is defined in the "github.com/hyperledger/fabric/protos/peer" package: message

peer endorsement policy not working hyperledger fabric

情到浓时终转凉″ 提交于 2019-12-24 15:09:10
问题 I am trying to enforce simple endorsement policy for 2 org network. Here is my crypto-config.yaml OrdererOrgs: - Name: Orderer Domain: example.com Specs: - Hostname: orderer PeerOrgs: - Name: Org1 Domain: org1.example.com EnableNodeOUs: true # CA: # OrganizationalUnit: peer Template: Count: 1 Users: Count: 1 - Name: Org2 Domain: org2.example.com EnableNodeOUs: true # CA: # OrganizationalUnit: peer Template: Count: 1 Users: Count: 1 And i can see OU as peer in both peers. peer0.org2.example

why http://localhost:10007/web/example/ is giving empty response in Corda?

六眼飞鱼酱① 提交于 2019-12-24 09:16:07
问题 I Started with cordapp set up. I am able to build corapp-example as in the set up instruction. To test when I opened above link its not working? Should I do any other set up 回答1: This is a bug in the docs that is being addressed. When running via IntelliJ, the webports for the nodes are http://localhost:10009/, http://localhost:10012/ and http://localhost:10015/. 来源: https://stackoverflow.com/questions/50228037/why-http-localhost10007-web-example-is-giving-empty-response-in-corda

error executing chaincode: failed to execute transaction: timeout expired while executing transaction

我的未来我决定 提交于 2019-12-24 07:45:46
问题 I write this chaincode and when I invoke it to read with GetOrgan the command is succeeded but when i want to add an organ with AddOrgan i have this error : Error endorsing invoke: rpc error: code = Unknown desc = error executing >chaincode: failed to execute transaction: timeout expired while executing >transaction - import ( "bytes" "encoding/json" "fmt" "strconv" "github.com/hyperledger/fabric/core/chaincode/shim" sc "github.com/hyperledger/fabric/protos/peer" ) type SmartContract struct {

Decrypting the payload in hyperledger

北战南征 提交于 2019-12-24 06:44:33
问题 I am currently using Developer Environment for Hyperledger Fabrics. I tried using GET to retrieve block info and it does give me a response. However, in the response, there's one component called payload, and it's in a unreadable format. Is there a way to make it readable/decrypt it? For instance, in bluemix, when you do init of party "a" and party "b", the payload shows inita100b100. Firstly, I did this transaction/REST request { "jsonrpc": "2.0", "method": "invoke", "params": { "type": 1,

Decrypting the payload in hyperledger

假如想象 提交于 2019-12-24 06:44:19
问题 I am currently using Developer Environment for Hyperledger Fabrics. I tried using GET to retrieve block info and it does give me a response. However, in the response, there's one component called payload, and it's in a unreadable format. Is there a way to make it readable/decrypt it? For instance, in bluemix, when you do init of party "a" and party "b", the payload shows inita100b100. Firstly, I did this transaction/REST request { "jsonrpc": "2.0", "method": "invoke", "params": { "type": 1,