humblenginr / goocoin

Full bitcoin solution written in Go (golang)
Other
0 stars 0 forks source link

Make the remote wallet to work without any fixed paths #2

Closed piotrnar closed 3 months ago

piotrnar commented 3 months ago

Get rid of the TempWalletFolderPath so we don't have to modify it each time after pulling the sources before building. Maybe just assume that the wallet's executable will be placed in the current folder. Or add a simple config file where the user can setup these values (as well as e.g. the client's ip:port). Choose whatever method you like, but the fixed paths and addresses have to be removed from the source code, for obvious reasons.

piotrnar commented 3 months ago

This still needs to be addressed.

A preferred solution is to use a temporary folder for the files needed to sign a transaction - either in the gateway's sub-folder or somewhere within the path returned by os.TempDir() Also would be nice to clean the files after the signing is done.

For the wallet's binary, there should be no need to configure any paths. There will only be a requirement that the wallet binary must be placed within OS'es PATH.

Also mind that Windows uses wallet.exe as the binary name and the default path separator character is different there. A neat solution would be to use "os.PathSeparator" (from golang os package) for building the paths.

humblenginr commented 3 months ago

fixed in https://github.com/piotrnar/gocoin/pull/68/commits/7fd8ff1b2a2a85783c8987083b0fd436a65f3e9a

humblenginr commented 3 months ago

By default, if the -wallet flag is not provided, then gateway program creates a temporary folder named wallet in the current working directory and uses that. The temporary folder will be deleted when the program terminates.

piotrnar commented 3 months ago

good