ethpm / ethpm-go

Go packages to support ethpm. Package manifest schema is defined here https://github.com/ethpm/ethpm-spec
MIT License
9 stars 3 forks source link
ethereum ethereum-dapp ethereum-development ethpm golang

ethpm-go =========================

Join the chat at https://gitter.im/Modular-Network/Lobby Discord

A go package which provides an EthPM v2 package manifest reader and writer

What we need

At this point, there are 10 packages which provide enough funtionality to build an ethpm in golang. The functions defined here could even be including directly into a geth node for package management. We need contributors for the following:

Finish familiarizing yourself and let us know if you have any questions!

Layout

This repository abides by the standard layout as defined here

Tools

This repository uses:

Packages

There are ten packages defined in the pkg directory with the primary package being ethpm.

Usage

package main

import (
    "fmt"
    "log"

    "github.com/ethpm/ethpm-go/pkg/ethpm"
)

func main()  {
  pm := `{"manifest_version":"2","package_name":"array-utils","version":"1.2.7"}`
  p := ethpm.PackageManifest{}

  if err := p.Read(pm); err != nil {
    log.Fatal(err)
  }
  fmt.Printf("%+v\n", p)

  if newManifest, err := p.Write(); err != nil {
    log.Fatal(err)
  } else {
    fmt.Println(newManifest)
  }
}

Notes

This is v0.0.1 and should be treated as such. Contributions are welcome as well as any issues identified while using this code. While some of the on-chain functionality has been lightly tested, many of the full compilation, deployment, and publishing workflows have not been fully developed nor tested just yet.