ethpm-go

module
v0.0.0-...-1791402 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 29, 2018 License: MIT

README

ethpm-go

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:

  • More testing and evaluate the quality of the codebase
  • Open issues and send PR's for overall improvement
  • Build tools that make use of this repository
  • Let me know (@Hackdom on github, use the gitter link, or Hackdom#1999 if you go to Discord) if you've made a tool using this

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.

Directories

Path Synopsis
cmd
pkg
bytecode
Package bytecode provides requisite structs and utility functions to build and validate unlinked and unlinked bytecode objects for the ethpm v2 manifest.
Package bytecode provides requisite structs and utility functions to build and validate unlinked and unlinked bytecode objects for the ethpm v2 manifest.
ethcontract
Package ethcontract provides `ABIObject`, which correlates with a compiler's abi output, as well as `ContractInstance` and `ContractType` which follows the EthPM v2 spec for these objects.
Package ethcontract provides `ABIObject`, which correlates with a compiler's abi output, as well as `ContractInstance` and `ContractType` which follows the EthPM v2 spec for these objects.
ethpm
Package ethpm provides the primary manifest object defined in `packagemanifest.go`.
Package ethpm provides the primary manifest object defined in `packagemanifest.go`.
ethregexlib
Package ethregexlib provides various regex utility functions that are relevant to ethpm and Ethereum in general.
Package ethregexlib provides various regex utility functions that are relevant to ethpm and Ethereum in general.
gethutils
Package gethutils provides utility functions that use ethereum-go.
Package gethutils provides utility functions that use ethereum-go.
githubutils
Package githubutils provides utility functions to utilize github in the context of retrieving and saving ethpm package manifests
Package githubutils provides utility functions to utilize github in the context of retrieving and saving ethpm package manifests
librarylink
Package librarylink provides the `LinkReference` and `LinkValue` structs which describe bytecode linking locations.
Package librarylink provides the `LinkReference` and `LinkValue` structs which describe bytecode linking locations.
natspec
Package natspec provides DevDoc, UserDoc, and DocUnion structs which correlate with Ethereum compiler natspec output
Package natspec provides DevDoc, UserDoc, and DocUnion structs which correlate with Ethereum compiler natspec output
packageregistry
Package packageregistry provides a function for retrieving a package registry abi to use for an on-chain package registry.
Package packageregistry provides a function for retrieving a package registry abi to use for an on-chain package registry.
solcutils
Package solcutils provides utilities for compiling solidity files using an installed solc compiler.
Package solcutils provides utilities for compiling solidity files using an installed solc compiler.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL