Decentralized multiplayer streaming platform. channel subscribers will own NFT to make channel decisions
DeciStream is a multiParticipates Streaming platform inspired by "Twitter Spaces" or "Joe Rogan Experience" streams. where streamers can participate in making content for the stream such as discussing an interesting topic.
DeciStream focuses on decentralized values. For example, each channel is an erc721 when a subscriber will be minted an erc721 token to be able to participate in that channel's DAO activities such as voting for the next stream participant. Besides the video is also the erc721 that owned by the content creator.
I use /room and /stream feature to be able to create multi-participant streams
I use 4 tables namely Channels, Steams, Videos, Subscriptions.
To ensure the correctness of the data in the database i added functions to ERC721 so that whenever nft is minted or transferred, it updates their value in the table.
File: Master.sol
...
function insertSubcription(address erc721contract, address subscriberAddress ,uint256 newTokenId) external onlySubcriptions {
TablelandDeployments.get().mutate(
address(this),
_tables["Subscriptions"],
SQLHelpers.toInsert(
"Subscriptions",
_tables["Subscriptions"],
"subscription_erc721_address,subscriber_address,tokenId",
string.concat(
SQLHelpers.quote(Strings.toHexString(erc721contract)),
",",
SQLHelpers.quote(Strings.toHexString(subscriberAddress)),
",",
Strings.toString(newTokenId)
)
)
);
}
function updateSubcription(address erc721contract, address to, uint256 tokenId) external onlySubcriptions {
string memory setters = string.concat(
"subscriber_address=",
SQLHelpers.quote(Strings.toHexString(to)) // Wrap strings in single quotes
);
string memory filters = string.concat(
"subscription_erc721_address=",
SQLHelpers.quote(Strings.toHexString(erc721contract)),
"and tokenId=",
Strings.toString(tokenId)
);
TablelandDeployments.get().mutate(
address(this),
_tables["Subscriptions"],
SQLHelpers.toUpdate(
"Subscriptions",
_tables["Subscriptions"],
setters,
filters
)
);
}
...
File: Subcriptions.sol
...
function mint() external {
uint256 newTokenId = _tokenId.current();
_mint(msg.sender, newTokenId);
_tokenId.increment();
Master(_masterAddress).insertSubcription(address(this), msg.sender, newTokenId);
....
}
function _transfer(address from, address to, uint256 tokenId) internal override virtual {
super._transfer(from, to, tokenId);
Master(_masterAddress).updateSubcription(address(this), to, tokenId);
}
...
I am using notification feature from push protocol
Currently I'm using 2 notification templates
To make accounts more readable i use ens. If an account already owns ENS, it will display Ens avatar and Ens name instead of wallet address
I use storage video and metadata of Nft