/lekhanam4stella

Lekhanam is from Malayalam language meaning Letter. And we try to send PostCards!

Primary LanguageTypeScriptApache License 2.0Apache-2.0

Lekhanam 💌

Lekhanam is from Malayalam language meaning letter.

Lekhanam lets you create a greeting card and publishes it to the Stellar blockchain. Which could be later used by 3rd party postal services to distribute the postcards.

Demo

Lekhanam demo is Deployed at Vercel. Where you are able to interact with the dApp on Stellar testnet.

Note: Currently the smart contract is only deployed to Stellar TestNet.

Setup

The application resides in the folder soroban-react-dapp.

The smart contract is the contracts folder. The NextJS application is in the src folder.

Once you clone the project, you would need to cd into the soroban-react-dapp folder. And run yarn to install the packages.

Then cd into the contracts directory and run

cp .env.example .env
yarn
yarn build
yarn dev

This will start the soroban frontend application

You can then cd into the individual contracts, here it's greeting

cd greeting
cargo build --target --release wasm32-unknown-uknown

Which would create a wasm file for you in the target/ directory.

You can then use stellar cli to deploy the wasm file onto the stellar blockchain network.

Deploy

Deploy to Standalone/local using Stellar CLI

stellar contract deploy \
    --wasm target/wasm32-unknown-unknown/release/greeting.wasm \
    --source alice \
    --network local

Deploy to TestNet using Stellar CLI

stellar contract deploy \
    --wasm target/wasm32-unknown-unknown/release/greeting.wasm \
    --source alice \
    --network testnet

Note: In order to deploy with Stellar CLI, you would need to generate an identity (we used the identity here as alice). And also define the network configuration we would be using, i.e., testnet, futurenet, mainnet, local

And once the contract is deployed, it will give you the contract address of the wasm file in the network you have deployed to. Copy that address and replace the appropriate contract address in ./soroban-react-dapp/contracts/deployments.json according to the network the smart contract was deployed in.

And if you have run yarn dev the applicaion would update as soon as you save the changes. Just refresh the browser window to get you dApp sync those new changes.