Tutorial: Deploying your DApp to POA Network

POA Network is an extremely fast, low-cost network that is 100% compatible with Ethereum. This means you create as you normally would for Ethereum, but when you deploy to POA Network you get the benefit of a fast sidechain and gas pricing suitable for micro-transactions and gameplay.

Best of all, deploying to POA Network is easy!

The following tutorials use:

  • Google Chrome. Versions 59.0.3071.115+ are supported. Pop-ups should be enabled.
  • Nifty Wallet v 4.8.5
    or
  • Metamask v 4.11.1

Note: You will need POA or SPOA (for the Sokol testnet) to proceed. Instructions are included below.

Deploying to POA Network using Remix with Nifty Wallet:

  1. Download and install the chrome extension. For more instructions, see: https://github.com/poanetwork/wiki/wiki/POA-Network-on-Nifty-Wallet
    or
    https://poanet.zendesk.com/hc/en-us/articles/360008957634-Nifty-Wallet
    Note: Nifty wallet is currently not available through the chrome store, please download from its github page https://github.com/poanetwork/nifty-wallet

  2. Get some POA! You can buy real POA from Binance, BiBox, CEX Plus, HitBTC, or other exchanges. To start on the Sokol Test Network ( recommended for testing! ), you can get free SPOA using the faucet.

a. Go to https://faucet.poa.network/

b. Enter in your wallet address, select the ‘I’m not a robot’ box, and click the Request 0.5 SPOA button.

c. You should see a success box. Check your wallet to verify that SPOA has been added.

Note: You will need to be connected to the Sokol network to view your SPOA (see step #6)

  1. Open Remix

  2. Create a contract and paste the contract code into Remix.
    a. Press the + button
    b. Name your contract
    c. Paste in from your editor (or create in the IDE)

  3. Check compile functionality - either set to autocompile or compile manually.

  4. Make sure your Nifty Wallet is active and set to the correct Network (POA or Sokol). To change to the testnet, click on the Nifty wallet icon in the top right of your Chrome browser and select POA Sokol Test Network from the dropdown list.

  1. In Remix, go to the Run tab and select Injected Web3 as the environment. The Account and Gas limit should auto-populate.

  2. If your contract has compiled, you will see it in the dropdown menu (in this example it is called Count). Click Deploy .

  3. You will see a Nifty Wallet confirmation pop-up to create a new contract. Click Submit .

  4. View the details of the contract creation in the Remix transactions box.

  5. Click on the entry to expand the details. Copy the transaction hash.

  6. Paste the transaction hash into the https://blockscout.com/poa/sokol/ (if you are testing on Sokol - if you are on the POA main net go to https://blockscout.com/poa/core/) and click Search to view the details.

  1. In Remix, you can test your contract functions on the network in the Deployed Contracts section.

Deploying to POA Network using Remix with MetaMask Wallet:

Note: MetaMask and Nifty wallet can compete with one another when visiting a web3 site. The browser will recognize Nifty wallet first. If you have both installed but want to use MetaMask to interact, disable Nifty Wallet by clicking on the 3 dots in the top right corner of Chrome, going to Settings -> More Tools -> Extensions, and disabling the Nifty Wallet extension.

  1. Download and install the MetaMask extension for Chrome. For more instructions, see: https://github.com/poanetwork/wiki/wiki/POA-Network-on-MetaMask
    or
    https://poanet.zendesk.com/hc/en-us/articles/360007464553-MetaMask

  2. Get some POA! You can buy real POA from Binance, BiBox, CEX Plus, HitBTC, or other exchanges. To start on the Sokol Test Network ( recommended for testing! ), you can get free POA using the faucet.

a. Go to https://faucet.poa.network/
b. Enter in your wallet address, select the ‘I’m not a robot’ box, and click the Request 0.5 SPOA button.

c. You should see a success box. Check your wallet to verify that SPOA has been added.

Note: You will need to be connected to the Sokol testnet in MetaMask to see your SPOA (see Step #6).

  1. Open Remix

  2. Create a contract and paste the contract code into Remix.
    a. Press the + button
    b. Name your contract
    c. Paste in from your editor (or create in the IDE)

  3. Check compile functionality - either set to autocompile or compile manually.

  4. Make sure MetaMask is active and set to the correct Network (POA or Sokol). To change networks, click on the MetaMask wallet icon in the top right of your Chrome browser
    a. Sokol: https://sokol.poa.network
    b. POA core: https://core.poa.network
    c. xDai chain: https://dai.poa.network

d. Click on Networks dropdown.

e. Select Custom RPC from the dropdown list.

f. In the URL, enter the Sokol Testnet or POA RPC and click Save.

g. You will now see Private Network in the Network dropdown, and your balance will display.

Note: POA and SPOA coins with display ETH as the denomination, but these are POA/SPOA coins.

  1. In Remix, go to the Run tab and select Injected Web3 as the environment. The account and gas limit should auto-populate. Change limit and value if necessary.

  2. If your contract has compiled, you will see it in the dropdown menu (in this example it is called Count). Click Deploy .

  3. Will see a MetaMask confirmation pop-up to create a new contract. Click Confirm . Depending on your settings, Confirmation requests may also appear in the Metamask icon. Click the icon to review.

  4. View the details of the contract creation in the Remix transactions box.

  5. Click on the entry to expand the details. Copy the transaction hash.

  6. Paste the transaction hash into the POA Sokol explorer (assuming you are testing on Sokol - if you are on the POA main net go to https://poaexplorer.com) and click Search to view the details

  7. In Remix, you can test your contract functions on the network in the Deployed Contracts section.

Deploying to POA Network using Truffle Framework:

Greg from DApp University has created a video guide on how to deploy to POA Network using the Truffle Framework. Check it out below.

5 Likes