Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AEWeb: display the size when listing the files of a directory #800

Closed
bchamagne opened this issue Jan 3, 2023 · 15 comments · Fixed by #807
Closed

AEWeb: display the size when listing the files of a directory #800

bchamagne opened this issue Jan 3, 2023 · 15 comments · Fixed by #807
Assignees
Labels
external contribution Contribution by non core team feature New feature request good first issue Good for newcomers web hosting issue regarding web hosting

Comments

@bchamagne
Copy link
Contributor

Is your feature request related to a problem?

No response

Describe the solution you'd like

We added the size (in bytes) of every files in the reference transaction.
We can now add a column to display the size of every files when listing the files of a directory:

image

Additional context

Example of a reference transaction:

{
  "aewebVersion": 1,
  "hashFunction": "sha1",
  "metaData": {
    "dir1/file10.txt": {
      "hash": "d5772baf70d86e28b3349580569f58b3ec1a8db9",
      "size": 8,
      "encoding": "gzip",
      "addresses": [
        "0000942ea8e9246f51f589373075bf09e3490c34138ce63702b3a27336bac8316168"
      ]
    },
    ...
}
@bchamagne bchamagne added feature New feature request good first issue Good for newcomers web hosting issue regarding web hosting labels Jan 3, 2023
@SamantaTarun
Copy link
Contributor

I would like to contribute to this issue. Please assign it to me.

@samuelmanzanera samuelmanzanera added the external contribution Contribution by non core team label Jan 4, 2023
@SamantaTarun
Copy link
Contributor

@Neylix How to run this project?

docker login require

@SamantaTarun
Copy link
Contributor

SamantaTarun commented Jan 4, 2023

ERROR: pull access denied for archethic-node, repository does not exist or may require 'docker login': denied: requested access to the resource is denied

@Neylix
Copy link
Member

Neylix commented Jan 4, 2023

@Neylix How to run this project?

docker login require

Hello, I recommend you to not use docker for developing as every change you do you will need to rebuild docker image which takes several minutes.
Instead you can install erlang and elixir (if you are on linux, you can run the script in scripts/install.sh) then use iex -S mix to run the project

@SamantaTarun
Copy link
Contributor

@Neylix
sed: can't read /etc/needrestart/needrestart.conf: No such file or directory
******* FAILED *******

@Neylix
Copy link
Member

Neylix commented Jan 4, 2023

@Neylix sed: can't read /etc/needrestart/needrestart.conf: No such file or directory ******* FAILED *******

You can remove the line 15 of install.sh file

sudo sed -i 's/#$nrconf{restart} = '"'"'i'"'"';/$nrconf{restart} = '"'"'a'"'"';/g' /etc/needrestart/needrestart.conf

@SamantaTarun
Copy link
Contributor

src/c/crypto/tpm/lib.c:5:10: fatal error: tss2/tss2_esys.h: No such file or directory
5 | #include <tss2/tss2_esys.h>
| ^~~~~~~~~~~~~~~~~~

@Neylix
Copy link
Member

Neylix commented Jan 4, 2023

src/c/crypto/tpm/lib.c:5:10: fatal error: tss2/tss2_esys.h: No such file or directory 5 | #include <tss2/tss2_esys.h> | ^~~~~~~~~~~~~~~~~~

If you run this manually, do you have any error ?

wget https://github.com/tpm2-software/tpm2-tss/releases/download/3.2.1-rc2/tpm2-tss-3.2.1-rc2.tar.gz
tar -xf tpm2-tss-3.2.1-rc2.tar.gz --one-top-level=tpm2-tss --strip-components 1
rm tpm2-tss-3.2.1-rc2.tar.gz && cd tpm2-tss
./configure --with-udevrulesdir=/etc/udev/rules.d
make -j$(nproc)

sudo make install
sudo sed -i "s/tss/$(whoami)/gi" /etc/udev/rules.d/tpm-udev.rules
sudo udevadm control --reload-rules && sudo udevadm trigger
sudo ldconfig
sudo apt install tpm2-tools -y

@SamantaTarun
Copy link
Contributor

@Neylix ,

I am pushing it, please run it

@SamantaTarun
Copy link
Contributor

I am getting many config errors

@SamantaTarun
Copy link
Contributor

Somehow run it

Please tell me the endpoint for getting this indexof screen

@Neylix
Copy link
Member

Neylix commented Jan 4, 2023

Somehow run it

Please tell me the endpoint for getting this indexof screen

You can look at AEWeb documentation here : https://archethic-foundation.github.io/archethic-docs/participate/aeweb/

You need to use aeweb_cli to deploy website : https://github.com/archethic-foundation/aeweb-cli

Code relative to AEWeb is in lib/archethic_web/controllers/api/web_hosting_controller.ex

@SamantaTarun
Copy link
Contributor

Endpoint for this screen in localhost

210397946-5cf43eba-8770-4a38-b0b6-e5fef049e286

@bchamagne
Copy link
Contributor Author

bchamagne commented Jan 4, 2023

Hello, thanks for taking this issue !

Start a node

as described in README.md

Clone AEWeb CLI

https://github.com/archethic-foundation/aeweb-cli

Add funds to a wallet

[bastien@T495 aeweb-cli]$ ./aeweb.js generate-address --seed bastien --index 0
000030831178cd6a49fe446778455a7a980729a293bfa16b0a1d2743935db210da76

and then go to http://localhost:4000/faucet and get 100 UCOs

Upload a folder

[bastien@T495 aeweb-cli]$ ./aeweb.js deploy --endpoint http://127.0.0.1:4000 --seed bastien --path /tmp/mydir/
Connecting to http://127.0.0.1:4000
Creating file structure and compress content...
Creating transactions ...
Estimating fees ...
Total Fee Requirement would be : 13.48326625 UCO ( $ 1.24 | € 1.16), for 27 transactions.
Do you want to continue. (yes/no) yes
Sending 27 transactions...
Transaction 1...
Waiting transaction validation...
Transaction confirmed !
See transaction in explorer: http://127.0.0.1:4000/explorer/transaction/0000f9b8d3eeb102cf2a11cd0b566aa9c9c651cf11814b30de1d5466c51decbc1952
-----------
[...]
-----------
Transaction 27...
Waiting transaction validation...
Transaction confirmed !
See transaction in explorer: http://127.0.0.1:4000/explorer/transaction/0000b5c0890d3bc52003f9279db6c22cf602bef7c08319ff765aea31c2c1ac919830
-----------
Website is deployed at: http://127.0.0.1:4000/api/web_hosting/00007d9167bdce9dbb1258501c3bc3a48494773554e5ceab15896d1617f5a6285683/

The URL of this upload is displayed last: http://127.0.0.1:4000/api/web_hosting/00007d9167bdce9dbb1258501c3bc3a48494773554e5ceab15896d1617f5a6285683/


In the code, this page is generated in ArchethicWeb.API.WebHostingController.DirectoryListing module.
I'll update the documentation with a meaningful example asap.
Hope this help!

@samuelmanzanera
Copy link
Member

Epic: #1062

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external contribution Contribution by non core team feature New feature request good first issue Good for newcomers web hosting issue regarding web hosting
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants