Setting up Ethereum smart contract development using Parity on Ubuntu

Ethereum represents one of the most interesting technological developments in the past few years, taking the fundamental principles of a blockchain, and allowing executable “contracts” to be written. These contracts can be relatively simple but also incredibly powerful.

This post will walk you through setting up a development environment so that you can deploy and test your own smart contracts on the Ethereum test blockchain (“Ropsten”).

Installing Parity

Parity is a fast Ethereum browser, a tool which allows you to interact with the blockchain. On my laptop at least, it is significantly faster to synchronise and use than geth, which is probably the “standard” tool for interacting with the Ethereum blockchain.

To install for your platform, follow the instructions on the Parity site. If you use Mac OSX or Ubuntu, this is as simple as running the following command:

bash <(curl https://get.parity.io -Lk)
Connecting to the Ropsten testnet

To run Parity and connect to the testnet, use the following command:

parity — chain=ropsten

You’ll see a stream of stuff fly by in the terminal as Parity connects to the testnet, and starts the process of synchronising the blockchain. This might take a while…but rest assured it’s much faster than using the Ethereum Wallet app.

While you wait, you can still get started using Parity through its lovely web interface.

Setting up Parity

Parity comes with a really nice, fully featured web interface. This allows you to view and create wallets (where you keep your Ether), interact with other apps and to create or interact with Contracts.

By default, the parity web interface should be available at http://127.0.0.1:8180

The Parity web interface

When you first launch the web interface, it will guide you through creating a wallet. Use a strong password, but remember as this is on the testnet, the Ether you collect here aren’t anywhere near as valuable as “real” Ether.

Get some testnet Ether

To deploy and interact with a Contract on the blockchain (testnet or otherwise) you’ll need some Ether. Getting Ether on the testnet is a little easier than on the main blockchain, and there are a couple of options:

  • Try and find a working testnet faucet — you’ll enter your wallet address and (hopefully) receive some Ether
  • Ask nicely in the Ethereum gitter chat
  • Set up Ethminer to mine for some Ether

After a bit of time trying the first two options, I resolved to mine my own Ether, and it wasn’t too hard.

Setting up Ethminer

Ethminer is a separate tool which talks to the blockchain via Parity with the aim of validating the transactions that occur. As a reward for validating the transactions, you will occasionally receive some Ether. It’s not super quick to receive the Ether, but it’s pretty quick to setup, so I just left it for a few hours and came back to almost 100 Ether in my wallet. WooHoo!

To install in Ubuntu:

sudo add-apt-repository ppa:ethereum/ethereum
sudo apt-get update
sudo apt-get install ethereum ethminer

Now, to get everything hooked up, you’ll need to run a slightly modified Parity command. First, make a note of the wallet address you created in the web interface. Now restart parity using the following:

parity — chain=ropsten --rpc --author=<your_wallet_address>

Now in a new terminal window start ethminer:

ethminer -G

Note: The -G option enables GPU mining, which speeds it up. However, this does assume you have a suitable card and have set up your using the appropriate graphics card drivers etc. If it doesn’t work, try again without the -G.

Ethminer doing some mining

Again, you’ll see a wall of stuff stream past — this is ethminer starting to do its business. I left it for a few hours and came back to some Ether.

Writing a contract

Once you have some Ether, you can stop mining and start writing!

Parity has a built in contract development tool, which is pretty nice. Make sure you can see it by going first to the Settings in the Parity web interface and ensuring it is enabled.

Parity settings

Now you can go to the Contracts tab, hit the Develop button and you’re ready to go!

Developing an example smart contract

As for what to write, that’s for another article. You can get started with your own cryptocurrency and learning more about Solidity, one of the languages used to programme smart contracts. But you now have all the tools and some Ether!

原文地址:https://medium.com/@joshua_e_k/setting-up-ethereum-smart-contract-development-using-parity-on-ubuntu-abca4da3dce2

Explore the blockchain-based decentralized platform and understand how Ethereum works with Dapps examples Ethereum is a blockchain-based, decentralized computing platform that allows running smart contracts. This book provides a basic overview of how Ethereum works, its ecosystem, mining process, and the consensus mechanism. It also demonstrates a step-by-step approach for building decentralized applications. This book begins with the very basics of Blockchain technology. Then it dives deep into the Ethereum architecture, framework and tools in its ecosystem. It also provides you an overview of ongoing research on Ethereum, for example, Layer 1 and 2 scaling solution, Stablecoin, ICO/STO/IEO, etc. Next, it explains Solidity language in detail, and provides step-by-step instructions for designing, developing, testing, deploying, and monitoring decentralized applications. In addition, you’ll learn how to use Truffle, Remix, Infura, Metamask, and many other Ethereum technologies. It’ll also help you develop your own cryptocurrency by creating ERC20, and ERC721 smart contracts from scratch. Finally, we explain private blockchains, and you learn how to interact with smart contracts through wallets. What you will learn - Understand the concepts of blockchain and cryptocurrency - Master Ethereum development tools such as Truffle, Remix IDE and Infura - Delve into smart contract development - Develop DApps frontend using Node.js, React.js, and Web3js API - Learn Etherscan and other tools to secure and monitor smart contracts - Develop and debug smart contracts by working with Remix - Apply Truffle suite to compile, migrate, and unit test smart contracts - Explore smart contracts such as ERC20 token and decentralized digital market
Python网络爬虫与推荐算法新闻推荐平台:网络爬虫:通过Python实现新浪新闻的爬取,可爬取新闻页面上的标题、文本、图片、视频链接(保留排版) 推荐算法:权重衰减+标签推荐+区域推荐+热点推荐.zip项目工程资源经过严格测试可直接运行成功且功能正常的情况才上传,可轻松复刻,拿到资料包后可轻松复现出一样的项目,本人系统开发经验充足(全领域),有任何使用问题欢迎随时与我联系,我会及时为您解惑,提供帮助。 【资源内容】:包含完整源码+工程文件+说明(如有)等。答辩评审平均分达到96分,放心下载使用!可轻松复现,设计报告也可借鉴此项目,该资源内项目代码都经过测试运行成功,功能ok的情况下才上传的。 【提供帮助】:有任何使用问题欢迎随时与我联系,我会及时解答解惑,提供帮助 【附带帮助】:若还需要相关开发工具、学习资料等,我会提供帮助,提供资料,鼓励学习进步 【项目价值】:可用在相关项目设计中,皆可应用在项目、毕业设计、课程设计、期末/期中/大作业、工程实训、大创等学科竞赛比赛、初期项目立项、学习/练手等方面,可借鉴此优质项目实现复刻,设计报告也可借鉴此项目,也可基于此项目来扩展开发出更多功能 下载后请首先打开README文件(如有),项目工程可直接复现复刻,如果基础还行,也可在此程序基础上进行修改,以实现其它功能。供开源学习/技术交流/学习参考,勿用于商业用途。质量优质,放心下载使用。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值