{"id":19348988,"url":"https://github.com/archlinuxstudio/blockchain-election-react","last_synced_at":"2025-02-24T10:18:47.658Z","repository":{"id":108617090,"uuid":"463328883","full_name":"ArchLinuxStudio/blockchain-election-react","owner":"ArchLinuxStudio","description":"A Decentralized Ethereum Voting Application Tutorial -- With React","archived":false,"fork":false,"pushed_at":"2022-04-27T06:01:34.000Z","size":731,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-06T15:18:05.894Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ArchLinuxStudio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-02-24T23:06:58.000Z","updated_at":"2023-06-10T00:34:14.000Z","dependencies_parsed_at":"2023-04-30T18:19:28.795Z","dependency_job_id":null,"html_url":"https://github.com/ArchLinuxStudio/blockchain-election-react","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/ArchLinuxStudio%2Fblockchain-election-react","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArchLinuxStudio%2Fblockchain-election-react/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArchLinuxStudio%2Fblockchain-election-react/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArchLinuxStudio%2Fblockchain-election-react/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ArchLinuxStudio","download_url":"https://codeload.github.com/ArchLinuxStudio/blockchain-election-react/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240457988,"owners_count":19804489,"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":[],"created_at":"2024-11-10T04:24:05.662Z","updated_at":"2025-02-24T10:18:47.620Z","avatar_url":"https://github.com/ArchLinuxStudio.png","language":"TypeScript","readme":"# blockchain-election-react\n\nA election sample write with react and truffle. Basic version please check https://github.com/ArchLinuxStudio/blockchain-election-sample\n\n## Dependencies\n\nNPM: https://nodejs.org  \nTruffle: https://github.com/trufflesuite/truffle  \nGanache: http://truffleframework.com/ganache/  \nMetamask: https://metamask.io/\n\n## Run\n\n```bash\nyarn install\nyarn migrate\nyarn start\n```\n\n## IPFS\n\n```bash\nipfs add -r dist/\nipfs name publish YOUR_HASH\n```\n\n## Deploy to rinkeby test network\n\n1. Run geth node\n\n```bash\ngeth --rinkeby --http --http.api personal,eth,net,web3 --allow-insecure-unlock\n```\n\nThis can take dozens of hours, depending on your machine configuration and internet speed.  \nThis will cost you close to 100GB or so of hard drive space.\n\n2. Create a new account\n\n```bash\ngeth --rinkeby account new\n```\n\n3. Attach into geth console\n\n```bash\ngeth --rinkeby attach\n```\n\nAnd you can do many things in geth console\n\n```bash\neth.syncing     #check the syncing status\neth.accounts    #check all accounts\neth.getBalance(eth.accounts[0]) #check account balance\npersonal.unlockAccount(eth.accounts[0],null,1200)   #unlock a certain accont for 20 minutes\n```\n\n4. Acquire eth from https://www.rinkeby.io/#faucet\n\nHere they require that you have to post a twitter or facebook, which is disgusting.\n\n5. Migrate\n\n```bash\ntruffle migrate --reset --compile-all --network rinkeby\n```\n\n6. Verify deployment\n\n```bash\ngeth --rinkeby attach\n```\n\n```bash\nvar contractAddress = \"Your_Contract_Address\"\nvar contractAbi = [Your_ABI_Array] #copy the abi array in build/contracts/Election.json, turn it into one line style\nvar electionContract = web3.eth.contract(contractAbi)\nvar electionInstance = electionContract.at(contractAddress)\nelectionInstance.candidates(1)\nelectionInstance.vote(1, {from: eth.accounts[0]});\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farchlinuxstudio%2Fblockchain-election-react","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farchlinuxstudio%2Fblockchain-election-react","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farchlinuxstudio%2Fblockchain-election-react/lists"}