bitcoin-dev-project / sim-ln

Payment activity generator for the lightning network
MIT License
63 stars 28 forks source link

docker setup-volume script flexibilty #136

Open pinheadmz opened 1 year ago

pinheadmz commented 1 year ago

Running macOS with the GNU version of sed installed, replacing the BSD version of sed (because all the bitcoin core devs run linux I suppose?) I encountered this issue where I think the empty string parameter is unnecessary:

--> make mount-volume SIMFILE_PATH=/Users/matthewzipkin/.warnet/warnet/warnet/simln/sim.json
chmod +x ./docker/setup-volume.sh && ./docker/setup-volume.sh "/Users/matthewzipkin/.warnet/warnet/warnet/simln/sim.json"
sed: can't read s|/Users/matthewzipkin/.warnet/warnet/warnet/simln/tls.cert|/data/lnd/warnet_ln_000000/tls.cert|: No such file or directory
sed: can't read s|/Users/matthewzipkin/.warnet/warnet/warnet/simln/admin.macaroon|/data/lnd/warnet_ln_000000/admin.macaroon|: No such file or directory
sed: can't read s|/Users/matthewzipkin/.warnet/warnet/warnet/simln/tls.cert|/data/lnd/warnet_ln_000001/tls.cert|: No such file or directory
sed: can't read s|/Users/matthewzipkin/.warnet/warnet/warnet/simln/admin.macaroon|/data/lnd/warnet_ln_000001/admin.macaroon|: No such file or directory
sed: can't read s|/Users/matthewzipkin/.warnet/warnet/warnet/simln/tls.cert|/data/lnd/warnet_ln_000002/tls.cert|: No such file or directory
sed: can't read s|/Users/matthewzipkin/.warnet/warnet/warnet/simln/admin.macaroon|/data/lnd/warnet_ln_000002/admin.macaroon|: No such file or directory
simln-data

In addition, the sed command won't work for my particular use-case (exporting from warnet) because my cert and macaroon files are not named exactly how you expect:

sed -i '' 's|'$(dirname $NODE_TLS_PATH_ON_HOST)'/tls.cert|/data/lnd/'$NODE_ID'/tls.cert|' $STAGING_DIR/sim.json

but my sim.json file...

{
  "nodes":
  [
    {
      "LND":
      {
        "id": "warnet_ln_000000",
        "address": "https://100.13.229.42:10009",
        "macaroon": "/Users/matthewzipkin/.warnet/warnet/warnet/simln/warnet_ln_000000_admin.macaroon",
        "cert": "/Users/matthewzipkin/.warnet/warnet/warnet/simln/warnet_ln_000000_tls.cert"
      }
    },
...
etc
Extheoisah commented 1 year ago

I'll look into this since I started it