How to run two nodes locally
by Hidenori
- Create two copies of
stellar-core
.- In other words, you should have something like
~/stellar-core
and~/stellar-core-2
such that each of them is a copy of Stellar Core. In the following, we will assume that you have one copy in~/stellar-core
and another in~/stellar-core-2
.
- In other words, you should have something like
- Install each by following the installation guide.
- Create
~/stellar-core/stellar-core.cfg
with the following content:
HTTP_PORT=8080
PUBLIC_HTTP_PORT=false
RUN_STANDALONE=false
NETWORK_PASSPHRASE="My local network"
PEER_PORT=11625
# public key = GB6TNFAOGXLLEMXP5NZEN36O3XEEUPOIK55FAHHCZGOBFMDB2CB6FO4K
NODE_SEED="SADB4NABNQ3BKTGX3LHDOR43LAKBIAGK5YQNDN5J2BTJDCRVL5VQTMZ5 self"
NODE_IS_VALIDATOR=true
DATABASE="sqlite3://stellar.db"
COMMANDS=["ll?level=info"]
ARTIFICIALLY_GENERATE_LOAD_FOR_TESTING=true
FAILURE_SAFETY=0
UNSAFE_QUORUM=true
KNOWN_PEERS = ["127.0.0.1:11626"]
[QUORUM_SET]
THRESHOLD_PERCENT=100
VALIDATORS=["$self", "GB6Y2KCSMXJIBRW4JQTTOY3IDXM5SOC5WK56HCID5RI2GLMBUTKASVEW"]
[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}"
- Create
~/stellar-core-2/stellar-core.cfg
with the following content:
HTTP_PORT=8088
PUBLIC_HTTP_PORT=false
RUN_STANDALONE=false
NETWORK_PASSPHRASE="My local network"
PEER_PORT=11626
# public key : GB6Y2KCSMXJIBRW4JQTTOY3IDXM5SOC5WK56HCID5RI2GLMBUTKASVEW
NODE_SEED="SA3YGQZVLVS7CAE33DBSEYPIURFC65THP66ZWJXXI66I2XCKAAXP3JBW self"
NODE_IS_VALIDATOR=true
DATABASE="sqlite3://stellar.db"
COMMANDS=["ll?level=info"]
ARTIFICIALLY_GENERATE_LOAD_FOR_TESTING=true
FAILURE_SAFETY=0
UNSAFE_QUORUM=true
KNOWN_PEERS = ["127.0.0.1:11625"]
[QUORUM_SET]
THRESHOLD_PERCENT=100
VALIDATORS=["$self", "GB6TNFAOGXLLEMXP5NZEN36O3XEEUPOIK55FAHHCZGOBFMDB2CB6FO4K"]
[HISTORY.vs]
get="cp /tmp/stellar-core/history-2/vs/{0} {1}"
put="cp {0} /tmp/stellar-core/history-2/vs/{1}"
mkdir="mkdir -p /tmp/stellar-core/history-2/vs/{0}"
- In both
~/stellar-core
and~/stellar-core-2
, runstellar-core new-db; stellar-core force-scp; stellar-core run
. - If you see messages about closed ledgers like following, the two nodes are talking to each other!
2020-06-03T13:18:32.101 GB6Y2 [Ledger INFO] Got consensus: [seq=4, prev=f6b88d, txs=0, ops=0, sv: [ txH: c141b3, ct: 1591204712, upgrades: [ ] ]] 2020-06-03T13:18:32.104 GB6Y2 [Ledger INFO] Closed ledger: [seq=4, hash=7da1db] 2020-06-03T13:18:37.122 GB6Y2 [Herder INFO] Quorum information for 3 : {"agree":2,"delayed":0,"disagree":0,"fail_at":1,"hash":"d073ee","ledger":3,"missing":0,"phase":"EXTERNALIZE","validated":true} 2020-06-03T13:18:37.123 GB6Y2 [Ledger INFO] Got consensus: [seq=5, prev=7da1db, txs=0, ops=0, sv: [ txH: 6d045f, ct: 1591204717, upgrades: [ ] ]] 2020-06-03T13:18:37.128 GB6Y2 [Ledger INFO] Closed ledger: [seq=5, hash=520f75]
Subscribe via RSS