How to Deploy Compiled WASM Contract on 5ire Native Chain

Deploying WASM smart contract for the first time can be very hard for beginners like you but worry no more because I will try to simplify the process for you.

Note : This tutorial is only for windows users like me.

Now let us start.

1. Install Git on your computer,

https://git-scm.com/download/win

Just select the one according to your computer’s version.

post image

2. Install code writer on Microsoft store. Don’t worry it’s free.

post image

After a successful installation, just close it . We will use that later on.

3. Install node.js

https://nodejs.dev/en/download/

Choose the Windows installer . After a successful installation, open a node.js terminal. Go to start button, search “node.js command prompt” and run that as administrator.

post image

4. Now, let us clone 5ire’s repository for WASM contract deployment Run this command on your node.js terminal,

git clone https://github.com/5ire-tech/wasm-contract-deployment.git

Wait while the system is copying the whole WASM contract from the 5ire’s repo.

If you see things like this, that means cloning is successful . Then let’s proceed next.

post image

5. Go to you file explorer then look for “wasm-contract-deployment” as what you can see below.

Click to open it and look for “deploy” folder.

6. Right click that folder and open it with code writer. Remember the one you installed awhile ago? That red icon below. It will show you the whole script of the wasm contract.

post image

It will show you the whole script of the WASM contract. Like this one.

post image

7. Now , scroll down the contract and look for this

post image

Replace it with your 5ire chain wallet seedphrase. Be careful. Do not disclose your seedphrase to anybody. That one above is just an example.

Now here is the problem. You cannot save the changes you just made right away due to some security reasons. In addition, it’s probably because you do not have yet the write permission to the directory where the file is located. But don’t worry we can change the permissions of the directory to allow write access.

Here’s how to do it in Windows:

8. Right-click on the directory file where the file is located and select “properties from the context menu.

post image

9. In the Properties window, click on the “Security” tab. 10. Click on the “Edit” button to change the permissions for the directory. 11. In the Permissions window, click on “Add” to add a new user or group. 12. Enter your username ( that username in your Microsoft account) in the “Enter the object names to select” field and click on “Check Names” to verify the name.

13. Click on “OK” to add the user to the permissions list. 14. In the Permissions window, select the user you just added and check the “Full Control” box in the “Allow” column.

15. Click on “OK” to save the changes and close the window.

After changing the permissions of the directory go back to the contract and try saving the changes you made awhile ago by pressing control + S. You should be able to save your seedphrase by now.

To confirm whether the old seedphrase has been replaced by yours, try closing the code writer and open it again. You should then see your seedphrase on the contract. Then let’s proceed on deploying the contract.

Make sure your wallet has already have some 5IRE test tokens on it to spend on gas fee. If not then try requesting in the faucet . Just click the link below.

https://explorer.5ire.network/faucet

Just paste your 5ire native address in the box and the amount you want to . The max request is 100.

post image

It will just arrive to your wallet few minutes after requesting.

Now let’s begin deploying the contract.

16. Go back to your node.js terminal and run this command:

cd wasm-contract-deployment

Then this:

npm i

That should look like this.

post image

Now let’s proceed to the final deployment buy running this command:

node deploy.js

Just wait for awhile then it should look like this.

post image

You should see that 5ire address below to consider your deployment is successful. If it is, then Congratulations! You made it.

Wait for at least 3 - 5 minutes then confirm the transaction on the blockchain. Just go to the explorer.

https://explorer.5ire.network/dashboard

Paste your native address on the search box then hit enter. Click on the most recent tx hash. That should be like this.

post image

Aaaaand that’s all . Goodluck frens!