Generates a static page (to be hosted on IPFS) for redirecting to a dapp URL registered in the eosio contract metadata.
The script iterates over given endpoints (passed in the URL as an IPFS address) and compares the results, so there is no need to trust a specific eos node.
- Bookmark which redirects to a static DAO chosen frontend (content can also be hosted in IPFS)
- Contract developers can declare the recommended ui for the contract
- Website discovery without DNS
-
Mainnet endpoints hash: QmTfUGaVqXYgvzrAJpseZcNVyqKTitd7NkNF9XG19aAza2
-
Kylin endpoints hash: QmZEMyJANVnjSDB6ujQLMbNQ56U65SG8nzx78wQ2SnouS1
-
Main page hash: Qma9Wvk8gnqmhDkNGNQiQNib2QH12LkdCeo9nJAtS59J52
yarn install
TBD
TBD
npm run initipfs
npm run deploy
open browser at http://localhost:9090/ipfs/QmUuduj7gQozD57sjo1JmwbQifqpGxtGbQgRFSH1T41YoV#?endpoints=QmYzeayjNXdPxosFEYFDphMGwEzBX7s3vzK6sVaaECVxUB&name=yourapp
npx --no-install jsipfs add .\endpoints-kylin.list
npx --no-install jsipfs add .\endpoints-mainnet.list
Add the following code to your contract's class body:
TABLE meta {
name key;
std::string value;
uint64_t primary_key() const { return key.value; }
};
typedef eosio::multi_index<"meta"_n, meta> _t_meta;
[[eosio::action]]
void setmeta(
name key,
std::string value
){
require_auth(_self);
_t_meta items( _self, _self.value );
auto existing = items.find( key.value );
if(existing == items.end()) {
items.emplace(_self, [&]( auto& a ){
a.key = key;
a.value = value;
});
} else {
items.modify( *existing, eosio::same_payer, [&]( auto& a ) {
a.value = value;
});
}
}
cleos push action yourcontract setmeta "[\"frontend.url\", \"https://mywebsite.com\"]" -p yourcontract@active
-
Frontend URL "frontend.url"
-
Frontend code git "frontend.git"
-
Contract code git "contract.git"