📜 [專欄新文章] 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.
👏 歡迎轉載分享鼓掌
server in node js 在 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.
server in node js 在 โปรแกรมเมอร์ไทย Thai programmer Facebook 的最佳貼文
วันนี้ข้อแนะนำ ไลบรารี่ JavaScript หรับงาน AI ด้าน Deep Learning (อยู่ในหมวดหมู่ Neural Networks)
ตามลิงค์นี้ http://cs.stanford.edu/people/karpathy/convnetjs/index.html
ข้อดีไลบรารี่นี้คือ
-ตัวอย่างโค้ดอ่านง่ายมาก ถ้าใครคอ Deep learning เห็นโค้ดปุ๊บ ก็จะเข้าใจโครงสร้าง model ทันที (คิดว่าไม่แพ้ไลบรารี่ตัวอื่น)
-มี demo เป็นกราฟฟิกให้เห็นภาพชัด ดีเยี่ยมยอดมากๆ
-ด้วยความเป็น JavaScript จึงติดตั้งใช้ง่าย ไม่ยุ่งยากอะไร เพียงแค่ดาวน์โหลดไลบรารี่ ก็เรียกใช้ได้เลย
-สามารถใช้ในฝั่งหน้าเว็บ Browser หรือฝั่ง Server side (Node.js)
ข้อเสีย คือ
- document ที่อธิบายน้อยไปหน่อย เลยไม่รู้จะเขียนอะไรได้พลิกแพลงมากกว่านี้หรือเปล่า
- ตัวอย่างโค้ด ที่มีคนเคยเอาไปใช้ก็น้อยไปหน่อย จะไม่เหมือนไลบรารี่ดังๆ ของภาษาอื่น มีตัวอย่างให้เห็นตรึม
- ยิ่งจะใช้โครงสร้าง Network ที่ซับซ้อนกว่านี้ (เช่น LSTM) ในเอกสารก็ไม่เขียนบอก ดูแล้วน่าจะทำไม่ได้เนอะ (เดา)
ถึงอย่างไร ก็เป็นอีกทางเลือกหนึ่ง น่าสนใจ สำหรับสายงานด้านนี้ครับ
Today, Javascript library recommendation for ai on deep learning (in neural networks category)
Follow this link http://cs.stanford.edu/people/karpathy/convnetjs/index.html
The Advantages of this library is
- sample code is very easy to read. If anyone has deep learning neck. See the code, you will understand the model structure immediately. (I think it's not allergic to other libraries)
- there is demo as graphics to see clear. Awesome.
- with Javascript, it's easy to install, no hassle. Just download the library and it can be used.
- can be used on browser or server side (Node. JS)
The disadvantage is
- the document that explains a little less. I don't know what to write. Can I flip the raft more.
- the sample of the code that someone used to use is a little bit. It won't look like the loud library of other languages. There is an example to see.
- the more complicated network structure (e.g. lstm) in the documents, I don't write. I can't do it. (guess)
It's another interesting choice for this line of work.Translated
server in node js 在 Node Js 起手式— 自架一個Web Server - 想吃燒肉 的相關結果
小時候覺得廣志是廢柴長大後才發現他真厲害有車有房有小孩. “Node Js 起手式— 自架一個Web Server” is published by 想吃燒肉. ... <看更多>
server in node js 在 Day7 - Node.js 內建的Web Server 介紹及使用 的相關結果
var http = require('http'); // 1 - 載入Node.js 原生模組http var server = http.createServer(function (req, res) { // 2 - 建立server // 在此處理客戶端向http ... ... <看更多>
server in node js 在 Express/Node introduction - 學習該如何開發Web 的相關結果
Node (或者說Node.js) 是一個開源、跨平台和允許開發者使用Javascript創造伺服器端工具和應用的執行環境。運行的目的是為了能在瀏覽器外使用,例如:直接執行在電腦或 ... ... <看更多>