robinmonjo / coincoin

Blockchain based cryptocurrency proof-of-concept built with Elixir. Feedback welcome
404 stars 54 forks source link

make release error && cannot run #15

Closed denispeplin closed 7 years ago

denispeplin commented 7 years ago
$ make release
cd apps/blockchain_web && MIX_ENV=prod mix phx.digest
** (Mix.Config.LoadError) could not load config config/prod.secret.exs
    ** (File.Error) could not read file "/home/den/projects/coincoin/apps/blockchain_web/config/prod.secret.exs": no such file or directory
    (elixir) lib/file.ex:272: File.read!/1
    (mix) lib/mix/config.ex:180: Mix.Config.read!/2
    (mix) lib/mix/config.ex:217: anonymous fn/3 in Mix.Config.read_wildcard!/2
    (elixir) lib/enum.ex:1811: Enum."-reduce/3-lists^foldl/2-0-"/3
    (stdlib) erl_eval.erl:670: :erl_eval.do_apply/6
    (stdlib) erl_eval.erl:878: :erl_eval.expr_list/6
    (stdlib) erl_eval.erl:404: :erl_eval.expr/5
Makefile:9: recipe for target 'shared' failed
make: *** [shared] Error 1

I'm doing exactly as it said in README, but make release fails. Error came from blockchain_web.

I've removed mention of secrets from prod.exs and trying to run release.

First node starts, but then I've got an error:

PORT=4001 P2P_PORT=5001 _build/prod/rel/coincoin/bin/coincoin.run console
Protocol 'inet_tcp': the name coincoin@127.0.0.1 seems to be in use by another Erlang node
robinmonjo commented 7 years ago

I’ll take a look at what’s going on. For now you can just run it using iex -S mix phx.server (With the same environment variable you already use).

As for the secrets, this is standard in Phoenix but I should document it.

Thank you for the feedback !!

robinmonjo commented 7 years ago

Well just tried and indeed the README is false.

  1. first I should commit the phoenix prod.secret.exs. I don't really care about the secret_key_base being public as it is intended to be deployed on localhost only. This would fix your first issue
  2. As for the second error, it seems that we can't start on the same computer 2 erlang VM with the same name. I didn't think about that 😁

Will fix this a soon as I can find some time !

yordis commented 7 years ago

@robinmonjo remove the import for the secret file is there is no secrets. Don't commit the file that is meant to be for secret stuff 😄