Profile
서리

2018.04.09

#1. EOS.IO 스마트컨트랙트 개발을 위한 가상 머신 설치하기 by nsjames

Views 1143 Votes 7

 

 

 

Setup EOSIO Virtual Machine

 

1) Getting VirtualBox

 

2) Getting Ubuntu 16.04

 

3) Setting up the Virtual Machine

  • Minimum requirements: at least 8096 ( 8GB ) RAM to spare and 30-50GB disk space

  • Create new Virtual Machine

  • Select Linux as the OS

  • Select Ubuntu as the distribution

  • Double click the new Virtual Machine

  • Load the Ubuntu 16.04 disk as the startup disk and click "Start"

  • Select both "Download Updates" and "Install third party" for best coverage.

  • Select "Erase disk and continue".

  • Select timezone and fill out user data

  • Select your language and click "Install Ubuntu"

  • Let it finish installing and restart

  • Press enter when prompted "Please remove installation medium"

  • Open a Terminal window ( ctrl+alt+t )

  • sudo apt update

  • sudo apt upgrade

  • sudo apt-get install virtualbox-guest-dkms

  • sudo adduser <YOUR_USER_NAME_HERE> vboxsf

  • Close the Virtual Machine and make sure to "Power Off", not just to exit and save it's state.

 

4) Setting up host connection

  • Go back to VirtualBox Manager

  • Right click your new virtual box

  • Click Settings

  • Click Network

  • Select "Bridged Adapter" from the Attached To dropdown

 

5) Setting up shared folder

  • While still in the Settings panel click "Shared Folders"

  • Click the little plus sign folder icon on the right to add a shared folder

  • Create a folder for contracts somewhere on your local machine called "shared_contracts" and select it for the Folder Path

  • Select "Auto-Mount" and make sure "Read Only" is NOT selected

 

6) Finishing Basic Setup

  • Save your settings.

  • Restart the Virtual Machine. You can see your shared folder in "Files" now with "sf_" in front of it.

    • This is where you will be putting your contracts so that you can work on them in Windows but use them on Ubuntu without having to copy paste them between host/guest machines.

  • Click the Devices menu from the top again, click "Shared Clipboard" and select "Bidirectional"

    • This will allow you to copy/paste between guest/host and make it easier to follow these tutorials

  • Open a Terminal window ( ctrl+alt+t )

  • sudo apt install git

  • ifconfig | grep "inet addr" | grep Bcast

  • This should show you an IP ( something like 192.168.56.101 ). Grab it and save it somewhere.

 

7) Setting up EOSIO

( Refer to the EOSIO wiki for changes to this flow. )

  • Open a Terminal window ( ctrl+alt+t )

  • cd ~

  • sudo apt install git

  • git clone https://github.com/EOSIO/eos --recursive

  • cd eos

  • ./eosio_build.sh

    • If prompted to install dependencies type 1 and click enter to install them.

  • cd build

  • sudo make install

 

8) Testing EOSIO setup

  • Create a new empty document on your desktop to save some information for later ( I'll refer to it as "eostext" from now on )

  • Open a Terminal window ( ctrl+alt+t )

  • nodeos

  • Press "ctrl+c" to stop nodeos now that it has created a config.ini file.

  • Let's find the genesis file using sudo find / -name genesis.json

  • It should come up with a few options, save the one that has "/eosio/nodeos/config" in it to your eostext file, for instance "/home/nsjames/.local/share/eosio/nodeos/config/genesis.json"

  • sudo nano ~/.local/share/eosio/nodeos/config/config.ini

  • Towards the bottom of the config file there should be a private key starting with "5", save it in your eostext file.

  • Edit the config.ini file, adding/updating the following settings to the defaults already in place:

  • You can press "ctrl+w" to find things inside of nano.

 

	# Find and change ( This will be the IP you saved before, something like 192.168.56.101 )
	http-server-address = 192.168.56.101:8888

	# Fill this with the genesis path you save in your eostext file before.
	genesis-json = /path/to/eos/source/genesis.json

	# Find and switch to true
	enable-stale-production = true

	# Find, remove "#", and change to "eosio"
	producer-name = eosio

	# Copy the following plugins to the bottom of the file
	plugin = eosio::producer_plugin
	plugin = eosio::wallet_api_plugin
	plugin = eosio::chain_api_plugin
	plugin = eosio::http_plugin
	plugin = eosio::account_history_api_plugin

 

 

  • Press "ctrl+x", then "y" and press enter to save the config file.

  • Open a new Terminal Window ( ctrl+alt+t )

  • Run "nodeos" and let is keep running in it's own window.

  • Setup an alias for cleos now that we're using a different IP

  • sudo nano ~/.bash_aliases

  • Add the following line to the end of that file ( replace IPs with the one you entered into the config.ini ): alias cleos='cleos -H 192.168.56.101 -p 8888 --wallet-host 192.168.56.101 --wallet-port 8888'

  • source ~/.bashrc

 

9) Creating a wallet

  • cleos wallet create

  • This will create a wallet and return a password for you. Save it in your eostext file.

  • Create two sets of keypairs using cleos create key, Save each keypair in your eostext file and label the first "Owner Key" and the second "Active Key"

  • Import the private keys you just created. The private key from the config.ini should already be inside your wallet

  • cleos wallet import <PRIVATE_KEY>

  • cleos wallet keys

  • Make sure there are 3 private keys in your wallet, if it has 2 import the key from the config.ini

 

10) Creating an account

  • cd ~/eos/contracts/eosio.bios/

  • eosiocpp -o eosio.bios.wast eosio.bios.cpp

  • cleos set contract eosio ../eosio.bios -p eosio

  • cleos create account eosio currency <Owner Public Key> <Active Public Key>

  • cleos get account currency

 

11) Uploading and testing your first contract

  • cd ~/eos/contracts/currency

  • eosiocpp -o currency.wast currency.cpp

  • cleos set contract currency ../currency -p currency

  • cleos push action currency create '{"issuer":"currency","maximum_supply":"1000000.0000 CUR","can_freeze":"0","can_recall":"0","can_whitelist":"0"}' -p currency

  • cleos push action currency issue '{"to":"currency","quantity":"1000.0000 CUR","memo":""}' -p currency

  • cleos get table currency currency accounts

  • cleos push action currency transfer '{"from":"currency","to":"eosio","quantity":"20.0000 CUR","memo":"my first transfer"}' -p currency

  • cleos get table currency eosio accounts

  • cleos get table currency currency accounts

 

 SOURCE : https://github.com/nsjames/Scatter-Tutorials/blob/master/setup.md

 

Profile
9
Lv

1개의 Comment

Profile
veramonte
2018.04.10
WSL로 도전!!
Profile
No. Subject Author Date Views
28 EOS.IO 질문 재식 2018.09.04 92
27 EOSIO DEEP DIVE 페이스북 그룹 소개 smarteasy 2018.08.21 70
26 EOSJS 시작하기 ogaeng 2018.08.01 273
25 테스트넷(정글넷) 에서 account 생성할때 램이 부족하다고 오류가 뜹니다. 1 카이쿵 2018.07.17 340
24 EOS 1.0.5 테스트 노드 계정 생성 에러 3 kai 2018.06.20 444
23 메인넷 연결을 위한 EOS seed list, config.ini, genesis.json 정보 공유 드립니다. 1 팔오사이 2018.06.11 621
22 메인넷의 HTTP API 접근 방법 공유 드립니다. 1 팔오사이 2018.06.11 717
21 Dapp 개발 입문을 해보고 싶습니다. 2 프라다 2018.06.09 581
20 Dapp 과 Block 과의 관계에 대한 질문요. 2 어카우 2018.05.23 296
19 제2회 EOS 개발자 밋업을 개최합니다. 10 profile eric 2018.05.21 478
18 eos 소스 분석 모임을 만들고 싶습니다 이더킬러 2018.05.18 255
17 EOS Commander 가 dawn4.0 지원하도록 업데이트되었습니다. 3 profile eric 2018.05.17 305
16 EOS Dapp을 개발해 보고 싶어요. 2 카이쿵 2018.05.12 1165
15 BigInteger library for EOSIO profile eric 2018.05.02 290
14 JAVA/안드로이드 환경에서 EOS dApp/지갑 개발 4 profile eric 2018.05.02 1088
13 Docker로 EOS Node 쉽게 실행하기 4 profile LeafCat 2018.04.17 1111
12 cleos wallet create error 2 profile veramonte 2018.04.10 464
11 EOS Dawn 3를 설치하면서... 4 profile 변견 2018.04.09 824
#1. EOS.IO 스마트컨트랙트 개발을 위한 가상 머신 설치하기 by nsjames 1 profile 서리 2018.04.09 1143
9 EOS Source를 분석하는 모임을 만들고자 합니다. 10 profile 변견 2018.04.08 543