Skip to content
This repository was archived by the owner on Feb 21, 2024. It is now read-only.

Commit 56eaa13

Browse files
authored
Merge pull request #16 from masa-finance/v1.01
V1.01
2 parents 6c6ee5c + 4a05149 commit 56eaa13

File tree

6 files changed

+165
-202
lines changed

6 files changed

+165
-202
lines changed

.DS_Store

-10 KB
Binary file not shown.

.gitignore

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,12 @@
1616
**/geth
1717
**/keystore
1818
**geth.ipc
19-
# geth node build files
19+
**/build/bin
20+
# geth node build files
21+
22+
# OS generated files #
23+
######################
24+
*.DS_Store
25+
**.DS_Store
26+
.DS_Store
27+
.DS_Store?

README.md

Lines changed: 155 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,53 @@
1-
# Masa Testnet Node V1.0
2-
3-
## Get An OpenVPN File
4-
You must must be connected to our OpenVPN network in order to join the Masa Testnet and access bootnodes and node IP's. Please reach out to an admin on Discord (https://discord.gg/SXwRKNMc) to get an OpenVPN file! Please download the OpenVPN Connect client to connect to the Masa Testnet cluster [here](https://openvpn.net/vpn-client/)
5-
6-
### Check you can access the node IP range througe OpenVPN
7-
Check your routing table by running `netstat -rn` from the command line to ensure you can access the Masa Testnet. You will see `172.16.239/24 10.254.0.17 UGSc utun4` if you have OpenVPN setup correctly.
8-
```sh
9-
netstat -rn
10-
11-
Internet:
12-
Destination Gateway Flags Netif Expire
13-
default 192.168.1.1 UGScg en0
14-
10.254.0.1/32 10.254.0.17 UGSc utun4
15-
10.254.0.16/30 10.254.0.18 UGSc utun4
16-
10.254.0.17 10.254.0.18 UH utun4
17-
127 127.0.0.1 UCS lo0
18-
127.0.0.1 127.0.0.1 UH lo0
19-
169.254 link#6 UCS en0 !
20-
172.16.239/24 10.254.0.17 UGSc utun4
21-
```
22-
1+
# Masa Testnet Node V1.01
2+
## Release Date
3+
February 22nd, 2022
4+
## Roadmap & Todo's
5+
The Masa Node UI is in alpha and will get incremental releases, please report all bugs you find to [email protected] or submit an issue [here](https://github.com/masa-finance/masa-node-v1.0/issues)
6+
# Run With Docker
7+
This guide will get you up and running using docker. If you want to us the geth binary please navigate to the bottom section of the page [here](#run-with-geth).
238
## Get Docker
249
1. Install Docker (https://www.docker.com/get-started)
2510
- If your Docker distribution does not contain `docker-compose`, follow [this](https://docs.docker.com/compose/install/) to install Docker Compose
2611
- Make sure your Docker daemon has at least 4G memory
27-
- Required Docker Engine 18.02.0+ and Docker Compose 1.21+
28-
29-
30-
## Install The Masa Testnet Node v1.0
12+
- Required: Docker Engine 18.02.0+ and Docker Compose 1.21+
13+
## Install The Masa Testnet Node v1.01
14+
The Docker compose file also launches the Node UI which can be accessed at the following URL
15+
`http://localhost:3000`
3116

17+
Navigate here to interact with the node
3218
```
33-
git clone https://github.com/masa-finance/masa-node-v1
34-
cd masa-node-v1
19+
git clone https://github.com/masa-finance/masa-node-v1.0
20+
cd masa-node-v1.0
3521
```
36-
Directory structure
22+
### Directory structure
3723
```
3824
masa-node-v1/
3925
├── network
4026
│ ├── testnet
4127
│ ├── genesis.json
4228
├── node
4329
│ ├── data
44-
├── node-ui
30+
├── src
31+
│ ├── ui
32+
│ ├── geth files
33+
│ ├── ...
4534
├── docker-compose.yml
4635
├── genesis.json
4736
```
48-
49-
37+
## Run Docker
5038
1. Run ` PRIVATE_CONFIG=ignore docker-compose up -d`
5139
```sh
52-
cd masa-node-v1
40+
cd masa-node-v1.0
5341
PRIVATE_CONFIG=ignore docker-compose up -d
5442
```
5543
1. Run `docker ps` to verify that you masa-node container is **healthy**
5644
1. Run `docker logs <container-name> -f` to view the logs for a particular container
5745

5846
1. __Note__: to attach geth to your node Javascript console (use the same container id or name from `docker ps`
5947
```sh
60-
docker exec -it masa-node-v10_masa-node_1 geth attach /qdata/dd/geth.ipc
48+
docker exec -it masa-node-v10_masa-node_1
49+
geth attach /qdata/dd/geth.ipc
50+
6151
Welcome to the Geth JavaScript console!
6252

6353
instance: Geth/node1-istanbul/v1.9.24-stable-d5ef77ca(quorum-v21.7.1)/linux-amd64/go1.15.5
@@ -72,46 +62,155 @@ masa-node-v1/
7262
```sh
7363
docker-compose down
7464
```
75-
7665
## Troubleshooting Docker
7766
1. Docker is frozen or containers crash and reboot
7867
- Check if your Docker daemon is allocated enough memory (minimum 4G)
68+
### Additional Bootnodes
69+
Masa operates several bootnodes, one is already included in the Docker file by default. If you are having issues connecting to the bootnode please use an alternaitve from the list below.
70+
71+
We are also looking for community run bootnodes to add to our list. Please reach out to us on Discord or Submit a PR to this repo if you want to add a bootnode to the community list.
72+
#### Masa Bootnodes
73+
```
74+
enode://ac6b1096ca56b9f6d004b779ae3728bf83f8e22453404cc3cef16a3d9b96608bc67c4b30db88e0a5a6c6390213f7acbe1153ff6d23ce57380104288ae19373ef@54.146.254.245:21000
75+
76+
enode://91a3c3d5e76b0acf05d9abddee959f1bcbc7c91537d2629288a9edd7a3df90acaa46ffba0e0e5d49a20598e0960ac458d76eb8fa92a1d64938c0a3a3d60f8be4@54.158.188.182:21000
77+
78+
enode://d87c03855093a39dced2af54d39b827e4e841fd0ca98673b2e94681d9d52d2f1b6a6d42754da86fa8f53d8105896fda44f3012be0ceb6342e114b0f01456924c@34.225.220.240:21000
7979
80+
enode://fcb5a1a8d65eb167cd3030ca9ae35aa8e290b9add3eb46481d0fbd1eb10065aeea40059f48314c88816aab2af9303e193becc511b1035c9fd8dbe97d21f913b9@52.1.125.71:21000
81+
```
82+
#### Community Bootnodes
83+
Submit a PR to add a bootnode to the community list [here](https://github.com/masa-finance/masa-node-v1.0/pulls).
84+
## Node Syncing
85+
It can take some time for your node to fully sync to the Masa Testnet 2.0 - please be patient while your node catches up with the most recent blocks.
8086
## Node UI
8187
### Specification
82-
- Next.js & Typescript
88+
- React.js & Typescript
8389
- Docker for deployment
84-
### Config
85-
Next.js is launched in Docker using the following `Dockerfile`
90+
- The Node UI runs when you deploy using the Docker compose files above
91+
Navigate to you local host to interact with the Masa Node
92+
`http://localhost:3000`
93+
# Run With Geth
94+
To run from source follow these steps
95+
## Clone the repository and build the source:
96+
```
97+
git clone https://github.com/masa-finance/masa-node-v1.0
98+
cd masa-node-v1.0/src
99+
make all
100+
```
101+
**`make all` must be run from within the src folder**
102+
## Run the tests:
103+
```
104+
make test
105+
```
106+
## Add PATH
107+
### Method 1
108+
Binaries are placed in `$REPO_ROOT/build/bin`. You must add the `bin` folder to `PATH` to make `geth` and `bootnode` easily invokable from the command line. For example, if `Users/yourname/masa-node-v1.0` is the location you have cloned the masa-node repository to on your computer. In your terminal run
109+
```
110+
sudo nano /etc/paths
111+
or
112+
export PATH=$PATH:$REPO_ROOT/build/bin
113+
```
114+
Remember to source your $PATH or restart the terminal. Run `echo $PATH` from the command line to check that the `PATH` has been added correctly.
86115

116+
For example;
87117
```
88-
# Naively Simple Node Dockerfile
118+
echo $PATH
89119
90-
FROM node:14.17-alpine
120+
gives the following response
91121
92-
RUN mkdir -p /home/app/ && chown -R node:node /home/app
93-
WORKDIR /home/app
94-
COPY --chown=node:node . .
122+
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/quorum/build/bin:/Users/yourname/masa-node/build/bin:/usr/local/go/bin:/usr/local/share/dotnet:~/.dotnet/tools:/Library/Frameworks/Mono.framework/Versions/Current/Commands
123+
```
124+
### Method 2
125+
The second way to make geth and bootnode easily invokable is to copy the binaries located in `$REPO_ROOT/build/bin` to a folder already in your `PATH` file such as `/usr/local/bin`.
126+
### Method 3
95127

96-
USER node
128+
You can also supplement `PATH` by adding add `PATH=$PATH:$REPO_ROOT/build/bin` to your `~/.bashrc`, `~/.bash_aliases`, or `~/bash_profile` file.
129+
## Testing PATH
130+
When you run geth from the command line from an arbitrary folder you will get the following output on the terminal.
131+
```
132+
geth
133+
134+
returns
135+
136+
INFO [12-08|05:37:18.131] Starting Geth on Ethereum mainnet...
137+
INFO [12-08|05:37:18.131] Bumping default cache on mainnet provided=1024 updated=4096
138+
INFO [12-08|05:37:18.131] Running with private transaction manager disabled - quorum private transactions will not be supported
139+
INFO [12-08|05:37:18.132] Maximum peer count ETH=50 LES=0 total=50
140+
INFO [12-08|05:37:18.160] Set global gas cap cap=25000000
141+
INFO [12-08|05:37:18.160] Running with private transaction manager disabled - quorum private transactions will not be supported
142+
INFO [12-08|05:37:18.160] Allocated trie memory caches clean=1023.00MiB dirty=1024.00MiB
143+
INFO [12-08|05:37:18.160] Allocated cache and file handles database=/Users/brendanplayford/Library/Ethereum/geth/chaindata cache=2.00GiB ...
144+
...
145+
INFO [12-08|05:37:18.751] Started P2P networking self=enode://162cfffb34b0c3e76abeb9f31541737fcd3b622e35fa3b0080a14dfb9d2a53168ac3abf10122b79d3b8d7d55516982e0f903d179916ccb51abe5cd00de1bdb07@127.0.0.1:30303
146+
INFO [12-08|05:37:18.752] IPC endpoint opened url=/Users/brendanplayford/Library/Ethereum/geth.ipc isMultitenant=false
147+
INFO [12-08|05:37:18.752] Security Plugin is not enabled
148+
Fatal: Consensus not specified. Exiting!!
149+
```
150+
## Initialize the node
151+
Navigate to the `node` directory and initialize the first node.
152+
The repo directory includes the `genesis.json` file that is used to connect to the Masa protocol at the following path `../genesis.json`
97153

98-
RUN yarn install --frozen-lockfile
99-
RUN yarn build
154+
Run the following command
155+
```
156+
cd node
157+
geth --datadir data init ../genesis.json
158+
```
159+
You will get the following output;
160+
```
161+
INFO [12-09|18:22:24.031] Running with private transaction manager disabled - quorum private transactions will not be supported
162+
INFO [12-09|18:22:24.035] Maximum peer count ETH=50 LES=0 total=50
163+
INFO [12-09|18:22:24.063] Set global gas cap cap=25000000
164+
INFO [12-09|18:22:24.064] Allocated cache and file handles database=/Users/brendanplayford/masa/masa-node-v1.0/node/data/geth/chaindata cache=16.00MiB handles=16
165+
INFO [12-09|18:22:24.135] Writing custom genesis block
166+
INFO [12-09|18:22:24.140] Persisted trie from memory database nodes=7 size=1.02KiB time="280.583µs" gcnodes=0 gcsize=0.00B gctime=0s livenodes=1 livesize=0.00B
167+
INFO [12-09|18:22:24.141] Successfully wrote genesis state database=chaindata hash="69b521…fb4c77"
168+
INFO [12-09|18:22:24.141] Allocated cache and file handles database=/Users/brendanplayford/masa/masa-node-v1.0/node/data/geth/lightchaindata cache=16.00MiB handles=16
169+
INFO [12-09|18:22:24.204] Writing custom genesis block
170+
INFO [12-09|18:22:24.205] Persisted trie from memory database nodes=7 size=1.02KiB time="162.437µs" gcnodes=0 gcsize=0.00B gctime=0s livenodes=1 livesize=0.00B
171+
INFO [12-09|18:22:24.205] Successfully wrote genesis state database=lightchaindata hash="69b521…fb4c77"
172+
```
100173

101-
EXPOSE 3000
102-
CMD [ "yarn", "start" ]
174+
## Set your node identity
175+
Set your own identity of your node on the Masa protocol to be easily identified in a list of peers.
176+
177+
For example; we name our node 'MasaMoonNode' by setting the flag `--identity MasaMoonNode` will set up an identity for your node so it can be identified as MasaMoonNode in a list of peers.
178+
**Update your flag `--identity MasaMoonNode` to be unique**
179+
## Start the node
180+
In the `node` directory, start the node by running the following command:
181+
```
182+
PRIVATE_CONFIG=ignore geth --identity MasaMoonNode --datadir data --bootnodes enode://91a3c3d5e76b0acf05d9abddee959f1bcbc7c91537d2629288a9edd7a3df90acaa46ffba0e0e5d49a20598e0960ac458d76eb8fa92a1d64938c0a3a3d60f8be4@54.158.188.182:21000 --emitcheckpoints --istanbul.blockperiod 1 --mine --miner.threads 1 --syncmode full --verbosity 5 --networkid 190250 --rpc --rpccorsdomain "*" --rpcvhosts "*" --rpcaddr 127.0.0.1 --rpcport 8545 --rpcapi admin,db,eth,debug,miner,net,shh,txpool,personal,web3,quorum,istanbul --port 30300
103183
```
104-
### Running
105-
`cd node-ui`
184+
### Additional Bootnodes
185+
Masa operates several bootnodes, one is already included in the comnand above by default. If you are having issues connecting to the bootnode please use an alternaitve from the list below.
106186

107-
Build the image
108-
`docker build -t masa-node-ui .`
187+
We are also looking for community run bootnodes to add to our list. Please reach out to us on Discord or Submit a PR to this repo if you want to add a bootnode to the community list.
188+
#### Masa Bootnodes
189+
```
190+
enode://ac6b1096ca56b9f6d004b779ae3728bf83f8e22453404cc3cef16a3d9b96608bc67c4b30db88e0a5a6c6390213f7acbe1153ff6d23ce57380104288ae19373ef@54.146.254.245:21000
109191
110-
Check the local built image
111-
`docker image ls`
192+
enode://91a3c3d5e76b0acf05d9abddee959f1bcbc7c91537d2629288a9edd7a3df90acaa46ffba0e0e5d49a20598e0960ac458d76eb8fa92a1d64938c0a3a3d60f8be4@54.158.188.182:21000
112193
113-
Start the docker container
114-
`docker run -p 3000:3000 masa-node-ui`
194+
enode://d87c03855093a39dced2af54d39b827e4e841fd0ca98673b2e94681d9d52d2f1b6a6d42754da86fa8f53d8105896fda44f3012be0ceb6342e114b0f01456924c@34.225.220.240:21000
115195
196+
enode://fcb5a1a8d65eb167cd3030ca9ae35aa8e290b9add3eb46481d0fbd1eb10065aeea40059f48314c88816aab2af9303e193becc511b1035c9fd8dbe97d21f913b9@52.1.125.71:21000
197+
```
198+
#### Community Bootnodes
199+
Submit a PR to add a bootnode to the community list [here](https://github.com/masa-finance/masa-node-v1.0/pulls).
200+
## Node Syncing
201+
It can take some time for your node to fully sync to the Masa Testnet 2.0 - please be patient while your node catches up with the most recent blocks.
202+
## Node UI
203+
You must be running Docker to run the Node UI with geth
204+
### Specification
205+
- React.js & Typescript
206+
- Docker for deployment
207+
## Run The Masa Node UI
208+
Follow these instructions to run the Node UI with geth
209+
```
210+
cd masa-node-v1.0
211+
cd src
212+
cd ui
213+
docker-compose up ui
214+
```
116215
Navigate to you local host to interact with the Masa Node
117216
`http://localhost:3000`

genesis.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"alloc": {
33
"0xed9d02e382b34818e88b88a309c7fe71e65f419d": {
4-
"balance": "8000000000000000000000000000"
4+
"balance": "4000000000000000000000000000"
55
},
66
"0xca843569e3427144cead5e4d5999a3d0ccf92b8e": {
77
"balance": "4000000000000000000000000000"

0 commit comments

Comments
 (0)