Skip to content

Conversation

Thoralf-M
Copy link
Member

@Thoralf-M Thoralf-M commented Oct 13, 2025

Add a script to start a localnet with a gas station

Tested with

./run_localnet.sh start
make python-example gas_station
# ./run_localnet.sh logs
./run_localnet.sh stop
Starting local IOTA network with gas station...
Backed up config to ./.github/actions/start-local-network/config.yaml.backup
Starting PostgreSQL...
postgres
Starting IOTA network...
Setting keypair in config...
Waiting for network to start and requesting faucet coins...
Starting Gas Station...
[+] Running 4/4
 ✔ Volume start-local-network_redis_data                                       Created                                                                                                                                                                                0.0s 
 ✔ Container gas-station-redis                                                 Started                                                                                                                                                                                0.2s 
 ✔ Container iota-gas-station                                                  Started                                                                                                                                                                                0.3s 
 ! iota-gas-station Published ports are discarded when using host network mode                                                                                                                                                                                        0.0s 
Waiting for gas station to be ready...
Local network and gas station started successfully!
IOTA PID: 155408
Logs are being written to iota_network.log
To view logs: ./run_localnet.sh logs
To stop, run: ./run_localnet.sh stop

Running Python example "gas_station"
<lib.iota_sdk_ffi.TransactionEffects object at 0x79da05e56bc0>
Sponsored transaction was successful!
Stopping local IOTA network and gas station...
Stopping Gas Station...
OK
[+] Running 2/2
 ✔ Container iota-gas-station   Removed                                                                                                                                                                                                                              10.2s 
 ✔ Container gas-station-redis  Removed                                                                                                                                                                                                                               0.0s 
Removing Redis data volume...
start-local-network_redis_data
Stopping IOTA network...
Stopping PostgreSQL...
postgres
Restored config from backup
Removed log file iota_network.log
Local network and gas station stopped.

Fixes #280

@Thoralf-M Thoralf-M force-pushed the feat/localnet-script branch from 4e07abf to 4bfb6c8 Compare October 14, 2025 07:42
@Thoralf-M Thoralf-M marked this pull request as ready for review October 14, 2025 07:42
@Thoralf-M Thoralf-M linked an issue Oct 14, 2025 that may be closed by this pull request
Copy link
Member

@thibault-martinez thibault-martinez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't work on macOS but I need it in another PR so I'll merge it an open an issue to investigate

@thibault-martinez thibault-martinez merged commit eff42ab into sdk-bindings Oct 20, 2025
14 checks passed
@thibault-martinez thibault-martinez deleted the feat/localnet-script branch October 20, 2025 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create script to start a local network with gas station

3 participants