CryptoCoinsInfoClub.com

Ganache Truffle Ethereum

Gamasutra: Paul Gadi's Blog - Lets Build A Decentralized Game Economy Using Blockchains (part 2)

Gamasutra: Paul Gadi's Blog - Lets Build A Decentralized Game Economy Using Blockchains (part 2)

Lets Build A Decentralized Game Economy Using Blockchains (Part 2) The following blog post, unless otherwise noted, was written by a member of Gamasutras community. The thoughts and opinions expressed are those of the writer and not Gamasutra or its parent company. Setting Up A Local Solidity Development Environment and a Private Blockchain In Part 1 of this series we created the foundations of a decentralized game economy on the blockchain. We discussedDecentralized Applications, created our own ERC20 token on the Ethereum blockchain, and used Metamask and Unity to transfer tokens from one account to another. To reduce setup time and quickly get started, most of the software we used for Part 1 were online cloud-based tools: remix.ethereum.org to deploy our contract code, the Ropsten testnet as our blockchain, and ropsten.etherscan.io to verify our contract transactions. If were going to start writing other contract code aside from the boilerplate ERC20 token though, it would be a good idea to set up a local development environment. Having one would allow us to easily recreate our own private blockchain with provisioned accounts, execute contracts more quickly, and even run test scripts on our code. Heres a side-to-side comparison of the tools we used in Part 1 and the ones that well be using by the end of this article: Lets install the tools we need one by one, starting from the top. In Part 1, we edited (or actually just copy-pasted ) our code using Remix on remix.ethereum.org . If we want to edit and save code locally, well need an IDE that can read Solidity. Atom is a great IDE for this not only is it a clean and customizable code editor for any language, but it can also be used with Solidity after we install the language-ethereum package. Install atom from their w Continue reading >>

Ethereum: Diy Tools For Smart Contracts

Ethereum: Diy Tools For Smart Contracts

Posted by Andrew B. Collier on 2018-01-19. What tools do you need to start working with Ethereum smart contracts? The Solidity Online Compiler provides a quick way to experiment with smart contracts without installing any software on your machine. Another promising online alternative is Cosmo . However at some stage youll probably want to put together a local Ethereum development environment. Here are some suggestions for how to do that on an Ubuntu machine. Since Im just feeling my way into this new domain, Im not sure to what degree all of these are necessary. I do know for sure, that Truffle and testrpc are crucial. Accurate time is important. Probably not critical to have nanosecond or microsecond accuracy. But you want your computers clock to be correct to within a few milliseconds. An owner of a grandfather clock needs to regularly wind it and check its time. Thats fine for an antique heirloom. But you dont want to have to do the same for your shiny computing machine, do you? Hell no! Nothing sexy about that. Rather ensure that you have NTP running . NTP will take care of timekeeping tasks, adjusting your clocks time and offseting any inherent drift. The Ethereum command line client allows to have direct access to the blockchain. By running the client youll be able to mine blocks, send and receive ETH, deploy and interact with smart contracts. There are multiple implementations of the client: $ geth versionGethVersion: 1.7.3-stableGit Commit: 4bb3c89d44e372e6a9ab85a8be0c9345265c763aArchitecture: amd64Protocol Versions: [63 62]Network Id: 1Go Version: go1.9Operating System: linuxGOPATH=GOROOT=/usr/lib/go-1.9 New releases come out every few weeks, so its not a bad idea to update from time to time. This is a good time to synchronise with the blockchain . Alternative Continue reading >>

How To Create Token And Initial Coin Offering Contracts Using Truffle + Openzeppelin

How To Create Token And Initial Coin Offering Contracts Using Truffle + Openzeppelin

How To Create Token and Initial Coin Offering Contracts Using Truffle + OpenZeppelin Update: this blog post has been updated for OpenZeppenlin version v1.3.0 I have tested this blog post with the following dependencies: Token contracts are hot. Token crowd sales aka Initial Coin Offers(ICO) are hotter. There have been a lot going in terms of ICOs lately in the crypto world and if you would like to code one yourself, look no further. In this blog post I am going to go through the steps to create your own and only token as well as the ICO contract for it. We will also use the help of some clever tools. Caveat: You should not actually release your ICO with the code found here. It is for demo purposes only. But it is a good start. For this tutorial I am going to be using Truffle and OpenZeppelin . Truffle is the de facto framework for creating smart contracts and decentralized applications. OpenZeppelin is a library that has extensive and well tested smart contracts that adhere to security best practices. In the smart contract world where a small bug can cost you money, it is good not to reinvent the wheel when there are trusted solutions out there. We will also use testrpc as the blockchain node because it is fast and developer friendly. Side note: If you want to actually create the contract on the Ethereum testnet or main net you would have to use something like Geth or Parity . Moving on: provided that you have npm and node installed, from terminal type the commands: A lot of magic happened with those commands above. But in essence it is the setup that will get you up and running with creating and deploying your ICO smart contract. This adds the zeppelin-solidity folder to node_modules and in it you will find all smart contract templates from the OpenZeppelin library . Continue reading >>

Truffle - Where Does Ganache Store The Ethereum Blockchain - Stack Overflow

Truffle - Where Does Ganache Store The Ethereum Blockchain - Stack Overflow

Where does ganache store the Ethereum blockchain I'm actually using truffle with Ganache to do some development. I would like to know where does Ganache store it's blockchain to see how much data is used by my test. Is it stored somewhere accessible on the pc? TestRPC used to just be in memory. They only recently released support for writing the blockchain out to the file system. As far as I can tell, the in memory implementation is still the default behavior. If you want to find the blockchain files, you'd specify the location yourself with the --db option. Because we backed the TestRPC via the filesystem, this means you can now save your blockchain's data for later use. That's right, if you close the TestRPC and reopen it later, say, you can start up right where you left off. You'll need to use the new --db option (see the README) to tell the TestRPC where you'd like the data saved. You'll also likely want to use the --mnemonic option to use the same accounts each time. Continue reading >>

Your First Full Stack Dapp On Ethereum Blockchain

Your First Full Stack Dapp On Ethereum Blockchain

DApps(Decentralized Applications) are built as over the top services on the blockchain network. This tutorial is designed to give you a head-start to DApp development on Ethereum Blockchain. Through this tutorial, we will accomplish the following: Setup local blockchain network with Ganache-cli (previously testrpc) Compile and deploy the contracts into network A basic knowledge of Ethereum, HTML and JavaScript would be ideal. I would suggest you have a look at the tutorial on your first smart contract on Ethereum blockchain . Make sure you followed MetaMask setup from above tutorial and have it installed on your browser. Truffle is development environment and asset pipeline for Ethereum development. Truffle makes our life of a smart contract developer much simpler. First of all, verify installation of Node.js v6+. If not, you can install from their official site. Download Node.js Let us now install truffle framework and confirm the same. Create a folder Metacoin for purpose of this tutorial and navigate into it. Truffle can be used to initialize the current directory with base project structure. As you can see, truffle creates all necessary files and folders to run a full stack DApp. You will have the following project structure: contracts/ : Contains Smart contracts written in Solidity. To learn more, refer Solidity Contracts migrations/ : Contains migrations files which are used for deploying contracts onto blockchain. To learn more, refer Running Migrations app/ : Contains HTML/JavaScript files of the dapp. For this tutorial, we will restrict ourselves to Ganache CLI (previously testrpc), a personal blockchain for Ethereum development. Think of this as blockchain simulation environment. Let us first install Ganache CLI. Open up a new terminal and navigate to metacoi Continue reading >>

Deploy Your First Ethereum Smart Contract On A Blockchain!

Deploy Your First Ethereum Smart Contract On A Blockchain!

Deploy Your First Ethereum Smart Contract on a Blockchain! Understanding the concepts behind a blockchain is not as hard as one could imagine. Of course some specific concepts of a blockchain environment are harder to understand (e.g. mining) but I will try first to give you a simple introduction to the most important concept of blockchain. Then we will write a first smart contract inside a blockchain. That will be the first step before trying to build a decentralized web application implementing smart contracts! Basically a blockchain is a chain of block, more precisely a linked chain of blocks. A block is one element of a blockchain and each block has a common structure. The security of a blockchain is assured by its decentralized nature. Unlike a classic database, a copy of the blockchain is stored in each node of its peer-to-peer network. In the case where the local version of a blockchain in a networks node were corrupted, all the other nodes of the P2P network would still be able to agree on the actual value of the blockchain: thats the consensus. In order to add a fraudulous transaction to a blockchain, one should be able to hack half of the user of the network. Furthermore, it is also very hard to alter even only a local version of a blockchain because of a block structure. What is interesting in the concept of blockchain is that we can store any kind of data with very high security. Data is stored inside a block that contains several elements: An index (number of the block in the chain) A nonce (an integer that will be used during the mining process) If you are not familiar with the concept of hash, the important things to know are: From a very large departure set (typically infinite and very diverse), a hash function gives back a string of fixed length Given Continue reading >>

Ganache-cli - Npm

Ganache-cli - Npm

NOTICE: testrpc is now ganache-cli. Use it just as you would testrpc. Ganache CLI, part of the Truffle suite of Ethereum development tools, is the command line version of Ganache , your personal blockchain for Ethereum development. Ganache CLI uses ethereumjs to simulate full client behavior and make developing Ethereum applications faster, easier, and safer. It also includes all popular RPC functions and features (like events) and can be run deterministically to make development a breeze. If you came here expecting to find the TestRPC, you're in the right place! Truffle has taken the TestRPC under its wing and made it part of the Truffle suite of tools. From now on you can expect better support along with tons of new features that help make Ethereum development safer, easier, and more enjoyable. Use ganache-cli just as you would testrpc. ganache-cli is written in Javascript and distributed as a Node package via npm. Make sure you have Node.js (>= v6.11.5) installed. Having problems? Be sure to check out the FAQ and if you're still having issues and you're sure its a problem with ganache-cli please open an issue. -a or --accounts: Specify the number of accounts to generate at startup. -e or --defaultBalanceEther: Amount of ether to assign each test account. Default is 100. -b or --blockTime: Specify blockTime in seconds for automatic mining. Default is 0 and no auto-mining. -d or --deterministic: Generate deterministic addresses based on a pre-defined mnemonic. -n or --secure: Lock available accounts by default (good for third party transaction signing) -m or --mnemonic: Use a specific HD wallet mnemonic to generate initial addresses. -p or --port: Port number to listen on. Defaults to 8545. -h or --hostname: Hostname to listen on. Defaults to Node's server.listen() de Continue reading >>

Welcome To Ganache Cli

Welcome To Ganache Cli

NOTICE: testrpc is now ganache-cli. Use it just as you would testrpc. Ganache CLI, part of the Truffle suite of Ethereum development tools, is the command line version of Ganache , your personal blockchain for Ethereum development. Ganache CLI uses ethereumjs to simulate full client behavior and make developing Ethereum applications faster, easier, and safer. It also includes all popular RPC functions and features (like events) and can be run deterministically to make development a breeze. If you came here expecting to find the TestRPC, you're in the right place! Truffle has taken the TestRPC under its wing and made it part of the Truffle suite of tools. From now on you can expect better support along with tons of new features that help make Ethereum development safer, easier, and more enjoyable. Use ganache-cli just as you would testrpc. ganache-cli is written in Javascript and distributed as a Node package via npm. Make sure you have Node.js (>= v6.11.5) installed. Having problems? Be sure to check out the FAQ and if you're still having issues and you're sure its a problem with ganache-cli please open an issue. -a or --accounts: Specify the number of accounts to generate at startup. -e or --defaultBalanceEther: Amount of ether to assign each test account. Default is 100. -b or --blockTime: Specify blockTime in seconds for automatic mining. Default is 0 and no auto-mining. -d or --deterministic: Generate deterministic addresses based on a pre-defined mnemonic. -n or --secure: Lock available accounts by default (good for third party transaction signing) -m or --mnemonic: Use a specific HD wallet mnemonic to generate initial addresses. -p or --port: Port number to listen on. Defaults to 8545. -h or --hostname: Hostname to listen on. Defaults to Node's server.listen() de Continue reading >>

Github - Trufflesuite/ganache: Personal Blockchain For Ethereum Development

Github - Trufflesuite/ganache: Personal Blockchain For Ethereum Development

Ganache is your personal blockchain for Ethereum development. You can download a self-contained prebuilt Ganache binary for your platform of choice using the "Download" button on the Ganache website, or from this repository's releases page. Please open issues and pull requests for new features, questions, and bug fixes. If using Windows, you may need windows-build-tools installed first. Each platform has an associated npm run configuration to help you build on each platform more easily. Because each platform has different (but similar) build processes, they require different configuration. Note that both Windows and Mac require certificates to sign the built packages; for security reasons these certs aren't uploaded to github, nor are their passwords saved in source control. Building on Windows will create a .appx file for use with the Windows Store. Before building, create the ./certs directory with the following files: ./certs/cert.pfx - Note a .pfx file is identical to a .p12. (Just change the extension if you've been given a .p12.) In order to build on Windows, you must first ensure you have the Windows 10 SDK installed. If you have errors during the build process, ensure the package.json file's windowsStoreConfig.windowsKit points to your Windows 10 SDK directory. The one specified in the package.json file currently is what worked at the time this process was figured out; it may need to be updated periodically. Because Windows requires a certificate to build the package -- and that certificate requires a password -- you'll need to run the following command instead of npm run make: Replace ... in the command above with your certificate password. This will create a .appx file in ./out/make. Building on a Mac will create a standard Mac .dmg file. Before building on a Continue reading >>

Truffle: A New Development Environment For Ethereum Coders

Truffle: A New Development Environment For Ethereum Coders

Truffle: A New Development Environment For Ethereum Coders Gaining insights as to how a blockchain works and what it is capable of is invaluable to developers, business owners, and government officials. There is a lot of focus on the Ethereum blockchain in particular as of late, and Truffle will act as a developer environment and testing framework for this technology. This should make life easier for Ethereum developers, as well as for those who seek to gain a deeper understanding of how this technology works. Also read: Bitcoins Cosmic Threat: Beware the Magnetic Field As more and more people take notice of the Ethereum blockchain, it only makes sense to see new platforms emerge that aim to helppeople understand the technology. Compared to the Bitcoin blockchain, certain technological features are for now only available to Ethereum developers. Terms such as smart contracts and blockchain-as-a-service are thrown around quite a lot, yet hardly anyone fully understands what this means. A smart contract will serve as an agreement between multiple parties, which will be overseen by a computer rather than a human third-party. The settlement will occur automatically, and disputes should be settled much quicker, as all of the evidence is processed automatically by the software. Blockchain-as-a-service, on the other hand, is a developer sandbox offered by companies such as Microsoft. Such a service lets any coder in the world set up a Microsoft Azure virtual machine, through which they can interact with the Ethereum blockchain without running the software on their computer. However, Truffle works slightly different, as it is not a blockchain-as-a-service kind of project. Getting involved with Ethereum technology can be scary, as developers need to have a good understanding of Continue reading >>

 Ethereum. 4: Truffle, Ganache, Infura

Ethereum. 4: Truffle, Ganache, Infura

Ethereum. . , , . , , , . , , : , , ( ). - , , . , . . Truffle , , . 4.0.6. , Embark Dapple , , . ( , ): contracts, migrations tests. contracts migrations Migrations, ( ). : migrations 1_description.js, 2_another_one.js n_etc.js. , , , . . Migrations , . , . , , truffle migration --reset. , , truffle : $ truffle create contract ExampleContract$ truffle create migration ExampleMigration$ truffle create test ExampleContract , . , . truffle init (Metacoin ConvertLib). , , Truffle Boxes. , Truffle web-, ReactJS. , , . . : , truffle init. Metacoin, ConvertLib . , , JavaScript Solidity ( , , Truffle). . development : Truffle Develop started at 0x627306090abab3a6e1400e9345bc60c78a8bef57(1) 0xf17f52151ebef6c7334fad080c5704d77216b732(2) 0xc5fdf4076b8f3a5357c5e395ab970b5b54098fef(3) 0x821aea9a577a9b44299b9c15c88cf3087f3b5544(4) 0x0d1d4e623d10f9fba5db95830f7d3839406c6af2(5) 0x2932b7a2355d6fecc4b5c0b6bd44cc31df247a2e(6) 0x2191ef87e392377ec08e7c08eb105ef5448eced5(7) 0x0f4f2ac550a1b4e2280d04c21cea7ebd822934b5(8) 0x6330a553fc93768f612722bb8c2ec78ac90b3bbc(9) 0x5aeda56215b167893e80b4fe645ba6d5bab767deMnemonic: candy maple cake sugar pudding cream honey rich smooth crumble sweet treattruffle(develop)> ? . , TestRPC. , Truffle Ganache . , . , : Compiling ./contracts/ConvertLib.sol...Compiling ./contracts/MetaCoin.sol...Compiling ./contracts/Migrations.sol...Writing artifacts to ./build/contracts Using network 'develop'.Running migration: 1_initial_migration.js Deploying Migrations... ... 0x29619f8ba9b9e001bef885c8ca2fbee45beab738adc41c7f9e2e8273fbc67e9f Migrations: 0x8cdaf0cd259887258bc13a92c0a6da92698644c0Saving successful migration to network... ... 0xd7bc86d31bee32fa3988f1c1eabce403a1b5d570340a3a9cdba53a472ee8c956Saving artifacts...Running migration: 2_deploy_contracts.js Deploying C Continue reading >>

Ganachetruffle Framework

Ganachetruffle Framework

This is an article dedicated to the review of the basic features Ganache a new tool launched by Consensys in their Truffle Framework suite. This tool is open source and the source code can be found here . The Ganache tool can be downloaded here and you can have a full list of releases here . For the Linux folks out there, there is a small twist in that the package to be download as it is in AppImage format . Apart from the fact that it is a relatively new format, launching it is very easy. After having downloaded the Ganache file, give it executable rights by doing `chmod u+x ganache-1.0.1-x86_64.AppImage` (or the corresponding version that you have). Launch the app by doing `./ganache-1.0.1-x86_64.AppImage` As soon as Ganache is launched, it will display a list of 10 addresses with a default balance of 100.00 ETH. The interface allows you to view and work with the following sections: Accounts displays a list of addresses which can be used in the Ethereum blockchain instance. You have the ability to click on the key icon to reveal the private key for the address (bear in mind that in the mainnet, you need to keep this key private, hence its name). Blocks a list of blocks on the blockchain. Clicking on the block will open more details on the clicked block including the mined on date and block hash. Transactions the transaction tab will provide a list of all transactions in this instance of the blockchain. Logs this tab provides us with a descriptive list of logs related to the actions on the private blockchain. Settings clicking on the top-right settings icon will open the settings view which will allow you to change the configuration including the hostname, port number, network ID, set defaults for the number of accounts/keys to create, gas limit and gas price. After a Continue reading >>

Getting Started With Ganache: Your Personal Blockchain For Ethereum Development

Getting Started With Ganache: Your Personal Blockchain For Ethereum Development

2) Compile and deploy the contracts to the test net (~30s) 3) Copy the built contracts ABI's to my frontend repository 4) Run the frontend and test the calls to the blockchain (~30s to 2m) That means that for testing a small change in the smart contract I'd spend nearly 3 minutes! Not mentioning that sometimes I ran out of Ether and had to use my clicking abilities to get free (fake) money from the faucet . On the other hand, now I'm a Rinkeby rich . Now using Ganache I dramatically reduced the time spent in this process: 2) Compile and deploy the contracts to the local net (~2s to 5s) 3) Copy the built contracts ABI's to my frontend repository 4) Run the frontend and test the calls to the blockchain (instantaneous) Now I can modify and test my solidity code way faster and after the new feature is ready I send it to the test net to play around with a real blockchain. If you have ever developed an Ethereum smart contract you probably heard of TestRPC. The TestRPC is a local blockchain for development purposes. It emulates the blockchain so you can make RPC calls to it without having to actually mine the blocks. Now Ganache is like TestRPC on steroids. The amazing Truffle team developed an Electron interface where you can see and interact with your own private blockchain. And that is amazing! For this tutorial I'll be using the truffle-init-webpack which is a boilerplate for a dApp: a frontend bundled with webpack + a token smart contract. 1) Download and install truffle-init-webpack Make sure you have truffle installed globally. mkdir truffle-init-webpack && cd truffle-init-webpacktruffle unbox webpack Go to your localhost:8080 and you'll see this error in the DevTools. That's because we didn't compile the Smart Contracts yet. But before we do this, let's download Ganac Continue reading >>

Ethereum Development Walkthrough (part 2: Truffle, Ganache, Geth Andmist)

Ethereum Development Walkthrough (part 2: Truffle, Ganache, Geth Andmist)

Dapps, web, and games developer. Interested in AI, blockchain, and smart contracts. You can reach me at [email protected] or @dev_zl Ethereum Development Walkthrough (Part 2: Truffle, Ganache, Geth andMist) We have seen in the first part of this tutorial series what a smart contract is, and how it works. Now, we will deploy it to two kinds of test networks. The most prominent tools at the moments are: Truffle: A development environment, testing framework and asset pipeline for Ethereum. In other words, it helps you develop smart contracts, publish them, and test them, among other things. You can read the docs of the Truffle suite for more informations. Ganache: It was called TestRPC before, if you have read a tutorial from a few months ago, chances are they use TestRPC with Truffle, but it was renamed upon the integration of TestRPC within the Truffle Suite. What Ganache does is simple, it creates a virtual Ethereum blockchain, and it generates some fake accounts that we will use during development. Mist: Its a browser for decentralized web apps. It seeks to be the equivalent of Chrome or Firefox, but for Dapps. Its still insecure and you shouldnt use it with untrusted dapps as of yet. Ethereum wallet: Its a version of Mist, but only opens one single dapp, the Ethereum Wallet . Mist and Ethereum Wallet are just UI fronts. And we need a core that will connect us to an Ethereum blockchain(It could be the real Ethereum blockchain, or a test one). Geth: Is the core application on your computer that will connect you to a blockchain. It can also start a new one (in our case we will create a local test blockchain), create contract, mine ether etc. We will start by using Truffle and Ganache, and then use Truffle with geth and Mist. The requirements for this tutorial are that y Continue reading >>

How To Make Ethereum Decentralized Application

How To Make Ethereum Decentralized Application

03/24/2018 05:15 PM 135 truffle-config.js Now we will create smart contract file. we use solidity as contract programminng language version 0.4.19. The purpose of this contract is to initiate a state variable called name in the blockchain and manipulating that value of that variable by invoking our smart contract method from a dapp. User changes the name variable value and shows the change on the page. Lets create NameChange.sol file under contracts folder in our project folder(ethereumdapp). add this content to the NameChange.sol Use truffle compile to compile the contract D:\blockchain\ethereum\ethereumdapp>truffle compile It creates a NameChange.json into the /build folder, this files contains the ABI details for the contract, meaning that Application Binary Interface. The Application Binary Interface (ABI) is a data encoding scheme used in Ethereum for working with smart contract. This can be used in later stage of this process. Till now, we have created smart contract and compiled. Now the time for deploy the contract to blockchain which is the ganache, the test blockchain. For that, we need to configure this project with the blockchain address and port number which is available in ganache settings. We can provide this information truffle.js or truffle-config.js in the project folder. Saving successful migration to network... ... 0xf36163615f41ef7ed8f4a8f192149a0bf633fe1a2398ce001bf44c43dc7bdda0 At this stage contract is deployed to the ganache and generated a contract address. This can confirmed in ganache trasaction list This is angular 5 app that we provide user interface to the user to interact with blockchain t. We use angular-cli commands to create / run the app. Change directory back a level and execute ng new ethereumdapp D:\blockchain\ethereum>ng new ethe Continue reading >>

More in ethereum