All Projects → Dev43 → arweave-go

Dev43 / arweave-go

Licence: MIT license
Arweave-go SDK

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to arweave-go

likecoin-wordpress
The WordPress plugin to integrate LikeCoin - Decentralized Publishing Infrastructure.
Stars: ✭ 19 (-29.63%)
Mutual labels:  arweave
glosseta
Glosseta is an open-source glossary meant to help people explore and learn the terminology behind web3
Stars: ✭ 23 (-14.81%)
Mutual labels:  arweave
arweave-python-client
This client allows you to integrate your python apps with the Arweave network allowing you to perform wallet operations and transactions
Stars: ✭ 87 (+222.22%)
Mutual labels:  arweave
alpha-interface
✨ Token Exchange App for Arweave Profit Sharing Tokens
Stars: ✭ 34 (+25.93%)
Mutual labels:  arweave
trading-post
💸 Verto's decentralised exchange mediator
Stars: ✭ 18 (-33.33%)
Mutual labels:  arweave
arloader
Rust command line application and client for uploading files to Arweave.
Stars: ✭ 79 (+192.59%)
Mutual labels:  arweave
.com
Digital garden built using Next13, Typescript, and a bunch of goodies
Stars: ✭ 186 (+588.89%)
Mutual labels:  arweave
sworn
Sworn compiles Clarity smart contracts into SmartWeave contracts.
Stars: ✭ 50 (+85.19%)
Mutual labels:  arweave
mirror-next
A Next.js-powered frontend for your Mirror publication
Stars: ✭ 98 (+262.96%)
Mutual labels:  arweave
goar
Arweave http client and wallet implemented in go, Arweave SDK
Stars: ✭ 60 (+122.22%)
Mutual labels:  arweave
arwiki
A decentralized and permanent wiki for Arweave docs.
Stars: ✭ 13 (-51.85%)
Mutual labels:  arweave
kyve
KYVE - A protocol for verified data-streams
Stars: ✭ 51 (+88.89%)
Mutual labels:  arweave
ardrive-web
The ArDrive Web App allows a user to log in to securely view, upload and manage their ArDrive files.
Stars: ✭ 23 (-14.81%)
Mutual labels:  arweave
redstone-smartcontracts
An implementation of the Arweave SmartWeave smart contracts protocol.
Stars: ✭ 42 (+55.56%)
Mutual labels:  arweave
vartex
Vartex is a vortex into the permaweb -- the decentralised web on top of the Arweave protocol.
Stars: ✭ 16 (-40.74%)
Mutual labels:  arweave
weve
A Weavemail client implementation—private, decentralized and open source mail, built on Arweave.
Stars: ✭ 57 (+111.11%)
Mutual labels:  arweave

Arweave Go SDK

License GoDoc Go Report Card

Golang Client to interact with the Arweave Blockchain.

Usage

Wallet

In the current version, you can load the Arweave wallet file created from the Arweave server or the plugin.

// create a new wallet instance
w := wallet.NewWallet()
// extract the key from the wallet instance
err = w.LoadKeyFromFile("./arweave.json")
if err != nil {
	//...
}

You can directly load the key by using it's filepath or pass it as an array of bytes using LoadKey([]byte).

With the wallet struct, you can sign and verify a message:

// sign the message "example"
msg := []byte("example")
sig, err := w.Sign(msg))
if err != nil {
	//...
}
err = w.Verify(msg, sig)
if err != nil {
	// message signature is not valid...
}
// message signature is valid

API

You can call all of the Arweave HTTP api endpoints using the api package. First you must give it the node url or IP address.

ipAddress := "127.0.0.1"
c, err := api.Dial(ipAddress)
if err != nil {
	// problem connecting
}

To call the endpoints, you will need to pass in a context.

c.GetBalance(context.TODO(), "1seRanklLU_1VTGkEk7P0xAwMJfA7owA1JHW5KyZKlY")

Transactions

To create a new transaction, you will need to interact with the transactor package. The transactor package has 3 main functions, creating, sending and waiting for a transaction.

	// create a new transactor client
	ar, err := transactor.NewTransactor("127.0.0.1")
	if err != nil {
		//...
	}

	// create a new wallet instance
	w := wallet.NewWallet()
	// extract the key from the wallet instance
	err = w.LoadKeyFromFile("./arweave.json")
	if err != nil {
		//...
	}
	// create a transaction
	txBuilder, err := ar.CreateTransaction(context.TODO(), w, "0", []byte(""), "1seRanklLU_1VTGkEk7P0xAwMJfA7owA1JHW5KyZKlY")
	if err != nil {
		//...
	}
	
	// sign the transaction
	txn, err := txBuilder.Sign(w)
	if err != nil {
		//...
	}

	// send the transaction
	resp, err := ar.SendTransaction(context.TODO(), txn)
	if err != nil {
		//...
	}

	// wait for the transaction to get mined
	finalTx, err := ar.WaitMined(context.TODO(), txn)
	if err != nil {
		//...
	}
	// get the hash of the transaction
	fmt.Println(finalTx.Hash())

If you enjoy the library, please consider donating:

  • Arweave Address: pfJXiTwwjQwSJF9VT1ZK6kauvobWuKKLUzjz29R1gbQ
  • Ethereum Address: 0x3E42b8b399dca71b5c004921Fc6eFfa8dDc9409d
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].