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

how to get this run installly? npm install,then "truffle migrate --reset", then "npm run dev"? #2

Open
Csyoung29 opened this issue Oct 10, 2019 · 2 comments

Comments

@Csyoung29
Copy link

No description provided.

@Csyoung29 Csyoung29 changed the title how to get this run installly? how to get this run installly? npm install,then "truffle migrate --reset", then "npm run dev"? Oct 10, 2019
@Csyoung29
Copy link
Author

$ truffle migrate --reset
Warning: Both truffle-config.js and truffle.js were found. Using truffle-config.js.

Compiling your contracts...

Compiling .\contracts\Migrations.sol
Compiling .\contracts\SimpleStorage.sol

> compilation warnings encountered:

/D/ipfs_image_uploader-master/contracts/Migrations.sol:11:3: Warning: This declaration shadows an existing declaration.
function Migrations() public {
^ (Relevant source part starts here and spans across multiple lines).
/D/ipfs_image_uploader-master/contracts/Migrations.sol:3:1: The shadowed declaration is here:
contract Migrations {
^ (Relevant source part starts here and spans across multiple lines).

Error: CompileError: /D/ipfs_image_uploader-master/contracts/Migrations.sol:11:3: SyntaxError: Functions are not allowed to have the same name as the contract. If you intend this to be a constructor, use "constructor(...) { ... }" to define it.
function Migrations() public {
^ (Relevant source part starts here and spans across multiple lines).
,/D/ipfs_image_uploader-master/contracts/Migrations.sol:20:5: TypeError: Name has to refer to a struct, enum or contract.
Migrations upgraded = Migrations(new_address);
^--------^

Compilation failed. See above.
at Object.compile (C:\Users\user\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\workflow-compile\legacy\index.js:72:1)
Truffle v5.0.38 (core: 5.0.38)
Node v10.16.0

@Atik-Mujawar
Copy link

Atik-Mujawar commented Nov 6, 2022

I would like to contribute to this issue by stating the steps to successfully run this decentralized application of (ipfs_image_uploader) and also the code as per the updated versions.
Step 1: Clone this repository to you system with the help of git clone command.
Command - "git clone https://github.com/dappuniversity/ipfs_image_uploader.git "
Step 2: Now to download all the dependencies of the project run this command.
Command - "npm install"
Step 3: After installing all the dependencies of the project now we have to compile the smart contract. Make sure you have your Ganache up and running.
Step 4: Before compiling we have to make some changes in the 'truffle-config.js' file, we have to un comment the deployment code and put in the details of Ganache which you are using.

development: {
     host: "127.0.0.1",     // Localhost (default: none)
     port: 7545,            // Standard Ethereum port (default: none)
     network_id: "*",       // Any network (default: none)
    },

Step 5: After making this changes we have to go to truffle folder and run this command.

- Contracts: Compile:         cd truffle && truffle compile
- Contracts: Test:                cd truffle && truffle test
- Contracts: Migrate:         cd truffle && truffle migrate

Step 6: After successfully compiling the smart contract now we should the run the frontend of the application

- Dapp: Run dev server:         cd client && npm start
- Dapp: Test:                           cd client && npm test
- Dapp: Build for production: cd client && npm run build

By following all these commands your application will be up and running.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants