From this, i found that
To add a token to watch, go to the contracts page and then click "Watch Token". A pop-up will appear and you only need to paste the contract address. The token name, symbol and decimal number should be automatically filled.
How can i perform same thing in case of testnet. I mean how will a testnet user will see the tokens he possess.I am using GETH client and web3 to interact with node and pass related data to UI .
Asked
Active
Viewed 1,168 times
2
Aniket
- 3,545
- 2
- 20
- 42
1 Answers
1
From your question, you don't want to use the Ethereum Wallet to add the Watch Token function. Instead you want to use geth JavaScript to find the token balance.
If this is the case, you can use the same type of script as in Script To Get Account Balances And Including TheDAO Tokens.
Your code would look like the following:
var tokenContractABI = {your token contract ABI};
var tokenContractAddress = "{your token contract address}";
var tokenContract = eth.contract(tokenContractABI).at(tokenContractAddress);
var tokens = tokenContract.balanceOf({user address});
console.log(tokens);
BokkyPooBah
- 40,274
- 14
- 123
- 193
gethon a private network and connect the Ethereum Wallet togethand EW will be your UI. See the answer to http://ethereum.stackexchange.com/questions/5716/ethereum-wallet-with-private-testnet-not-working-chaindata-lockpermission-deni . – BokkyPooBah Aug 23 '16 at 08:24geth. You should be starting the firstgethinstance with the appropriate parameters, then run Ethereum Wallet. If yourgethparameters are correct, Ethereum Wallet will connect to thegethinstance you started. If not, Ethereum Wallet will try to start up a secondgethinstance. – BokkyPooBah Aug 25 '16 at 14:39