Open SCBuergel opened 8 years ago
Same here, exactly same error.
In fact the pull request https://github.com/SilentCicero/ethereumjs-accounts/pull/14 is fixing that. Not sure when that would be merged in though.
Still doesn't work
hi, did you guys find any fix for this issue?
same problem here
the same issue, any updates?
same issue
same issue
Once again, this library is depreciated. Please use ethereumjs account or ethjs or ethers js!
Sent from my iPhone
On Dec 18, 2017, at 6:45 AM, pau1m notifications@github.com wrote:
same issue
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.
Oh bugger, I'm getting the same error. I was hoping to use this library to generate an account since the latest Web3.js 1.0.0-beta.27 hasn't finished adding unlockAccount()
https://github.com/ethereum/web3.js/issues/1264. I just tried using ethers.js but that didn't work for me either: https://github.com/ltfschoen/geth-node/compare/ethers-library?expand=1, it gave me error: Provided address "0x3141592653589793238462643383279502884197169399375105820974944592" is invalid, the capitalization checksum test failed, or its an indrect IBAN address which can't be converted.
I would say then: use ethjs-account for generation, and ethereumjs-tx for signing. If you need a provider to intercept and sign transactions use ethjs-provider-signer.
Just don't use ethjs-signer (as it doesn't have replay protection eip155).
Sent from my iPhone
On Dec 30, 2017, at 7:07 AM, Luke Schoen notifications@github.com wrote:
Oh bugger, I'm getting the same error. I was hoping to use this library to generate an account since the latest Web3.js 1.0.0-beta.27 hasn't finished adding unlockAccount() ethereum/web3.js#1264. I just tried using ethers.js but that didn't work for me either: https://github.com/ltfschoen/geth-node/compare/ethers-library?expand=1
— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.
@SilentCicero Thanks, you've created some awesome resources and I just quickly tried them out, but they don't appear to incorporate deployment of an actual smart contract to a network. I also encountered the error shown below:
I installed the dependencies:
npm install --save-dev ethjs-query
npm install --save-dev ethjs-account
npm install --save-dev ethereumjs-tx
npm install --save-dev ethjs-provider-signer
Then injected the dependencies into main.js and ran with node main.js
:
const EthjsAccount = require('ethjs-account');
const EthjsProviderSigner = require('ethjs-provider-signer');
const EthjsQuery = require('ethjs-query');
const ethjsAccount = EthjsAccount.generate('892h@fs8sk^2h8s8shfs.jk39hsoi@hohsko');
const ethjsAccountAddress = EthjsAccount.getAddress(ethjsAccount.privateKey);
console.log(`ethjsAccount: `, ethjsAccount);
console.log(`ethjsAccountAddress: `, ethjsAccountAddress);
const ethjsSignerProvider = new EthjsProviderSigner(GETH_IPC_PATH, {
signTransaction: (rawTx, cb) => cb(null, EthjsSigner.sign(rawTx, ethjsAccount.privateKey)),
accounts: (cb) => cb(null, [ethjsAccountAddress]),
});
const ethjsQueryProvider = new EthjsQuery(ethjsSignerProvider);
console.log(`ethjsSignerProvider: `, ethjsSignerProvider);
console.log(`ethjsQueryProvider: `, ethjsQueryProvider);
But the error was:
Error: [ethjs-account] invalid address value "0xc3ab8291f0c2029bb712159c2f4d768b55f59c978eab26dcf1e5fc5e7bd24294" not a valid hex string
at Object.getAddress (/Users/Ls/code/blockchain/geth-node/node_modules/ethjs-account/lib/index.js:53:11)
at Object.<anonymous> (/Users/Ls/code/blockchain/geth-node/scripts/main.js:21:42)
at Module._compile (module.js:624:30)
at Object.Module._extensions..js (module.js:635:10)
at Module.load (module.js:545:32)
at tryModuleLoad (module.js:508:12)
at Function.Module._load (module.js:500:3)
at Function.Module.runMain (module.js:665:10)
at startup (bootstrap_node.js:187:16)
at bootstrap_node.js:608:3
Here's a branch in my repo where I tried to incorporate it. I got that error, but the idea was to use that address and provide it to .send
after .deploy
, as shown https://github.com/ltfschoen/geth-node/compare/ethjs-libraries?expand=1
I've created individual files where I've experimented here: https://github.com/ltfschoen/geth-node/tree/master/scripts/experiments
That is another tool yet to be incorporated ;) checkout SilentCicero/ethdeploy to be ethjs-deploy.
Sent from my iPhone
On Dec 30, 2017, at 3:54 PM, Luke Schoen notifications@github.com wrote:
@SilentCicero Thanks, you've created some awesome resources and I just quickly tried them out, but they don't appear to incorporate deployment of an actual smart contract to a network. I also encountered the error shown below:
I installed the dependencies:
npm install --save-dev ethjs-query npm install --save-dev ethjs-account npm install --save-dev ethereumjs-tx npm install --save-dev ethjs-provider-signer Then injected the dependencies into main.js and ran with node main.js:
const EthjsAccount = require('ethjs-account'); const EthjsProviderSigner = require('ethjs-provider-signer'); const EthjsQuery = require('ethjs-query');
const ethjsAccount = EthjsAccount.generate('892h@fs8sk^2h8s8shfs.jk39hsoi@hohsko'); const ethjsAccountAddress = EthjsAccount.getAddress(ethjsAccount.privateKey); console.log(
ethjsAccount:
, ethjsAccount); console.log(ethjsAccountAddress:
, ethjsAccountAddress);const ethjsSignerProvider = new EthjsProviderSigner(GETH_IPC_PATH, { signTransaction: (rawTx, cb) => cb(null, EthjsSigner.sign(rawTx, ethjsAccount.privateKey)), accounts: (cb) => cb(null, [ethjsAccountAddress]), }); const ethjsQueryProvider = new EthjsQuery(ethjsSignerProvider); console.log(
ethjsSignerProvider:
, ethjsSignerProvider); console.log(ethjsQueryProvider:
, ethjsQueryProvider); But the error was:Error: [ethjs-account] invalid address value "0xc3ab8291f0c2029bb712159c2f4d768b55f59c978eab26dcf1e5fc5e7bd24294" not a valid hex string at Object.getAddress (/Users/Ls/code/blockchain/geth-node/node_modules/ethjs-account/lib/index.js:53:11) at Object.
(/Users/Ls/code/blockchain/geth-node/scripts/main.js:21:42) at Module._compile (module.js:624:30) at Object.Module._extensions..js (module.js:635:10) at Module.load (module.js:545:32) at tryModuleLoad (module.js:508:12) at Function.Module._load (module.js:500:3) at Function.Module.runMain (module.js:665:10) at startup (bootstrap_node.js:187:16) at bootstrap_node.js:608:3 — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
I was mistaken about Web3.js 1.0.0-beta.27. unlockAccount
does actually work. I didn't use Promises correctly in order to unlockAccount
before running deploy
to deploy the contract. Here's a commit where i got it to deploy https://github.com/ltfschoen/geth-node/commit/611723f044295b8cb05858d382c1b6377d1e1955
This is the log output, any help would be appreciated: