I've managed to deploy a contract on geth by unlocking the account of the node. (How this would work in production I have no idea, as I think it would pose a security risk)
Now I connect with my truffle app to the local geth node (connecting my truffle app to the testrpc works completely, with callbacks etc.)
What I'm missing is the 10 accounts & 10 private keys that I get with testrpc on my geth account.
Correct me if I'm wrong, but I could add these in my genesis.json, but they are different each time I start the testrpc, but the same when I start geth.
What I'm missing, or can't see any clear instructions or workflow for, is switching between the two.
Where would I start when I want to test it on a geth (or other eth node) instance?
Main issues:
- I can't influence the accounts being used/created with
testrpc, only the number of default accounts. - When I successfully deploy contracts and compile
.sol.jsfiles and the addresses match the ones registered in thegethinstance, I do a transfer, but the promise callback (then) doesn't get triggered, whereas on thetestrpcit does.
The callback in question:
shares.sendShares(destinationAccountId, amount, {from: accountId}).then(function() {
return getShares(accountId, function(val){
store.dispatch(setSendStatus("Shares Sent!", val))
})
return getDestinationShares(destinationAccountId, function(val){
store.dispatch(setDestinationStatus("Shares received!", val))
});
})
- Right now, I'm just retrieving the accounts array and use the
0and1of that, what if I want a default existing account integrated intestrpc?
Not sure how relevant, but my genesis.json: (from: http://tech.lab.carl.pro/kb/ethereum/testnet_setup)
{
"nonce": "0x0000000000000042",
"mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"difficulty": "0x4000",
"alloc": {},
"coinbase": "0x0000000000000000000000000000000000000000",
"timestamp": "0x00",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"extraData": "Custem Ethereum Genesis Block",
"gasLimit": "0xffffffff"
}
geth, and referring to the containing array withaccounts[0]etc. But this is not practical in a live environment, where there are dozens of accounts, which can be shuffled around depending how they alphabetically sort (or whatever sorting algorythm is used) – BlockChange Jul 12 '16 at 12:40