forked from energicryptocurrency/gen2-energi
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVagrantfile
More file actions
71 lines (60 loc) · 3.04 KB
/
Copy pathVagrantfile
File metadata and controls
71 lines (60 loc) · 3.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
Vagrant.configure("2") do |config|
config.vm.define "builder" do |node|
node.vm.provider "virtualbox" do |v|
# TODO: better detect from host system
# - half RAM
# - all CPUs
# "safe" defaults for any modern developer's system
v.memory = ENV.fetch('VM_MEMORY', 4096)
v.cpus = ENV.fetch('VM_CPUS', 4)
v.gui = true
end
node.vm.box = "bento/ubuntu-18.04"
# gdbserver
node.vm.network "forwarded_port", guest: 2000, host: 2000, host_ip: "127.0.0.1"
# mainnet
node.vm.network "forwarded_port", guest: 9797, host: 9797, host_ip: "0.0.0.0"
# mainnet RPC
node.vm.network "forwarded_port", guest: 9796, host: 9796, host_ip: "127.0.0.1", guest_ip: "127.0.0.1"
# testnet
node.vm.network "forwarded_port", guest: 19797, host: 19797, host_ip: "0.0.0.0"
# testnet RPC
node.vm.network "forwarded_port", guest: 19796, host: 19796, host_ip: "127.0.0.1", guest_ip: "127.0.0.1"
node.vm.provision 'libdb4', type: "shell", inline:\
"add-apt-repository ppa:bitcoin/bitcoin;"\
"apt-get update;"\
"apt-get install -y libdb4.8-dev libdb4.8++-dev"
node.vm.provision 'cid', type: "shell", inline:\
"apt-get install -y python3-pip;"\
"/usr/bin/pip3 install -U futoin-cid"
node.vm.provision 'git', type: "shell", inline:\
"apt-get install -y --no-install-recommends git;"\
"sudo -H -u vagrant git config --global user.name '#{`git config --global user.name`}';"\
"sudo -H -u vagrant git config --global user.email '#{`git config --global user.email`}'"
node.vm.provision 'xorg', type: "shell", inline:\
"echo 'nodm nodm/enabled boolean true' | debconf-set-selections;"\
"apt-get install -y --no-install-recommends xorg fluxbox nodm;"
node.vm.provision 'debugger', type: "shell", inline:\
"apt-get install -y gdb gdbserver valgrind;"\
"/usr/bin/pip3 install gdbgui"
node.vm.provision 'bashrc', type: "shell", inline:\
"ensure_bashrc() { grep -q \"$@\" /home/vagrant/.bashrc || (echo \"$@\" >> /home/vagrant/.bashrc )};"\
"ensure_bashrc 'cd /vagrant';"\
"ensure_bashrc 'export DISPLAY=\":0\"';"\
"ensure_bashrc 'export GDBSERVER_COMM=0.0.0.0:2000';"\
"ensure_bashrc 'export GDBGUI_HOST=0.0.0.0';"\
"ensure_bashrc 'export GDBGUI_PORT=2000';"
node.vm.synced_folder(".", "/vagrant",
type: 'virtualbox',
owner: 'vagrant', group: 'vagrant',
create: true
)
VM_ENERGICORE_DATA = ENV.fetch('VM_ENERGICORE_DATA', '../energicore_vagrant_data')
FileUtils.mkdir_p VM_ENERGICORE_DATA
#node.vm.synced_folder(VM_ENERGICORE_DATA, "/home/vagrant/.energicore",
# type: 'virtualbox',
# owner: 'vagrant', group: 'vagrant',
# create: true
#)
end
end