Blockchain Nanodegree 补充资源(随时更新)

版权声明:本栏目下的所有文章均为个人学习笔记,部分内容为直接搬运,供学习分享。如有版权问题请联系作者删除。 https://blog.csdn.net/xiaozhenliu/article/details/83993522

LevelDB

http://leveldb.org/

A light-weight, single-purpose library for persistence with bindings to many platforms.

JavaScript Promises规范

https://cn.udacity.com/course/javascript-promises--ud898

JavaScript ES6

https://cn.udacity.com/course/es6-javascript-improved--ud356

npm 淘宝镜像

npm install --registry=https://registry.npm.taobao.org
alias cnpm="npm --registry=https://registry.npm.taobao.org \
--cache=$HOME/.npm/.cache/cnpm \
--disturl=https://npm.taobao.org/dist \
--userconfig=$HOME/.cnpmrc"

IDE: VSCode

  • globally installed ESlint
  • change window scale under preference-settings
  • change font to 16pt under ppreference-settings

Configuring your project

  • Use NPM to initialize your project and create package.json to store project dependencies.
npm init
  • Install crypto-js with --save flag to save dependency to our package.json file
npm install crypto-js --save
  • Install level with --save flag
npm install level --save

Testing

To test code:
1: Open a command prompt or shell terminal after install node.js.
2: Enter a node session, also known as REPL (Read-Evaluate-Print-Loop).

node

3: Copy and paste your code into your node session
4: Instantiate blockchain with blockchain variable

let blockchain = new Blockchain();

5: Generate 10 blocks using a for loop

for (var i = 0; i <= 10; i++) {
  blockchain.addBlock(new Block("test data "+i));
}

6: Validate blockchain

blockchain.validateChain();

7: Induce errors by changing block data

let inducedErrorBlocks = [2,4,7];
for (var i = 0; i < inducedErrorBlocks.length; i++) {
  blockchain.chain[inducedErrorBlocks[i]].data='induced chain error';
}

8: Validate blockchain. The chain should now fail with blocks 2,4, and 7.

blockchain.validateChain();

Blockchain explorer

https://bitcoin.org/en/developer-glossary#section

Blockchain Developer Glossary

https://bitcoin.org/en/developer-glossary#section

JavaScript Promise

https://developers.google.com/web/fundamentals/primers/promises

Testnet:

https://en.bitcoinwiki.org/wiki/Testnet

Developer Test Application Examples

https://bitcoin.org/en/developer-examples#testing-applications

Bitcoin TestNet Sandbox Faucet

http://bitcoinfaucet.uo1.net/

Resources for Web Services

Need a review for Web Services or Javascript? Checkout these courses:

Postman

POSTMAN is an application that allow you to test your endpoints with Graphical User Interface application.

To install Postman, go to Postman, and download & install the appropriate package for your OS.

Once you have it installed locally in your computer let’s do this test:

Open Postman and paste: https://maps.googleapis.com/maps/api/directions/json?origin=Florence&destination=Milan&waypoints=Genoa|Bologna|Venice&optimizeWaypoints=true&key=[YOUR_API_KEY]

Then, check the parameters in the param button and hit SEND option. The application make the request and should show you the response from the server api like it is showed in the video below.

https://s3.cn-north-1.amazonaws.com.cn/u-vid-hd/0LSjbIaQq0E.mp4

Documentation: https://www.getpostman.com/docs/v6/

CURL

CURL is used in command lines or scripts to transfer data, so it can be used to test our RESTful APIs.

Let’s check a quick example:

curl -X GET \
  https://jsonplaceholder.typicode.com/todos/1 \
  -H 'Cache-Control: no-cache' \
  -H 'Content-Type: application/x-www-form-urlencoded' \

https://s3.cn-north-1.amazonaws.com.cn/u-vid-hd/9ctIhoEhsSs.mp4

Free Curl Book: https://curl.haxx.se/book.html

CSS and HTMLs

JSON

JavaScript Object Notation. JSON is a popular and simple format for storing and transferring nested or hierarchal data. It’s so popular that most other programming languages have libraries capable of parsing and writing JSON (like Python’s JSON library). Internet GET and POST requests frequently pass data in JSON format. JSON allows for objects (or data of other types) to be easily encapsulated within other objects. See the MDN or JSON.org for more details.

This is a fantastic deep dive from Jason Lengstorf about JSON and its ubiquitous use in the form of AJAX requests.

Why should I lint my JSON?

With a mix of nested curly braces, square brackets and commas, it’s easy to make mistakes with JSON. And mistakes mean bugs. Seriously, I mess up JSONs all the time. You might even be able to spot a bug in one of my JSONs in a video in this course…

If you’re generating JSON by hand, you should copy and paste your code into a JSON linter like jsonlint.com to quickly and easily find syntax errors. A linter is a piece of software that analyzes code for syntax errors. Some text editors, like Sublime Text, will automatically lint (or highlight) most syntax errors. But a JSON linter won’t miss any syntax errors and you can rest assured that your JSONs will be properly formatted.

DOM

https://developer.mozilla.org/en-US/docs/Web/API/Document_Object_Model

Nmap

You’ll also need to install ncat, which is part of the Nmap network testing toolkit. We’ll be using ncat to investigate how web servers and browsers talk to each other.

To check whether ncat is installed and working, open up two terminals. In one of them, run ncat -l 9999 then in the other, ncat localhost 9999. Then type something into each terminal and press Enter.

To exit the ncat program, type Control-C in the terminal. If you exit the server side first, the client should automatically exit. This happens because the server ends the connection when it shuts down.

You’ll be learning much more about the interaction between clients and servers throughout this course.

13 Node.js frameworks

https://nordicapis.com/13-node-js-frameworks-to-build-web-apis/

Framework Homepages

Expressjs.com

Sailsjs.com

Hapijs.com

Express.js Conclusion

This is an extremely powerful framework and there are many resources to help you get started. If you’re interested in learning more, they provide a great list of books and blogs on their site here.

Also, each of the modules along with their documentation are listed here.

Sails.js Conclusion

猜你喜欢

转载自blog.csdn.net/xiaozhenliu/article/details/83993522
今日推荐