Skip to content
This repository has been archived by the owner on Apr 13, 2022. It is now read-only.
Alejandro Alfonso Fernández edited this page Feb 3, 2021 · 13 revisions

F.A.Q.

Technical resources

  1. How to pull request to alastria-node
  2. If you have made a pull request and don't get any peers
    1. Case 1
    2. Case 2
    3. Case 3
    4. Case 4
  3. Node network_id does not match nomenclature
  4. Update from branch change (network is changed)
  5. Too many open files
  6. Create a swap file
  7. Error Workarounds
  8. Update Geth binary version
  9. Private Transactions in Alastria

How to pull request to alastria-node

  1. Log in with Your account on https://github.com.
  2. Browse to https://github.com/alastria/alastria-node.
  3. Click on the Fork button, this will create a copy of t the current repository in our user space, ex.: https://github.com/marcossanlab/alastria-node
  4. In this repository, we navigate to the data/constellation-node.json file and click on the pencil icon to edit, then we add the changes at the end of the list inside the brackets. Once changes are ready, we'll press on the Commit changes button.
  5. Next, go to data/permissioned-nodes_validator.json and again with the pencil icon, add the changes made during the configuration process on your node. Once you're ready, press Commit changes button again.
  6. Browse to DIRECTORY_REGULAR.md and edit it adding a new line at the bottom of the file with your information following this example:
| Test Alastria |  Marcos Serradilla (@mserradilla, [email protected]) | Amazon AWS (2C/8Gb/100Gb)| BAKMjJL7xeRjUt1za/Ax8pKIb9T66tSJWxW3QfTmOSY= | enode://d0f067fdf960ee637037b1a8dbfe8cabfce64a1fed87b3dcb8c2bab834f1f56e398e30dc10692e82b60e665d3870c18308abff1e03adc3ad24024a272275b8d3@35.176.34.215:21000?discport=0 |
  1. Once done, press Commit changes button like before.
  2. Go to the Pull request tab and press on New Pull Request button. Verify on the left you see alastria\alastria-node repository and your_user/alastria-node on the right side.
  3. Use Create pull request button to send the pull request to alastria-node so the platform team can accept it and add your node to the network.

Comparing Changes

Type of sync

  • Full Sync: Gets the block headers, the block bodies, and validates every element from genesis block.
  • Fast Sync: Gets the block headers, the block bodies, it processes no transactions until current block - 64(*). Then it gets a snapshot state and goes like a full synchronization.
  • Light Sync: Gets only the current state. To verify elements, it needs to ask to full (archive) nodes for the corresponding tree leaves.

If you have made a pull request and don't get any peers

Case 1

Even if the Pull request is accepted, this does not mean the node is updated, so you should verify you're alastria-node app is in the last version.

You can use update.sh script to do so.

Case 2

If this is the case, check UPD 21000 port is active on your node and opened in your firewall.

You can check from outside your network (phone tethering for example) with the following command

sudo map -sT -sU -Pn -p 21000 YOUR_IP

Case 3

If previous checks fail and you still don't get synchronized, verify that the enode running on your host is the same you've published on your pull request. You can get your enode with:

$ geth attach ~/alastria/data/geth.ipc
> admin.nodeInfo

Case 4

In case the IP public address from your node is not the same that init.sh auto detects, you've to make a new Pull request modifying the directory and .json permissioned and constellation files.

Node network_id does not match nomenclature

In case the NETWORK_ID is changed, it's only necessary to stop the node, update the repository and start again the services.

$ cd ~/alastria-node/scripts
$ git pull
$ ./update.sh

Update from branch change (network is changed)

If an old branch is being used on the node to keep it running, it would be like doing a new fresh install. A new rule has been defined for node nomenclature and looks like this: TYPE_COMPANY_NET_CORES_RAM_SEQ

  • Type: VAL | REG.
  • Company: Your company name.
  • NET: TestNet | DevNet | MainNet.
  • Cores: Number of cores the node has.
  • RAM: Ram memory in GB on the node.
  • SEQ: Sequential starting at 00.

The process would be:

$ rm -Rf alastria-node
$ pkill -f monitor
$ pkill -f bee
$ pkill -f constellation-node
$ pkill -f geth
$ rm ~/alastria/logs/*.log
$ rm -Rf ~/alastria/workspace
$ git clone https://github.com/alastria/alastria-node
$ cd alastria-node
$ git checkout develop
$ cd scripts
$ sudo -H ./bootstrap.sh
$ ./init.sh backup general YOUR_ACTUAL_ID
$ ./update.sh
$ ./monitor.sh update
$ ./monitor.sh start

Too many open files

We've identified that sometimes, nodes stop synchronizing between them and logs show an error.

ERROR[05-04|08:51:10] parsePermissionedNodes: Failed to access nodes err="open /home/ubuntu/alastria/data/permissioned-nodes.json: too many open files"

If you experience this issue, please follow these steps taken from 'Ubuntu 16 - how to increase maximum file open limit ( ulimit -n )' tutorial, which says:

$ sudo nano /etc/sysctl.conf

Add at the end of the file:

fs.file-max = 131072

Execute:

sudo sysctl -p

Edit:

sudo nano /etc/security/limits.conf

Add the following at the end of the file:

* soft     nproc          131072    
* hard     nproc          131072   
* soft     nofile         131072   
* hard     nofile         131072
root soft     nproc          131072    
root hard     nproc          131072   
root soft     nofile         131072   
root hard     nofile         131072

Edit:

sudo nano /etc/pam.d/common-session

Add:

session required pam_limits.so

Restart server.

Create a swap file

During the transactions executions, Quorum makes very high memory reservations on the node, and we've detected that sometimes this produces a Panic error leaving the node out of order.

To avoid these problems, you can create a swap file to help the application survive. The following is an example of how to create a swapfile.

$ sudo fallocate -l 1G /mnt/1GB.swap
$ sudo dd if=/dev/zero of=/mnt/1GB.swap bs=1024 count=1048576
$ sudo mkswap /mnt/1GB.swap
$ sudo swapon /mnt/1GB.swap
$ sudo nano /etc/fstab

Add at the end of fstab:

/mnt/1GB.swap  none  swap  sw 0  0

Edit:

$ sudo nano /etc/sysctl.conf

Add at the end:

vm.swappiness=10

Last thing:

$ sudo chmod 600 /mnt/1GB.swap

Error Workarounds

  • An error appears "Blockchain not empty, fast sync disabled" in Quorum log at node start.

Quorum is started with the script ./start.sh con --fast-sync. This error appears when the node tries to start and it's not synchronized and the blockchain is not empty. In this case, you can't use --fast-sync mode and need to use --full mode to start. This makes the app to start slowly and spend a few minutes to be completely up and accessible via RPC for it's use.Issue #63

Update Geth binary version

Please, follow the guide made by Tribalyte (in Spanish) here

Alternatively, you can follow these instructions: Without docker

$ cd ~/alastria-node/scripts
$ pkill -f geth
$ pkill -f monitor
$ pkill -f bee
$ cd ~/
$ wget https://github.com/alastria/quorum/releases/download/v2.2.3-0.Alastria_EthNetstats_IBFT/geth
$ chmod +x geth
$ sudo mv geth /usr/local/bin/geth
$ cd ~/alastria-node/scripts
$ ./update.sh

With docker

$ docker exec CONTAINER_ID /bin/bash
$ cd ~/alastria-node/scripts
$ pkill -f geth
$ pkill -f monitor
$ pkill -f bee
$ cd ~/
$ wget https://github.com/alastria/quorum/releases/download/v2.2.3-0.Alastria_EthNetstats_IBFT/geth
$ chmod +x geth
$ mv geth /usr/local/bin/geth
$ cd ~/alastria-node/scripts
$ ./update.sh

"My node is out of sync with the alastria-t network"

As there are several ways to run the node, there are several parameter that should be tested. Alastria-T network it's a public-permisioned network, that uses Quorum (AKA GoQuorum, JPMorgan Quorum) as client. So, there's be running a "geth" process. Here a example of a geth process running as REGULAR (AKA "general") node:

geth --datadir /root/alastria/data --networkid 83584648538  
--identity REG_MemberNameInAlastria_T_2_4_00 --permissioned --port 21000  
--rpc --rpcaddr 0.0.0.0 --rpcapi admin,db,eth,debug,miner,net,shh,txpool,personal,web3,quorum,istanbul --rpcport 22000  
--istanbul.requesttimeout 10000 --verbosity 3 --vmdebug  
--ethstats REG_MemberNameInAlastria_T_2_4_00:[email protected]:80 --emitcheckpoints --targetgaslimit 8000000  
--syncmode full --gcmode full --vmodule consensus/istanbul/core/core.go=5 --nodiscover  
--metrics --metrics.influxdb --metrics.influxdb.endpoint http://geth-metrics.planisys.net:8086 --metrics.influxdb.database alastria  
--metrics.influxdb.username alastriausr --metrics.influxdb.password ala0str1AX1 --metrics.influxdb.host.tag=REG_MemberNameInAlastria_T_2_4_00

If there's no running process for geth, there's no client for AlastriaT network running, so you should start it with start.sh in /root/alastria-node/scripts localion.

Also, a tipical top or ps aux commands should help to know the status of such process

Be aware that geth can be running in a docker container; in such case, you can identify that the contaniner its running, with docker ps -a, or start a interactive console with docker exec -it <container_name_or_id> /bin/bash

"What ports are used for the client?"

gethneeds, at least these ports open for whisper protocol. These is a commom configuration:

protocol port inbound outbound
tcp 21000 0.0.0.0/0 0.0.0.0/0
udp 21000 0.0.0.0/0 0.0.0.0/0

Please, note that inbound and outbound rules can be changed to use inbound and outbound IPs, listed in:

"Theres other ports are used for the client?"

geth uses another port to interact with the node. These port can be used by geth clients, or other kind of applications:

protocol port
tcp 22000

Beware do not open woldwide this port, insted you know wath you're doing. It gives access for your node, but lacks any kind of encription or strong autentificantion.

Use of this port is controled in startup of ther node:

[...]
--rpc --rpcaddr **127.0.0.0** --rpcport **22000 **--rpcapi admin,db,eth,debug,miner,net,shh,txpool,personal,web3,quorum,istanbul 
[...]

This port is used to interact with the node, or using Metamask, Remix, Truffle,... or any kind of web3 application, and its common to find it running with nginx proxy, as a added security layer for outside connetions, and described in alastria-access-point

"Why its nginx service running?"

CORS:

  • Es necesario arrancar el nodo con la opción "GLOBAL_ARGS=$GLOBAL_ARGS --rpccorsdomain "http://localhost:8080""