Run TomoChain node get error "etherbase must be explicitly specified" - blockchain

We sending this command
tomo --rpc --port 30304 --rpcport 8547 --rpccorsdomain "*" --rpcaddr "127.0.0.1" --rpcapi admin,db,eth,debug,net,shh,txpool,personal,web3
Load all like ethereum and then:
Fatal: Can't verify masternode permission: etherbase must be explicitly specified

You will have to create a tomo account, what its telling you now is that no account is available for it to start mining, try :
tomo account new

Related

How to Remote to a VM over an IAP tunnel with PyCharm

I have a google VM instance that has no external IP address assigned. I intend to establish SSH connection through PyCharm installed on my local machine (running macOS).
This can be done in terminal through gcloud IAP tunnel:
gcloud compute ssh <instance_name> --tunnel-through-iap
The entry added to ~./ssh/config for the instance is as following:
Host compute.<instance_id>
HostName compute.<instance_id>
IdentityFile /Users/<user_name>/.ssh/google_compute_engine
CheckHostIP no
HostKeyAlias compute.<instance_id>
IdentitiesOnly yes
StrictHostKeyChecking yes
UserKnownHostsFile /Users/<user_name>/.ssh/google_compute_known_hosts
ProxyCommand /Users/<user_name>/miniconda3/bin/python3 -S /Users/<user_name>/google-cloud-sdk/lib/gcloud.py beta compute start-iap-tunnel <instance_name> %p --listen-on-stdin --project=<project_name> --zone=us-central1-a --verbosity=warning
ProxyUseFdpass no
User <user_name>
With VS Code's Remote-SSH plugin, this setting can be used directly to establish SSH connection with no problem (example).
However, I have difficulty setting up the connection via PyCharm. The SSH Configurations tab takes:
- Host: compute.<instance_id>
- User name: compute.<instance_id>
- Port: 22
- Authentication type: key pair
- Private key file: path to ~/.ssh/google_compute_engine
and throws an exception for Host not being in the correct format.
If I try the internal IP address of the VM instance as host, the connection times out.
Is there a plugin similar to Remote-SSH in VS Code for PyCharm that can work properly with an IAP-tunnel? Or any other way this can be set up without exposing or assigning an External IP to the VM instance?
I know it's been a while, but I was just working on the same thing. I used the same config entry in ~./ssh/config, but PyCharm is doing some checks to make sure that top level Host value is valid (even though it isn't being used). I replaced that with something that would pass their validation checks, but I know I'd never actually use (to avoid potential conflicts).
For example, you can update to this:
Host mahmoud.local
HostName compute.<instance_id>
IdentityFile /Users/<user_name>/.ssh/google_compute_engine
CheckHostIP no
HostKeyAlias compute.<instance_id>
IdentitiesOnly yes
StrictHostKeyChecking yes
UserKnownHostsFile /Users/<user_name>/.ssh/google_compute_known_hosts
ProxyCommand /Users/<user_name>/miniconda3/bin/python3 -S /Users/<user_name>/google-cloud-sdk/lib/gcloud.py beta compute start-iap-tunnel <instance_name> %p --listen-on-stdin --project=<project_name> --zone=us-central1-a --verbosity=warning
ProxyUseFdpass no
User <user_name>
Then when you configure the SSH connection in PyCharm, you will want to use Host = mahmoud.local
Yes, also got it to work with the ~/.ssh/config host. At first I got a fingerprint error, but I turned off StrictHostkeyChecking and that solved it:
Host lukas-notebook-gpu
HostName compute.1234
IdentityFile /Users/lbatteau/.ssh/google_compute_engine
CheckHostIP no
HostKeyAlias compute.1234
IdentitiesOnly yes
StrictHostKeyChecking no
HashKnownHosts no
UserKnownHostsFile /Users/lbatteau/.ssh/google_compute_known_hosts
ProxyCommand /Users/lbatteau/.config/gcloud/virtenv/bin/python3 /Users/lbatteau/google-cloud-sdk/lib/gcloud.py compute start-iap-tunnel lukas-notebook-gpu %p --listen-on-stdin --project=myproject --zone=europe-west4-a --verbosity=warning
ProxyUseFdpass no

Ansible deployment to windows host behind bastion

I am currently successfully using Ansible to run tasks on hosts that are in a private subnet in AWS, which the below group_vars is setting up:
ansible_ssh_common_args: '-o ProxyCommand="ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -W %h:%p -q ec2-user#bastionhost#example.com"'
This is working fine.
For Windows instances not in a private subnet the following group_vars works:
---
ansible_user: "AnsibleUser"
ansible_password: "Password"
ansible_port: 5986
ansible_connection: winrm
ansible_winrm_server_cert_validation: ignore
Now, trying to get Ansible to deploy to a Windows server behind the bastion by just using the ProxyCommand won't work - which I understand.
I believe though that there is a new protocol/module I can use called psrp.
I imagine that my group_vars for my Windows hosts needs to change to something like this:
---
ansible_user: "AnsibleUser"
ansible_password: "Password"
ansible_port: 5986
ansible_connection: psrp
ansible_psrp_cert_validation: ignore
If I run with just the above changes against instances that are publicly available (and not trying to connect via a bastion), my task seems to work fine:
Using module file /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/ansible/modules/windows/win_shell.ps1
<10.100.11.14> ESTABLISH PSRP CONNECTION FOR USER: Administrator ON PORT 5986 TO 10.100.11.14
PSRP: EXEC (via pipeline wrapper)
I know there must be more changes before I can try this on a windows server behind a bastion, but ran it anyway to see what errors I get to give me clues on what to do next. Here is the result when running this on an instance behind a bastion server:
Using module file /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/ansible/modules/windows/setup.ps1
<10.100.11.14> ESTABLISH PSRP CONNECTION FOR USER: Administrator ON PORT 5986 TO 10.100.11.14
The full traceback is:
.
.
.
.
ConnectTimeout: HTTPSConnectionPool(host='10.100.11.14', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(<urllib3.connection.VerifiedHTTPSConnection object at 0x110bbfbd0>, 'Connection to 10.100.11.14 timed out. (connect timeout=30)'))
It seems like Ansible is ignoring my group_vars for the ProxyCommand - which I'm not sure if that's expected.
I'm also not sure on what the next steps are to enable Ansible to deploy to Windows servers behind a bastion.
What config am I missing?
The doc says, the ansible_ssh_common_args setting is appended to sftp, scp, and ssh commands. So it sounds normal to me that is not taking into account when using winrm or psrp ansible_connection.
As explained in the link provided by Pouyan in the comments, ansible_psrp_proxy variable will be used to provide proxy information.
ansible_connection: psrp
ansible_psrp_proxy=socks5h://localhost:1234
More info on the creation of the socks proxy can be found on: https://www.bloggingforlogging.com/2018/10/14/windows-host-through-ssh-bastion-on-ansible/

geth account new could not decrypt key with given passphrase

I want to synchronize with the network test network. I create a new user with the following command:
sudo geth --datadir/data/ethereum/test --keystore /data/ethereum/test/keystore account new
Next, I run:
sudo geth --testnet --syncmode "fast" --datadir /data/ethereum/test --keystore /data/ethereum/test/keystore --maxpeers 20 --cache=1024 --rpc --rpcapi "db,eth,net,web3,personal" --rpcport=8545 --rpcaddr "0.0.0.0" --rpccorsdomain "*" console
An error occurs:
WARN [12-06 | 11: 29: 30.933] Failed account unlock attempt address = 0x06C55Ac0d9C14348D5b63FC693e134889340ecBa err = "cannot decrypt key with given passphrase".
I enter the password 100% correct.
Ports are open
tcp: 80, 8080, 443, 30000 - 30999, 8545.
udp: 30000 - 30999.
I connect to the server using PuTTY. Server: ubuntu-bionic-18.04-amd64. If you delete all accounts and create anew, this error will still occur. If the network is synchronized and I create a new account, it is still an error.

x509: ECDSA verification failure

I have to install a bna file on fabric . I am following the link https://hyperledger.github.io/composer/tutorials/deploy-to-fabric-single-org.html . However when I run the command: composer runtime install -c PeerAdmin#fabric-network -n tutorial-network
I am getting the error :
Error: Error trying install composer runtime. Error: No valid
responses from any peers.
Response from attempted peer comms was an error:
Error: Failed to deserialize creator identity, err The supplied
identity is not valid, Verify() returned x509: certificate signed by
unknown authority (possibly because of "x509: ECDSA verification
failure" while trying to verify candidate authority certificate
"ca.org1.example.com").
Any help on this please
sounds like you have made an error in following the tutorial (which definitely works). Are you sure the MSP id (Org1MSP) for the peer has been setup correctly ? Have you checked that the peer has successfully joined the channel (when the Fabric was started)? Have you done a docker ps to see your Fabric docker containers are running?) Assuming you followed the steps correct and using an identity you have obtained from a fabric-ca server (per the tutorial), have you checked the fabric-ca server is running correctly (docker logs ? Also, is it possible you're restarted your Fabric docker environment at one point and now your old key information is invalid?
eg
{
"name": "fabric-network",
"type": "hlfv1",
"mspID": "Org1MSP",
"peers": [
{
"requestURL": "grpc://localhost:7051",
"eventURL": "grpc://localhost:7053"
}
],
"ca": {
"url": "http://localhost:7054",
"name": "ca.org1.example.com"
},
"orderers": [
{
"url" : "grpc://localhost:7050"
}
],
"channel": "composerchannel",
"timeout": 300
}
then re-create the card with the correct key/signcert info
composer card create -p connection.json -u PeerAdmin -c Admin#org1.example.com-cert.pem -k xxxxx_sk -r PeerAdmin -r ChannelAdmin
where the .pem file comes from signcerts directory and xxxxx is the generated value for the key filename in keystore.

How to set up a Private network and connect peers in geth?

I am trying to setup a private network and trying to connect peers. Currently I'm trying it on my laptop and desktop (both of them are connected to different internet).
I run the below command in first terminal(in both systems (data dir is different in both systems)):
geth --rpc --rpcaddr "0.0.0.0" --rpcport "8545" --rpccorsdomain "http://localhost:5000, http://localhost:6000" --port "2403" --ipcapi "admin,db,eth,debug,miner,net,shh,txpool,personal,web3" --rpcapi "db,eth,net,web3" --networkid 1001201 --datadir "E:\User\priv\data" init "E:\User\priv\genesis.json"
then I run:
geth --datadir "E:\User\priv\data"
Now, in the second terminal:
geth attach ipc:\\.\pipe\geth.ipc
I get the same enode value on both the systems when i run admin.nodeInfo.enode
then on 1st PC,
admin.addPeer("enode://e0c4960659b6ce4eda71c67b337055636f67660a711d157a81572b5eff1ed1b77931bef4bd079e2660baa661ac16d696b831e9394cb619378071a2593ecdf17a#[192.168.1.2]:30301");
on 2nd PC,
admin.addPeer("enode://e0c4960659b6ce4eda71c67b337055636f67660a711d157a81572b5eff1ed1b77931bef4bd079e2660baa661ac16d696b831e9394cb619378071a2593ecdf17a#[13.75.117.156]:30302");
both of them return true.
But admin.peerCount returns 0.
Can somebody please help me to setup a private geth network?
Step1
geth --identity "YourNodeName" --rpc --rpcport "8092" --datadir "DirectoryPathToStoreData" --port "30330" --nodiscover --rpcapi "db,eth,net,web3" --networkid 2010 init PathOfGenesisFile
The above command is to initialise a Genesis File.
Note: All Peers willing to connect to a network should have a same Genesis File.
Step2
geth --identity "YourNodeName" --rpc --rpcport "8092" --datadir "DirectoryPathToStoreData" --port "30330" --nodiscover --rpcapi "db,eth,net,web3" --networkid 2010 console
The above command opens a Geth JavaScript console.
Do the above 2 steps in other system also.
Step3
In the system where you want to add other system as peer type the following command admin.addPeer("Argument") where Argument is the enode value of other node which is obtained by typing admin.nodeInfo() in other system.
Eg:admin.nodeInfo
{
enode: "enode://965dc2b0f39e199d3a07871293015d8a4ad9349834fc27b7ee5e87bea89547e4fafda3ce7982ae07c14b8770c87a6c14e3fe2f91ef0d0ca717eb6ae56aa3e74b#[::]:30330?discport=0",
//////////
}
where 30330 is the network id of other system.
copy upto 30330.You need to give the ip address of other system in place of
[::]
It returns true if that node is capable of acting as a peer but not mean that it is added to our network, to know that type net.peerCount. It returns 1, if added.
You can follow the step3 for adding more peers.
You can create a private blockchain without creating a Genesis File.If you opt for that, follow this link.
As outlined here, your --port and --rpcport variables should be different. The resulting EnodeURLs should also be different.
Also, when you run geth the second time, I'd include everything you used in the first run before init.