web3.eth.contract().at() TypeError in geth

griffgriff Posts: 1Member
I'm following the greeter tutorial at https://www.ethereum.org/greeter and I can't find a way to call web3.eth.contract().at() in geth 1.6 without a TypeError. I have successfully deployed the contract and can interact with it with Remix.

Any suggestions on the problems below are appreciated.

> var contractAddress = [0xFcE6Cb61a2D5d399a6B54897deE236aC70D12780]
> var contractAddressStr = "0xFcE6Cb61a2D5d399a6B54897deE236aC70D12780"

> var greeterAbi = '[{"constant":false,"inputs":[],"name":"kill","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"greet","outputs":[{"name":"","type":"string"}],"payable":false,"type":"function"},{"inputs":[{"name":"_greeting","type":"string"}],"payable":false,"type":"constructor"}]'

> greeterContract = eth.contract(greeterAbi)
{
abi: "[{\"constant\":false,
...

> var greeter = eth.contract(greeterAbi).at(contractAddress)
TypeError: 'filter' is not a function
at web3.js:2815:5
at web3.js:3024:5
at :1:15

> var greeter = eth.contract(greeterAbi).at(contractAddressStr)
TypeError: 'filter' is not a function
at web3.js:2815:5
at web3.js:3024:5
at :1:15

I noticed the signature for at() includes a callback function as the second parameter so I tried to add that:

> var cb = function(e, contract) { console.log("Contract engaged! Address: " + contract.address); }

> var greeter = eth.contract(greeterAbi).at(contractAddress, cb)
TypeError: 'filter' is not a function
at web3.js:2815:5
at web3.js:3024:5
at :1:15
Sign In or Register to comment.