All Projects → codemaveric → libra-go

codemaveric / libra-go

Licence: MIT license
Go Client for interacting with Libra Blockchain

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to libra-go

LibraBrowser
LibraBrowser
Stars: ✭ 37 (-26%)
Mutual labels:  blockchain-technology, libra
rippled-php
A PHP library for rippled (XRP Ledger) communication.
Stars: ✭ 33 (-34%)
Mutual labels:  blockchain-technology
blockchain-cli
⛓️ A minimal blockchain command-line interface.
Stars: ✭ 1,139 (+2178%)
Mutual labels:  blockchain-technology
berlinblockchainweek
Website for Berlin Blockchain Week 2018
Stars: ✭ 15 (-70%)
Mutual labels:  blockchain-technology
radiator
Hive Ruby API Client
Stars: ✭ 49 (-2%)
Mutual labels:  blockchain-technology
deep ethereum
电子书:以太坊技术与实现
Stars: ✭ 304 (+508%)
Mutual labels:  blockchain-technology
photos
"Fx Fotos" is an opensource gallery app in react native with the same smoothness and features of Google Photos and Apple Photos. It is backend gnostic and connects to decentralized backends like "box", "Dfinity", "Filecoin" and "Crust".
Stars: ✭ 620 (+1140%)
Mutual labels:  blockchain-technology
fingernft
FingerNFT是一款开源NFT市场,兼容Opensea、Rarible。
Stars: ✭ 1,827 (+3554%)
Mutual labels:  blockchain-technology
rivine
Blockchain technology for creating custom chains.
Stars: ✭ 23 (-54%)
Mutual labels:  blockchain-technology
readme
The Blockchain Bible,a collections for blockchain tech,bitcoin,ethereum,crypto currencies,cryptography,decentralized solutions,business scenarios,hyperledger tech,meetups,区块链,数字货币,加密货币,比特币,以太坊,密码学,去中心化,超级账本
Stars: ✭ 46 (-8%)
Mutual labels:  blockchain-technology
react-native-defi-app
React Native Defi Decentralized Applications(dApps)
Stars: ✭ 31 (-38%)
Mutual labels:  blockchain-technology
block-chain-article
📙📗📘《睡前学点区块链》系列文章。推荐使用Gitbook阅读:https://wangbicong.github.io/block-chain-article/
Stars: ✭ 20 (-60%)
Mutual labels:  blockchain-technology
blockgeeks-build-blockchain-advanced
Code that shows how to build your own Bitcoin-like blockchain with JavaScript.
Stars: ✭ 24 (-52%)
Mutual labels:  blockchain-technology
DataToken
Decentralized access control middleware for data exchange and monetization
Stars: ✭ 17 (-66%)
Mutual labels:  blockchain-technology
MadMax
Ethereum Static Vulnerability Detector for Gas-Focussed Vulnerabilities
Stars: ✭ 96 (+92%)
Mutual labels:  blockchain-technology
pacNEM
pacNEM is a Browser PacMan game with NodeJS, Socket.io, Handlebars and NEM Blockchain
Stars: ✭ 20 (-60%)
Mutual labels:  blockchain-technology
class
Rust library for building IQC: cryptography based on class groups of imaginary quadratic orders
Stars: ✭ 54 (+8%)
Mutual labels:  blockchain-technology
HealthLedger
Application for tracking Organs donations in hospitals and minimizing the scope of Organ trafficking using Blockchain (Hyperledger) technology.
Stars: ✭ 29 (-42%)
Mutual labels:  blockchain-technology
nis-python-client
Python client for NEM NIS API (https://nemproject.github.io). XEM\NEM\Crypto
Stars: ✭ 16 (-68%)
Mutual labels:  blockchain-technology
Simple-Game-ERC-721-Token-Template
🔮 Very Simple ERC-721 Smart Contract Template to create your own ERC-721 Tokens on the Ethereum Blockchain, with many customizable Options 🔮
Stars: ✭ 83 (+66%)
Mutual labels:  blockchain-technology

Libra Golang Client

Libra Golang Client is library to interact with Libra Blockchain

Note: The project is still under major development! The Package is not stable and will keep changing!

Installation

To install run:

go get github.com/codemaveric/libra-go/pkg/goclient

Usage

Example

package main

import (
	"log"
	"strings"

	"github.com/codemaveric/libra-go/pkg/goclient"
	"github.com/codemaveric/libra-go/pkg/librawallet"
)

func main() {
 	// I will advice you to change the mnemonic to something else
	mnemonic := "present good satochi coin future media giant"
	wallet := librawallet.NewWalletLibrary(mnemonic)
	address, childNum, err := wallet.NewAddress()
	if err != nil {
		log.Fatal(err)
	}
	log.Print(address.ToString())

	// Generate Keypair with mnemonic and childNum
	keyPair := librawallet.GenerateKeyPair(strings.Split(mnemonic, " "), childNum)

	// Create Account from KeyPair
	sourceAccount := librawallet.NewAccountFromKeyPair(keyPair)
	// Libra Client Configuration
	config := goclient.LibraClientConfig{
		Host:    "ac.testnet.libra.org",
		Port:    "80",
		Network: goclient.TestNet,
	}
	// Instantiate LibraClient with Configuration.
	libraClient := goclient.NewLibraClient(config)

	// Mint Coin from Test Faucet to account generated.
	err = libraClient.MintWithFaucetService(sourceAccount.Address.ToString(), 500000000, true)

	if err != nil {
		log.Fatal(err)
	}

	// Get Account State.
	SourceaccState, err := libraClient.GetAccountState(sourceAccount.Address.ToString())
	if err != nil {
		log.Fatal(err)
	}
	log.Print(SourceaccState.Balance)

	// Set the current account sequence.
	sourceAccount.Sequence = SourceaccState.SequenceNumber

	// Transfer Coins from source account to destination address.
	err = libraClient.TransferCoins(sourceAccount, "f4aebe371e4176143c3409122d0adf43c0e00a6552b5b0ae9980d8981fcd0221", 11000000, 0, 10000, true)
	if err != nil {
		log.Fatal(err)
	}
	
	// Get Account Transaction by Sequence Number.
	transaction, err := libraClient.GetAccountTransaction(sourceAccount.Address.ToString(), 0, true)

	if err != nil {
		log.Fatal(err)
	}

	log.Println(transaction)
}

Contribution

Feel free to contribute by opening issues or PR's.

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].