I just pushed a version that has the DB MGW integrated into SuperNET API. Almost everything works, but you need to generate a DB first. Once you do, things are pretty fast, eg. 5 minutes first scan and then <1 minute and that is to find all pending deposits and withdraws.
Got stuck on getting multisig deposit addresses generated, in realtime!
Finally got that working and now any SuperNET node will be able to remotely access the designated MGW servers and generate a multisig deposit address, about 30 seconds to 1 minute the first time, after that, less than 1 second
I also made it so that just by changing the JSON, you can specify a different set of MGW servers, eg. coins, node addresses. So, any enterprising trio can setup MGW. You will need to fiddle with the SuperNET.conf and create the "magic" JSON like:
curl -k --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "SuperNET", "params": ["{\"requestType\":\"genmultisig\",\"destip\":\"209.126.70.159\",\"refcontact\":\"NXT-QJUP-SB6U-CQCT-852GL\",\"coin\":\"BTCD\",\"asset\":\"11060861818140490423\",\"contacts\":[\"10694781281555936856\",\"8894667849638377372\",\"13434315136155299987\"],\"M\":\"2\",\"N\":\"3\"}"] }' -H 'content-type: text/plain;'
https://127.0.0.1:7777/The above curl command directly contacts one of the MGW servers and generates a BTCD MGW deposit address for NXT-QJUP-SB6U-CQCT-852GL
Just by changing that part of the JSON, you can get the deposit address for another acct, but only if the servers are running.
Once generated, your node saves it to the blockchain and it is there for future use, but you can always generate it again.
The following command will scan (everything) and display what needs to be done:
curl -k --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "SuperNET", "params": ["{\"requestType\":\"MGWdeposits\",\"specialNXT\":\"7117166754336896747\",\"rescan\":\"1\",\"coin\":\"BTCD\",\"asset\":\"11060861818140490423\",\"NXT0\":\"423766016895692955\",\"NXT1\":\"12240549928875772593\",\"NXT2\":\"8279528579993996036\",\"exclude0\":\"7581814105672729429\",\"exclude1\":\"13434315136155299987\"}"] }' -H 'content-type: text/plain;'
https://127.0.0.1:7777/so, it will find pending deposits, pending withdraws and if you set "actionflag" to 1, it will do the deposit asset transfers it found, if action flag is -1, it will process the withdraws it found, though this part is not quite finished yet. I get all the way to generating the signed rawtxbytes, but since it is bigger than fits into UDP the servers cant easily compare. I am on the fence as to whether to just use the old MGW code for this or to come up with some new way to do it that also allows anybody to easily manage multisig payments using the SuperNET API. I am leaning toward the latter, though it will take a few days extra. I just hate having to put in old code into a new framework and if multisig was easy to use, I think a lot of creative solutions will be built with it.
Notice my genmultisig it totally generic and it abstracts out all the details of multisig, so even non-bitcoin multisig will fit right in and just by changing the "coin" field the same JSON will make mulsig address. The 3 signer limit for bitcoin network is also not inherent in the SuperNET multisig.
James