Send Asset command gives Insufficient funds and transfer assets to itself

+1 vote
Hi Multichain,

I have two nodes one is the Admin Node and other is the child node which is running on the seed node.

I want to transfer some quantity of asset from Admin node to the seed node for which i am using the command :

sendWithMetadata({ address: nodeAddress, amount: amount, data: util.generateHex(metaData) })

Now there are two issues :

1. The admin node say A1 has imported the address of child node A2 , so when I am triggering the command

getaddresses on A1 node I am getting the address of both the two nodes i.e. A1 and A2.

and when send asset command is triggered here : transfer is happening only on the A1 node's end. that is in a way it is transferring assets to the Node A2 address which is imported on A1 wallet only.

So I am not able to see the received asset on A2 node . But since A1 has the imported address of the A2 node so I am able to see the updated balance on A1 node only where it has both the addresses of node A1 and A2 . So here we can say that Node A1 is transferring the assets to itself only.

2. After the send asset was triggered from Node 1 , the above scenario happened, but now when i am transferring the assets from A1 to A2 it is saying "Insufficient Funds".

Can you please suggest on the above mentioned two issues ? Please note that the setup is completely done on Windows.

Thanks in Advance !!
asked Mar 26, 2018 by ss_developer
reshown Mar 28, 2018 by MultiChain

1 Answer

+1 vote

First you should please note that you are not literally transferring assets between nodes – you are updating the blockchain which represents the addresses that own those assets, and each node has the private key(s) for controlling certain addresses.

So the question of whether you can or cannot see the balance on A2 does not literally relate to whether the assets were transferred to A2. The transfer has taken place on the blockchain, it's just that A2 doesn't know about it.

In any event the most likely explanation is that the nodes are not connected to each other and synchronizing blocks. Check the blocks field of getinfo on each node to verify if they are in sync. If not, check the clock times on both servers are close together and/or try using addnode to add one node's address to the other.

answered Mar 26, 2018 by MultiChain
Yes Actually the nodes are not connected to each other because when I am triggering the getpeerinfo command for the Admin node , it is returning me an empty array.

Now As you said I tried to check the blocks field of both the nodes :
For admin node , the blocks is 82 and
For child node , the block is 59.

How to check the clock times on both the servers :: I dont know how to do this !

And I tried adding the child nodes address to this Admin node :

Commands and output are as follow :

multichain-cli adminNode addnode "IP_address_of_child_node:Port_of_child_node" "add"

So after sometime when I tried this command it gave me this output :

Command :
multichain-cli adminNode getaddednodeinfo true

Output :

        "addednode" : "IP_address_of_child_node:port_number_of_child_node",
        "connected" : true,
        "addresses" : [
                "address" : "IP_address_of_child_node:port_number_of_child_node",
                "connected" : "outbound"
        ] }]

But after this again I tried to check :

getpeerinfo on my admin node , it is showing empty list []

And In this way Nodes are not getting connected to each other.
And as you said : The transfer has taken place on the blockchain, it's just that child node doesn't know about it.

can you suggest on the mentioned issue ?
Can you please suggest on this issue?
Check your firewall connections to ensure the nodes can connect to each other, then use the addnode API if necessary to re-establish the connection.
How can we check the firewall connection so that both the nodes are connected to each other . Add node API I used and child node's address got added to this Admin node's wallet but when I am triggering the getpeerinfo() on admin Node then an empty array is returned .
As you said that Firewall connection must be ensured . Can you please help how can we check the firewall connection ? As in what approach should I follow.

Appreciate your help !
This will depend on your operating system and I'm afraid is beyond our scope here. If you're on Linux, try reading about the iptables tool.