發表文章

目前顯示的是 2018的文章

[dApp] remix-ide v0.7.5 發生 remix connection from origin http://localhost:8080 rejected

很好這又是新版本的災情阿,主要是跟remixd的參數整合的問題 發現以下錯誤時 remix connection from origin http://localhost:8080 rejected 請去你的npm的路徑如下 [USER]\AppData\Roaming\npm\node_modules\remix-ide\bin 編輯 remix-ide 檔案 把以下幾行 server.listen(8080, '127.0.0.1', function () {}) var router = new remixd.Router(65520, remixd.services.sharedFolder, (webSocket) => {     remixd.services.sharedFolder.setWebSocket(webSocket)     remixd.services.sharedFolder.setupNotifications(folder)     remixd.services.sharedFolder.sharedFolder(folder)   }) router.start() 變成 server.listen(8080, '127.0.0.1', function () {}) 存檔 再啟動  remix-ide 啟動後再啟動 remixd -s <合約位置> --remix-ide http://127.0.0.1:8080 當然你必須自己先透過 npm 安裝  remixd

如果用node-gyp 6.4.1 在使用 truffle compile 會發生Cannot find module './build/Release/scrypt'

出現以下錯誤 Error: Cannot find module './build/Release/scrypt'     at Function.Module._resolveFilename (internal/modules/cjs/loader.js:580:15)     at Function.Module._load (internal/modules/cjs/loader.js:506:25)     at Module.require (internal/modules/cjs/loader.js:636:17)     at require (internal/modules/cjs/helpers.js:20:18)     at Object. (C:\Users\a2924\git\iogtoken\node_modules\scrypt\index.js:3:20)     at Module._compile (internal/modules/cjs/loader.js:688:30)     at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)     at Module.load (internal/modules/cjs/loader.js:598:32)     at tryModuleLoad (internal/modules/cjs/loader.js:537:12)     at Function.Module._load (internal/modules/cjs/loader.js:529:3) 很好這是新板的node-gyp 6.4.1的BUG 這時候要去修改 [專案位置]/ \node_modules\scrypt\index.js 修改以下程式碼 //var scryptNative = require("./build/Release/scrypt") var scryptNative = require("scrypt") 這樣就可以成功了

[Java][Gradle] 不能執行Task Multi-project EAR - "Cannot run tasks for included builds"

圖片
如果使用 Gradle 的 task 卻不能用,顯示 Multi-project EAR - "Cannot run tasks for included builds" 把專案刪除,不要實際把檔案刪除,只是在 Eclipse中的View 移除,重新匯入就可以了,但是確定錯誤已經移除,會發生這個錯誤,是因為專案原本有誤,解決了,但是Task 沒有同步更新

[Java][Gradle] 如果舊版的Gradle 到新版時會發生錯誤

圖片
如果原本是舊版的 gradle 換了新的 gradle,在Eclpse 中會發生錯誤,或是換了一台電腦會發生以下錯誤 Description Resource Path Location Type Unable to load annotation processor factory 'C:\Users\Kirin\.gradle\caches\modules-2\files-2.1\ch.qos.logback\logback-classic\1.1.11\ccedfbacef4a6515d2983e3f89ed753d5d4fb665\logback-classic-1.1.11.jar' for project SurfMJoystick SurfMJoystick Annotation processor factory path APT Build Problem 此時要到 把舊的 gradle cache 全選 Remove 這樣就可以解決了

[Dapp] how get a revert message / 在主鍊(mainet)上如何抓取 revert 或 require 的訊息

圖片
down vote favorite 像是以下的範例 用 revert 跳出錯誤訊息 contract Example { function foo (){ revert ( "hello world!!!" ); } } 在 remix IDE在 debug內就可以看了,只是上了主鍊後,要用下面方法看,如下 透過etherscans提供的工具 然後選擇"Remix Debugger". 然後大概要等5~10秒左右,如下圖把處理的Bar 移到最右邊 然後選擇下方的" Memory "選項,然後點擊"眼睛"得圖示 這樣就可以看到,你之前寫的錯誤訊息了 !!

發生 creation of ???? errored: transaction execution failed,但是又沒任何錯誤,該如何處理

圖片
用 Solidity remix 使用Javascript VM deploy 功能時發現已下錯誤時 creation of BullsAndCows pending... [vm] from: 0xca3...a733c to: BullsAndCows.(constructor) value: 0 wei data: 0x608...a0029 logs: 0 hash: 0xf18...0d95c Debug creation of BullsAndCows errored: transaction execution failed 但是compiler 都沒有錯誤,這時候通常是 合約已經寫了很長了但是 gas limt 設定太小了,我個人會在後面加上三個0 以確保是夠用的 , 反正Javascript VM 也不會損失什麼XD 設定如下

[Dapp]發生Attempting to run transaction which calls a contract function, but recipient address 0 xdfbcbf6aa1667c94542fa134f128978be31ba9e5 is not a contract address

當發生 Attempting to run transaction which calls a contract function, but recipient address 0 xdfbcbf6aa1667c94542fa134f128978be31ba9e5 is not a contract address 是因為之前compiler 已經上傳到不同網路,需要把build\contracts 的 *.json 當刪除 然後再重新 truffle compile 然後再 deploy truffle  migrate --reset --network development 就可以解決了

[git]快速用remote 最後的版本

git fetch origin git reset --hard origin/master

[Dapp] truffle migrate --network rinkeby 錯誤 Cannot find module 'ethereumjs-wallet/hdkey'

install npm install ethereumjs-wallet 但是現在 ethereumjs-wallet 有點問題,錯誤如下 Error: Cannot find module 'ethereumjs-wallet/hdkey' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:594:15) at Function.Module._load (internal/modules/cjs/loader.js:520:25) at Module.require (internal/modules/cjs/loader.js:650:17) at require (internal/modules/cjs/helpers.js:20:18) at Object. (/home/robert/Documents/GitHub/ME/ether-band-battles-work/solidity/node_modules/truffle-hdwallet-provider/index.js:2:13) at Module._compile (internal/modules/cjs/loader.js:702:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:713:10) at Module.load (internal/modules/cjs/loader.js:612:32) at tryModuleLoad (internal/modules/cjs/loader.js:551:12) at Function.Module._load (internal/modules/cjs/loader.js:543:3) at Module.require (internal/modules/cjs/loader.js:650:17) at require (internal/modules/cjs/helpers.js:20:18) at Object. (/

[Dapp] npm install truffle-hdwallet-provider 在Windows 除錯方法

在Linux 用的好好的  npm install truffle-hdwallet-provider 或是   npm install zeppelin-solidity 因為合作的關係在千百個不願意還是換到了windows,在Windows 卻發生很多問題 : 以下是確認步驟: 1.記得要先設定git的環境變數 ex: C:\Program Files\Git\cmd 2.發現錯誤 npm ERR! git fetch -a origin (https://github.com/debris/bignumber.js.git) fatal: unable to access 'https://github.com/debris/bignumber.js.git/': Couldn't connect to server 此時先去更新git的版本 3.發現錯物 gyp ERR! node-gyp -v v3.6.2 gyp ERR! not ok 此時要更新 node-gyp  npm install -g node-gyp@latest 4. 發現錯誤  Can't find Python executable "python", you can set the PYTHON env varia ble. 此時要去安裝python ,但是自己安裝除除非很懂python ,不然這裡推薦一個方法 用管理員身分 執行 利用windows的 powershell 去執行以下這段command npm install --global --production windows-build-tools 所有插件一次安裝到好

[Unity] LIGHT_ATTENUATION 2018 要換成 UNITY_LIGHT_ATTENUATION

2017 版本之前的程式碼 : Code (shader): float attenuation = LIGHT_ATTENUATION(i); 2018 版需要改成如下 Code (shader): UNITY_LIGHT_ATTENUATION(attenuation, i, i.posWorld.xyz); 記住不需要定義  attenuation 變數直接就可以使用了

[Ethereum區塊鏈] "GET /node_modules/web3/dist/web3.min.js" Error (404): "Not found"

會發生  "GET /node_modules/web3/dist/web3.min.js" Error (404): "Not found"  這個錯誤 請在 hello_web3 資料夾下執行      npm install 這樣才會把需要的套件安裝起來

[Ethereum區塊鏈] npm install truffle-hdwallet-provider error

使用 npm install truffle-hdwallet-provider or npm install truffle-hdwallet-provider 會發生 npm ERR! code ENOGIT npm ERR! No git binary found in $PATH npm ERR! npm ERR! Failed using git. npm ERR! Please check if you have git installed and in your PATH. npm ERR! A complete log of this run can be found in: npm ERR!     /root/.npm/_logs/2018-05-25T12_45_33_203Z-debug.log 這時候就是沒有安裝 git  , 請先安裝git 若讀者想使用二進位安裝程式安裝 Git 到 Linux,一般來說讀者可經由發行套件提供的套件管理工具完成此工作。若讀者使用 Fedora,可使用  yum : $ yum install git-core 若讀者在以 Debian 為基礎的發行套件,如:Ubuntu。 試試  apt-get : $ apt-get install git 這時候就可以解決了 PS 要先確定你的  npm 和 node 是否為最新版