Posts

Showing posts with the label terralunasmartcontracts

Interacting with Local Terra Smart Contracts Using Python

Image
In this article, we first connect to local Terra using Docker. Then we try to interact with local Terra smart contracts using Python scripts and at the same time use the CosmWasm functions inside LocalTerra\src folder written in Rust programming language. Finally, we will manage to interact with it. Connecting to Local Terra with Docker with Python First off, To start our interaction with local Terra, we need to make sure docker is running: Coppied to clipboard. sudo usermod -aG docker $USER Make sure you sign in to your docker profile to be able to easily log in using the following command docker login . Coppied to clipboard. docker-compose up Result: Coppied to clipboard. terrad_1 | 8:48PM INF received proposal module=consensus proposal="Type":32,"block_id":"hash":"3F119B6520D17CCC29A23F016B9E40151E3A5784A3F83D65BD0DD2D282FB1A4F"," parts": ...

How to Write Terra Smart Contracts: A Complete Tutorial

Image
This article explains the connections between the python codes we wrote earlier (same for JavaScript) and the pre-built functions inside the src folder created with the cargo generate–git command. Reading this article will give you a deeper insight into what actually happens when we instantiate, execute or query a state of Terra smart contracts in python code and how it communicates with the CosmWasm libraries written in Rust. Being familiar with Rust programming language can help you better understand the steps we are going to take to interact with the CosmWasm smart contracts on the Terra network. We have provided a small Rust tutorial to make you more familiar with Rust scripts at CosmWasm Smart Contracts - learning Rust series. What Are Terra Smart Contracts? In the blockchain, Terra smart contracts are instances of a singleton object whose internal state is persisted on the blockchain. A singleton is a class that allows only a single instance of itself to be created an...