A data union can scale to thousands or even millions of data-producing members.

Members are the people and/or devices that produce and share data.

After joining, they start receiving a share of the revenue that accumulates in the data union contract.

Member Stats

Get useful information about a specific member address:

const memberStats = await dataUnion.getMemberStats('0x1234');
// returns:
    earningsBeforeLastJoin: BigNumber {_hex: '0x00', _isBigNumber: true},
    status: "ACTIVE",
    totalEarnings: BigNumber {_hex: '0x00', _isBigNumber: true},
    withdrawableEarnings: BigNumber {_hex: '0x00', _isBigNumber: true}

Check if member is part of the data union:

await dataUnion.isMember();

Inactive And Active Members

The data union smart contract does not delete members when they leave or get removed from the data union. Instead they are set as inactive. This prevents them from earning more tokens. When they (re)join the data union they get set as active. That way members that got removed or left are still able to withdraw their earnings from the contract.

Member Joins

Members cannot join your data union without the help of a joinPart agent - The smart contract prevents that.

To automate member joins, read more here:

Join Server

Member Parts/Leaves

Every member is able to leave the data union at any time:

const tx = await dataUnion.part();

Last updated