Is the Geth instance running on Ropsten using the default rpc port, 8545? If you haven't specified it as a command line argument then it will be. If you are also using testrpc without specifying a port then testrpc will also be using 8545. Make sure to kill testrpc if this is the case. Two applications can't use the same port at once.
If you have specified the port that the Ropsten Geth instance is running on then it needs to be changed in the truffle.js config as specified here: http://truffleframework.com/docs/advanced/configuration
As a side note, consider using the Rinkeby testnet: https://www.rinkeby.io/ It's more reliable and has everything you need to use it in that one page.
I hope this helps.
[This might be] an error regarding HTTPProvider not connecting to the "https://ropsten.etherscan.io"
That's correct, you cannot use the etherscan.io API as a JSON-RPC server.
Instead, I'd recommend running an Ethereum node locally that is synced with Ropsten, similar to how (I presume) you ran the private testnet.
One way to do that would be:
parity --chain ropsten
You can then connect with:
from web3 import Web3, HTTPProvider
web3 = Web3(HTTPProvider("http://localhost:8545"))
assert web3.isConnected()
Naturally, you'll need to create an account before the balanceOf()
call will work. For the transfer()
function to work, you'll also need to send the account ropsten ether.
API Comparison
Let's look at how each API sends the latest block number.
Etherscan
To get the current block number with the etherscan.io API, you would use a GET call, specifying eth_blockNumber
as the action
parameter.
eth_blockNumber
Returns the number of most recent block
https://ropsten.etherscan.io/api?module=proxy&action=eth_blockNumber&apikey=YourApiKeyToken
like so:
curl "https://ropsten.etherscan.io/api?module=proxy&action=eth_blockNumber"
Ethereum JSON-RPC server
In contrast, JSON-RPC specifies the API as a POST call, with eth_blockNumber
sent as the method
parameter, like so:
// Request
curl -X POST --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":83}'
// Result
{
"id":83,
"jsonrpc": "2.0",
"result": "0x4b7" // 1207
}
Best Answer
There is (almost) no way to get the ABI if you only have the transaction hash and/or contract address.
I said almost because it is possible to reverse-engineer the contract. At least in theory. Reverse-engineering is always a difficult process and it might not work. There are some tools which attempt to do it for you but I don't really know how accurate they are.
Some more info on reverse-engineering: Is there a way to extract ABI from a deployed contract?
Just to clarify some confusion in an another answer's comments: verifying your code on Etherscan isn't really a Ethereum term. It's only functionality which was (possibly) invented by Etherscan team. It's a handy feature but it's not necessary in any way. You can publish your code in the blockchain without providing the source code to anyone.