3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Ethereum開発環境構築:Windows編

Last updated at Posted at 2018-06-28

**Note:**記事は執筆時点(2018年6月)の内容です。技術の進歩が早く、今後陳腐化する可能性もあるのでご留意ください。

はじめに

  • Ethereumをローカル(Windows)で開発するのに必要な環境構築を行います

作業の流れ

  1. WSL(Ubuntu)のインストール
  2. WSL(Ubuntu)の起動
  3. インストール事前準備
  4. node/truffle/ganache-cliのインストール
  5. WSL(Ubuntu)の共有フォルダ設定
  6. Visual Studio Codeのインストール
  7. Visual Studio CodeのPluginのインストール

【手順1】WSL(Ubuntu)のインストール

  • Powershellを管理者モードで起動。以下コマンドにて、WSLを有効化する。
# WSLの有効化
$ Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
  • Microsoft Storeを起動
  • Ubuntuで検索して、インストール

Related Link

How to install Truffle & TestRPC on Ubuntu or Windows 10 with “Windows subsystem for Linux”

Install the Windows Subsystem for Linux

【手順2】WSL(Ubuntu)の起動

  • Ubuntuをスタートメニューから起動する
  • 初回起動時にUser/Passを聞かれるので、設定する

**Note:**UserはWindowsのユーザとは異なるユーザでよい

Related Link

WSL : Windows で Ubuntu環境 を実行する

【手順3】インストール事前準備

  • 起動したUbuntuにて、以下コマンドを実行

Ubuntuの最新化

# Ubuntuの最新化
$ sudo apt-get update -y && sudo apt-get upgrade -y

build essentialとpythonのインストール

# build essentialとpythonのインストール
$ sudo apt install build-essential python -y

nvmのインストール

# nvmのインストール
$ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash

ターミナルの再起動

# ターミナルの再起動
$ exec bash

【手順4】node/truffle/ganache-cliのインストール

  • 手順3のターミナルで、以下コマンドを実行

nodeのインストール

# nodeのインストール
$ nvm install node

truffle/ganache-cliのインストール

# truffle/ganache-cliのインストール
$ npm install -g truffle ganache-cli

【手順5】WSL(Ubuntu)の共有フォルダ設定

  • Windows側とUbuntu側でファイルのやりとりするフォルダを作成する
  • c:\Users<username><your-folder>にフォルダ作成

bashのカレントディレクトリを変更する

# viで.bashrcを編集
$ vi .bashrc

# viにて編集
cd /mnt/c/Users/<username>/<your-folder>  をファイルの最後に追加

**Note:次回ログイン時に、カレントディレクトリが/mnt/c/Users/<username>/<your-folder>**になる

【手順6】Visual Studio Codeのインストール

  • Visual Studio Codeをダウンロードしてインストール

**Note:**インストール済みの場合は、本手順はスキップ

Related Link

Visual Studio Code

【手順7】Visual Studio CodeのPluginのインストール

  • 以下のプラグインをインストール

    • solidity
    • Material Icon Theme
  • Icon Themeを有効化

    • File –> Preferences –> File Icon Theme

**Note:**Material Icon ThemeのダウンロードとIcon Themeは必須ではない。

Related Link

Configuring Visual Studio code for Ethereum Blockchain development

3
1
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
3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?