{"id":20008292,"url":"https://github.com/bethanyuo/truffle-deploy","last_synced_at":"2026-05-14T02:34:36.813Z","repository":{"id":116556768,"uuid":"256920196","full_name":"bethanyuo/truffle-deploy","owner":"bethanyuo","description":"Develop and Deploy Smart Contracts with Truffle.","archived":false,"fork":false,"pushed_at":"2020-07-12T16:49:43.000Z","size":31,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-02T01:31:05.731Z","etag":null,"topics":["smart-contracts","truffle","truffle-framework","truffle-testing","unit-testing"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bethanyuo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2020-04-19T05:15:55.000Z","updated_at":"2020-07-12T16:51:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"7a3bdb34-3702-4606-a47d-0428c85be13f","html_url":"https://github.com/bethanyuo/truffle-deploy","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bethanyuo/truffle-deploy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bethanyuo%2Ftruffle-deploy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bethanyuo%2Ftruffle-deploy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bethanyuo%2Ftruffle-deploy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bethanyuo%2Ftruffle-deploy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bethanyuo","download_url":"https://codeload.github.com/bethanyuo/truffle-deploy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bethanyuo%2Ftruffle-deploy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33008149,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T13:14:54.681Z","status":"online","status_checked_at":"2026-05-14T02:00:06.663Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["smart-contracts","truffle","truffle-framework","truffle-testing","unit-testing"],"created_at":"2024-11-13T07:09:15.618Z","updated_at":"2026-05-14T02:34:36.799Z","avatar_url":"https://github.com/bethanyuo.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Develop and Deploy Smart Contracts with Truffle\nCreate a smart contract, compile and deploy it using the Truffle Framework and add Unit Tests for the contract logic using Truffle. Deploy the smart contract in Ganache-CLI with Truffle. Then write unit tests for the smart contract and test it with Truffle. The contract will be written in Solidity. Before getting started, Truffle and Ganache-cli must be installed. Ganache-cli will be the tool we will use to create a private blockchain that runs on our machine only. \nFor this exercise we will use Ubuntu 16.04.3.\n\n## Requirements\n*  Ubuntu 16.04.3\n* Ganache-CLI\n* Truffle\n\n## Truffle Init\n1.\tSet the Truffle and Ganache-cli\n\n2.\tIf you already have Ganache-cli installed just skip this step, otherwise open terminal console and write command:\n```bash\n$ sudo npm install -g ganache-cli@6.4.5\n```\nIf you are running Windows, the recommended way to do this exercise is to install Windows Subsystem for Linux.\n\n3.\tCreate folder Exercise and open console. Create truffle project here by writing command: `truffle init`. Truffle will install three folders. \n*\tIn folder contracts: we will save our smart contracts. \n*\tIn migrations: we will hold configuration files for migrations. They are _.js_ files starts with number, like _1_initial_migration.js_ and _2_deploy_contracts.js_.\n*\tFolder test: holds unit test files.\n\nThe file _truffle-config.js_ is the truffle configuration file.\n\n4. The `port` in which ganache-cli communicates is `8545`. \n \n## Deploy a Smart Contract\n\n1.\tNow is time to write our smart contract. Open Remix Solidity IDE. The contract allows you to publish a time-limited article with name and text. Modifier `onlyOwner` allows only the owner of the contract to modify the `articleName` and `articleText`. Modifier `limitedTime` restricts for how long the article is readable. Write the following solidity code in Remix. Click Start to compile to compile and verify the contract.\n \n2.\tNow, copy the code of the smart contract. Open the contracts directory, create file _PublicArticle.sol_ in there and pastе the copied code in the file.\n \n3.\tGo to migrations folder and create file _2_deploy_contracts.js_ with the following content:\n \n4.\tNow, you are ready to compile the contract and migrate it to ganache-cli blockchain. Open console and run ganache-cli. The local testnet will started and gives you `10 addresses` and `10 private keys`. If you don't declare something else the first `“0”` address will be used by default. If you deploy contract with him, it will be the owner's address.\n```bash\n$ ganache-cli\n```\n \n5.\tOpen second terminal, go to Exercise directory and type:\n```bash\n$ truffle migrate\n```\nThe smart contract was successfully deployed. You can see the transaction number wrote in `block 4` of the blockchain.\n\n6.\tNow run the truffle console and call the info for block 4.  There is the transaction number which we see in migration info.\n```bash\n$ truffle console\n$ \u003e web3.eth.getBlock(4)\n```\n\n## Module\nMI4: Module 1: E3\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbethanyuo%2Ftruffle-deploy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbethanyuo%2Ftruffle-deploy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbethanyuo%2Ftruffle-deploy/lists"}