• j9_345670
  • 91.4MB
  • zip
  • 0
  • VIP专享
  • 0
  • 2022-06-05 07:29
区块链 运行权限证明区块链 权限证明(PoA)算法通常用于私有区块链网络,因为它需要预先批准或投票批准可以批准交易(封签)的账户地址。 由于必须批准帐户,因此我们将生成两个具有新帐户地址的新节点,这些地址将用作我们预先批准的封闭者地址。 使用geth为网络的两个节点创建帐户,并为每个节点分别创建一个数据datadir 。 ./geth --datadir node1帐户新 ./geth --datadir node2帐户新 接下来,生成您的创世块。 运行puppeth ,为网络命名,然后选择选项以配置新的创世块。 选择Clique (Proof of Authority)共识算法。 将第一步中的两个帐户地址一次粘贴到要密封的帐户列表中。 再次将它们粘贴到帐户列表中以进行预注资。 PoA中没有集体奖励,因此您需要预先投入资金。 您可以选择no使用wei为预编译帐户(0x1 ..
# Unit 18 | Homework Assignment: Building the Blockchain The blockchain domain is rapidly changing. Even those in a highly technical role must stay abreast of what is happening in the digital finance landscape as many FinTech companies are using and creating tools and services that are powered by blockchain. As a FinTech professional in these changing times, it's important to not only be aware of the advancements happening within the FinTech blockchain space, but to also understand the process for developing your very own blockchain. This homework will be a two-part series in which you will first create a case study on a Canadian FinTech blockchain company. Then, you wil develop your very own blockchain. ## Before You Begin 1. Create a new GitHub repo called `blockchain-homework`. Then, clone it to your computer. 2. In your local git repository, create a directory for both of the Blockchain activities. Use folder names that correspond to the activities: **Blockchain Case Study** and **POA Development Chain**. 3. Push the above changes to GitHub. ## Blockchain Case Study For this part one assignment, your task is to create a case study that analyzes how a Canadian FinTech blockchain company is using technology to solve a standing financial problem in Canada. In this homework assignment, you will: * Select a Canadian FinTech blockchain company that interests you. * Research the domain and company. * Write a detailed case study of the company. * Upload your case study to your git repository. Reference the example [TokenFunder Case Study](Resources/TokenFunder_Case_Study.md) to get an understanding of the format and content that you'll need to write. This assignment will challenge you to learn more about Canadian advancements in the blockchain industry. ## Proof of Authority Development Chain For part two of 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](Images/custom-node.png) * 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](Images/transaction-success.png) #### 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](Resources/POA-Blockchain-guide.md). * 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. --- © 2020 Trilogy Education Services, a 2U, Inc. brand. All Rights Reserved.
    • blockchain_consensus_algorithm:代码实现五种区块链共识算法 The code implements
      近期学习总结并代码实现的五大区块链共识算法,如果发现bug或者理解方面的错误请不吝指教 :) POW(工作量证明) POS(权益证明) DPOS(股份授权证明) PBFT(实用拜占庭) RAFT
    • 密码学与共识算法
    • PaxosDemo_py:区块链共识算法Paxos实战
      基于Python的区块链共识算法Paxos实战 0.前言 本文记录笔者学习和理解区块链共识算法Paxos的点滴,文章比较长,需要耐心来细细琢磨,笔者也是苦战了一个周末才对此有那么一点初步了解,有问题的地方请不吝斧正! 1....
    • 区块链算法—共识算法
      本套课程带你认识常用的共识算法及其代码实现; 课程简介 在区块链网络中,谁获得记账权是通过全网节点间所达成的共识来决定的; 共识算法即这种“共识”的算法/代码体现; 共识算法解决了拜占庭将军问题,即让一...
    • 区块链基础:共识算法
    • 共识算法—PoW算法及其实现
      本套课程带你认识常用的共识算法及其代码实现 课程简介 @课程收益: 掌握劳动量证明(PoW)算法及其实现;  课程配套学习资料,建议学员学习过程中跟着视频教程实操,可理解更加深入。技术问题可在下方留言,每晚8...
    • go语言实现工作量证明(POW)共识算法
    • 30种共识算法完全列表
      30种共识算法完全列表 30种共识算法完全列表 30种共识算法完全列表
    • 区块链paxos算法.zip
    • SIM800C_MQTT.rar