quickstart icon indicating copy to clipboard operation
quickstart copied to clipboard

NETWORK_PASSPHRASE is not changing

Open gionapaolini opened this issue 4 years ago • 5 comments

I am trying to change the network passphrase in a standalone configuration

I tried changing the NETWORK_PASSPHRASE value in the following files /opt/stellar/core/etc/stellar-core.cfg /opt/stellar/core/etc/stellar-captive-core.cfg /opt/stellar/horizon/etc/horizon.env

I tried passing the argument in the docker run command (this does not work at all as it says argument not valid): sudo docker run -it -v $(pwd)/stellar:/opt/stellar --rm -p 0.0.0.0:8000:8000 --name stellar stellar/quickstart --standalone --enable-horizon-captive-core --network-passphrase XXX

I tried passing setting an environment variable in the docker run command: sudo docker run -e NETWORK_PASSPHRASE=XXX -it -v $(pwd)/stellar:/opt/stellar --rm -p 0.0.0.0:8000:8000 --name stellar stellar/quickstart --standalone --enable-horizon-captive-core

But in every scenario I get this:

Starting Stellar Quickstart
mode: persistent
network: standalone (Standalone Network ; February 2017)           <-----------------SAME DEFAULT PASSPHRASE 
postgres: config directory exists, skipping copy
supervisor: config directory exists, skipping copy
stellar-core: config directory exists, skipping copy
horizon: config directory exists, skipping copy
postgres: already initialized
chown-core: ok
core: already initialized
Waiting for postgres to be available...
postgres: up
init-core-scp: ok
horizon: already initialized
postgres: down
starting supervisor
2021-11-05 15:45:26,074 CRIT Supervisor is running as root.  Privileges were not dropped because no user is specified in the config file.  If you intend to run as ro
ot, you can set user=root in the config file to avoid this message.
2021-11-05 15:45:26,080 INFO RPC interface 'supervisor' initialized
2021-11-05 15:45:26,081 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2021-11-05 15:45:26,081 INFO supervisord started with pid 1
2021-11-05 15:45:27,085 INFO spawned: 'postgresql' with pid 59
2021-11-05 15:45:27,088 INFO spawned: 'stellar-core' with pid 60
2021-11-05 15:45:27,091 INFO spawned: 'horizon' with pid 61
2021-11-05 15:45:27,330 INFO exited: stellar-core (exit status 1; not expected)     <-------FAILS TO INITIALIZE
2021-11-05 15:45:28,407 INFO success: postgresql entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2021-11-05 15:45:28,409 INFO spawned: 'stellar-core' with pid 113
2021-11-05 15:45:28,411 INFO success: horizon entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2021-11-05 15:45:28,411 INFO exited: horizon (exit status 1; not expected)

What is the correct way of changing the network passphrase?

gionapaolini avatar Nov 05 '21 15:11 gionapaolini

This issue is stale because it has been open for 30 days with no activity. It will be closed in 30 days unless the stale label is removed.

github-actions[bot] avatar Dec 06 '21 22:12 github-actions[bot]

Hi would like to reopen this issue, the docs describe the solution to this as using whatever SDK or tool you're using to set the passphrase with no context or link. Looking at the start script, the network passphrase when using the --local flag will simply override the value with no way of setting your own value. This goes against what is in the documentation which describes that it is a default value, when in reality it seems to be the only value

KyleSmith19091 avatar Apr 03 '25 07:04 KyleSmith19091

The image doesn't support setting a completely custom network passphrase, because the image is primarily designed for local testing and development.

This goes against what is in the documentation which describes that it is a default value

That's a good point. The use of the term 'default' here is probably not the best choice of word. The --local mode does support an additional option --randomize-network-passphrase that when specified will set the network passphrase to a random value to make it unique.

I think given --local already supports a random passphrase, it would be reasonable to change the image to support passing a passphrase.

Could you share more details about the use case of setting a custom network passphrase?

leighmcculloch avatar Apr 03 '25 23:04 leighmcculloch

My use case is I just wanted to be able to reuse the testnet password for testing a local stellar data ingestion pipeline build, this just simplifies the calls from the horizon SDK. I understand I can make this change myself, but I don't see why the startup image should not have the ability to set a custom passphrase, when it supports setting a random one?

KyleSmith19091 avatar Apr 04 '25 07:04 KyleSmith19091

I agree, it seems reasonable to be able to set a custom network passphrase when running locally.

leighmcculloch avatar Apr 04 '25 08:04 leighmcculloch

This issue is stale because it has been open for 90 days with no activity.

github-actions[bot] avatar Aug 17 '25 18:08 github-actions[bot]

This was implemented in #688.

leighmcculloch avatar Aug 17 '25 20:08 leighmcculloch