Post
Topic
Board Announcements (Altcoins)
Re: $XAI Sapience AIFX - Decentralized AI | 11% PoS | PlumeDB,IBTP on Testnet
by
CedricQuotient
on 26/05/2015, 04:16:01 UTC
I pushed an update to github and tagged the last public version and the latest commit (6.1.14 and 6.2.21).  I'm still beating my head against the wall trying to get the Windows build to work, I had a workaround that I thought would work but it just results in strange undefined reference issues - which was to embed libqtlua within the source tree and build it that way.  But libqtlua is using headers with inline declarations and my suspicion is that mingw can't handle the mixing and matching like that.  I thought I had it working but when I did a make clean and tried to build from scratch it started spewing those issues again.  To build it on Linux you need Lua 5.3 and libqtlua 2.0, on my system I put them in ~/deps/lua and ~/deps/libqtlua, if you put them somewhere else you'll want to update the paths in the .pro file.  Works like a charm on Linux.

So what you'll see is that for IBTP the simple way I am doing the integration across coin networks is by filtering on the pchMessageStart.  I pre-load a directory of known chains:

Code:
struct SChain
{
public:
    std::string sChainName;
    std::string sCurrencyCode;
    unsigned char pchMessageOne;
    unsigned char pchMessageTwo;
    unsigned char pchMessageThree;
    unsigned char pchMessageFour;

    SChain()
    {
    }

    SChain(std::string sName, std::string sCode, unsigned char cOne, unsigned char cTwo, unsigned char cThree, unsigned char cFour)
    {
        sChainName = sName;
        sCurrencyCode = sCode;
        pchMessageOne = cOne;
        pchMessageTwo = cTwo;
        pchMessageThree = cThree;
        pchMessageFour = cFour;
    }
};

And then in ProcessMessage all of the various message handling gets a check on a flag set on the node object:

Code:
// Relay alerts
if(!pfrom->fForeignNode)
{

When the node first connects and does the version handshake, it detects if it is not an XAI note and in the IBTP directory and sets the fForeignNode flag.  And thats it, from then on you can differentiate between native or non-native blockchains and handle the messaging appropriately.