Skip to content

PreResearch-Labs/go-ucanto-ucan-protocol

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-ucanto

Ucanto UCAN RPC in Golang.

package main

import (
  "net/url"
  "ioutil"

  "github.com/alanshaw/go-ucanto/client"
  "github.com/alanshaw/go-ucanto/did"
  "github.com/alanshaw/go-ucanto/principal/ed25519/signer"
  "github.com/alanshaw/go-ucanto/transport/car"
  "github.com/alanshaw/go-ucanto/transport/http"
)

u, _ := url.Parse("https://up.web3.storage")
p, _ := did.Parse("did:web:web3.storage")

ch := http.NewHTTPChannel(u)
co := car.NewCAROutboundCodec()

cn, _ := client.NewConnection(p, co, ch)

ss, _ := ioutil.ReadFile("path/to/private.key")
snr, _ := signer.Parse(ss)

// TODO: define inv
// TODO TODO
client.Execute(inv, cn)

About

Golang implementation of ucanto - UCAN RPC

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%