You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 13, 2024. It is now read-only.
I am writing a demo on my TestRPC nodes, with code below:
self.web3 =Web3.newWeb3(URL(string:"http://localhost:8545")!)!
// ABI
guardlet path =Bundle.main.path(forResource:"abi", ofType:"json"),let abiString =try?String(contentsOf:URL(fileURLWithPath: path))else{fatalError("Can not get abi data")}
// Contract
self.contract =self.web3.contract(abiString, at:EthereumAddress(self.contractAddress))!
// Account
guardlet defaultAccount =self.web3.eth.getAccounts()?[0]else{fatalError("No default account")}self.defaultAccount = defaultAccount
But getting this error in Xcode console:
["id": 1517586668, "error": {
code = "-32000";
message = "Error: Method eth_getAccounts not supported.\n at GethApiDouble.handleRequest (/Users/me/.nvm/versions/node/v8.1.4/lib/node_modules/ethereumjs-testrpc/build/cli.node.js:89858:16)\n at next (/Users/me/.nvm/versions/node/v8.1.4/lib/node_modules/ethereumjs-testrpc/build/cli.node.js:59378:18)\n at GethDefaults.handleRequest (/Users/me/.nvm/versions/node/v8.1.4/lib/node_modules/ethereumjs-testrpc/build/cli.node.js:89767:12)\n at next (/Users/me/.nvm/versions/node/v8.1.4/lib/node_modules/ethereumjs-testrpc/build/cli.node.js:59378:18)\n at FilterSubprovider.handleRequest (/Users/me/.nvm/versions/node/v8.1.4/lib/node_modules/ethereumjs-testrpc/build/cli.node.js:65832:7)\n at next (/Users/me/.nvm/versions/node/v8.1.4/lib/node_modules/ethereumjs-testrpc/build/cli.node.js:59378:18)\n at DelayedBlockFilter.handleRequest (/Users/me/.nvm/versions/node/v8.1.4/lib/node_modules/ethereumjs-testrpc/build/cli.node.js:89595:3)\n at next (/Users/me/.nvm/versions/node/v8.1.4/lib/node_modules/ethereumjs-testrpc/build/cli.node.js:59378:18)\n at ReactiveBlockTracker.handleRequest (/Users/me/.nvm/versions/node/v8.1.4/lib/node_modules/ethereumjs-testrpc/build/cli.node.js:89722:12)\n at next (/Users/me/.nvm/versions/node/v8.1.4/lib/node_modules/ethereumjs-testrpc/build/cli.node.js:59378:18)";
}, "jsonrpc": 2.0]
The text was updated successfully, but these errors were encountered:
Main focus of the library was to have keys and signatures done on device, so this method was not tested for remote node. However it's looks like just a typo in method name, this should be "eth_getAccounts" -> "eth_accounts", I'll fix it when get to the main dev machine.
I am writing a demo on my TestRPC nodes, with code below:
But getting this error in Xcode console:
The text was updated successfully, but these errors were encountered: