{"id":17194978,"url":"https://github.com/viandwi24/blockchain-simulation","last_synced_at":"2025-04-13T19:31:56.043Z","repository":{"id":61374720,"uuid":"407362106","full_name":"viandwi24/blockchain-simulation","owner":"viandwi24","description":"A Simple Blockchain Simulation with Javascript Nodejs and VueJs as Front End","archived":false,"fork":false,"pushed_at":"2022-02-17T19:42:56.000Z","size":40140,"stargazers_count":63,"open_issues_count":0,"forks_count":11,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-27T10:21:23.157Z","etag":null,"topics":["blockchain","javascript","nuxtjs","simulation","vue"],"latest_commit_sha":null,"homepage":"https://viandwi24.github.io/blockchain-simulation/","language":"Vue","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/viandwi24.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"ko_fi":"viandwi24","custom":["https://saweria.co/viandwi24","https://trakteer.id/viandwi24"]}},"created_at":"2021-09-17T01:13:36.000Z","updated_at":"2025-03-23T18:58:05.000Z","dependencies_parsed_at":"2022-10-16T07:12:54.679Z","dependency_job_id":null,"html_url":"https://github.com/viandwi24/blockchain-simulation","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viandwi24%2Fblockchain-simulation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viandwi24%2Fblockchain-simulation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viandwi24%2Fblockchain-simulation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viandwi24%2Fblockchain-simulation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/viandwi24","download_url":"https://codeload.github.com/viandwi24/blockchain-simulation/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248767957,"owners_count":21158563,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blockchain","javascript","nuxtjs","simulation","vue"],"created_at":"2024-10-15T01:48:52.480Z","updated_at":"2025-04-13T19:31:51.028Z","avatar_url":"https://github.com/viandwi24.png","language":"Vue","funding_links":["https://ko-fi.com/viandwi24","https://saweria.co/viandwi24","https://trakteer.id/viandwi24"],"categories":[],"sub_categories":[],"readme":"# Blockchain Simulation\nThis is just a Web to simulate how Blockchain works in a short and simple way. Built on javascript (nodejs) and using Vuejs as Front End. (Just for education only)\n\n![Preview](https://github.com/viandwi24/blockchain-simulation/blob/main/static/preview.gif?raw=true)\n\n## Demo\nTo see directly, you can see via the following link : [Live Demo](https://viandwi24.github.io/blockchain-simulation/)\n\nLoader Animation create in After Effect, if you wanna see :\n* [Loader render in mp4](https://viandwi24.github.io/blockchain-simulation/loader.mp4)\n* [Loader converted in lottie files (json)](https://github.com/viandwi24/blockchain-simulation/blob/main/static/blockchain.json)\n\n\n## Usage\nYou can see the base lib in `/blockchain-simulation/lib`\n```js\nconst Blockchain = require('./blockchain')\nconst Transaction = require('./transaction')\nconst { KeyGenerator } = require('./signature')\n\n// Create a new blockchain\nconst mycoin = new Blockchain()\n\n// Configure the blockchain\nmycoin.blockProofOfWorkDifficulty = 4\n\n// create a new wallet\nconst mywallet = (new KeyGenerator()).generate() // { publicKey: '...', privateKey: '...' }\n\n// make default balance of wallet\nconst systemTransaction = (new Transaction(mycoin.system.publicKey, mywallet.publicKey, 1000)).sign(mycoin.system.privateKey)\nmycoin.addTransaction(systemTransaction)\n// mycoin.mine(mycoin.system.privateKey)\n\n// create a new transaction\nconst destinationAddress = 'my-friend-address'\nconst mytransaction = new Transaction(mywallet.publicKey, destinationAddress, 10)\n\n// sign the transaction with my wallet private key\nmytransaction.sign(mywallet.privateKey)\n\n// add the transaction to the blockchain\nmycoin.addTransaction(mytransaction)\n\n//\nconst mineAddress = 'miner-address'\nmycoin.mine(mineAddress).then(() =\u003e {\n  // mine was successful\n  console.log({\n    myballance: mycoin.getBalance(mywallet.publicKey),\n    myfrinedballance: mycoin.getBalance(destinationAddress),\n    minerballance: mycoin.getBalance(mineAddress),\n  })\n  // get last block\n  const lastBlock = mycoin.getLastBlock()\n  console.log(lastBlock)\n  // check valid chain\n  console.log(mycoin.isValid()) // true\n})\n```\nThis script you can see in `/blockchain-simulation/lib/example.js`\n\n## Contributors\n\u003ca href=\"https://github.com/viandwi24/blockchain-simulation/graphs/contributors\"\u003e\n  \u003cimg src=\"https://contrib.rocks/image?repo=viandwi24/blockchain-simulation\"/\u003e\n\u003c/a\u003e\n\n## You Can Contribute!!!\nI will gladly accept your contribution for the better.\nYou can follow the contributing guide listed [here](./CONTRIBUTING.md)\n\n## Donate\nYou can support the development of this project at :\n- [Saweria](https://saweria.co/viandwi24)\n- [Trakteer](https://trakteer.id/viandwi24)\n- [Ko-fi](https://ko-fi.com/viandwi24)\n\n## License\nBlockchain Simulation is open-sourced software licensed under the [MIT license](./LICENSE.md).\n\n---\n\n-   Created by [Alfian Dwi Nugraha](https://www.facebook.com/viandwi24)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fviandwi24%2Fblockchain-simulation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fviandwi24%2Fblockchain-simulation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fviandwi24%2Fblockchain-simulation/lists"}