genericserver

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2019 License: GPL-3.0 Imports: 38 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Adminservice adminsrv.Service
View Source
var Claimservice claimsrv.Service
View Source
var Counterfactualservice counterfactualsrv.Service
View Source
var Rootservice rootsrv.Service

Functions

func Assert

func Assert(msg string, err error)

func CmdAddClaim

func CmdAddClaim(c *cli.Context) error

Claim

func CmdAddClaimsFromFile

func CmdAddClaimsFromFile(c *cli.Context) error

func CmdDbIPFSexport

func CmdDbIPFSexport(c *cli.Context) error

func CmdDbRawDump

func CmdDbRawDump(c *cli.Context) error

DB

func CmdDbRawImport added in v0.0.6

func CmdDbRawImport(c *cli.Context) error

func CmdNewIdentity added in v0.0.6

func CmdNewIdentity(c *cli.Context) error

func Fail

func Fail(c *gin.Context, msg string, err error)

func HandleClaimsDump

func HandleClaimsDump(c *gin.Context)

func HandleGetRoot

func HandleGetRoot(c *gin.Context)

Generic

func HandleInfo

func HandleInfo(c *gin.Context)

Admin

func HandleRawDump

func HandleRawDump(c *gin.Context)

func HandleRawImport

func HandleRawImport(c *gin.Context)

func ListenAndServe

func ListenAndServe(srv *http.Server, name string) error

func LoadAdminService

func LoadAdminService(mt *merkletree.MerkleTree, rootservice rootsrv.Service, claimservice claimsrv.Service) adminsrv.Service

func LoadContract

func LoadContract(client eth.Client, jsonabifile string, address *string) *eth.Contract

func LoadCounterfactualService added in v0.0.4

func LoadCounterfactualService(client *eth.Web3Client, claimservice claimsrv.Service, storage db.Storage) counterfactualsrv.Service

func LoadEthClient2 added in v0.0.6

func LoadEthClient2(ks *ethkeystore.KeyStore, acc *accounts.Account) *eth.Client2

func LoadGenesis added in v0.0.6

func LoadGenesis(mt *merkletree.MerkleTree) *core.GenesisProofClaims

LoadGenesis will calculate the genesis id from the keys in the configuration file and check it against the id in the configuration. It will populate the merkle tree with the genesis claims if it's empty or check that the claims exist in the merkle tree otherwise. It returns the ProofClaims of the genesis claims.

func LoadIdentityService added in v0.0.4

func LoadIdentityService(claimservice claimsrv.Service) identitysrv.Service

func LoadKeyStore

func LoadKeyStore() (*ethkeystore.KeyStore, accounts.Account)

func LoadKeyStoreBabyJub added in v0.0.5

func LoadKeyStoreBabyJub() (*babykeystore.KeyStore, *babyjub.PublicKeyComp)

func LoadMerkele

func LoadMerkele(storage db.Storage) *merkletree.MerkleTree

func LoadRootsService

func LoadRootsService(client *eth.Client2, kUpdateRootMtp []byte) rootsrv.Service

func LoadSignedPacketSigner

func LoadSignedPacketSigner(ks *babykeystore.KeyStore, pk *babyjub.PublicKey, claimservice claimsrv.Service) *signedpacketsrv.SignedPacketSigner

LoadSignedPacketSigner Adds new claim authorizing a secp256ks key. Returns SignedPacketSigner to sign with key sign.

func LoadStorage

func LoadStorage() db.Storage

func LoadWeb3

func LoadWeb3(ks *ethkeystore.KeyStore, acc *accounts.Account) *eth.Web3Client

func MustRead

func MustRead(c *cli.Context) error

func NewAdminAPI

func NewAdminAPI(prefix string, stopch chan interface{}) (*gin.Engine, *gin.RouterGroup)

func NewIdentity added in v0.0.6

func NewIdentity(keyStorePath, keyStorePassword, keyStoreBabyPath, keyStoreBabyPassword string) error

func NewServiceAPI

func NewServiceAPI(prefix string) (*gin.Engine, *gin.RouterGroup)

Types

type Config

type Config struct {
	Server struct {
		ServiceApi string
		AdminApi   string
	}
	Web3 struct {
		Url string
	}
	KeyStore struct {
		Path     string
		Password string
	}
	KeyStoreBaby struct {
		Path     string
		Password string
	}
	Keys struct {
		Ethereum struct {
			KDisRaw        string         `mapstructure:"kdis"`
			KDis           common.Address `mapstructure:"-"`
			KReenRaw       string         `mapstructure:"kreen"`
			KReen          common.Address `mapstructure:"-"`
			KUpdateRootRaw string         `mapstructure:"kupdateroot"`
			KUpdateRoot    common.Address `mapstructure:"-"`
		}
		BabyJub struct {
			KOpRaw string            `mapstructure:"kop"`
			KOp    babyjub.PublicKey `mapstructure:"-"`
		}
	}
	IdRaw     string  `mapstructure:"id"`
	Id        core.ID `mapstructure:"-"`
	Contracts struct {
		RootCommits   ContractInfo
		Iden3Impl     ContractInfo
		Iden3Deployer ContractInfo
		Iden3Proxy    ContractInfo
	}
	Storage struct {
		Path string
	}
	Domain    string
	Namespace string
	Names     struct {
		Path string
	}
	Entitites struct {
		Path string
	}
}
var C Config

type ContractInfo

type ContractInfo struct {
	JsonABI string
	Address string
}

Jump to

Keyboard shortcuts

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