Need some advice on how to setup and run API on Linux multi-chain nodes.

+1 vote
Hello:

I am rather new to this software. I made some progress, I can setup dual nodes in Linux and issue some tokens.

Now, I want go one step further, the details:

On node1, create chain1, and create token called DollarETH1 for 200 units; on node2, create chain2, and create token called DollarETH2 for 200 units.

Then I will send 100 DollarETH1 from node1 to node2 in node2’s address, then I will send 100 DollarETH2 from node2 to node1. Thus simulate multi-chain wallet to send and receive tokens, like: send USDT to and from ERC20/BEP20 networks.

I think I can do this by hand.

But I would like you provide some ideas on how to do this by API, like JavaScript or Python on Linux.

I want to know how to select different network via API.

 

However, after some time, if I am familiar those steps by API, then I want to go live, but then I can only use Windows 10.

I want to know how can I put the multi-chain wallet address under control of multi-chain in Windows 10.

Let’s say if I can create 2 addresses by third party software, I get their private keys. For one address, I want to be able to send and receive tokens via ERC20 and BEP20 network, as their address format is almost the same; I want to have another address can receive and send tokens via HECO network.

Please advice if it is possible via mutlichain, if possible, please give a general idea on how to proceed.

Thanks,
asked Nov 28, 2022 by zydjohn

1 Answer

0 votes

So if I understand correctly, you want to import an externally generated private key into a MultiChain wallet. For this the appropriate API is importprivkey.

However you should note that MultiChain accepts a private key in a particular format, and it is quite technical to build the key string correctly. Everything is documented here:

https://www.multichain.com/developers/address-key-format/

It might be easier to use a MultiChain blockchain with bitcoin-compatible keys and addresses (see instructions at the top of the same page), and then you will find plenty of information and source code online about how to create bitcoin private keys.

answered Nov 29, 2022 by MultiChain
Thank you very much for your detailed reply.
Now, I have one question regarding the private key format.
I read the private key format document, I see that multichain can generate at least 2 types of private keys.
One is native multichain private key, another is BITCOIN private key.
Now, I can export private keys and addresses from some online multi-chain wallet, for example: Huobiwallet.
My question is: given some specific private keys exported from Huobiwallet,
how can I easily decide if those private keys can be used under multichain API?
For example, if I can use multichain API to generate the same addresses as exported from Huobiwallet, then the exported keys can be used by multichain API?
Please advise,
Thanks,
I'm afraid I don't know what type of keys are used by Huobiwallet. If Huobiwallet uses bitcoin-compatible private keys, then you can use them with MultiChain, but if only if you configured your blockchain for bitcoin-compatible addressing before the chain was started.
Hello:
Thank you very much for your reply.
Please provide some documents on how to configure blockchain for bitcoin-compatible address, so I can take some practice before I start the chain.
Appreciated!
It's explained on the page I already mentioned:

https://www.multichain.com/developers/address-key-format/
...