Metis | Introduction to Polis
ETHGlobal·Sat, Oct 9, 2021, 12:00 AM
Watch a workshop titled, "Introduction to Polis," part of ETHOnline 2021, a month-long virtual hackathon with over 1,000 engineers, designers, and creators building new protocols, learning at summits and workshops, and gaining valuable feedback from ecosystem professionals along the way. ---------------------------------------------------- Follow us: https://twitter.com/ETHGlobal Check us out: https://ethglobal.co Email us at: hello@ethglobal.co
Transcript
hi everyone welcome to the guide to use the polis application and how you can use it to manage your smart contracts as well as user authentication in this tutorial you need to have node yarn and hard hat first we want to create an account on polis when you create an account you will be provided with 0.1 test metis tokens for development purposes if you'd like to get more tokens navigate to testswap.metis.io forward slash faucet in order to use the development section of polis you have to click the button requesting for registration we will clone the repository and deploy this smart contract in this project we have three folders the client contract and server we want to navigate to the contract folder to the example.nf file we have two environment variables bemidji's deployment url and the private key to get the most updated version of the deployment url navigate to docs.
metis.io forward slash connection details for the private key when you created your metis account a non-custodial wallet was automatically created in order to access your polis private key navigate to profile settings click export private key and copy the value navigate back to the editor and paste your private key once you are finished filling in the variables make sure to change the name from example.end to dot amp open up a terminal and type yarn install next type in yarn metis this command should compile and deploy your contract to the metis mainnet once deployed navigate to the polis dashboard where we will add your contracts to be managed by polis notice how our balance has changed after we deployed our contract to add our application to polis we'll be using both the create domain section and the application management section note that in order to use these options your account has to have developer status as active navigate to create a domain and click on create new domain add in your domain name this name is unique and in my case my domain name is testing now we need to add in the abi the abi is generated when we compile the smart contract navigate back to our editor go to the contract folder and look at deployments forward slash metis forward slash cryptodevs.json you can see the contract address and the abi copy the abi and navigate back to polis paste your abi into the api section next we want to add the contract address let's navigate back to our editor you can scroll up to find the contract address but you can also copy the address from the terminal navigating back to polis we can set the chain id and input the contract address to finally create the domain now our smart contract is managed by polis let's create our authentication for our application for the polis front-end navigate to application management and click create new app fill in all of your details for the application since we'll be using a local development environment for this application we will type in localhost.localdomain colon 3000.
if you'd like to know more about configuring your host file see docs.metis.i you should now have created your application now ready to start populating this information into the application navigate back to your text editor navigate to the client forward slash example dot n fill in the app id next fill in the contract name in my case it is the domain name of testing next enter the chain id that your contract is deployed on in this case the contract is deployed on chain 435 once you are finished filling in the variables make sure to change the name from example.end to dot n next navigate to server forward slash example dot n fill in the app id and the app secret finally rename the example.nf to dot env the architecture of this application ensures that the secrets are secret now we are ready to launch this application in a terminal located within the same project directory type yarn server in a separate terminal within the same project directory type yarn client that should load and open your ready application we see this is our erc 721 creation application you should see a login button click that you'll be asked for approval for this application to access your information and request to make transactions accept the request and you should be redirected back into your application with your populated credentials next click on the create nft button enter the information for the nft in my case it'll be a space themed nft i've already found an image if you copy the image link you can paste it in the image url section click submit and you should see a dialog that pops up to accept the creation of the nft if we click accept we can see that our nft was created we can click the view button to view our nft congratulations you have just deployed your first polis application this application has some limitations if you refresh the application you will lose the access token that you have received when you approved your access to the site this is fixed by implementing a cookie service the contract has a limit of 10 nfts that can be created you can adjust this limit in the contract forward slash deploy forward slash erc 721 file you have to be logged into the application in order to make requests or view your nfts thank you for following along with this tutorial see you in the next one meetings is holding a hackathon from october 2nd to 30th with a prize pool of over 1 million usd in meetings tokens with tasks that range from building a new dap to porting an existing dap to the metis leader 2.
so what are you waiting for come register today
Automatic transcript — names and jargon may be misspelled.