LoginSignup
8
6

More than 5 years have passed since last update.

Rasberry Pi2にEthereumクライアントをインストールしてJSON-RPCにトライ

Last updated at Posted at 2015-11-24

モチベーション

  • 新しくなったRasberryPi2というスペックが結構よさ気なハードウェア

最近流行りのIoT?とかに使えるらしい。

  • Ethereumをインストールすれば、なんかすごいことに使えるんじゃないか?

Macだとなんか容量が取られてしんどい

  • RasberryPiなら持ち運びも楽だ。

ということでトライしました。

RasberryPi2購入

買ったもの
* Raspberry Pi2本体(ケース付き);Amazonで6000円くらい
* マイクロSDカード16GB(これくらいないと足りなくなるらしい):1000円
* MacBookAirとインターネット共有:LANをUSBに変換するケーブル1300円
BUFFALO 10/100M USB2.0用 LANアダプタ (Wii、Wii U、MacBookAir動作確認済み) LUA3-U2-ATX

流れ

  1. Raspbain OSインストール
  2. go-thereumインストール
    https://github.com/ethereum/wiki/wiki/Raspberry-Pi-instructions
    http://raspnode.com/diyEthereumGeth.html

  3. ethereumブロックチェーンと同期(時間かかった)

  4. RPCサーバーとして起動
    consoleにて

>admin.startRPC("192.168.2.2(LAN内でのローカルIP)",8545,"*","web3,db,net,eth")
  1. Macからcurlコマンドで確認 API一覧はこちら https://github.com/ethereum/wiki/wiki/JavaScript-API

入力

curl -X POST http://192.168.2.2:8545 --data '{"jsonrpc":"2.0","method":"web3_clientVersion","params":[],"id":67}

出力

{"id":67,"jsonrpc":"2.0","result":"Geth/v1.3.1-f75becc2/linux/go1.4"}

とりあえずうまく呼べた。


EthereumをMeteorフレームワークで動かす

8
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
6