Reader small image

You're reading from  Blockchain Quick Start Guide

Product typeBook
Published inDec 2018
Reading LevelIntermediate
PublisherPackt
ISBN-139781789807974
Edition1st Edition
Languages
Concepts
Right arrow
Authors (2):
Xun (Brian) Wu
Xun (Brian) Wu
author image
Xun (Brian) Wu

Xun (Brian) Wu is a senior blockchain architect and consultant. With over 20 years of hands-on experience across various technologies, including Blockchain, big data, cloud, AI, systems, and infrastructure, Brian has worked on more than 50 projects in his career. He has authored nine books, which have been published by O'Reilly, Packt, and Apress, focusing on popular fields within the Blockchain industry. The titles of his books include: Learn Ethereum (First Edition), Learn Ethereum (Second Edition), Blockchain for Teens, Hands-On Smart Contract Development with Hyperledger Fabric V2, Hyperledger Cookbook, Blockchain Quick Start Guide, Security Tokens and Stablecoins Quick Start Guide, Blockchain by Example, and Seven NoSQL Databases in a Week.
Read more about Xun (Brian) Wu

Weimin Sun
Weimin Sun
author image
Weimin Sun

Weimin Sun has 20 years' of experience working in the financial industry. He has worked for top-tier investment and commercial banks such as J.P. Morgan, Bank of America, Citibank, and Morgan Stanley, where he also managed large teams for developing IT applications. Weimin has also held corporate titles such as executive director and senior VP in some of these firms. Weimin has in-depth knowledge of the blockchain technology, data science, data architecture, data modeling, and big data platforms. He holds Ph.D, M.B.A and M.Sc degrees. He has co-authored Blockchain Quick Start Guide and published several statistical journal papers.
Read more about Weimin Sun

View More author details
Right arrow

Writing a campaign decentralized application


We just deployed our smart contract on our local Ganache blockchain environment. Now, we will start to write UI code to trigger smart contract functions through an RPC call. The source code for this chapter is available here:

https://github.com/PacktPublishing/Blockchain-Quick-Start-Guide/tree/master/Chapter04/CrowdFunding.

Selecting a web3 provider

When we load a web page, we need to connect to a web3 provider. If you have already installed a provider such as MetaMask, you can use your correct provider option, as follows:

App.web3Provider = web3.currentProvider;

In our crowdfunding example, for the sake of simplicity, we will directly connect to our local Ganache server, as follows:

App.web3Provider = new Web3.providers.HttpProvider('http://localhost:8545');

Loading account information

To load accounts, we define a drop-down menu with empty content, as follows:

<div class="form-group">
                <label for="exampleFormControlSelect1">...
lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Blockchain Quick Start Guide
Published in: Dec 2018Publisher: PacktISBN-13: 9781789807974

Authors (2)

author image
Xun (Brian) Wu

Xun (Brian) Wu is a senior blockchain architect and consultant. With over 20 years of hands-on experience across various technologies, including Blockchain, big data, cloud, AI, systems, and infrastructure, Brian has worked on more than 50 projects in his career. He has authored nine books, which have been published by O'Reilly, Packt, and Apress, focusing on popular fields within the Blockchain industry. The titles of his books include: Learn Ethereum (First Edition), Learn Ethereum (Second Edition), Blockchain for Teens, Hands-On Smart Contract Development with Hyperledger Fabric V2, Hyperledger Cookbook, Blockchain Quick Start Guide, Security Tokens and Stablecoins Quick Start Guide, Blockchain by Example, and Seven NoSQL Databases in a Week.
Read more about Xun (Brian) Wu

author image
Weimin Sun

Weimin Sun has 20 years' of experience working in the financial industry. He has worked for top-tier investment and commercial banks such as J.P. Morgan, Bank of America, Citibank, and Morgan Stanley, where he also managed large teams for developing IT applications. Weimin has also held corporate titles such as executive director and senior VP in some of these firms. Weimin has in-depth knowledge of the blockchain technology, data science, data architecture, data modeling, and big data platforms. He holds Ph.D, M.B.A and M.Sc degrees. He has co-authored Blockchain Quick Start Guide and published several statistical journal papers.
Read more about Weimin Sun