diff --git a/Makefile b/Makefile index 275b9efc1..f95f8bf95 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,7 @@ .POSIX: PREFIX = /usr/local -CONFDIR = $(HOME)/.config/darkfi -DLURL = http://185.165.171.77 +DLURL = https://testnet.cashier.dark.fi CARGO = cargo DLTOOL = wget -nv --show-progress -O- @@ -17,18 +16,12 @@ BINDEPS = \ $(shell find token -type f) \ $(shell find sql -type f) -all: $(BINS) uid confdir mint.params spend.params +all: $(BINS) mint.params spend.params $(BINS): $(BINDEPS) $(CARGO) build --release --all-features --bin $@ cp target/release/$@ $@ -uid: - id -u > $@ - -confdir: - @echo "$(CONFDIR)" > $@ - %.params: $(DLTOOL) $(DLURL)/$@ > $@ @@ -41,29 +34,24 @@ fix: clippy: $(CARGO) clippy --release --all-features -install: - @if ! [ -f uid ]; then \ - echo "Please run 'make' as user first." ; \ - exit 1 ; \ - fi; +install: all mkdir -p $(DESTDIR)$(PREFIX)/bin + mkdir -p $(DESTDIR)$(PREFIX)/share/darkfi + mkdir -p $(DESTDIR)$(PREFIX)/share/doc/darkfi cp -f $(BINS) $(DESTDIR)$(PREFIX)/bin - mkdir -p "$(shell cat confdir)" - for i in $(BINS); \ - do \ - cp example/config/$$i.toml "$(shell cat confdir)" ; \ - done; - cp mint.params spend.params "$(shell cat confdir)" - chown -R "$(shell cat uid):$(shell cat uid)" "$(shell cat confdir)" + cp -f example/config/*.toml $(DESTDIR)$(PREFIX)/share/doc/darkfi + cp -f mint.params spend.params $(DESTDIR)$(PREFIX)/share/darkfi uninstall: for i in $(BINS); \ do \ rm -f $(DESTDIR)$(PREFIX)/bin/$$i; \ done; + rm -rf $(DESTDIR)$(PREFIX)/share/doc/darkfi + rm -rf $(DESTDIR)$(PREFIX)/share/darkfi clean: - rm -f $(BINS) mint.params spend.params uid confdir + rm -f $(BINS) mint.params spend.params distclean: clean rm -rf target diff --git a/README.md b/README.md index 31622e9b5..204b9d9d3 100644 --- a/README.md +++ b/README.md @@ -15,19 +15,23 @@ $ make ## Install -This will install the binaries in `/usr/local`, and set up the -config files in your user's `$HOME/.config/darkfi`. You can review -the installed config files, but the defaults should be good for using -the testnet. +This will install the binaries and configurations in the configured +namespace (`/usr/local` by default). The configurations are installed +as TOML files in `/usr/local/share/doc/darkfi`. They have to be copied +in your user's `$HOME/.config/darkfi` directory. You can review the +installed config files, but the defaults should be good for using +the testnet if you're following this document. ``` $ sudo make install +$ mkdir -p ~/.config/darkfi +$ cp -f /usr/local/share/doc/darkfi/*.toml ~/.config/darkfi ``` ## Usage -After the installation, you should have `drk` and `darkfid` binaries in -`/usr/local`. Also, the params and configuration files should be in +After the installation, you should have `drk` and `darkfid` +binaries in `/usr/local`. Also, the configuration files should be in `~/.config/darkfi`. Now we're ready to use the testnet. In one terminal, start `darkfid`, which is the daemon that will diff --git a/example/config/cashierd.toml b/example/config/cashierd.toml index de36b8697..9e7eab238 100644 --- a/example/config/cashierd.toml +++ b/example/config/cashierd.toml @@ -24,10 +24,10 @@ gateway_protocol_url = "tcp://testnet.gateway-protocol.dark.fi:3333" gateway_publisher_url = "tcp://testnet.gateway-publish.dark.fi:4444" # Path to mint.params -mint_params_path = "~/.config/darkfi/mint.params" +mint_params_path = "/usr/local/share/darkfi/mint.params" # Path to spend.params -spend_params_path = "~/.config/darkfi/spend.params" +spend_params_path = "/usr/local/share/darkfi/spend.params" # Path to cashierd wallet cashier_wallet_path = "~/.config/darkfi/cashier_wallet.db" diff --git a/example/config/darkfid.toml b/example/config/darkfid.toml index 31030a9ed..a0d973540 100644 --- a/example/config/darkfid.toml +++ b/example/config/darkfid.toml @@ -24,10 +24,10 @@ gateway_protocol_url = "tcp://testnet.gateway-protocol.dark.fi:3333" gateway_publisher_url = "tcp://testnet.gateway-publish.dark.fi:4444" # Path to mint.params -mint_params_path = "~/.config/darkfi/mint.params" +mint_params_path = "/usr/local/share/darkfi/mint.params" # Path to spend.params -spend_params_path = "~/.config/darkfi/spend.params" +spend_params_path = "/usr/local/share/darkfi/spend.params" # Path to the client database database_path = "~/.config/darkfi/darkfid_client.db"