metamask源碼學習導論

()MetaMask Browser Extension

https://github.com/MetaMask/metamask-extensioncss

這就是整個metamask的源碼所在之處,好好看看git

https://metamask.github.io/metamask-extension/這是源碼的類、對象等的詳細解釋github

 

1)瞭解整個代碼的學習流程,看:https://github.com/MetaMask/metamask-extension/blob/develop/docs/porting_to_new_environment.md服務器

Guide to Porting MetaMask to a New Environment

 

2)爲了可以更好地學習metamask的實現代碼,首先咱們要先學習stream

stream-handbook

英文版:https://github.com/MetaMask/metamask-extension/blob/develop/docs/porting_to_new_environment.md網絡

中文版:https://github.com/jabez128/stream-handbookapp

 

3)就好比說以前遊戲是想說直接將metamask嵌入到遊戲中,這樣就不用下載插件了,並且不是本身有一個服務器嗎,而後能夠像將以太坊主網ide

同樣將這個服務器上的區塊鏈網絡設置爲上面的一個可選項,更甚至就是玩這個遊戲就只有咱們這個服務器環境的選擇,基本上就是會直接連上咱們的服務器學習

下面就是若是你要添加一個定製的網絡的話,你須要更改的文件有哪一些區塊鏈

Adding Custom Networks

To add another network to our dropdown menu, make sure the following files are adjusted properly:ui

app/scripts/config.js
app/scripts/lib/buy-eth-url.js
ui/app/app.js
ui/app/components/buy-button-subview.js
ui/app/components/drop-menu-item.js
ui/app/components/network.js
ui/app/components/transaction-list-item.js
ui/app/config.js
ui/app/css/lib.css
ui/lib/account-link.js
ui/lib/explorer-link.js

You will need:

  • The network ID
  • An RPC Endpoint url
  • An explorer link
  • CSS for the display icon
相關文章
相關標籤/搜索