Sunday, June 11, 2017

Ethereum Coding Adventures


You'll notice that a lot of stuff just doesn't damn work.  Remix doesn't do anything beyond being the only syntax checking editor.  Mix was supposedly usable, but the binaries are taken down and I wasted hours trying to make the older code build at all (it doesn't).

Any contract beyond a basic 'Hello World' cannot be built in Mist because it's badly broken and won't allow you to move the default 'gas' beyond the laughable default.  Remix will barf out JavaScript code for Web3.  Okay, we can live with that.  Except Web3 doesn't work.  Oops.

Command line geth and the Mist wallet UI don't seem to know anything about each other.  If you run geth all by itself, it doesn't use the same wallets that Mist does.  If you run Mist, you can't write anything Web3 related because it runs geth in the background in IPC mode.

Don't believe me?  Run `ps -eaf` in a window, or looks in TaskMan if you a Windows dude:


/home/lpreimesberger/.config/Ethereum Wallet/binaries/Geth/unpacked/geth --rpc --testnet --fast --ipcpath /home/lpreimesberger/.ethereum/geth.ipc

Yup - no --rpc option.  Easy to fix.

$ killall geth
$ "/home/lpreimesberger/.config/Ethereum Wallet/binaries/Geth/unpacked/geth" --rpc --testnet --fast --ipcpath /home/lpreimesberger/.ethereum/geth.ipc --rpc

Okay - you can now use Web3.   Oh - snap.   What's this?

Error: authentication needed: password or unlock  at Object.InvalidResponse /home/lpreimesberger/projects/caprica-e/node_modules/web3/lib/web3/errors.js:38:16)

Hmm - yeah, not useful.  Try to use the Wiki documented login routine.  Good luck with that - it's gone.  No worries, there's an --unlock option.  The password option is documented as a string input in the Wiki  It's not.  Just damn file.   That are just toying with you again.  Put the wallet password in a file and try again:

"/home/lpreimesberger/.config/Ethereum Wallet/binaries/Geth/unpacked/geth" --rpc --testnet --fast --ipcpath /home/lpreimesberger/.ethereum/geth.ipc --unlock 0xE066F3a4BfAa155Bcb1F528BD9fb8266B86CCce8 --password ~/projects/caprica-e/pw

Whee!  Yeah, finally the JavaScript output will work.



No comments:

Post a Comment