Skip to content

staex-io/tc-linera-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TrustedChain Linera application

Usage

You can install and use Linera application on testnet and local network.

Testnet

make init_wallet_testnet
make request_chain_testnet
make build
make publish
# fc7db02564389ad2886598769bfe2675c391970ae9155ca15b28fe1e8c0bdade
# Get your current chain.
linera wallet show
# 787eda3c41d105ee9b3eb271dbafc182c173cbb77f0d70c183ece2ea85570c10
make local_service
# Go to http://localhost:7070/chains/787eda3c41d105ee9b3eb271dbafc182c173cbb77f0d70c183ece2ea85570c10/applications/fc7db02564389ad2886598769bfe2675c391970ae9155ca15b28fe1e8c0bdade

Local

  1. Remove already defined local keys and chains.
rm -rf /Users/lavr/Library/Application\ Support/linera

This is a default location on macOS.

  1. Run local Linera network.
make local_net
  1. Init local wallet.
make init_wallet_local
  1. Request local chain.
make request_chain_local
  1. Build your source code.
make build
  1. Publish your application.
make publish

Somewhere save application id.

  1. Start local Linera service.
make local_service
  1. Get your default local chain.
linera wallet show

Get first chain id and save it somewhere.

  1. You can use application using GraphQL API

Go to http://localhost:7070/chains/<chain_id>/applications/<application_id> and execute GraphQL queries.

GraphQL examples

Land data on-chain

mutation {
  land(
    id: "6a300ad5-15c5-4ac6-be27-b8a4d1d972ee"
    hash: "903b1c65f8ad53b2acf8704cf2ae766eae37eac0b5196321f34c3e07df3ecf30"
    signature: "2c546b2937ea6452c1f381d0c20077f02f63af72f77c1ed76edd4e220e2f59733fada263eab046c55d89a1ca8a6e3504d65eb4d6f40205c3cc7ac2c4603ffb04"
  )
}

Query data

{
  value(id: "6a300ad5-15c5-4ac6-be27-b8a4d1d972ee") {
    hash
    signature
  }
}

Releases

No releases published

Packages

No packages published