圖靈鏈學院 Turing Chain Institute
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Write
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Help
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Write
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # 第一屆圖靈鏈學院:共同問答空間 ### 範例 #### Q1. 請問圖靈鏈學院的英文是什麼? > Turing Chain Institute #### Q2. 請問怎用hackmd? > https://www.markdownguide.org/cheat-sheet/ #### Q3. 請問每一個區塊的Merkle tree 中,一般會儲存(或壓縮)多少筆交易資料?比特幣&以太坊的區塊儲存資料筆數是否會不一樣?(Yen) > Bitcoin 是照區塊大小的限制來決定儲存多少交易資料,詳細數字可以參考這個連結:https://cryptoslate.com/bitcoin-transactions-per-block-at-all-time-highs/ > 照連結簡單來說,Bitcoin一個block可裝 2MB,若以一筆交易 570 bytes,則可裝約 3500 筆 > > Ethereum 則是取決於 Gas Fee (照以下三年前的連結是 3,141,592 gas),因此以太坊的礦工打包時會看一筆交易會不會消耗非常高額的 Gas 導致一個區塊只能裝下很少的交易,造成總手續費不高。由於以太坊上每筆交易所耗的 gas 不盡相同,因此也無法估算一個 block 能裝多少交易,詳細內容參考此連結:https://ethereum.stackexchange.com/questions/1106/is-there-a-limit-for-transaction-size/1110#1110 > 以上連結是三年前的,目前一個區塊的 gas limit 是 10,000,000,根據此 9/25 的連結:https://ethgasstation.info/blog/ethereum-block-size/ > (Shao) #### Q4. 有看見文章描述「在工作量證明PoW時,到底是怎樣比較Hash值的大小?」,請問為什麼要比較大小呢?不是先猜到Nonce的人就擁有該區塊嗎。(Jerry Lee) > 首先來看最簡化的例子:https://en.bitcoin.it/wiki/Proof_of_work > ![](https://i.imgur.com/UqX4dVl.png) > 依照上圖,假設目前的難度是2的240次方,我們要做的是找到一個 nonce 值,讓其他資料和 nonce 值串接起來後經過 hash function,再將 hash 值轉成的整數值會小於目標難度。 > > 具體的情況參考此連結:https://www.zhihu.com/question/22075219 > ![](https://i.imgur.com/SwcPSF0.png) > 這邊共有六個值,前五個值:版本號、前一個區塊的hash、merkle root hash、時間戳、目標難度,就是上一個截圖中的“Hello, world”。 這五個資訊要加上第六個值 nonce 隨機數後,一起進行 hash,就能跟第五個值目標難度 419668748 進行比較。 > > 至於為什麼在16進位時,數字前幾位有幾個 0 就代表難度呢?因為16進位代表的是一個數字有16種可能性 [0,15]:0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F。如果之前的難度是8個0,現在被改成9個,代表第九個數字一定要是0,不能是 [1,15] 之中的數字,也就是說猜中的可能性變成 1/16、或說難度提高了16倍。 > > 另外要注意的是,數字前幾位有越多的0,代表挖礦的難度越高,但是目標難度的「值會越小」,此處的特性有點反直覺。假設現在有兩組數字: 0x00FF = 15x16+15 = 255; 0x000F = 15。值為 0x00FF 時,前面有兩個0,代表難度較低,值卻較大;值為 0x000F 時,前面有三個0,難度較高、值較小。 > > 總結,比較大小是為了找出正確的 nonce 讓整個 hash 值小於目標難度,而先猜到 nonce 的礦工就會得到打包該區塊的獎勵。若想知道全部確切的步驟以及來龍去脈,可以參考第二個連結以及此連結:https://medium.com/swlh/how-does-bitcoin-blockchain-mining-work-36db1c5cb55d > 看完之後應該就會有完整的理解了! > (Shao) #### Q5. 在MBA有描述「下一個區塊信息量要大於之前區塊信息量」。我的理解是區塊鏈的大小變化主要因為該區塊的交易量不同因而不同,為什麼會出現這樣的描述呢?(Jerry Lee) >``` >區塊容量問題,由於區塊鏈需要承載複製之前產生的全部信息,下一個區塊信息量要大於之前區塊信息量,這樣傳遞下去,區塊寫入信息會無限增大,帶來的信息存儲、驗證、容量問題有待解決。 >``` > 我想你指的應該是這一段文字。這邊整段話的意思應該是指:區塊鏈每多紀錄一個區塊,這條鏈的**訊息量/交易量/大小**就更大,這樣才能解釋的通「區塊鏈需要承載複製之前產生的全部信息」、「這樣傳遞下去,區塊寫入信息會無限增大」。而單獨的這句話「下一個區塊信息量要大於之前區塊信息量」,我認為他的用詞不太正確,想表達的觀點應該只是前面那句「由於區塊鏈需要承載複製之前產生的全部信息」。 > (Shao) #### Q6. 關於註記詞,他是如何用12個單字存多筆私鑰的?(Amulin) #### Q7. 想請問是否能介紹 Nest_Framework 的用途以及demo Update TypeORM中步驟2-5該改成什麼數值?(Shao) #### Q7. 想請問除了把網址直接丟到Postman,以下fetch的指令是要用在什麼地方來取得api?我好菜好困惑qq(Shao) ![](https://i.imgur.com/BBJe9MA.png) #### Q7. 想請問NEST框架在證書中的角色(Hank) #### Q8. Nest_Framework(Harry) 1. 想請問在 Nest_Framework 中.env這個資料夾裡面的四個檔案差異在哪邊? 2. 「連接資料庫時,請至 .env 資料夾底下輸入對應的 DB 資訊 與對應的環境」,想請問DB資訊要輸入什麼? 3. [Nest Github](https://github.com/nestjs/nest) 4. [Nest Doc](https://docs.nestjs.com/) #### Q9. 來自 [React Hook](https://zh-hant.reactjs.org/docs/hooks-effect.html) 的範例。(Jerry Lee) 1. 閱讀到這裡時,幾乎只剩茫然,不知道**useEffect**要解決的問題為何。 目前的理解是,預設每一次 Render 時會執行,但是在畫面中使用 State 資料時,不是已經可實現實時刷新了嗎? 2. 並且在文件內多次提到**更新DOM**,爬文後仍對**DOM**不明瞭。 > 如果你以前有寫過 React, 那麼 hook 帶來最直觀的效益就是更簡化你的 code,讓你能用更閱讀易懂的方式就寫出一個 component。 > 如果你以前沒有寫過 React,那麼 hook 簡單的說就是能夠在你的 componenet(Function) 裡面加上各種魔法,像是 state 的變化 / 然後更好的去處理 effect 的變化。 > useEffect 要解決的問題就是 side effect。前端是屬於一個大雜燴的場所,會跟很多種不同的 api 介接,也因此你的 app 可能會有很多可能的不同變化這叫做 side effect。 useEffect 就是在每一次 render 完之後,去執行的 function,專門處理 side effect。 詳細可以看這個:https://ithelp.ithome.com.tw/articles/10185780 問了比樓上菜的問題...超級菜! 第一次接觸 React 跟 JavaScript,看了一些,學了一些,但還是很矇。Orz... ```javascript= import React, { useState, useEffect } from 'react'; function FriendStatus(props) { const [isOnline, setIsOnline] = useState(null); useEffect(() => { function handleStatusChange(status) { setIsOnline(status.isOnline); } ChatAPI.subscribeToFriendStatus(props.friend.id, handleStatusChange); // Specify how to clean up after this effect: return function cleanup() { ChatAPI.unsubscribeFromFriendStatus(props.friend.id, handleStatusChange); }; }); if (isOnline === null) { return 'Loading...'; } return isOnline ? 'Online' : 'Offline'; } ``` <br> #### 10.想請問(George) 1. 如果網頁要做i18n 就需要寫多份類似的網頁 還是會幫你自動轉換 3. vscode有什麼推薦前端開發的EXTENSIONS > react, Code Spell Checker, ES7, ESLint, TSLint, Prettier 5. 看完hook教學(但也是超級朦朧...) 但想問一下專案裡面hook的useLoginMode > 行6.會先有一個變數user new一個useContext 參數是UserContext的type 行6.這段語法是把用戶的狀態(type)當參數丟進來的意思嗎? 然後下面他是有一個useLoginMode的bool變數 參數mode會傳入user或issuer useEffect是一個hook方法 主要判斷user.loginMode是user還是issuer 如果[user.loginMode]的結果變了才會執行component update並利用Router.push幫用戶換頁導到正確頁面(想問component update在哪邊執行) 最後回傳bool變數 這樣理解對嗎?~感謝 ```javascript= import { useContext, useEffect } from 'react'; import { UserContext } from '@/contexts/user'; import { Router } from '@/i18n'; const useLoginMode = (mode: 'user' | 'issuer') => { const { user } = useContext(UserContext); useEffect(() => { if (user.loginMode !== mode) { Router.push(`/auth/login?mode=${mode}`); } }, [user.loginMode]); return user.loginMode === mode; }; export default useLoginMode; ``` <br> #### 11.想請問(Ben) 1.想請問因為我是寫Vue的,有把React官方文件看過並試著做過一次,概念很相似。目前感覺是各有各的優缺點, JSX應該可以解釋成Vue中的component中的template,但他用更直觀的方式去呈現他,在架構比較複雜的狀 狀下易讀性會更高更好理解? 2.關於useState and useEffect useState => 可以把他理解為自定義狀態的接口為一組的(更新值,初始值),用來更新props狀態? useEffect => 可以把它理解成生命週期的初始(componentDidMount)、更新(componentDidUpdate()、銷毀 (componentWillUnmount),這個hook主要是將這三種狀態連在一起,姑且不論狀態是否有更新,依然會初始化,但一更新就會重新渲染, 主要把變數記了起來,並且在return回傳的時候清除(更新)狀態? 3.Next.js可以將它理解為是Vue的Cli(快速建置工具),而Redux則是Vuex?(狀態管理) 以上的問題,感謝,還有時間真的不夠啊啊啊啊啊啊啊(太弱了)。 #### 12. 想請教關於「證書前端 code base」的問題 Jerry Lee 有問題的程式碼。[Link](https://github.com/Turing-Chain/certs.turingchain.tech/blob/master/components/auth/Login.tsx#L122) 我的理解這行應該是在解析目前使用者的角色,但不清楚如何解析的,關於每個帳號扮演的角色存放的資料是在哪裡呢? #### 13. 想請問用yarn就可以build起來了為什麼要還用docker,是因為要在GCP上面跑嗎?(yuhao github的Nest_Framework) (Harry) #### 14. (Shao) 後端組的問題,照上次聽起來yuhao有說typescript重要,但我不會javascript所以看不太懂。因此,我想從目標來問:在11/30之前,我們要學到什麼地步?是...協助把部分的code改成nest的框架就好,還是希望我們在某段時間之前要對某個程式語言有什麼程度的認識?由於javascript, nodejs, typescript這些我都沒有碰過,所以如果有明確的指示會比較好著手...(還是就從js開始?) #### 一點筆記的分享 by Shao:https://www.notion.so/9-23-9-26-8c927d78e27043b593cd4ce49810d72c

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully