1

i have create a private network with 2 nodes. I have connect an account with metamask from my private network and i have created a full dapp ( contract,front-end). Now i want to deploy the whole dapp on my private network without truffle. Can you help me pls!~?

2

Now I want to deploy the whole dapp on my private network without truffle.

You are misunderstood Panos, you can't deploy the whole dapp into the blockchain. But you can deploy contract into private blockchain and using frontend you can interact with smart contract.

You need to do the following things:

  1. Start your private network node
  2. Open remix, compile and deploy your contract into your local node. (In the remix, change the environment to Web3 provider and connect to your localnode IP address).
  3. Connect to your localnode using web3. Like this,
const web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545")); //Your localnode IP
  1. To interact with that using metamask you also need to change networks to your custom RPC from metamask

By doing this, you can successfully run the dapp without using truffle. I hope this will help you.

  • Thanks for the help again. I connected remix but where i write the below command? const web3 = new Web3(new Web3.providers.HttpProvider("localhost:8545")); In my app.js file where i have the front end? And after that i run npm run dev to run the front end? – Panos Kor Jun 25 at 12:44
  • Panos, this methods is for nodejs, if you want to connect to your localnode using normal javascript there is a different method. I already answered that in your other question. – Mr. Sirja Jun 26 at 5:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.