MaastrichtU-IDS / DecentralizedHealthcareBackend

Other
0 stars 2 forks source link

Deploy Registry from Postman #20

Closed Giacomo-Terragni closed 1 year ago

Giacomo-Terragni commented 1 year ago

This is what i did:

  1. Closed everything
  2. (venv) PS C:\Users\giaco\OneDrive\Documenti\Maastricht University\Year 3\Thesis\DecentralizedHealthcareBackend\luce_vm\brownie> .\venv\Scripts\Activate
  3. (venv) PS C:\Users\giaco\OneDrive\Documenti\Maastricht University\Year 3\Thesis\DecentralizedHealthcareBackend\luce_vm\brownie> pip install eth-brownie
  4. I then deleted "build" in "C:\Users\giaco\OneDrive\Documenti\Maastricht University\Year 3\Thesis\DecentralizedHealthcareBackend\luce_vm\brownie"
  5. (venv) PS C:\Users\giaco\OneDrive\Documenti\Maastricht University\Year 3\Thesis\DecentralizedHealthcareBackend\luce_vm\brownie> brownie compile

Now the "build" folder gets created again, i don't know if this is correct.

If now i start the containers and run the Postman post request is get the error: SolcNotInstalled at /admin/deployRegistry/ solc 0.6.2 has not been installed. Use solcx.install_solc('0.6.2') to install

however, I installed solcx 0.6.2 in both brownie and django.

klifish commented 1 year ago

You are correct.

We are running a blockchain instance in a Docker container (ganache_db), and we install the brownie framework in another container (luce_server).

Currently, we haven't made any configuration for compiling smart contracts while launching a new container. LUCE will use the results compiled in your local environment.

Actually, brownie will download a proper compiler according to the compiler version specified in the smart contract.

Please tell me the results after you run the command: brownie compile. @terraarret

Giacomo-Terragni commented 1 year ago

when running the command it prints:

Brownie v1.19.3 - Python development framework for Ethereum Project has been compiled. Build artifacts saved at C:\Users\giaco\OneDrive\Documenti\Maastricht University\Year 3\Thesis\DecentralizedHealthcareBackend\luce_vm\brownie\build\contracts

The "build" folder in Brownie appears again but i still can't deploy the contract ( i get solc 0.6.2 has not been installed) @klifish

klifish commented 1 year ago

when running the command it prints:

Brownie v1.19.3 - Python development framework for Ethereum Project has been compiled. Build artifacts saved at C:\Users\giaco\OneDrive\Documenti\Maastricht University\Year 3\Thesis\DecentralizedHealthcareBackend\luce_vm\brownie\build\contracts

The "build" folder in Brownie appears again but i still can't deploy the contract ( i get solc 0.6.2 has not been installed) @klifish

Delete the build folder, and then run brownie compile, I need to know if the compiler is downloaded correctly.

Giacomo-Terragni commented 1 year ago

the following is the output, it seems to be working fine. Brownie v1.19.3 - Python development framework for Ethereum

New compatible solc version available: 0.8.19 Compiling contracts... Solc version: 0.8.19 Optimizer: Enabled Runs: 200 EVM Version: Istanbul Generating build data...

Project has been compiled. Build artifacts saved at C:\Users\giaco\OneDrive\Documenti\Maastricht University\Year 3\Thesis\DecentralizedHealthcareBackend\luce_vm\brownie\build\contracts @klifish

klifish commented 1 year ago

OK, cool! The compiler version is fine!

Then try to clean the run-time environment, and run LUCE from the beginning:

  1. Delete the containers
  2. Delete images
  3. Delete the data folder which is located at the same level as luce_vm and docker-compose.yml
Giacomo-Terragni commented 1 year ago

ok, i started luce from scratch but i still get "solc 0.6.2 has not been installed"

klifish commented 1 year ago

ok, i started luce from scratch but i still get "solc 0.6.2 has not been installed"

OK, I know what happened! Did you pull the updates? I just remember I encountered this issue and fixed it in the latest updates. @terraarret

Giacomo-Terragni commented 1 year ago

Now it works, cheers :)