66

Make sure that you have configured your network in truffle.js. It should look something like this for the setup mentioned above: module.exports = { networks: { development: { host: "localhost", port: 8545, network_id: "*" // Match any network id } } };


25

First, make sure you have an account. web3.personal.listAccounts If you get [] ... web3.personal.newAccount() Try again. Then ... web3.personal.unlockAccount(web3.personal.listAccounts[0],"<password>", 15000) meaning unlock the first account with this password for 15,000 seconds (don't bug me for a while.) The DAPP side should stop ...


13

I had the same problem with truffle 4.0.1. After some investigation and advise from the truffle team I figured out that truffle 4.0.x has a new option. If you run truffle develop you don't need testrpc anymore. Since truffle develop runs on port 9545 you have to modify your truffle.js to something like this networks: { development: { host: "...


12

Using e.g. the web3 JS API, you could setup a filter and watch block changes: var filter = web3.eth.filter('latest'); filter.watch(function(error, result){ var block = web3.eth.getBlock(result, true); console.log('current block #' + block.number); });


11

Let's start with having a look at what we get in geth console for block number 40. Now let's consider a Go program. I Explained everything in code comments about how it is constructing keys and accessing values from Leveldb. package main import ( "github.com/syndtr/goleveldb/leveldb" "fmt" "encoding/binary" "github.com/ethereum/go-...


9

You need to use an Event, see example: contract answer{ // ... event VoteEvent(string ID, bool returnValue); function vote(string ID, uint qNum, uint ans) returns (bool) { // ... VoteEvent(ID, true); return true; } }


9

Summary The code in the question theoretically should not run, as the private key is in hex format and the call to new BigInteger(senderPrivKey) to parse the hex string without the 16 radix specified would result in a thrown exception. When the code is adjusted to use new BigInteger(senderPrivKey, 16) specifying the base 16 radix, the public key is ...


6

Currently EthereumJ has no JSON-RPC support, however we are planning to implement this in a nearest future as a separate project which also will include Web3 JS console


6

SOLVED!!! LONG/Detailed METHOD!!! (Shorter Version at bottom) The main problem was Bytes32(byte[]) only supports 32 length byte[]. Also keep in mind Numeric.hexStringToByteArray(strValueInHex) converts any HexString to byte[]. This is the process: String => Hex => 32 length Hex (ie. 64 length HexString) => byte[] => Bytes32 Note: "00" = 1 Hex ...


5

Full instructions and software is available at https://github.com/sammy007/open-ethereum-pool


5

Do it using your Transfer event in your contract. var myEvent = contract.Transfer({},{fromBlock: 0, toBlock: 'latest'}); myEvent.get((error, result) => { console.log(result); }); use fromBlock param as 5933218 ,the block in which contract created


4

Firstly you will need the following Maven pom.xml dependency: <dependency> <groupId>org.ethereum</groupId> <artifactId>ethereumj-core</artifactId> <version>1.2.0-RELEASE</version> <!-- <type>zip</type> --> </dependency> And here is the code to create ...


4

02/04/2016 I had a better look and no, there is no JSON-RPC API service. 07/04/2016 - The new changes to be merged that was referred to by @Oscar Guindzberg at https://github.com/ethereum/ethereumj/pull/352/files has a JSON RPC API with jetty for the HTTP handling and jsonrpc4j for the JSON conversions. Nice.


4

(I've only worked this out via code inspection, as I can't find anything in the documentation.) In the file ethereumj.conf change the line # Network id networkId = 1 to networkId = 2 In the same file set the network list by changing the line to set ip.list: ip.list = [ "92.51.165.126:30303", ] In the same file specify a boot node: active ...


4

You've got the right idea with checking balances for one address at a time and using promises. The square brackets are weird here. Looks like you're adapting array style but this is a function call that returns one number. You got a txhash because you sent a transaction to be mined ... different than call() which is local, read only, faster, free (no gas) ...


4

Try geth --light Light Sync: Gets only the current state. To verify elements, needs to ask to full (archive) nodes for the corresponding tree leave. You may take a look at this


3

You could probably do this, but it's unlikely to be the best approach. All three main clients expose a set of APIs via JSON-RPC; this is what web3 apps call. Instead of integrating directly with a client, you should run a stock node, and call these APIs from your webapp.


3

Check any sample from samples source directory how to deal with Transactions, for example, this one: CreateContractSample.java, Your transaction call should be something like this: // Amount in ether to send BigInteger etherToSend = BigInteger.valueOf(100); // Weis in 1 ether BigInteger weisInEther = BigInteger.valueOf(1_000_000_000_000_000_000L); ...


3

Here is some sample code to connect ethereumj to a testnet from github - ethereumj-core/.../samples/TestNetSample.java: private final String config = // network has no discovery, peers are connected directly "peer.discovery.enabled = false \n" + // set port to 0 to disable accident inbound connections "...


3

Because s2 is a struct being instantiated in the function rather than the contract, solidity will make it a storage member of the contract itself. This is unlike other primitive types which default to memory in the local scope of the function. The warning is a prompt to make a proper declaration. Either declare s2 in the contract or use memory to make s2 ...


3

The topic is used for filtering on indexed parameters in events/logs. If you have looked at Solidity (the most popular language for writing smart contracts in Ethereum), you can write events with the following format: event myEvent (type1 indexed arg1, type2 indexed arg2, type3 arg3); The indexed keyword allows you to filter on it when browsing event logs. ...


3

In order to parse the information in the LogInfo you will need the contract ABI. Once you have the ABI it's easy to parse : @Override public void onTransactionExecuted(TransactionExecutionSummary summary) { String abi = "[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"to\",\"type\":\"...


3

There is a non-merged pull request you can try https://github.com/ethereum/ethereumj/pull/352


3

I finally found a solution. As discussed in the other answer, you need to parse and append the init parameters to the contract code before sending the transaction. I did't found actually an elegant and generic way to parse arguments directly in Java (but it should not hard to do it) so I decoded the ABI syntax into byte[]. First of all copy the ...


3

These results make sense, because when EtherBank is deployed, only the msg.sender of the deployment transaction is given a balance. There are two entirely separate types of balance here: There is Ether, the funds that allow you to pay for gas and which act as mining rewards, and then there is your "Bank" balance. When you use the --account="privKey1,...


3

It seems that Azure is deploying an old, somewhat outdated Ethereum client that does not implement EIP 155 replay protections, which slightly changes the signature format in a way that has a nice migration path for clients to update before signers, but not for signers to update before clients. MetaMask has an issue for adding the ability to turn off EIP 155 ...


3

I'm using geth VERSION: 1.6.5-stable-cf87713d in the Geth --help you can read DEPRECATED OPTIONS: --fast Enable fast syncing through state downloads --light Enable light client mode I'm using --syncmode "fast" Blockchain sync mode ("fast", "full", or "light") I hope it's help.


3

You cannot update a contract at a given address. There are patterns to circumvent this limitation and have upgradable contracts, for example by having a front-end contract at a fixed address that points to the latest version of the contract. You can invoke a method on the contract that will cause its self destruction, if that method has been implemented at ...


3

I would say that the most developed development ecosystem for the Ethereum blockchain is Javascript. There is the web3 javascript library as well as well as a number of libraries over on Github - ethereumjs. In principle however you can utilise any programming language. For interacting with a node you need to interface with JSON_RPC endpoints. A number of ...


Only top voted, non community-wiki answers of a minimum length are eligible