Git Product home page Git Product logo

poa-dev-chain's Introduction

PoA-Dev-Chain

Home of the August Rice Fintech Owl network. Also known as the AFRO blockchain network.

Proof of Authority Development Chain

For this assignment, you will take on the role of a new developer at a small bank.

Your mission, should you choose to accept it, will be to set up a testnet blockchain for your organization.

To do this, you will create and submit four deliverables:

  • Set up your custom testnet blockchain.

  • Send a test transaction.

  • Create a repository.

  • Write instructions on how to use the chain for the rest of your team.

Background

You have just landed a new job at ZBank, a small, innovative bank that is interested in exploring what blockchain technology can do for them and their customers.

Your first project at the company is to set up a private testnet that you and your team of developers can use to explore potentials for blockchain at ZBank.

You have decided on setting up a testnet because:

There is no real money involved, which will give your team of developers the freedom to experiment.

Testnets allows for offline development.

In order to set up a testnet, you will need to use the following skills/tools we learned in class:

  • Puppeth, to generate your genesis block.

  • Geth, a command-line tool, to create keys, initialize nodes, and connect the nodes together.

  • The Clique Proof of Authority algorithm.

Tokens inherently have no value here, so we will provide pre-configured accounts and nodes for easy setup.

After creating the custom development chain, create documentation for others on how to start it using the pre-configured nodes and accounts. You can name the network anything you want, have fun with it!

Be sure to include any preliminary setup information, such as installing dependencies and environment configuration.

Instructions

Setup the custom out-of-the-box blockchain

  • Create a new project directory for your new network. Call it whatever you want!

  • Create a "Screenshots" folder inside of the project directory.

  • Create accounts for two (or more) nodes for the network with a separate datadir for each using geth.

  • Run puppeth, name your network, and select the option to configure a new genesis block.

  • Choose the Clique (Proof of Authority) consensus algorithm.

  • Paste both account addresses from the first step one at a time into the list of accounts to seal.

  • Paste them again in the list of accounts to pre-fund. There are no block rewards in PoA, so you'll need to pre-fund.

  • You can choose no for pre-funding the pre-compiled accounts (0x1 .. 0xff) with wei. This keeps the genesis cleaner.

  • Complete the rest of the prompts, and when you are back at the main menu, choose the "Manage existing genesis" option.

  • Export genesis configurations. This will fail to create two of the files, but you only need networkname.json.

  • You can delete the networkname-harmony.json file.

  • Screenshot the puppeth configuration once complete and save it to the Screenshots folder.

  • Initialize each node with the new networkname.json with geth.

  • Run the first node, unlock the account, enable mining, and the RPC flag. Only one node needs RPC enabled.

  • Set a different peer port for the second node and use the first node's enode address as the bootnode flag.

  • Be sure to unlock the account and enable mining on the second node!

  • You should now see both nodes producing new blocks, congratulations!

Send a test transaction

  • Use the MyCrypto GUI wallet to connect to the node with the exposed RPC port.

  • You will need to use a custom network, and include the chain ID, and use ETH as the currency.

custom-node

  • Import the keystore file from the node1/keystore directory into MyCrypto. This will import the private key.

  • Send a transaction from the node1 account to the node2 account.

  • Copy the transaction hash and paste it into the "TX Status" section of the app, or click "TX Status" in the popup.

  • Screenshot the transaction metadata (status, tx hash, block number, etc) and save it to your Screenshots folder.

  • Celebrate, you just created a blockchain and sent a transaction!

transaction-success

Create a repository, and instructions for launching the chain

  • Create a README.md in your project directory and create documentation that explains how to start the network.

  • Remember to include any environment setup instructions and dependencies.

  • Be sure to include all of the geth flags required to get both nodes to mine and explain what they mean.

  • Explain the configuration of the network, such as it's blocktime, chain ID, account passwords, ports, etc.

  • Explain how to connect MyCrypto to your network and demonstrate (via screenshots and steps) and send a transaction.

  • Upload the code, including the networkname.json and node folders.

Remember, never share your mainnet private keys! This is a testnet, so coins have no value here!

Hints

  • If you get stuck - try our step by step PoA Guide located here.

  • If you aren't seeing any movement in the wallet amounts in MyCrypto after sending/receiving transactions, try the following:

    • Terminate both nodes using control+C in the Node1 and Node2 terminal windows.
    • Change networks in MyCrypto to a Testnet such as Kovan.
    • Restart Node1 and Node2 in their terminal windows.
    • Reconnect to your network in MyCrypto.
    • Log into your wallet and refresh the amount.
  • If that doesn't help make sure you are sending a large enough sum of ETH to see actual movement in the digits. You may have to click on the amount itself to see the full value down to the WEI.

    before_after_click_mycrypto


© 2020 Trilogy Education Services, a 2U, Inc. brand. All Rights Reserved.

poa-dev-chain's People

Contributors

sudo-august avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.