VOTING POWER100.00%
DOWNVOTE POWER100.00%
RESOURCE CREDITS100.00%
REPUTATION PROGRESS0.00%
Net Worth
0.000USD
STEEM
0.001STEEM
SBD
0.000SBD
Effective Power
1.201SP
├── Own SP
0.000SP
└── Incoming DelegationsDeleg
+1.201SP
Detailed Balance
| STEEM | ||
| balance | 0.001STEEM | STEEM |
| market_balance | 0.000STEEM | STEEM |
| savings_balance | 0.000STEEM | STEEM |
| reward_steem_balance | 0.000STEEM | STEEM |
| STEEM POWER | ||
| Own SP | 0.000SP | SP |
| Delegated Out | 0.000SP | SP |
| Delegation In | 1.201SP | SP |
| Effective Power | 1.201SP | SP |
| Reward SP (pending) | 0.000SP | SP |
| SBD | ||
| sbd_balance | 0.000SBD | SBD |
| sbd_conversions | 0.000SBD | SBD |
| sbd_market_balance | 0.000SBD | SBD |
| savings_sbd_balance | 0.000SBD | SBD |
| reward_sbd_balance | 0.000SBD | SBD |
{
"balance": "0.001 STEEM",
"savings_balance": "0.000 STEEM",
"reward_steem_balance": "0.000 STEEM",
"vesting_shares": "0.000000 VESTS",
"delegated_vesting_shares": "0.000000 VESTS",
"received_vesting_shares": "1953.311140 VESTS",
"sbd_balance": "0.000 SBD",
"savings_sbd_balance": "0.000 SBD",
"reward_sbd_balance": "0.000 SBD",
"conversions": []
}Account Info
| name | coogy |
| id | 1222439 |
| rank | 1,563,402 |
| reputation | 12203115 |
| created | 2019-02-18T22:28:30 |
| recovery_account | steem |
| proxy | None |
| post_count | 1 |
| comment_count | 0 |
| lifetime_vote_count | 0 |
| witnesses_voted_for | 0 |
| last_post | 2019-02-18T22:54:18 |
| last_root_post | 2019-02-18T22:54:18 |
| last_vote_time | 2019-02-18T22:54:42 |
| proxied_vsf_votes | 0, 0, 0, 0 |
| can_vote | 1 |
| voting_power | 0 |
| delayed_votes | 0 |
| balance | 0.001 STEEM |
| savings_balance | 0.000 STEEM |
| sbd_balance | 0.000 SBD |
| savings_sbd_balance | 0.000 SBD |
| vesting_shares | 0.000000 VESTS |
| delegated_vesting_shares | 0.000000 VESTS |
| received_vesting_shares | 1953.311140 VESTS |
| reward_vesting_balance | 0.000000 VESTS |
| vesting_balance | 0.000 STEEM |
| vesting_withdraw_rate | 0.000000 VESTS |
| next_vesting_withdrawal | 1969-12-31T23:59:59 |
| withdrawn | 0 |
| to_withdraw | 0 |
| withdraw_routes | 0 |
| savings_withdraw_requests | 0 |
| last_account_recovery | 1970-01-01T00:00:00 |
| reset_account | null |
| last_owner_update | 1970-01-01T00:00:00 |
| last_account_update | 1970-01-01T00:00:00 |
| mined | No |
| sbd_seconds | 0 |
| sbd_last_interest_payment | 1970-01-01T00:00:00 |
| savings_sbd_last_interest_payment | 1970-01-01T00:00:00 |
{
"active": {
"account_auths": [],
"key_auths": [
[
"STM7K23Tip1cAr4eKiFCivrtAJicnxSNzW3NBq3GRRj64Xg1uEf67",
1
]
],
"weight_threshold": 1
},
"balance": "0.001 STEEM",
"can_vote": true,
"comment_count": 0,
"created": "2019-02-18T22:28:30",
"curation_rewards": 0,
"delegated_vesting_shares": "0.000000 VESTS",
"downvote_manabar": {
"current_mana": 488327785,
"last_update_time": 1588924371
},
"guest_bloggers": [],
"id": 1222439,
"json_metadata": "{}",
"last_account_recovery": "1970-01-01T00:00:00",
"last_account_update": "1970-01-01T00:00:00",
"last_owner_update": "1970-01-01T00:00:00",
"last_post": "2019-02-18T22:54:18",
"last_root_post": "2019-02-18T22:54:18",
"last_vote_time": "2019-02-18T22:54:42",
"lifetime_vote_count": 0,
"market_history": [],
"memo_key": "STM5L1d63r7KJkD2SMwf5YkpmbFNaMfsc7tZ5pCFKdhXZneCQa1z8",
"mined": false,
"name": "coogy",
"next_vesting_withdrawal": "1969-12-31T23:59:59",
"other_history": [],
"owner": {
"account_auths": [],
"key_auths": [
[
"STM7FBXhesvqWK1yDJETQWGbjYBaawXgnEnirYzjYwkYSBzrbzrAe",
1
]
],
"weight_threshold": 1
},
"pending_claimed_accounts": 0,
"post_bandwidth": 0,
"post_count": 1,
"post_history": [],
"posting": {
"account_auths": [],
"key_auths": [
[
"STM53sVN6N6ucztjRfHtLdRzAWM5hvyYTVhDx7vMt7jJCrVVFva6v",
1
]
],
"weight_threshold": 1
},
"posting_json_metadata": "",
"posting_rewards": 0,
"proxied_vsf_votes": [
0,
0,
0,
0
],
"proxy": "",
"received_vesting_shares": "1953.311140 VESTS",
"recovery_account": "steem",
"reputation": 12203115,
"reset_account": "null",
"reward_sbd_balance": "0.000 SBD",
"reward_steem_balance": "0.000 STEEM",
"reward_vesting_balance": "0.000000 VESTS",
"reward_vesting_steem": "0.000 STEEM",
"savings_balance": "0.000 STEEM",
"savings_sbd_balance": "0.000 SBD",
"savings_sbd_last_interest_payment": "1970-01-01T00:00:00",
"savings_sbd_seconds": "0",
"savings_sbd_seconds_last_update": "1970-01-01T00:00:00",
"savings_withdraw_requests": 0,
"sbd_balance": "0.000 SBD",
"sbd_last_interest_payment": "1970-01-01T00:00:00",
"sbd_seconds": "0",
"sbd_seconds_last_update": "1970-01-01T00:00:00",
"tags_usage": [],
"to_withdraw": 0,
"transfer_history": [],
"vesting_balance": "0.000 STEEM",
"vesting_shares": "0.000000 VESTS",
"vesting_withdraw_rate": "0.000000 VESTS",
"vote_history": [],
"voting_manabar": {
"current_mana": 1953311140,
"last_update_time": 1588924371
},
"voting_power": 0,
"withdraw_routes": 0,
"withdrawn": 0,
"witness_votes": [],
"witnesses_voted_for": 0,
"rank": 1563402
}Withdraw Routes
| Incoming | Outgoing |
|---|---|
Empty | Empty |
{
"incoming": [],
"outgoing": []
}From Date
To Date
2020/05/08 07:52:51
2020/05/08 07:52:51
| delegatee | coogy |
| delegator | steem |
| vesting shares | 1953.311140 VESTS |
| Transaction Info | Block #43191421/Trx b8ad701d43461143038c2bb4b7ee23608a87a378 |
View Raw JSON Data
{
"block": 43191421,
"op": [
"delegate_vesting_shares",
{
"delegatee": "coogy",
"delegator": "steem",
"vesting_shares": "1953.311140 VESTS"
}
],
"op_in_trx": 0,
"timestamp": "2020-05-08T07:52:51",
"trx_id": "b8ad701d43461143038c2bb4b7ee23608a87a378",
"trx_in_block": 40,
"virtual_op": 0
}2020/04/24 17:05:48
2020/04/24 17:05:48
| delegatee | coogy |
| delegator | steem |
| vesting shares | 9774.211846 VESTS |
| Transaction Info | Block #42809046/Trx ba9b4795a0341d240c59a5d49c71be434582cc47 |
View Raw JSON Data
{
"block": 42809046,
"op": [
"delegate_vesting_shares",
{
"delegatee": "coogy",
"delegator": "steem",
"vesting_shares": "9774.211846 VESTS"
}
],
"op_in_trx": 0,
"timestamp": "2020-04-24T17:05:48",
"trx_id": "ba9b4795a0341d240c59a5d49c71be434582cc47",
"trx_in_block": 17,
"virtual_op": 0
}2020/02/18 23:00:33
2020/02/18 23:00:33
| author | steemitboard |
| body | Congratulations @coogy! You received a personal award! <table><tr><td>https://steemitimages.com/70x70/http://steemitboard.com/@coogy/birthday1.png</td><td>Happy Birthday! - You are on the Steem blockchain for 1 year!</td></tr></table> <sub>_You can view [your badges on your Steem Board](https://steemitboard.com/@coogy) and compare to others on the [Steem Ranking](https://steemitboard.com/ranking/index.php?name=coogy)_</sub> **Do not miss the last post from @steemitboard:** <table><tr><td><a href="https://steemit.com/steemitboard/@steemitboard/valentine-s-day-challenge-give-a-badge-to-your-beloved"><img src="https://steemitimages.com/64x128/http://i.cubeupload.com/LvDzr5.png"></a></td><td><a href="https://steemit.com/steemitboard/@steemitboard/valentine-s-day-challenge-give-a-badge-to-your-beloved">Valentine's day challenge - Give a badge to your beloved!</a></td></tr></table> ###### [Vote for @Steemitboard as a witness](https://v2.steemconnect.com/sign/account-witness-vote?witness=steemitboard&approve=1) to get one more award and increased upvotes! |
| json metadata | {"image":["https://steemitboard.com/img/notify.png"]} |
| parent author | coogy |
| parent permlink | decentralized-file-storage-with-kademlia-and-iota |
| permlink | steemitboard-notify-coogy-20200218t230032000z |
| title | |
| Transaction Info | Block #40939506/Trx 5150bf2d5c1a371b05e45c813fb1c9475ef983e5 |
View Raw JSON Data
{
"block": 40939506,
"op": [
"comment",
{
"author": "steemitboard",
"body": "Congratulations @coogy! You received a personal award!\n\n<table><tr><td>https://steemitimages.com/70x70/http://steemitboard.com/@coogy/birthday1.png</td><td>Happy Birthday! - You are on the Steem blockchain for 1 year!</td></tr></table>\n\n<sub>_You can view [your badges on your Steem Board](https://steemitboard.com/@coogy) and compare to others on the [Steem Ranking](https://steemitboard.com/ranking/index.php?name=coogy)_</sub>\n\n\n**Do not miss the last post from @steemitboard:**\n<table><tr><td><a href=\"https://steemit.com/steemitboard/@steemitboard/valentine-s-day-challenge-give-a-badge-to-your-beloved\"><img src=\"https://steemitimages.com/64x128/http://i.cubeupload.com/LvDzr5.png\"></a></td><td><a href=\"https://steemit.com/steemitboard/@steemitboard/valentine-s-day-challenge-give-a-badge-to-your-beloved\">Valentine's day challenge - Give a badge to your beloved!</a></td></tr></table>\n\n###### [Vote for @Steemitboard as a witness](https://v2.steemconnect.com/sign/account-witness-vote?witness=steemitboard&approve=1) to get one more award and increased upvotes!",
"json_metadata": "{\"image\":[\"https://steemitboard.com/img/notify.png\"]}",
"parent_author": "coogy",
"parent_permlink": "decentralized-file-storage-with-kademlia-and-iota",
"permlink": "steemitboard-notify-coogy-20200218t230032000z",
"title": ""
}
],
"op_in_trx": 0,
"timestamp": "2020-02-18T23:00:33",
"trx_id": "5150bf2d5c1a371b05e45c813fb1c9475ef983e5",
"trx_in_block": 8,
"virtual_op": 0
}2019/05/20 23:37:21
2019/05/20 23:37:21
| delegatee | coogy |
| delegator | steem |
| vesting shares | 9969.707002 VESTS |
| Transaction Info | Block #33086199/Trx f55b86b75b19ca7229a7ca56052ce3de85fb6bdd |
View Raw JSON Data
{
"block": 33086199,
"op": [
"delegate_vesting_shares",
{
"delegatee": "coogy",
"delegator": "steem",
"vesting_shares": "9969.707002 VESTS"
}
],
"op_in_trx": 0,
"timestamp": "2019-05-20T23:37:21",
"trx_id": "f55b86b75b19ca7229a7ca56052ce3de85fb6bdd",
"trx_in_block": 11,
"virtual_op": 0
}2019/02/26 06:33:15
2019/02/26 06:33:15
| author | partiko |
| body | Hello @coogy! This is a friendly reminder that you have 3000 Partiko Points unclaimed in your Partiko account! Partiko is a fast and beautiful mobile app for Steem, and it’s the most popular Steem mobile app out there! Download Partiko using the link below and login using SteemConnect to claim your 3000 Partiko points! You can easily convert them into Steem token! https://partiko.app/referral/partiko |
| json metadata | {"app":"partiko"} |
| parent author | coogy |
| parent permlink | decentralized-file-storage-with-kademlia-and-iota |
| permlink | partiko-re-coogy-decentralized-file-storage-with-kademlia-and-iota-20190226t063315161z |
| title | |
| Transaction Info | Block #30678385/Trx 56fa9d355267d2f4622f82899428d553c0a62f2c |
View Raw JSON Data
{
"block": 30678385,
"op": [
"comment",
{
"author": "partiko",
"body": "Hello @coogy! This is a friendly reminder that you have 3000 Partiko Points unclaimed in your Partiko account!\n\nPartiko is a fast and beautiful mobile app for Steem, and it’s the most popular Steem mobile app out there! Download Partiko using the link below and login using SteemConnect to claim your 3000 Partiko points! You can easily convert them into Steem token!\n\nhttps://partiko.app/referral/partiko",
"json_metadata": "{\"app\":\"partiko\"}",
"parent_author": "coogy",
"parent_permlink": "decentralized-file-storage-with-kademlia-and-iota",
"permlink": "partiko-re-coogy-decentralized-file-storage-with-kademlia-and-iota-20190226t063315161z",
"title": ""
}
],
"op_in_trx": 0,
"timestamp": "2019-02-26T06:33:15",
"trx_id": "56fa9d355267d2f4622f82899428d553c0a62f2c",
"trx_in_block": 20,
"virtual_op": 0
}2019/02/18 23:52:12
2019/02/18 23:52:12
| delegatee | coogy |
| delegator | steem |
| vesting shares | 30066.676604 VESTS |
| Transaction Info | Block #30468913/Trx 44fb072d8aaba784ad3b2c0f5522c3d79f4e7065 |
View Raw JSON Data
{
"block": 30468913,
"op": [
"delegate_vesting_shares",
{
"delegatee": "coogy",
"delegator": "steem",
"vesting_shares": "30066.676604 VESTS"
}
],
"op_in_trx": 0,
"timestamp": "2019-02-18T23:52:12",
"trx_id": "44fb072d8aaba784ad3b2c0f5522c3d79f4e7065",
"trx_in_block": 7,
"virtual_op": 0
}danielexupvoted (100.00%) @coogy / decentralized-file-storage-with-kademlia-and-iota2019/02/18 22:56:09
danielexupvoted (100.00%) @coogy / decentralized-file-storage-with-kademlia-and-iota
2019/02/18 22:56:09
| author | coogy |
| permlink | decentralized-file-storage-with-kademlia-and-iota |
| voter | danielex |
| weight | 10000 (100.00%) |
| Transaction Info | Block #30467792/Trx 212e5931d2b76658e6a87b03f1864c57abaec410 |
View Raw JSON Data
{
"block": 30467792,
"op": [
"vote",
{
"author": "coogy",
"permlink": "decentralized-file-storage-with-kademlia-and-iota",
"voter": "danielex",
"weight": 10000
}
],
"op_in_trx": 0,
"timestamp": "2019-02-18T22:56:09",
"trx_id": "212e5931d2b76658e6a87b03f1864c57abaec410",
"trx_in_block": 12,
"virtual_op": 0
}2019/02/18 22:54:54
2019/02/18 22:54:54
| amount | 0.001 STEEM |
| from | allaz |
| memo | Promote your post. Your post will be min. 10 resteemed with over 13000 followers and min. 25 Upvote Different account. Your post will be more popular and you will find new friends. Send 0.5 SBD or STEEM to @allaz (post URL as memo ) Service Active. |
| to | coogy |
| Transaction Info | Block #30467767/Trx 00f49b85488c57666cde361009878cc6184333a7 |
View Raw JSON Data
{
"block": 30467767,
"op": [
"transfer",
{
"amount": "0.001 STEEM",
"from": "allaz",
"memo": "Promote your post. Your post will be min. 10 resteemed with over 13000 followers and min. 25 Upvote Different account. Your post will be more popular and you will find new friends. Send 0.5 SBD or STEEM to @allaz (post URL as memo ) Service Active.",
"to": "coogy"
}
],
"op_in_trx": 0,
"timestamp": "2019-02-18T22:54:54",
"trx_id": "00f49b85488c57666cde361009878cc6184333a7",
"trx_in_block": 20,
"virtual_op": 0
}coogyupvoted (100.00%) @coogy / decentralized-file-storage-with-kademlia-and-iota2019/02/18 22:54:42
coogyupvoted (100.00%) @coogy / decentralized-file-storage-with-kademlia-and-iota
2019/02/18 22:54:42
| author | coogy |
| permlink | decentralized-file-storage-with-kademlia-and-iota |
| voter | coogy |
| weight | 10000 (100.00%) |
| Transaction Info | Block #30467763/Trx bc7cd53b647a4841fe58ec19c74a47e5ae34b2e6 |
View Raw JSON Data
{
"block": 30467763,
"op": [
"vote",
{
"author": "coogy",
"permlink": "decentralized-file-storage-with-kademlia-and-iota",
"voter": "coogy",
"weight": 10000
}
],
"op_in_trx": 0,
"timestamp": "2019-02-18T22:54:42",
"trx_id": "bc7cd53b647a4841fe58ec19c74a47e5ae34b2e6",
"trx_in_block": 4,
"virtual_op": 0
}coogypublished a new post: decentralized-file-storage-with-kademlia-and-iota2019/02/18 22:54:18
coogypublished a new post: decentralized-file-storage-with-kademlia-and-iota
2019/02/18 22:54:18
| author | coogy |
| body | <center>  </center> It has been said that the most valuable resource in the 21st century is no longer oil but data. With most of the data being controlled by 6 or 7 tech companies many people have started developing peer to peer/ decentralized systems again to try and take back control of data and mitigate the risk of relying on cloud providers. In this article I’ll explore the use of the Kademlia DHT and the Iota tangle for storing data on a decentralized network of nodes. <h1>Video:</h1> https://www.youtube.com/watch?v=Ps1DXpP2hc4 <h1>Software Libraries used:</h1> Kadence library Iota javascript library <h1>Overview</h1> Kademlia is a distributed hash table. It uses key-value pairs similarly to regular hash maps but it stores them on various nodes connected to it. It searches for the node with an ID that closely resembles the key in the routing table of each node until it finds the closest match. This allows it to find and store data in O(log(n)) time while only needing a small amount of addresses in the routing table. I used the Kadence library to implement a Kademlia network. Iota is a distributed ledger technology similar to blockchain but has a completely different structure. It is incredibly fast and is useful for projects where you use micro transactions. A basic Kademlia node will be ran that allows us to store and retrieve small bits of data and the Iota token will be used to pay small amounts to any node that stores the data. <h1>Project Discussion</h1> Kademlia requires two or more nodes to store data on the network. In my code I set up two nodes running on localhost and used the join method so one would connect to the other. ```const node = new kadence.KademliaNode({ identity: kadence.utils.getRandomKeyBuffer(), transport: new kadence.UDPTransport(), storage: levelup(encode(leveldown('database'))), contact: { hostname: 'localhost', port: 1337 } }); //Creating second node object// const nodeTwo = new kadence.KademliaNode({ identity: kadence.utils.getRandomKeyBuffer(), transport: new kadence.UDPTransport(), storage: levelup(encode(leveldown('secondDB'))), contact: { hostname: 'localhost', port: 8080 } }); //Listening on ports of each node// node.listen(1337); nodeTwo.listen(8080); //Node joins network through nodeTwo// node.join([ nodeTwo.identity, { hostname: 'localhost', port: 8080 }], async () => { //Rest of the article's code //goes in here besides the use //Methods and the sendIota function }); ``` The next thing required is to use the iterativeStore() function. This takes a key and a value as parameters. It finds K closest node IDs to the key and stores them on that node’s local storage. The storage directory can be seen in more detail in the video I have at the top of the article ``` //Details for key and Value we want to store// const key = kadence.utils.getRandomKeyBuffer(); const Value = 'Elon Did Nothing Wrong' console.log('The key is: '); console.log(key); node.iterativeStore(key, Value, function (err, data) { if (err) { return console.error(err); } else{ console.log(data); } }); ``` The KadenceNode class also has a function called iterativeFindValue. It normally returns an array of Entities which are a type with a Node ID, value and timestamp. This is what is needed to return the value again but for some reason when you first call the function it just returns an Array of Node IDs that the value was stored on. Happy accident since I can use this to send Iota tokens to all the nodes. I made a handler for each of the nodes that would send their Iota address. I then created a function called sendIota() that would connect to an Iota full node, prepare a transaction then attach it to the tangle. If you want a better explaination of how Iota work check THIS video out where I used it on another project. ``` node.use('IOTA', (req, res) => { const iota = 'QVFEHDRITCVU9LTPSNQGGQRELGSSBOMQG9XFWSLBRTUYDZMUFLSOWGYNS9ZW9UOAYWSBBJKHFZESDGWMZOQKDQOUSY'; res.send(iota); }); nodeTwo.use('IOTA', (req, res) => { const iota = 'CEEMLNFZSOOXVCTDNXZXWZBVVYZTJW9XKBWPHXKABB9FCSJMNLXZJ9UZTODXBSFSGRCYOILEFSQSTREPY9EGVFZTHZ'; res.send(iota); }); function sendIota(Address, Seed){ const iota = iotaCore.composeAPI({ provider: 'https://testnet140.tangle.works'}) const msg = converter.asciiToTrytes('Thanks for the storage'); // Array of transfers which defines transfer recipients and value transferred in IOTAs. const transfers = [{ address: Address, value: 0, // 1Ki tag: '', // optional tag of `0-27` trytes message: msg // optional message in trytes }] iota.prepareTransfers(Seed, transfers) .then(trytes => iota.sendTrytes(trytes, 3, 14)) .then(bundle => { console.log(`Published transaction with tail hash: ${bundle[0].hash}`) console.log(`Bundle: ${bundle}`) res.send(bundle[0].hash) }) .catch(err => { // catch any errors }) } ``` The last thing I needed to do was search through the array of Node IDs returned by the iterativeFindValue() function and call the sendIota() function for each address. I did this using a for loop. ``` node.iterativeFindValue(key, function (error, value, contact){ if (error) { return console.error(err); } else{ const resp = value; //const publisher = value.publisher; const len = resp.length; for(var i = 0; i < len; i++){ node.send('IOTA', ['Iota Address'], resp[i], function (err, result){ if (error) { return console.error(err); } else{ console.log(result); sendIota(result, mySeed); } }); } } }); ``` The code creates two nodes and stores data across each of them. It then sends Iota tokens to the address of any node that stores the data. This is a very broad overview of how DHTs and Iota could be used for storing files and is not meant to actually be used. My code can be found in my github below along with my social media. Thanks for reading. <h1>Github containing code: </h1> https://github.com/CoogyEoin/Decentralised-Kademlia-File-Storage |
| json metadata | {"tags":["blockchain","bitcoin","cryptocurrency","digital","video"],"image":["https://cdn.steemitimages.com/DQmSr79tXS4ooLRyXQseMAU1mAxvJKL7wU2qYJJSqBxf5Fj/proxy.duckduckgo.com.jpg","https://img.youtube.com/vi/Ps1DXpP2hc4/0.jpg"],"links":["https://www.youtube.com/watch?v=Ps1DXpP2hc4","https://github.com/CoogyEoin/Decentralised-Kademlia-File-Storage"],"app":"steemit/0.1","format":"markdown"} |
| parent author | |
| parent permlink | blockchain |
| permlink | decentralized-file-storage-with-kademlia-and-iota |
| title | Decentralized File Storage with Kademlia and IOTA |
| Transaction Info | Block #30467755/Trx c4caa8cee1c91da6c869ff8bfa9649efb8c7046f |
View Raw JSON Data
{
"block": 30467755,
"op": [
"comment",
{
"author": "coogy",
"body": "<center>\n\n</center>\n\nIt has been said that the most valuable resource in the 21st century is no longer oil but data. With most of the data being controlled by 6 or 7 tech companies many people have started developing peer to peer/ decentralized systems again to try and take back control of data and mitigate the risk of relying on cloud providers.\nIn this article I’ll explore the use of the Kademlia DHT and the Iota tangle for storing data on a decentralized network of nodes.\n\n<h1>Video:</h1> https://www.youtube.com/watch?v=Ps1DXpP2hc4\n\n\n<h1>Software Libraries used:</h1>\n\nKadence library\nIota javascript library\n\n\n<h1>Overview</h1>\n\nKademlia is a distributed hash table. It uses key-value pairs similarly to regular hash maps but it stores them on various nodes connected to it. It searches for the node with an ID that closely resembles the key in the routing table of each node until it finds the closest match. This allows it to find and store data in O(log(n)) time while only needing a small amount of addresses in the routing table. I used the Kadence library to implement a Kademlia network.\n\nIota is a distributed ledger technology similar to blockchain but has a completely different structure. It is incredibly fast and is useful for projects where you use micro transactions.\n\nA basic Kademlia node will be ran that allows us to store and retrieve small bits of data and the Iota token will be used to pay small amounts to any node that stores the data.\n\n\n<h1>Project Discussion</h1>\n\nKademlia requires two or more nodes to store data on the network. In my code I set up two nodes running on localhost and used the join method so one would connect to the other.\n\n\n```const node = new kadence.KademliaNode({\n identity: kadence.utils.getRandomKeyBuffer(),\n transport: new kadence.UDPTransport(),\n storage: levelup(encode(leveldown('database'))),\n contact: { hostname: 'localhost', port: 1337 }\n});\n\n//Creating second node object//\n\nconst nodeTwo = new kadence.KademliaNode({\n identity: kadence.utils.getRandomKeyBuffer(),\n transport: new kadence.UDPTransport(),\n storage: levelup(encode(leveldown('secondDB'))),\n contact: { hostname: 'localhost', port: 8080 }\n});\n\n//Listening on ports of each node//\nnode.listen(1337);\nnodeTwo.listen(8080);\n \n//Node joins network through nodeTwo//\n\nnode.join([ nodeTwo.identity, {\n hostname: 'localhost',\n port: 8080\n}], async () => {\n\n//Rest of the article's code\n//goes in here besides the use\n//Methods and the sendIota function\n\n});\n\n```\n\nThe next thing required is to use the iterativeStore() function. This takes a key and a value as parameters. It finds K closest node IDs to the key and stores them on that node’s local storage. The storage directory can be seen in more detail in the video I have at the top of the article\n\n\n```\n//Details for key and Value we want to store//\nconst key = kadence.utils.getRandomKeyBuffer();\nconst Value = 'Elon Did Nothing Wrong'\n\nconsole.log('The key is: ');\nconsole.log(key);\n \nnode.iterativeStore(key, Value, function (err, data) {\n if (err) {\n return console.error(err);\n }\n else{\n console.log(data); \n }\n});\n```\n\n\nThe KadenceNode class also has a function called iterativeFindValue. It normally returns an array of Entities which are a type with a Node ID, value and timestamp. This is what is needed to return the value again but for some reason when you first call the function it just returns an Array of Node IDs that the value was stored on.\nHappy accident since I can use this to send Iota tokens to all the nodes.\n\nI made a handler for each of the nodes that would send their Iota address. I then created a function called sendIota() that would connect to an Iota full node, prepare a transaction then attach it to the tangle. If you want a better explaination of how Iota work check THIS video out where I used it on another project.\n\n\n```\nnode.use('IOTA', (req, res) => {\n const iota = 'QVFEHDRITCVU9LTPSNQGGQRELGSSBOMQG9XFWSLBRTUYDZMUFLSOWGYNS9ZW9UOAYWSBBJKHFZESDGWMZOQKDQOUSY';\n res.send(iota);\n });\n\nnodeTwo.use('IOTA', (req, res) => {\n const iota = 'CEEMLNFZSOOXVCTDNXZXWZBVVYZTJW9XKBWPHXKABB9FCSJMNLXZJ9UZTODXBSFSGRCYOILEFSQSTREPY9EGVFZTHZ';\n res.send(iota);\n });\n\nfunction sendIota(Address, Seed){\n const iota = iotaCore.composeAPI({ provider: 'https://testnet140.tangle.works'})\n \n const msg = converter.asciiToTrytes('Thanks for the storage');\n\n// Array of transfers which defines transfer recipients and value transferred in IOTAs.\n const transfers = [{\n address: Address,\n value: 0, // 1Ki\n tag: '', // optional tag of `0-27` trytes\n message: msg // optional message in trytes\n }]\n \n iota.prepareTransfers(Seed, transfers)\n .then(trytes => iota.sendTrytes(trytes, 3, 14))\n .then(bundle => {\n console.log(`Published transaction with tail hash: ${bundle[0].hash}`)\n console.log(`Bundle: ${bundle}`)\n \n res.send(bundle[0].hash)\n })\n .catch(err => {\n // catch any errors\n })\n \n \n}\n\n\n```\n\nThe last thing I needed to do was search through the array of Node IDs returned by the iterativeFindValue() function and call the sendIota() function for each address. I did this using a for loop.\n\n```\nnode.iterativeFindValue(key, function (error, value, contact){\n if (error) {\n return console.error(err);\n }\n else{ \n const resp = value;\n //const publisher = value.publisher;\n const len = resp.length;\n \n for(var i = 0; i < len; i++){\n \n node.send('IOTA', ['Iota Address'], resp[i], function (err, result){\n if (error) {\n return console.error(err);\n } \n else{\n console.log(result);\n \n sendIota(result, mySeed);\n }\n });\n \n }\n }\n});\n\n```\n\nThe code creates two nodes and stores data across each of them. It then sends Iota tokens to the address of any node that stores the data.\n\nThis is a very broad overview of how DHTs and Iota could be used for storing files and is not meant to actually be used. My code can be found in my github below along with my social media.\n\nThanks for reading.\n\n<h1>Github containing code: </h1>\nhttps://github.com/CoogyEoin/Decentralised-Kademlia-File-Storage",
"json_metadata": "{\"tags\":[\"blockchain\",\"bitcoin\",\"cryptocurrency\",\"digital\",\"video\"],\"image\":[\"https://cdn.steemitimages.com/DQmSr79tXS4ooLRyXQseMAU1mAxvJKL7wU2qYJJSqBxf5Fj/proxy.duckduckgo.com.jpg\",\"https://img.youtube.com/vi/Ps1DXpP2hc4/0.jpg\"],\"links\":[\"https://www.youtube.com/watch?v=Ps1DXpP2hc4\",\"https://github.com/CoogyEoin/Decentralised-Kademlia-File-Storage\"],\"app\":\"steemit/0.1\",\"format\":\"markdown\"}",
"parent_author": "",
"parent_permlink": "blockchain",
"permlink": "decentralized-file-storage-with-kademlia-and-iota",
"title": "Decentralized File Storage with Kademlia and IOTA"
}
],
"op_in_trx": 0,
"timestamp": "2019-02-18T22:54:18",
"trx_id": "c4caa8cee1c91da6c869ff8bfa9649efb8c7046f",
"trx_in_block": 8,
"virtual_op": 0
}coogyupvoted (100.00%) @cryptonomics1 / legitimate-uses-of-cryptocurrency-with-chris-guida2019/02/18 22:35:45
coogyupvoted (100.00%) @cryptonomics1 / legitimate-uses-of-cryptocurrency-with-chris-guida
2019/02/18 22:35:45
| author | cryptonomics1 |
| permlink | legitimate-uses-of-cryptocurrency-with-chris-guida |
| voter | coogy |
| weight | 10000 (100.00%) |
| Transaction Info | Block #30467384/Trx 74343ba304467d2295cbcfdce53ce75cc948edf2 |
View Raw JSON Data
{
"block": 30467384,
"op": [
"vote",
{
"author": "cryptonomics1",
"permlink": "legitimate-uses-of-cryptocurrency-with-chris-guida",
"voter": "coogy",
"weight": 10000
}
],
"op_in_trx": 0,
"timestamp": "2019-02-18T22:35:45",
"trx_id": "74343ba304467d2295cbcfdce53ce75cc948edf2",
"trx_in_block": 6,
"virtual_op": 0
}2019/02/18 22:28:30
2019/02/18 22:28:30
| delegatee | coogy |
| delegator | steem |
| vesting shares | 30300.000000 VESTS |
| Transaction Info | Block #30467239/Trx 5b32ddd8e905dd9cd7d58594c3dd70b618c213c1 |
View Raw JSON Data
{
"block": 30467239,
"op": [
"delegate_vesting_shares",
{
"delegatee": "coogy",
"delegator": "steem",
"vesting_shares": "30300.000000 VESTS"
}
],
"op_in_trx": 0,
"timestamp": "2019-02-18T22:28:30",
"trx_id": "5b32ddd8e905dd9cd7d58594c3dd70b618c213c1",
"trx_in_block": 10,
"virtual_op": 0
}2019/02/18 22:28:30
2019/02/18 22:28:30
| active | {"account_auths":[],"key_auths":[["STM7K23Tip1cAr4eKiFCivrtAJicnxSNzW3NBq3GRRj64Xg1uEf67",1]],"weight_threshold":1} |
| creator | steem |
| extensions | [] |
| json metadata | {} |
| memo key | STM5L1d63r7KJkD2SMwf5YkpmbFNaMfsc7tZ5pCFKdhXZneCQa1z8 |
| new account name | coogy |
| owner | {"account_auths":[],"key_auths":[["STM7FBXhesvqWK1yDJETQWGbjYBaawXgnEnirYzjYwkYSBzrbzrAe",1]],"weight_threshold":1} |
| posting | {"account_auths":[],"key_auths":[["STM53sVN6N6ucztjRfHtLdRzAWM5hvyYTVhDx7vMt7jJCrVVFva6v",1]],"weight_threshold":1} |
| Transaction Info | Block #30467239/Trx 5b32ddd8e905dd9cd7d58594c3dd70b618c213c1 |
View Raw JSON Data
{
"block": 30467239,
"op": [
"create_claimed_account",
{
"active": {
"account_auths": [],
"key_auths": [
[
"STM7K23Tip1cAr4eKiFCivrtAJicnxSNzW3NBq3GRRj64Xg1uEf67",
1
]
],
"weight_threshold": 1
},
"creator": "steem",
"extensions": [],
"json_metadata": "{}",
"memo_key": "STM5L1d63r7KJkD2SMwf5YkpmbFNaMfsc7tZ5pCFKdhXZneCQa1z8",
"new_account_name": "coogy",
"owner": {
"account_auths": [],
"key_auths": [
[
"STM7FBXhesvqWK1yDJETQWGbjYBaawXgnEnirYzjYwkYSBzrbzrAe",
1
]
],
"weight_threshold": 1
},
"posting": {
"account_auths": [],
"key_auths": [
[
"STM53sVN6N6ucztjRfHtLdRzAWM5hvyYTVhDx7vMt7jJCrVVFva6v",
1
]
],
"weight_threshold": 1
}
}
],
"op_in_trx": 0,
"timestamp": "2019-02-18T22:28:30",
"trx_id": "5b32ddd8e905dd9cd7d58594c3dd70b618c213c1",
"trx_in_block": 10,
"virtual_op": 0
}Manabar
Voting Power100.00%
Downvote Power100.00%
Resource Credits100.00%
Reputation Progress0.00%
{
"voting_manabar": {
"current_mana": 1953311140,
"last_update_time": 1588924371
},
"downvote_manabar": {
"current_mana": 488327785,
"last_update_time": 1588924371
},
"rc_account": {
"account": "coogy",
"max_rc": "7966665620",
"max_rc_creation_adjustment": {
"amount": "6013354480",
"nai": "@@000000037",
"precision": 6
},
"rc_manabar": {
"current_mana": "15787566326",
"last_update_time": 1588924371
}
}
}Account Metadata
| POSTING JSON METADATA | |
| None | |
| JSON METADATA | |
| None |
{
"posting_json_metadata": {},
"json_metadata": {}
}Auth Keys
Owner
Single Signature
Public Keys
STM7FBXhesvqWK1yDJETQWGbjYBaawXgnEnirYzjYwkYSBzrbzrAe1/1
Active
Single Signature
Public Keys
STM7K23Tip1cAr4eKiFCivrtAJicnxSNzW3NBq3GRRj64Xg1uEf671/1
Posting
Single Signature
Public Keys
STM53sVN6N6ucztjRfHtLdRzAWM5hvyYTVhDx7vMt7jJCrVVFva6v1/1
Memo
STM5L1d63r7KJkD2SMwf5YkpmbFNaMfsc7tZ5pCFKdhXZneCQa1z8
{
"owner": {
"account_auths": [],
"key_auths": [
[
"STM7FBXhesvqWK1yDJETQWGbjYBaawXgnEnirYzjYwkYSBzrbzrAe",
1
]
],
"weight_threshold": 1
},
"active": {
"account_auths": [],
"key_auths": [
[
"STM7K23Tip1cAr4eKiFCivrtAJicnxSNzW3NBq3GRRj64Xg1uEf67",
1
]
],
"weight_threshold": 1
},
"posting": {
"account_auths": [],
"key_auths": [
[
"STM53sVN6N6ucztjRfHtLdRzAWM5hvyYTVhDx7vMt7jJCrVVFva6v",
1
]
],
"weight_threshold": 1
},
"memo": "STM5L1d63r7KJkD2SMwf5YkpmbFNaMfsc7tZ5pCFKdhXZneCQa1z8"
}Witness Votes
0 / 30
No active witness votes.
[]