smartcontracts

Chaincode (smart contract) interactions within and across channels in Hyperledger Fabric

纵然是瞬间 提交于 2019-12-05 17:39:37
Consider the Organization-Peer setup in a Hyperledger Fabric network as shown in the image. Org 1 has two peers, Org 2 has one peer - all of which exist inside the same channel - X. Org 3 has one peer which exist outside in a different channel. The peers have distinct chaincodes(c1, c2, c3 & c4) installed in each of them with the functions as explained. write() - put a key-value pair into the ledger update() - update a value for an existing key read() - query an existing key-value pair Now on to few questions. Can c3 invoke c2 to update a key's value (as c3 do not have update() function)? Can

Difference of Geth or Ganache

房东的猫 提交于 2019-12-04 06:05:59
问题 Hi I am new to blockchain topic and I am trying to make an Ethereum smart contract. First step I installed truffle and when I try to migrate it throws an error because I have no ethereum client. For solving this problem truffle develop, ganache, geth are recommended but I couldnt decide to which one is more suitable and I dont understand the difference of ganache and geth. Basically are they serving same thing or not? Here is error: Could not connect to your Ethereum client with the following

How to find out if an Ethereum address is a contract?

旧时模样 提交于 2019-12-03 05:47:42
问题 An address in Solidity can be an account or a contract (or other things, such as a transaction). When I have a variable x, holding an address, how can I test if it is a contract or not? (Yes, I've read the chapter on types in the doc) 回答1: Edit: Solidity has changed since this answer was first written, @manuel-aráoz has the correct answer. There is no way in solidity to check if an address is a contract. One of the goals of Ethereum is for humans and smart contracts to both be treated equally

BigQuery/ Ethereum dataset - how to write the code

拥有回忆 提交于 2019-12-02 12:02:24
问题 For the ethereum dataset, anyone could tell me how should I write in BigQuery if I'd know the last month transactions of a particular contract? For example, if i would know how many transactions are made in the last month for the contract address " 0x41dbecc1cdc5517c6f76f6a6e836adbee2754de3 " his a Everytime I try to analyze this address, it returns zero. For example SELECT from_address, to_address, value, transaction_hash FROM `bigquery-public-data.ethereum_blockchain.token_transfers` AS

BigQuery/ Ethereum dataset - how to write the code

折月煮酒 提交于 2019-12-02 06:01:13
For the ethereum dataset, anyone could tell me how should I write in BigQuery if I'd know the last month transactions of a particular contract? For example, if i would know how many transactions are made in the last month for the contract address " 0x41dbecc1cdc5517c6f76f6a6e836adbee2754de3 " his a Everytime I try to analyze this address, it returns zero. For example SELECT from_address, to_address, value, transaction_hash FROM `bigquery-public-data.ethereum_blockchain.token_transfers` AS token_trs JOIN `bigquery-public-data.ethereum_blockchain.contracts` AS contracts ON (contracts.address =

UnhandledPromiseRejectionWarning: Error: The contract code couldn't be stored, please check your gas limit

独自空忆成欢 提交于 2019-11-30 17:28:17
I am trying to deploy my simple solidity smart contract onto the Rinkeby Network but I keep getting the error: UnhandledPromiseRejectionWarning: Error: The contract code couldn't be stored, please check your gas limit. My solidity code is simple pragma solidity ^0.4.18; contract Greetings{ string public message; function Greetings(string initialMessage) public{ message = initialMessage; } function setMessage(string newMessage) public { message = newMessage; } } and my deploy script is: const HDWalletProvider = require('truffle-hdwallet-provider'); const Web3 = require('web3'); const {

Send ERC20 token with web3

喜欢而已 提交于 2019-11-26 20:50:28
I'm currently using 0.2x.x version of Web3 Javascript API. I deployed my custom ERC20 token by creating smart contract in solidity (on REMIX IDE). I installed the MetaMask and had a test on https://wallet.ethereum.org/ to send some custom ERC token to another my account. It worked well. I want to add the 'send custom ERC20 Token' function in my javascript code using Web3. Here is my code below. var http = require('http'); var Web3 = require('web3'); var Tx = require('ethereumjs-tx'); var abi = [{"...."}]; var data = '0x00..'; var contract_addr = '0x00..'; var owner = '0x00..'; var web3 = new