📜 [專欄新文章] Solidity Weekly #16
✍️ mingderwang
📥 歡迎投稿: https://medium.com/taipei-ethereum-meetup #徵技術分享文 #使用心得 #教學文 #medium
Expo (React Native) + web3.js 1.0.x 開發手機 dApps
今天要介紹如何利用 Expo,來撰寫手機 dApp。基本上,如果想做到去中心化的 dApp,期望能將 Javascript app 能盡可能的包裹成單一檔案,用去中心化檔案儲存空間,讓手機或網頁直接下載來執行。手機版的 App,也可用 Expo 做到類似的結果,但目前 Expo 還是有點中心化;當然利用 cipherbrowser 或 status.im 等方式開發也行,只要你不怕被 vendor lock-in。
Expo 是一種 MIT license 的開放源始碼,讓 React Native 開發與部屬更為簡單,讓用戶只要先下載 iOS 或 Android 的 Expo clients。就很容易透過 exp://xxx 的 URI 來執行。因為 React Native 跟 web3.js 都是用 Javascript 語言,因此很容易整合。(註:web3.js 也不是唯一連區塊鏈的方法,只是搭配 Remix,能產生 web3 程式片段,所以比較方便)
但由於 React Native 非 100% 與 node.js 相容,因此有些 workarounds 要做,例如 node 內建 standard library 裡的 crypto (註 2),Buffer 等 React Native 就沒有,所以這裏還不是很方便。(喜歡 truffle 的人,也可參考 react-native-box 來做,但也還沒很成熟)
Mobile dApp 有個問題是,你(用戶)沒有 localhost 自己的 node 當成 web3 provider 可以連線到 Ethereum 區塊鏈。所以有幾種選擇,最簡單的就是要再相信某一個 node,這裡用 infura (與 Metamask 同一家公司),也許還要搭配其他方法,讓這 dApp 不要依賴任何 server 也能運作。但如果要用到 HDWallet,還是要用 truffle-hdwallet-provider 來當 web3 provider,也能同時避開沒有 crypto 的問題。
使用 Expo 開發畫面
註 1:直接用 React Native 開發,不容易除錯,且速度慢。所以建議程式邏輯可以考慮用 React Native for Web 在 CodeSandbox.io 先做開發和測試,最後再搬到 Expo 的 React Native 裡。(或直接在 codesandbox.io 開發 Expo 程式也行)
CodeSandbox
註 2:例如當在 Expo 的環境裡使用到 web3.eth.accounts.create() 時,會出現以下 error,但其他地方(Condsandbox)不會。
解決方法,不要用 web3 provider 改用 truffle-hdwallet-provider (在 React Native 裡要用 Promise.promisifyAll 繞過問題)
var HDWalletProvider = require("truffle-hdwallet-provider"); var mnemonic = "manage velvet tide tube object spin identify neither foot together wagon tip"; var hd = new HDWalletProvider(mnemonic, "https://mainnet.infura.io/"); web3 = new Web3(hd); Promise.promisifyAll(web3.eth); let accounts = await web3.eth.getAccountsAsync();
Solidity Weekly #16 was originally published in Taipei Ethereum Meetup on Medium, where people are continuing the conversation by highlighting and responding to this story.
👏 歡迎轉載分享鼓掌
「js object for」的推薦目錄:
- 關於js object for 在 Taipei Ethereum Meetup Facebook 的最佳解答
- 關於js object for 在 โปรแกรมเมอร์ไทย Thai programmer Facebook 的最讚貼文
- 關於js object for 在 ienaeliena.com Facebook 的最讚貼文
- 關於js object for 在 Check if a value is an object in JavaScript - Stack Overflow 的評價
- 關於js object for 在 JavaScript Objects 的評價
- 關於js object for 在 Convert array of objects to an object in javascript 的評價
- 關於js object for 在 The Best Way to Add Properties to an Object in JavaScript? 的評價
- 關於js object for 在 JavaScript object for的問題包括PTT、Dcard、Mobile01 的評價
- 關於js object for 在 JavaScript object for的問題包括PTT、Dcard、Mobile01 的評價
- 關於js object for 在 JavaScript object for的問題包括PTT、Dcard、Mobile01 的評價
- 關於js object for 在 zloirock/core-js: Standard Library - GitHub 的評價
js object for 在 โปรแกรมเมอร์ไทย Thai programmer Facebook 的最讚貼文
แจกฟรีหนังสือ Node.js ของไมโครซอฟต์
[ฟรี] Building Cloud-Native Applications with Node.js and Azure 📖
เราจะทำตามสัญญา.. eBook ฟรีทุกวันศุกร์มาแล้วค่าา รอบนี้เอาใจสาย Node.js กันบ้าง กับหนังสือจัดเต็ม 71 หน้า แถมบทความอ่านง่าย
- พื้นฐานการพัฒนาแอป Node.js
- แนะนำข้อดีของแอปแบบ Native บน Cloud
- ขั้นตอนในการพัฒนาง่าย ๆ ตั้งแต่ Hello World และ Best Practice
- ตัวอย่างสถาปัตยกรรมที่นักพัฒนาสาย Node.js ชอบใช้บน Azure
รวมทั้ง Web App บน Linux / Kubernetes / Azure Cosmos DB / Azure Database สำหรับ MySQL และ PostgreSQL / Redis Cache / บริการเก็บข้อมูลแบบ Object
- ตัวอย่างโค้ดวิธีการใช้ Blog Storage จาก Node.js
- สำรวจบริการต่าง ๆ ของ Microsoft Azure
--------------------
โหลดเลย:
http://msft.social/kBkEge
คอร์สฟรีสำหรับนักพัฒนา Node.js:
https://azure.microsoft.com/…/learning-pa…/node-js-developer
ลิงก์ตัวอย่างแอป Hello World บน GitHub:
https://github.com/Azure-Samples/nodejs-docs-hello-world
--------------------
แถมบทความเพิ่มเติม:
1. เข้าใจ NodeJS ง่ายๆ สำหรับคนทำเว็บ
โดย Next Flow: Web, Cross Platform App, & Bot Platform Solution
http://nextflow.in.th/2016/node-js-for-web-developer
2. Node.js และ VS Code
ภาษาอังกฤษ:
https://code.visualstudio.com/docs/nodejs/nodejs-tutorial
ภาษาไทย โดยอ.บอนด์ Microsoft MVP ผู้ก่อตั้ง CodeBangkok:
https://medium.com/…/node-js-applications-with-visual-studi…
--------------------
ไม่พลาด Update จาก Microsoft
😸 ติดตามพวกเราบน Twitter twitter.com/mspthailand
#Microsoft #eBook #MSPTH
js object for 在 ienaeliena.com Facebook 的最讚貼文
JAWATAN KOSONG WEB DEVELOPER & IOS/ANDROID SOFTWARE ENGINEER
.
Email your Resume at [email protected]
.
WEB DEVELOPER
.
Ionnex Team is looking for a highly motivated, energetic and passionate web developer to join our team. As a Web Developer, you will specialize in building elegant product that brings the best user experience to millions of people anytime and anywhere. If you are interested in joining a team of passionate, talented engineers in web space, who like to work hard and play hard, we look forward to hear from you soon!
Responsibilities:
- Full-stack web/mobile application development with a variety of languages including but not limited to PHP, JavaScript and Java.
- Gather users’ requirements and translate it into system design.
- Design, code, test, debug and document software, according to functional requirements.
- Support, maintain and document software functionality
- Evaluate and identify new technologies for implementation
- Strong and effective inter-personal and communication skills and the ability to interact professionally with a diverse group of clients.
.
.
Requirements:
.
- Candidate must possess at least a bachelor’s Degree in Computer Science or IT/ Software related field.
- Required Skill(s): HTML, CSS, Javascript, .Net in C#, Boostrap Framework, Yii Framework, Laravel Framework, Node JS
- Familiar with following Skill is a plus: swift, objective C, java, kotlin, experience in server maintainance
- Willing and passionate to learn new technology.
- Able to work independently.
- Fresh graduates are welcome to apply.
iOS / Android Software Engineer
We are seeking full-time iOS / Android Engineers to help take our iOS & Android products to the next level. As an iOS / Android Software Engineer, you will specialize in building elegant products that bring the best user experience to millions of peoples anytime and anywhere. We are looking for engineers with strong experience developing applications on the iPhone or iPad using the iOS SDK / Android using the Android SDK. If you are interested in joining a team of
passionate, talented engineers in the mobile space, who like to work hard and play hard, we look forward to hearing from you soon!
.
.
Responsibilities:
.
- Work closely with our product and design teams to customize the mobile user experience for
the iOS & Android platform
- Write client-side code, create fast, easy-to-use, high volume production applications, and
develop prototypes quickly
- Prototype new and redesign features
- Analyze and optimize UI and back-end application code for efficiency and performance
- A focus on UI design principles and making apps work intuitively
- Contribute best-in-class programming skills to develop highly innovative, consumer-facing mobile products.
.
Requirements:
.
- 1+ years of object-oriented software development experience
- 1+ years mobile application development at the user interface and system levels
- 1+ years building iPhone or iPad using Objective-C/C++ or Android applications in Java
- Knowledge of iOS SDK performance tools and optimisation techniques
- Excellent problem solving, critical thinking and communication skills
- The ability to collaborate with the design and back-end engineers teams to ensure a great experience for our users.
- Be able to write elegant, readable, and well-documented code.
js object for 在 JavaScript Objects 的推薦與評價
In JavaScript, an object is an unordered collection of key-value pairs. Each key-value pair is called a property. The key of a property can be a string. ... <看更多>
js object for 在 Convert array of objects to an object in javascript 的推薦與評價
For the desired output , you essentially need a JS Map data structure. Why are we using a Map over a JS object ... ... <看更多>
js object for 在 Check if a value is an object in JavaScript - Stack Overflow 的推薦與評價
... <看更多>