0

I use stellar-core for the run an own private network. I have a private network setup with 2 nodes running (self-validating) and one REST server running. But on running Horizon API(http://localhost:8000/) it doesn't show a history of the ledger. it shows a 0 value and it's not updating. Using this reference, I was created a Private net.

Node 1:

    # What port stellar-core listens for commands on. This is for Horizon server.
    HTTP_PORT=11626

    PUBLIC_HTTP_PORT=false

    # If it is true, It prevents you from trying to connect to other peers
    RUN_STANDALONE=false

    # A phrase for your network. All nodes should have the same network phrase.
    NETWORK_PASSPHRASE="Standalone Network ; DEC 2018"

    # The seed used for generating the public key this node will be identified within SCP.
    NODE_SEED="SCKWWAH6W3AFRGZZGAWFLC5FGKUEB7YWOHAQY5XSWO7R3HTPU4GQ3Q4F self"

    # Only nodes that want to participate in SCP should set NODE_IS_VALIDATOR=true.
    # Most instances should operate in observer mode with NODE_IS_VALIDATOR=false.
    NODE_IS_VALIDATOR=true

    # Comma separated peers list
    KNOWN_PEERS=["127.0.0.1:11635"]

    # Postgres DB URL
    DATABASE="postgresql://dbname=stellar_node01_db host=localhost user=abc password=abc"

    # The port other instances of stellar-core can connect to you on.
    PEER_PORT=11625

    # Log level setup
    COMMANDS=["ll?level=trace"]

    FAILURE_SAFETY=0
    UNSAFE_QUORUM=true

    #The public keys of the Stellar servers
    [QUORUM_SET]
    THRESHOLD_PERCENT=100

    # comma sepearted validator list 
    VALIDATORS=["$self"]

    [HISTORY.vs]
    get="cp /tmp/stellar-core/history/vs/{0} {1}"
    put="cp {0} /tmp/stellar-core/history/vs/{1}"
    mkdir="mkdir -p /tmp/stellar-core/history/vs/{0}"

Node 2:

# What port stellar-core listens for commands on. This is for Horizon server.
HTTP_PORT=11636

PUBLIC_HTTP_PORT=false

# If it is true, It prevents you from trying to connect to other peers
RUN_STANDALONE=false

# A phrase for your network. All nodes should have the same network phrase.
NETWORK_PASSPHRASE="Standalone Network ; DEC 2018"

# The seed used for generating the public key this node will be identified within SCP.
NODE_SEED="SCKWWAH6W3AFRGZZGAWFLC5FGKUEB7YWOHAQY5XSWO7R3HTPU4GQ3Q4F self"

# Only nodes that want to participate in SCP should set NODE_IS_VALIDATOR=true.
# Most instances should operate in observer mode with NODE_IS_VALIDATOR=false.
NODE_IS_VALIDATOR=true

# Comma separated peers list
KNOWN_PEERS=["127.0.0.1:11625"]

# Postgres DB URL
DATABASE="postgresql://dbname=stellar_node02_db host=localhost user=abc password=abc"

# The port other instances of stellar-core can connect to you on.
PEER_PORT=11635

# Log level setup
COMMANDS=["ll?level=trace"]

FAILURE_SAFETY=0
UNSAFE_QUORUM=true

#The public keys of the Stellar servers
[QUORUM_SET]
THRESHOLD_PERCENT=100

# comma sepearted validator list 
VALIDATORS=["$self"]

[HISTORY.vs]
get="cp /tmp/stellar-core/history/vs/{0} {1}"
put="cp {0} /tmp/stellar-core/history/vs/{1}"
mkdir="mkdir -p /tmp/stellar-core/history/vs/{0}"

Output of Horizon Api:

enter image description here

  • Welcome. Questions should include code or configuration as text, not images. This improves search and helps users to solve your question. – Synesso Dec 27 '18 at 11:58
0

I wonder if your underlying Stellar Cores successfully got into the state of "Synced!". If not, Horizon should show zeros for the attributes in your red bracket.

Try viewing the state of your Core at http://localhost:11626/info & http://localhost:11636/info.

A likely problem with your config is that you use duplicated NODE_SEED. This may not even successfully start the network.

Another problem is that your two nodes are not cooperating actually. You tried to let them know each other by setting KNOWN_PEERS, but forgot to include each other at VALIDATORS.

Last problem is both config does not acknowledge the peer's history archive (or they simply write to the same one).


Suggestions on changes to configs:

node1@port11625 (writing to /tmp/stellar-core/history/vs1/)

ADD:

NODE_NAMES=[ "GBBBBBBBBBBBBBBBBBB node2peer ]

[HISTORY.[peer2]

get="cp /tmp/stellar-core/history/vs2/{0} {1}"

CHANGE TO:

NODE_SEED="SAAAAAAAAAAAAAAAAAA node1self"

VALIDATORS=[ $node1self , $node2peer ]

[HISTORY.local1]

get="cp /tmp/stellar-core/history/vs1/{0} {1}"

put="cp {0} /tmp/stellar-core/history/vs1/{1}"

mkdir="mkdir -p /tmp/stellar-core/history/vs1/{0}"

node2@port11635 (writing to /tmp/stellar-core/history/vs2/)

ADD:

NODE_NAMES=[ "GAAAAAAAAAAAAAAAAAA node1peer ]

[HISTORY.[peer1]

get="cp /tmp/stellar-core/history/vs1/{0} {1}"

CHANGE TO:

NODE_SEED="SBBBBBBBBBBBBBBBBBB node2self"

VALIDATORS=[ $node2self , $node1peer ]

[HISTORY.local2]

get="cp /tmp/stellar-core/history/vs2/{0} {1}"

put="cp {0} /tmp/stellar-core/history/vs2/{1}"

mkdir="mkdir -p /tmp/stellar-core/history/vs2/{0}"

I also suggest rebuilding your DB and then do the stellar-core --newhist XXX stellar-core --newdb stellar-core --forcescp and start Cores again.

For more, take reference on https://github.com/stellar/stellar-core/blob/master/docs/stellar-core_example.cfg.

  • it's worked for me. But i need to add another 3rd node in running 2 node stellar network. any idea about it. Thanks. – Isha Padalia Jun 14 at 7:10
  • Too long to answer here, i'll start in another answer below. Next time ask a new question with a separated thread. – cesarm Jun 14 at 7:43
0

As per request --- to add another 3rd node in running 2 node stellar network ---, below are some brief outline of the procedures.


To add a 3rd node (e.g. at port 11645) to your running Stellar-Core system (2 nodes at 11625 & 11635), just copy the same stellar-core.cfg to begin with.

part 1 - prepare config file for 3rd node

Below are the sessions that has to be changed on the 3rd config file:

  • NODE_SEED
  • KNOWN_PEERS
  • DATABASE
  • PEER_PORT
  • [HISTORY] & [HISTORY.xyz] (depend on your existing settings of the first 2 nodes)

At the session [QUORUM_SET], modify VALIDATORS such that it should contain the info of 3 nodes (i.e. an array of length 3).

part 2 - start 3rd node

this should take less than 5 minutes for the 3rd node to get into the state of "CATCHING_UP". Depending on how long you have run the first 2 nodes, the catchup time varies.

part 3 - modify the first 2 nodes

very likely you would like the first 2 nodes to recognise the 3rd node as a validator. So, modify the config files of node1 and node2 such that [QUORUM_SET] -> VALIDATORS contains info of node3, and also add a block like [HISTORY.node3].

After these modifications, restart node1 & node2 one-by-one (only when one has been successfully changed to show 3 validators agreeing).

  • Okay, But is it possible without stopping a first 2 nodes that are already in running state ? – Isha Padalia Jun 14 at 9:58
  • if you "restart" a StellarCore fast enough (e.g. stop and then start again within 5 seconds), basically it has no apparent effect on your system, even if your nodes are being in use. – cesarm Jun 14 at 17:52
  • Thank you so much for this. but mkdir -p /tmp/stellar-core/history/vs1/{0} is archive history path changeable or not ? – Isha Padalia Jun 17 at 13:29
  • not sure on this...maybe you could raise a separate question and see if anyone else has idea on this – cesarm Jun 18 at 2:48
  • Okay thank you. – Isha Padalia Jun 18 at 4:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.