ethereum

Create an account with web3.js v0.2.6

爱⌒轻易说出口 提交于 2019-12-13 03:38:58
问题 so everytime i try to create an account with web3 i always get errors like the wrong version of web3 and that i should switch to v1.0.0 i used this command to install web3 npm install ethereum/web3.js --save i ve tried these commands to create an account but there is always a mismatch web3.eth.accounts.create(); web3.eth.personal.newAccount('!@superpassword') .then(console.log); and i always get errors even though i installed npm install web3-eth-account --save npm install web3-eth-personal -

invoke a smart contract function from java application without need to listen to events

China☆狼群 提交于 2019-12-13 02:13:03
问题 As I understood that we have to use TransactionReceipt if we want to extract the events.. TransactionReceipt transactionReceipt = contract.someMethod( <param1>, ...).send(); but what about for example if I have a function called "register" and need many accounts to register their self by invoking the function register. how I can define accounts ( many credentials ) if the TransactionReceipt doesn't have parameters for ( from which account, gas limit, ..etc). One more thing that I invoked the

Is Hyperledger a truly secure blockchain like ethereum?

China☆狼群 提交于 2019-12-12 23:44:49
问题 In Hyperledger we have something called a network admin and this admin will have access to all the cards and assets on the blockchain (at least I have tried to deny the admin access to assets using the acl, but I couldn't deploy the change, it timed out Everytime). So, is it possible to isolate admin from our business network? Or all the blockchains like ethereum too have the network admin? 回答1: I believe you are referring in your question to Hyperledger Composer rather than Hyperledger

Interacting with the smart contract from Java application (We3j)

╄→尐↘猪︶ㄣ 提交于 2019-12-12 19:17:42
问题 I have many questions about the workflow ( sequence ) of interacting with the smart contract from Java application, so I will first explain what I have done and then put my questions, and if something wrong in my understanding please let me know. 1- I have written smart contract 2- Use truffle to get the smart contract java wrapper.(contract.java) 3- Use testrpc to test the contract I have 2 class uses testrpc accounts (credentials) to interact with the smart contract and call its functions

How to implement the EVM Trait for a Substrate Runtime?

↘锁芯ラ 提交于 2019-12-12 16:48:29
问题 Following the adding a module to your runtime, I'm trying to implement the Parity Substrate paint-evm trait for the Dothereum Runtime. The EVM module trait is defined as follows: pub trait Trait: Trait + Trait { type FeeCalculator: FeeCalculator; type ConvertAccountId: ConvertAccountId<Self::AccountId>; type Currency: Currency<Self::AccountId>; type Event: From<Event> + Into<Self::Event>; type Precompiles: Precompiles; } The adding a module tutorial here, however, is a bit vague and

How to improve smart contact design in order to distinguish data and their manipulation functions for the same domain object?

泪湿孤枕 提交于 2019-12-12 09:59:53
问题 We have a problem with contract redeploying. Each time when some logic is changed during new contract version deployment we are loosing all contract related data (which are stored in arrays, mappings). Then we need to execute data load procedures in order to restore environment to desired state which is time consuming action. I tried to split contract to tow ones (AbcDataContract, AbcActionsContract) but faced with problem of accessing to the mappings : Error: Indexed expression has to be a

web3j not working with contract function?

旧时模样 提交于 2019-12-12 06:45:15
问题 This is my simple contract in my private network contract AB { /* This creates an array with all balances */ mapping (address => uint256) public balanceOf; /* Initializes contract with initial supply tokens to the creator of the contract */ function AB () { balanceOf[msg.sender] = 1200; // Give the creator all initial tokens } /* Send coins */ function transfer(address _to, uint256 _value) { if (balanceOf[msg.sender] < _value) throw; // Check if the sender has enough if (balanceOf[_to] +

Solidity: ParserError: Expected pragma, import directive or contract /interface/library definition

霸气de小男生 提交于 2019-12-12 01:25:29
问题 I am getting error with both latest solc (0.5.2 version) and 0.4.25 too while I am writing Simple contract I have tried following steps uninstalled Solc: npm uninstall solc Installed targeted version: npm install --save solc@0.4.25 node compile.js (code given below) { contracts: {}, errors: [ ':1:1: ParserError: Expected pragma, import directive or contract /interface/library definition.\nD:\\RND\\BlockChain\\contracts\\Inbox.sol\n^\n' ],sourceList: [ '' ],sources: {} } Compile.js const path

Web3j v3.3.1 : Error while generating compiled solidity smart contracts which returns array of struct

北城以北 提交于 2019-12-11 21:32:52
问题 I am returning an array of struct from solidity function as below. pragma solidity ^0.4.21; pragma experimental ABIEncoderV2; function getPurchaseOrderForVendor(string vendorNameInput) constant returns (PurchaseOrderStruct[]) It is compiled to abi and bin files. The issue is with creating wrapper files for the contract using web3j(v3.3.1). Im getting the below errors. Generating com.contract.InvoiceSettlement_sol_InvoiceSettlement ... Exception in thread "main" java.lang

Error: Returned error: VM Exception while processing transaction: invalid opcode

半城伤御伤魂 提交于 2019-12-11 17:12:17
问题 I am trying to test a smart contract that monitors trading. I have three contracts, EscrowComplianceCecker, Industry, and Consumer. However, when testing my sendescrow() function on a truffle it seems to be throwing the above error. I am trying to figure out the reason for the bug I debugged with the truffle debugger. The problem seems to be coming from the line escrowobtainee.escrowobtainees[ escrowparticipator][obtcounter].escrowparticipantsinitialamountputin = escrowobtainee