Installing elemental-chat in the nix-shell

Hi,

today I have read this blog post https://blog.holochain.org/elemental-chat-is-live/.
Is it possible to install the elemental-chat in the nix-shell itself and not on a holoport?

I followed the installation guide in https://github.com/holochain/elemental-chat

The commands:
git clone https://github.com/holochain/elemental-chat && cd ./elemental-chat
CARGO_TARGET_DIR=target cargo build --release --target wasm32-unknown-unknown
dna-util -c elemental-chat.dna.workdir

worked fine.

The ‘npm intall’ command found one vulnerability.

[nix-shell:~/elemental-chat/tests]$ npm install
npm WARN demo-1@0.0.0 No description
npm WARN demo-1@0.0.0 No repository field.

audited 212 packages in 1.719s

41 packages are looking for funding
  run `npm fund` for details

found 1 high severity vulnerability
  run `npm audit fix` to fix them, or `npm audit` for details

I tried to fix it with the mentioned ‘npm audit fix’ command.

[nix-shell:~/elemental-chat/tests]$ npm audit fix
npm WARN demo-1@0.0.0 No description
npm WARN demo-1@0.0.0 No repository field.

up to date in 0.783s

41 packages are looking for funding
  run `npm fund` for details

fixed 0 of 1 vulnerability in 212 scanned packages
  1 vulnerability required manual review and could not be updated

With the ‘npm test’ command I tried to test it unfortunately it also failed.

nix-shell:~/elemental-chat/tests]$ npm test

> demo-1@0.0.0 test /home/student/elemental-chat/tests
> npm run test:setup && npm run test:standard


> demo-1@0.0.0 test:setup /home/student/elemental-chat/tests
> CARGO_TARGET_DIR=../target cargo build --release --target wasm32-unknown-unknown && dna-util -c ../elemental-chat.dna.workdir

    Finished release [optimized] target(s) in 0.05s

> demo-1@0.0.0 test:standard /home/student/elemental-chat/tests
> TRYORAMA_LOG_LEVEL=info RUST_LOG=holochain::core::ribosome::host_fn::debug=debug RUST_BACKTRACE=1 ts-node src/index.ts | tap-diff

        12:31:30 [tryorama] info: Using the following settings from environment variables:
        12:31:30 [tryorama] info: {
          "adminInterfaceId": "tryorama-interface-admin",
          "appInterfaceId": "tryorama-interface-app",
          "stateDumpOnError": true,
          "zomeCallTimeoutMs": 90000,
          "conductorTimeoutMs": 125000,
          "strictConductorTimeout": false,
          "chooseFreePort": false,
          "logLevel": "info",
          "portRange": [
            33000,
            34000
          ],
          "legacy": false,
          "singletonAppId": "TRYORAMA_APP",
          "holochainPath": "holochain",
          "lairPath": "lair-keystore"
        }

  chat away
        FIXME: ignoring onJoin
        12:31:30 [tryorama] info: Spawning lair for test with keystore at:  /tmp/tmp.PPbYVPDoH5/tryorama/vypSXL/keystore
        12:31:30 [tryorama] info: Using conductor path:  holochain
        12:31:30 [tryorama] info: Holochain version:     holochain 0.0.100
        12:31:30 [tryorama] info: Conductor config path: /tmp/tmp.PPbYVPDoH5/tryorama/vypSXL/conductor-config.yml
        12:31:30 info: 
        ☉☉☉ [[[CONDUCTOR c0]]]
        ☉ 
        ☉ ###HOLOCHAIN_SETUP###
        ☉ ###ADMIN_PORT:33000###
        ☉ ###HOLOCHAIN_SETUP_END###
        ☉ Conductor ready.
        ☉ 
        12:31:30 [tryorama] info: Conductor 'c0' process spawning completed.
        12:31:32 [tryorama] error: Test error: {
          type: 'error',
          data: {
            type: 'internal_error',
            data: 'Conductor returned an error while using a ConductorApi: EntryDefStoreError(DnaError(WasmError(Compile("link error: Import not found, namespace: env, name: __debug"))))'
          }
        }
    ✖  Test threw an exception. See output for details. at <anonymous> (/home/student/elemental-chat/tests/node_modules/@holochain/tryorama/src/middleware.ts:137:13)
        undefinedundefined
        12:31:32 [tryorama] info: conductor 'c0' exited with code null
        FIXME: ignoring onLeave
    ✖  test exited without ending: multi-chunk at process.<anonymous> (/home/student/elemental-chat/tests/node_modules/tape/index.js:85:19)
        undefinedundefined

passed: 0  failed: 2  of 2 tests  (17.1s)

2 of 2 tests failed.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! demo-1@0.0.0 test:standard: `TRYORAMA_LOG_LEVEL=info RUST_LOG=holochain::core::ribosome::host_fn::debug=debug RUST_BACKTRACE=1 ts-node src/index.ts | tap-diff`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the demo-1@0.0.0 test:standard script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/student/.npm/_logs/2021-02-13T11_31_45_731Z-debug.log
npm ERR! Test failed.  See above for more details.

[nix-shell:~/elemental-chat/tests]$ 

As mentioned in this pull request I have also tried it with this command in between.

Has someone managed to get this working?

Yes, I was able to. I think the main issue here is holochain versions, the nix shell you are in has a different version that the elemental chat is compiled with. This will change once nix files are added to the repo, in the meanwhile you can try to compile holochain from the core repository with the hash with which elemental chat was compiled: https://github.com/holochain/elemental-chat/blob/develop/zomes/chat/Cargo.toml.

1 Like

Thank you for your input.

Your linked file says:

...
[dependencies]

hdk3 = { git = "https://github.com/holochain/holochain.git", rev = "91d08f6574b2de41f5fcd27c23abfceeb54912a5" }
...

I looked up the syntax this says that the github branch of the holochain repository with the branch hash of “91d08f6574b2de41f5fcd27c23abfceeb54912a5” was used to compile the elemental-chat. Am I right?

Now for me the question was which branch has this hash.
I looked up all hashes for all branches unfortunately none of them matches.

I must miss something crucial here but I dont know what.

command output
git rev-parse origin/2020-04-10-roughtime 4f78f31961e2215064bad78c832f9400d937bd2b
git rev-parse origin/2020-04-27-riboplugin be57b5de1efc679e5ada198050fce5f11e2732b7
git rev-parse origin/2020-06-04-call-remote 95f5b653c1bb8ab55c1c3c02f961493766605430
git rev-parse origin/2020-06-11-entry-def-docs 9b8bf6b60473d2c3e7cf3a01d233968e07883424
git rev-parse origin/2020-07-09-link-tag-paths 0e52863879301b660b2226092848084db74c97fb
git rev-parse origin/2020-07-28-delete-entry d5911db05c32e29288e8ff70f49320673af2b605
git rev-parse origin/2020-08-03-validate-links 0674c76b933065762cfb0c81f1fdc47eaa040333
git rev-parse origin/2020-08-05-crate-prefix-hdk 52d7cd9f471b30879a2d949efa9e8372dd5cbd3f
git rev-parse origin/2020-08-05-entry-defs-macro 6bce715f914dd7926108ef43c9860a3eba6e6545
git rev-parse origin/2020-08-07-bench bc0867fccd6e0443c49fcceae19d4c24dfbc6b71
git rev-parse origin/2020-08-11-pewpewpew f17829430066836db0ddadae5bb4cb93e417b5fb
git rev-parse origin/2020-08-14-hdk-review c8ed3cc53b56800a48a7bdc3e7a421413f948555
git rev-parse origin/2020-08-20-hdk-sweep 3329a5347748cba655cf26f3cd80a2b14bcc9a89
git rev-parse origin/2020-08-23-hdk-sweep ceaebfba2a32da59fcd915666b8fe868ea6ffa50
git rev-parse origin/2020-08-24-hdk-sweep b5ecfac66328043c2778405ba2145f6c997f5640
git rev-parse origin/2020-08-25-hdk-docs b8a012c37803ac6b5243fcede25fd64d6380fcac
git rev-parse origin/2020-08-26-cap-commit c2668c2e55a114f574213124eaa9563825a96cba
git rev-parse origin/2020-08-28-cap-grant eced21ebd0c0a654f0cff71ef90f513e9b0b0026
git rev-parse origin/2020-08-30-cap-claim 69b8f6079786913ef4180fd0b6dc0a513e1ebbfa
git rev-parse origin/2020-09-03-cap-claim-crud 478c2031a463ba4785c722af8a5de58d25d98cea
git rev-parse origin/2020-09-12-create-entry d4c41d5ded8e67b83be0a1cec7f2188851cd98da
git rev-parse origin/2020-09-15-docker 766f4ef8495f6cffe40e5d88b92dc96bf133f67d
git rev-parse origin/2020-09-15-speed-test 6cbc6a84d7958752b1f90411b07310d1712e143d
git rev-parse origin/2020-09-17-binary-on-path 40c36ef06af863d6a7242bf64022126bc4f5406b
git rev-parse origin/2020-09-18-sign bac45f40c96ca0366522d16a0fc770703d9daa4e
git rev-parse origin/2020-09-21-remove-pewpewpew d860b7a38f906a0be58dc6682b36dfbde02a5f88
git rev-parse origin/2020-09-22-windows-test bbcf7b3618f34728dd9e7bd4e84a944780a8e57f
git rev-parse origin/2020-09-23-bench-test fc3ec573c90385c7f8280e7f1f2c9093ddcc9ea8
git rev-parse origin/2020-09-28-peer-db 459043b54045f4506b9cc2aeb67165e4cf5f4672
git rev-parse origin/2020-11-04-bootstrap ea3b5b5ab79069ce066605b8c616f4bb21828de1
git rev-parse origin/2020-11-07-expires-after-bootstrap c73ff0d9c62d5e05e3ecacb2f1b341169ad8a090
git rev-parse origin/2020-11-07-now 313666f199dbf0cffe5bb5c728834a222480add5
git rev-parse origin/2020-11-11-bootstrap-config 81db177a86910259e4ce777dbdf2269354388268
git rev-parse origin/2020-11-11-disable-bootstrap 840df61c13bb7e0c2ab1752a0a154eb56ee90cb7
git rev-parse origin/2020-11-15-bootstrap-docs 5625cbb1b4d18b5da80dbd76ce9a2783aebbdd57
git rev-parse origin/2020-11-16-export-hdk-externs a88d36eb3a2c9f52a9e604c3185b47c63fd93b37
git rev-parse origin/2020-11-16-host-externs 3493294a067951c9e77c70d574c54112279fdf34
git rev-parse origin/2020-11-16-infallible-debug 340c53684026c154119ba7ae015fd7ab5fa2045e
git rev-parse origin/2020-11-16-thiserror-again 67bfacd24fde4cd03c3a3053a2a681c61fdae0ac
git rev-parse origin/2020-11-17-constant-length-path 95b891cf08b74d0654433dd1ce78b45a6e7f6a44
git rev-parse origin/2020-11-17-hpos-deps a62499a8ea67018838d88290b96ce246abb738ce
git rev-parse origin/2020-11-17-references-hdk 4976f3fedbbd284cb51135cab9c2f637d0546627
git rev-parse origin/2020-12-15-devtest 5533eb485fb818f796f5af0c74087638ec5b63a8
git rev-parse origin/2020-12-16/devtest 0541ef36a8d14156bdf02af4babc22001170c235
git rev-parse origin/2020-12-17-dev-test e23bd8bdb3078ac6e21f2a1b1b4c34f8f37bb917
git rev-parse origin/2020-12-23-hpos 5daac31fe21f5d10c192bbe208f0b11f8ee67d88
git rev-parse origin/2021-01-04-hash-entry-consistent 45e2e46ea8c84de3b71ef4ed9a60b1875d5c862d
git rev-parse origin/2021-01-04-static-hdk 489f7869be2367223cf88638bd143c33b01ba5e5
git rev-parse origin/2021-01-21-error-handling 8b350b3e1f80f9f397a27686306d484968b0df5c
git rev-parse origin/2021-01-29-observability-fix 9de90306ccd8511d9c1bae6a755df7c10137d8df
git rev-parse origin/2021-02-02-hpos ee41e20fe6fe1936cb688839085acb5e9c1312e2
git rev-parse origin/2021-02-02-tracing ba8ff2a49b4ab28402ab80a7f8d6f2cc38ca3450
git rev-parse origin/2021-02-04-wasm-return 3a0d3dcb4698a3806763a9ab7dd9c5e93fce9501
git rev-parse origin/2021-02-08-entry-type-id c8a15e3f1c2a9851305097a7fcfd2c9a8743bfe0
git rev-parse origin/2021-02-08-prelude 2523087aabd695451b329491f845488bcbf1688e
git rev-parse origin/2021-02-08-sign-vec 9fb1f8b5ed907214eaf2784201ea9595b67bad21
git rev-parse origin/2021-02-10-fix-build 0a0e0a888f80c304cd38b4e64f224cfc762ac1b9
git rev-parse origin/585-split-entry-macros 4e21ffd7fb3cab2c38a697dd0ecf5da061d2950d
git rev-parse origin/HEAD -> origin/develop 4e1de9c2209a44c67839b9682ad4c9179a96f6c8
git rev-parse origin/JettTech-patch-1 d54d4fec69aeca21dfc6ed8927f4e715e8dfbbed
git rev-parse origin/JettTech-patch-1-1 c6a913a1a94e4ec86fc53cbcf34b1e1c98d83fe5
git rev-parse origin/add-changelog 00397d03c1bf762dc0ff8aad072cce9facf91cb2
git rev-parse origin/add-multiple-calls-test 62d1a865b587c3327b1da89d1f978513c8496fd6
git rev-parse origin/add-signal-channel 03f1c27e288f132c8d883cb2ce0ce5ad10ce6232
git rev-parse origin/add-test-doc de6bdab261df4f77ec1b150edb6532812ccb77ed
git rev-parse origin/attach-app-interface-at-any-ip 9c42712662ca1e687196a33640a8b750458a6bc5
git rev-parse origin/better_state_dump 4982ddb1ecede5863cc5aa3c409dd2c7fcb88fad
git rev-parse origin/call_remote_reg_test caf6e3aa606b26b113f164f4176f94cf801dfb76
git rev-parse origin/chill_out_pub a056a261666de6a22021ab8b6226a05bf5f5f631
git rev-parse origin/commit_limit 0fec3c1d793801f630c462a9d66bcaae3d3fa9fa
git rev-parse origin/crate-reorg-1 465c68dd90ef8eb2180d2c38e718bc915d7b41af
git rev-parse origin/crate-reorg-2 d46ce7a7a30e8721ef489dc4422209e0abe741da
git rev-parse origin/crate-reorg-state 49fae857a40ab488fc8a40f387cffde9ce371298
git rev-parse origin/crate-reorg-state-2 54b4b3ce40c12fc156b2f7124436fa2b3c2d1b21
git rev-parse origin/db-fixtures f9503108a36bdd538c0607af23002e257a3934b8
git rev-parse origin/debug_ec_2 e61a001f107f9d7f3cea61fd80e6ad982c6e1c0f
git rev-parse origin/debug_ec_3 556f3057bc6e03d1d1e14d7e86f17df87769be63
git rev-parse origin/debug_ec_4 bc893df6e7b25094bda8bc80f9e5ba9ec6d9206d
git rev-parse origin/debug_ec_5 140408fa7cd3d526e90a576646d1d6f88e7933e6
git rev-parse origin/deletes_on_updates bdf5e99b2913d775128c9b47070d3abd67cc552f
git rev-parse origin/detect-as-at-collision 1e873f7137f05e36713772519ee84c3841d8b90f
git rev-parse origin/develop 4e1de9c2209a44c67839b9682ad4c9179a96f6c8
git rev-parse origin/docs 9f196d164aed985aee49ef9d32d996319282f031
git rev-parse origin/docs-feature-list cf799bbceb8dd09122bf666759135b33fcea85a4
git rev-parse origin/ec-scalability-test-fork 84414b6f80d3b357368318a4898704708bb6b5cf
git rev-parse origin/entry_def_store 802e1103282c0aa34edb3d018ac487ebdf66c3f2
git rev-parse origin/entry_defs_cell 8bc7ce6cccb3efcdeb2845d147c8ade457936ac1
git rev-parse origin/entry_dht_status e9824222f10bf94c44f6ccc18bfd60d4137e4243
git rev-parse origin/eraser-based-reader-refactor 62e0c94fb38316d8a0d070c4bc7e8a0c7beee841
git rev-parse origin/error-cleanup 39e42cabe8b2ea019b81dc991ae285b89eb6e51e
git rev-parse origin/fix-multiple-commit-deadlock 2bb6ad9ebbf8834aae385a6b312d66582610038e
git rev-parse origin/fix_serde_renames 96ab91354bd513b09a5fb34d77f15d445e3b8e3c
git rev-parse origin/guillemcordoba-patch-1 cdd01b3be7b483b9425952a972c26235f2821f1b
git rev-parse origin/happ-bundles 814a209197510a2f2505cb855a63c9518613aa65
git rev-parse origin/happ-bundles-1 a410be8fbd7c6015c307540142e77148603710bc
git rev-parse origin/happ-bundles-1-point-5 2b0c578e2d4754f96f6235134e37eaaa79f98dac
git rev-parse origin/happ-bundles-2 28b78a500d7a6e18badc283aafa79d72be452de7
git rev-parse origin/happ-bundles-cli 41d66bbdce820e93706811a539b9f3db23098beb
git rev-parse origin/hashtype-serde-weirdness da8115e4bb75925af8db6dbf325678e31dd0d653
git rev-parse origin/hc_dna_util 40afd309535a1a2a60e6f44e18717d01073dcef9
git rev-parse origin/inline-zome-validation 002a8436caa6ff56ca05e3f08c676a4f881e9e43
git rev-parse origin/install-app-with-none-TK-05043 ea8ca08e9fa8986589df529d458bc1f9268040d8
git rev-parse origin/integration-tweak 62f4cee80d8eb02adb1a9bc2902899316b2c1298
git rev-parse origin/invalid_cell 266d19d07b69013357d90bddf10ca24bde3073db
git rev-parse origin/invalid_cell_2 55d9065b2b4eda3a7565549f89664c43f16cd09c
git rev-parse origin/kitsune-direct 4cb4707df6de84a85d79f2accd4f38d77feb8365
git rev-parse origin/kitsune-tuning 42a8e3e10a08c019e7f07724f113134e99d454e7
git rev-parse origin/kitsune-tx2 1ff9b8899e435e937f67f0af74888a477c13db40
git rev-parse origin/lair-config-fixes 66825a746b83c14c95ac3751ed8ac20067d71e96
git rev-parse origin/list-active-apps 5df65c23c055e77eadc7ebf701d7df73f7cd66bc
git rev-parse origin/lmdb-rkv-regression 85feaefac0da2b9b381a19b13be8117c5d119790
git rev-parse origin/local-only-cap-grant 549fff6e8c3353f9f381883127ec6e81039e1f22
git rev-parse origin/main 87042970b1db1b4276972d61814c6d7ad6f564c0
git rev-parse origin/mem-test-reader 17bc3934a438bc1bbe29eb89cf0cf5f02af39690
git rev-parse origin/mr-bundle 25d9f624e622369defc6dd4e4eb6cfbcce411c6f
git rev-parse origin/naive-gossip e56125af833c8bc63de58a50820f4f223143d182
git rev-parse origin/network-api 4d908950304d574a4f6c975aceac871f3febd031
git rev-parse origin/network_fs_1 4692788cf03608f2c9f0e8279a180db428ce74fe
git rev-parse origin/new-docs 755234ee10dbb80aa21baec10c9f7a9b539444ef
git rev-parse origin/poc-multi-index 6239c24da150e5e785b7ec6ac22f3ebdcd55ec19
git rev-parse origin/pr/fixup-macos-builds 7c901d6ebc2e3f7401b2a213a3fc980c0be4ab7d
git rev-parse origin/pr/shells/coredev-add-hn-rust-fmt 3fac6126011146b0fec2f43dea509d0e02e956dd
git rev-parse origin/pr/syntax-fixes 3f1c535a5f2aec621c1550088cb4d5169677d812
git rev-parse origin/pr/tokio-0.3 06cea2bb1052eb93add5c9912c0870ade9dba69a
git rev-parse origin/prefix_bufs 50fdd0fc2b3ac421df322ac57c407ebc3dfd3e00
git rev-parse origin/proxy-stress c7475c1b5e620614f07f239fe01a32a1735cea32
git rev-parse origin/publish_dhtops_workflow 76ea81615c4263e7b622724af1c2970d9d67bd4e
git rev-parse origin/quic-bench 65eaf7dab5f57bbceb62c01cf4ef197b6810038a
git rev-parse origin/readme-B-01561 0a54dba1556683a9bf46ca7eaeb074b5218857a3
git rev-parse origin/readme-TK-01743 0a54dba1556683a9bf46ca7eaeb074b5218857a3
git rev-parse origin/readme-top-level 85255a6bacb3f5cfd1ca2db4238ad04515efe616
git rev-parse origin/readme-updates df877cd7b12f376a3024781e7b2a9c3b553348f1
git rev-parse origin/register_element_header ee3f9df15a649723e2af0d7a7c9131172bf030a3
git rev-parse origin/relax-deps 870cc164b365a262f4b032760fc5ed1712a6fee9
git rev-parse origin/remove_async c74c35ac41731db5d98ebafaf986d9f6cf501c35
git rev-parse origin/rustc-bug 0eb42ba904a813492572ed401643608916a0686c
git rev-parse origin/show-cap-issue f3ef1f2841a754db1778edc10a9aea87a8cb053d
git rev-parse origin/simplify-shutdown e76b6ca93645b2ae683be244098c59e86f0e7c99
git rev-parse origin/small-fry 1dea60563cf2d2585fced7acb7a3e113470af675
git rev-parse origin/socket_ghost d93c994966813efe768c56b569675b92b6bd1898
git rev-parse origin/sodium 358b4c2cc77d88741e76126d89b6b8c583c54cce
git rev-parse origin/spawn_limit b3c7609c8773f4d8a6f56ebd2930f56205528306
git rev-parse origin/spawn_limit_2 c75a6e21b49523e510f50b081a1a22a964d5562f
git rev-parse origin/spawn_limit_bench a7b053df25f02c3a9262efd4cdd7f63f60a90905
git rev-parse origin/spike-tom-mike e377bf986a54ade3a9131a172bfd5df665d32919
git rev-parse origin/sqlite d0b0014dc299b838e9f334764d8518b6ee74bbec
git rev-parse origin/state-dumps 9408e16f80f7f7d403bbecc7e81feace59bb338e
git rev-parse origin/sweet-dna-file 0398ab0f7339c7facb197a39ef652ab052b67b7e
git rev-parse origin/test-source-chain-size 89f61a713fa1ec44d5d1cbf87837ea55b1dd1e06
git rev-parse origin/test_el_chat 901952e6aed73bc5d1d3f40c04c879a6ec28990d
git rev-parse origin/test_slow_get_links ea9c136570f61a851ccae9751c6ea06465699cbc
git rev-parse origin/throw-away-perf 7e14b66a97af3408a27732f3cdd0fd19af3dcb36
git rev-parse origin/tracing_spike a8afcb3f1108703542afec1f69f286e179278fb5
git rev-parse origin/ui-access e2a22a1d47cc79be29fc22dd05460a3a5c113a8e
git rev-parse origin/wasm-call-timing-TK-02024 6aee8e4fb725fa2776703492e4ab32551aeccee7
git rev-parse origin/wasmer-guest-patch 53ef6ae97902fa4482fc288ec92b4fe093ad1890
git rev-parse origin/yaml-dna ae08cd14d29a06ba40eada17685a729cacbd65a9

So that hash isn’t really associated with any branch. You need to just do git checkout HASH inside the core repository and then compile the source code.

1 Like

Thank you very much I now got the “npm test” command working.

Do you maybe know if the “elemental-chat-ui” is allready ported to the Holochain RSM?
https://github.com/holochain/elemental-chat-uia

Well it’s actually been built only for RSM. So yeah, I’ve been able to make it work, although beware of environment variables inside the js code and setting them in the package.json

1 Like