Go-Ethereum | How to connect to public Ropsten(testnet) running on local - rpc

Basically I want to connect to the public Ropsten testnet. I run geth on local with several options. (--testnet, --rpc, --rpcapi, console).
I thought I can get my (ropsten) account and check how much 'ether' or 'erc20 tokens' that I have on ropsten testnet.
However, it didn't recognize the ether that my account had.
For example, I successfully sent some 'ether' and 'custom erc20 tokens' to my account using "ethereum wallet". I could see the correct amounts on metamask when I connected to 'Ropsten Test Network' to click the dropdown bar at top of the metamask window.
However, If I changed it to the 'Localhost 8545' which is 4th of dropdown bar and connect to the 'localhost:8545', the ether and tokens changed to 0 amount.
Not the same amount which is weird. In conclusion, I think that the geth running on my local is not connected to public ropsten testnet network. Because it means I have different private key with same public address. The same public address on ropsten testnet has to have equal private key, I think.
Does anyone have same experience like this or can I get any idea how to (geth)command to connect to the public testnet network.
oh, and I have another issue!
I run the go-ethereum on local like below.
$ geth --testnet --rpc --rpcapi "db, net, web3, personal" --rpccorsdomain "*" --rpcaddir 127.0.0.1 --rpcport 8545 console
but I can't connect to localhost:8545 on metamask anymore.
netstat -na | grep -i LISTEN
netstat -na | grep -i LISTEN | grep 8545
I can't find the 8545 opened port.
Why the rpc port is not open sometimes?

First of all I would like to tell you that you don't need to specify "rpcport" parameter incase you want to start node on 8545, By default it starts on port 8454.
Now for the question regarding the balancing which is not visible when you connect to localhost:8545 on metamask. I would like to ask for how long you have been running ropsten using local geth. I have doubt whether it is fully synced or not.
Try running these commands in the new terminal-
geth attach
eth.syncing
it will provide you with the following info-:
1. Current block number
2. Total block height
If total block height is greater the the current block number, than it means your node is not fully synced and is still syncing.

Related

How to identify the internet status of the computer using Blue Prism

So that we can identify the status and proceed accordingly. Otherwise we have to face unwanted errors
SHORT ANSWER
By using the provided Utility - Network object's Ping action to run three ping tests for analysis.
CORRECT ANSWER
By using the provided Utility - Network object's Ping action to run three ping tests for analysis BUT this wholly depends on the network setup of your resource PC.
As well if you have any kind of Firewall configured to block ICMP packets a result will be that you can not send ICMP echo request packets to external networks.
However, let's say you know your network architecture enough to be certain the resource PC can directly send and receive packets. If that were the case then Solution 1 will work.
IF your resource is well and rightly insulated within your organizations network BUT are confident that your network exit points are always connected to the internet AND know your domain network name or IP Solution 2 will work.
Solution 1
ping google.comTo test that DNS is working on the resource
ping 8.8.8.8 To test that resource's TCP/IP settings are correct
ping 127.0.0.1 Loopback test to make sure there's nothing wrong with the resource's network adapter or connection settings
Depending on your requirements you can also directly ping the endpoint addresses your bot needs to communicate with. This would be especially useful if the bot is not using a browser-based application, but rather sending emails.
Solution 2
ping {yourdomainnetwork}.comTo test that DNS is working on the resource
ping {yourdomainnetwork IP} To test that resource's TCP/IP settings are correct
ping 127.0.0.1 Loopback test to make sure there's nothing wrong with the resource's network adapter or connection settings

Detecting that I am connected to a vpn/wifi and if not I automatically reconnect

so I made a script that logs into my schools vpn automatically by entering my username and password for me in my raspberry pi. Now I am trying to see if there is a way I can have a script running in the background that detects that I am connected to my vpn and also to my local wifi. If it detects there is no connection, then it will run my script of logging into the vpn automatically.
Below is the script I use to login to my vpn automatically my login.sh file:
#!/usr/bin/expect
spawn sudo openconnect vpn.ucr.edu/engineering
expect -r "\[sudo] .*\: " {
send "pw_for_my_linux\n"
}
expect "Username:" {
send "my_vpn_username\n"
}
expect "Password:" {
send "vpn_password\n"
}
interact
Perhaps you can use ethtool and check the connection status by looking at network interfaces.
ifconfig
(view network interface names, select network interface known to be associated with working vpn)
sudo ethtool eth0
Where 'eth0' is replaced by the name of the network interface that your vpn software is using
OUTPUT should look something like this if it's communicating (replace example net interface name eth0 with relevant one you can see in ifconfig):
Current message level: 0x00000007 (7)
drv probe link Link detected: yes
OUTPUT if down?:
Settings for eth0:
Link detected: no
In your bash code you can poll the 'link detected' status, parse out the answer to determine if you try reconnecting. Warning, haven't been able to test this on a vpn connection -- I have to use a special client other than openconnect, and for me I know the VPN is down if I run
ifconfig | grep "tun0"
If that returns something, VPN is up. If my network interface called tun0 is missing, VPN is not up.
Hope this gets you moving in the right direction!

Bridge Wifi to Raspberry Pi using Ethernet Cable

I am not finding this question in SF history, which was a surprise, so I'll go ahead and ask it.
I am working on an IoT Raspberry Pi project with Windows 10 and need to connect it to the internet via an Ethernet/USB adapter. The adapter itself is made by Belkin. Using this, I can see an ip of 169.stuff get generated for my Pi, which is a private ip. I can deploy code to that from my connected box, however other devices are not able to reach it, and it is not able to make connections out to any servers.
I'm wondering if anybody knows how to bridge the connection.
I am attempting to use the new Azure IoT Hub and the SDK with this in case that makes any differences as that is not a simple rest interface and I believe is some form of socket connection.
Additional Notes:
I have installed a DCHP Server and the Pi gets the ip address: 192.168.0.3 assigned to it. Unfortunately the Pi still can not ping external sites, such as google.com
Latest Discoveries:
I am on a corporate box, which has internet sharing disabled by the system admin. Following these instructions: http://zizhujy.com/blog/post/2013/07/07/Solved-Internet-Connection-Sharing-has-been-disabled-by-the-Network-Administrator.aspx Fails. It shuts down all connectivity to my box and I cannot ping anything or reach the internet or anything.
Thanks,
~David
The 169 address means it isn’t getting a DHCP address assigned.
Since you don't have a router for the Ethernet, you can use Internet Connection Sharing, however we will need to run the following commands against the Pi to set a static IP, gateway, and dns server, since internet connection sharing botches this up a bit at times:
Set-Item WSMan:\localhost\Client\TrustedHosts -Value 192.168.137.2
Enter-PSSession -ComputerName 192.168.137.2 -Credential 192.168.137.2\Administrator
set-executionpolicy unrestricted
netsh int ip set address "Ethernet" static 192.168.137.2 255.255.255.0 192.168.137.1
netsh int ip set dns "Ethernet" static 8.8.8.8
netsh interface ipv4 show config
set-executionpolicy remotesigned
You may need to reboot the Pi at this point then test pinging 8.8.8.8 and google.com to make sure resolution is working. You should be all set!
One other thing, if you have a group policy on the machine that is restricting Internet Connection Sharing then take a look at this article to fix the issue. Note if your organization is constantly sending down the policy then you may have to re-enable Internet Connection Sharing often which is aggravating but at least it will work.
http://zizhujy.com/blog/post/2013/07/07/Solved-Internet-Connection-Sharing-has-been-disabled-by-the-Network-Administrator.aspx
I do this by creating a DHCP server on my laptop and connecting the Pi directly to it. I followed these instructions to get it working:
Download DHCP Server for Windows. It is a 100kB download.
Go to the IPv4 properties page of the Ethernet adapter and set a fixed IP address, say 192.168.2.1
Run the DHCP Server Wizard (downloaded above)
Select the Ethernet adapter from the list shown
Save the configuration file and start up the DHCP Server
Click the 'Continue as tray app' button in the server control panel.
Boot up the Raspberry Pi
A popup notification shows the IP address assigned by the DHCP server to the Raspberry Pi.
Use a SSH client, like PuTTy, to connect to the IP address shown
Hope this works!

increase ssh timeout

I'm trying to connect to a mobile host connected over a 3G cell router from linux with
ssh root#74.198.25.XXX -p 2200
and all I immediately get is (doesn't even seem to run into a timeout)
ssh: connect to host 74.198.25.220 port 2200: Network is unreachable
However, when I try the same IP on port 2200 with putty on Windows, it presents my with the password prompt just fine as I'd expect.
What's going on here, do I need to increment my ssh timeout period to get this going or what?
Thank you,
Ron
Network unreachable implies the following:
The host is not on your local network
The network the host is on is not reachable from your local network
The reason for this could be many, but things to check would be:
Ensure that the device you're connecting from has a proper network connection
Ensure that the device you're connecting from has a proper gateway setup
Ensure that the device you're connecting from has a route leading to the target (Normally sorted by the abvoe)
Ensure that there's nothing between you and the target device firewalling port 2200

xampp server (How to get up and running)

I've been developing locally on a little ubuntu netbook with xampp for about 7 months. Two weeks ago I got a computer I'd like to use as a server. I've installed the latest Ubuntu distribution and xampp, moved all my files over, and forwarded port 80. I've also got a domain name from dyndns.com which is being updated by a client which runs in my router (a Netgear WGR6154 v8).
Now, when I try to access my server by typing in the address I got from dyndns.com the browser loads until it timesout. I can access everything locally using localhost as the address so I believe xampp is running, just unable to connect with the internet.
In order to be able to view my files over the internet what should I do next?
Thanks to all in advance...
[I'm starting a bounty for the first person to help me get my files successfully online]
You have a combination of issues here, and that is something of a problem. Each issue is complex in an of itself. Here is what I would recommend to get you going for certain.
First verify that you can surf the web from your server. This will confirm that you have a working ethernet interface.
Step 1 make sure that XAMPP, and your files are viewable from your home network. I assume you are using something like 192.168.1.X for your network and perhaps your server is 192.168.1.10
Go to another computer in your house and type http://192.168.1.10/ and see if you can see your files. If you can then you know that the server is properly configured and XAMPP is working.
Then add an entry to your hosts file to resolve yourdnsrecord.com (or whatever your dyndns record is) to your private ip address. Then when you type yourdnsrecord.com into a browser from that computer you should still get your files. This will rule out your server being improperly configured to listen for that domain name.
Next you need to test to see if there is a firewall problem. To simplify this, first remove your home router from the equation. Instead, place your new server directly onto your internet connection. (assuming you can). This way, you do not need to have NAT or firewalls properly configured. Your dyndns name should map to a public IP and your server should then have that IP and be connected directly to the Internet. If you have your server directly connected, and the command ifconfig from the root prompt returns the same public IP address that your dynamic dns record is point to, then it should work.
It will make your life easier if you have an iphone or some other way to test how your network is seen from the Internet.
If your public IP as shown by ifconfig is different than the IP record in your dyndns account, then your dynamic dns update script is broken. manually set the IP, and see if things work.
It is very possible that this will not work. Some ISPs firewall port 80 preventing their subscribers from hosting servers. Once you have your server directly connected to the internet you can test this (even if your dns is not working) by using the public IP address. As root, type ifconfig from the command prompt to get your public ip address. Then type the command tcpdump -i eth? port 80 from the root prompt. eth? needs to be the same interface that you saw had a public IP address from the ifconfig command. usually this is eth0 but it might be wire0 or something like that.
This command will show you all traffic coming on port 80 to your server.
From an iphone (or whatever second Internet connection you have) browse to the IP address that you got from your ifconfig command. If you see something on your server (and it is directly connected to your ISP) then your ISP is not firewalling you.
If you can get to your server, when it is directly connected to the Internet, either by IP address or by DynDNS address, then your ISP is OK and it is time to debug your firewall.
Two things need to work for your firewall to be configured NAT, where the public address that your router gets from your ISP is converted into your private network and a firewall rule which permits that traffic. If you get this far, then you know your firewall is the problem and then it is just a matter of getting its configuration correct. There are far to many home routers to document here, but you usually can find how-to instructions for your router for this task from the manufacturers website (usually it is part of the manual)
If you follow these instructions exactly you will get your system working. Make comments on the process and I will be happy to modify this to make it clearer.
HTH,
-FT
You should make sure your xampp is not listening to only the localhost.
to do so edit your apache configuration file and check and search for Listen directive
you should be able to know also by analysing the output of netstat -a.
After that make sure your router is forwarding properly, using tcpdump would help.
drop me a comment if you need more help.
Cheers

Resources