forked from whiteblock/genesis
-
Notifications
You must be signed in to change notification settings - Fork 1
/
INSTALL
56 lines (39 loc) · 2.41 KB
/
INSTALL
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
Right now genesis will only work on Linux systems. In the future we plan on supporting Mac OS as well.
Step 1. Install `golang`
Step 2. Install `docker`
Step 3. Clone the repository
Step 4. Ensure that you have your the path to your ssh key in the genesis.yaml file, under the `"sshKey"` value. You may place this config file in /etc/whiteblock or ~/.config/whiteblock.
Step 5. Designate a user that genesis will operate on, the running user is the default, you can set this in the config file as `"sshUser"`
Step 6. Add this user to the `docker` group, so that the user has docker access. If the ssh-user does not have the ability to use docker, then Genesis will be unable to spin up the nodes.
Step 7. (Optional) For full functionality, give this user sudo access without a password. For example, if you are using the user `wb`, then
add the line `wb ALL=(ALL) NOPASSWD: ALL` to your `/etc/sudoers` file. You can do this by running the `visudo` command as root.
Step 8. Add the public key corresponding to the key from step 3 to the .ssh/authorized_keys file for the user chosen in step 4.
Step 9. Set `handleNodeSshKeys` to false in your config file, since you most likely should not need to propogate ssh key pairs to your nodes. The values for `nodesPrivateKey` and `nodesPublicKey` are for cases where you would like to have keys placed within the nodes, and allow ssh access directly to the nodes using the keys. However, when running on a single machine, this feature will not extend functionality.
Step 10. Run `go get` to install the dependencies of genesis
Step 11. Run `go build` to compile it.
Step 12. Run genesis, preferably in the background, as it is a daemon process.
Step 13. Interact with Genesis via its REST interface. You may get a warning about having to use a default value, this is fairly normal, and is just a safe guard in case you wanted to set that variable.
Step 14.
Example Build
```bash
curl -X POST http://localhost:8000/testnets/ -d '{ \
"servers":[1],\
"blockchain":"geth", \
"nodes":3,\
"images":["gcr.io/whiteblock/geth:master"],\
"resources":[{ \
"cpus":"", \
"memory":"" \
}], \
"params":{ \
"networkId":15468, \
"difficulty":100000, \
"initBalance":"100000000000000000000", \
"maxPeers":1000, \
"gasLimit":4000000, \
"homesteadBlock":0, \
"eip155Block":10, \
"eip158Block":10 \
} \
}'
```