ledger

package
v0.0.0-...-74b78a2 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2020 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Overview

Package ledger implements access to a distributed Ethereum ledger for storing open feedback.

Index

Constants

View Source
const OpenFeedbackABI = "" /* 3256-byte string literal not displayed */

OpenFeedbackABI is the input ABI used to generate the binding from.

Variables

View Source
var OpenFeedbackBin = "" /* 4662-byte string literal not displayed */

OpenFeedbackBin is the compiled bytecode used for deploying new contracts.

View Source
var OpenFeedbackFuncSigs = map[string]string{
	"22b70c85": "addFeedback(bytes16,bytes16,uint8,uint8,uint8)",
	"aa80c06e": "getFeedbackByBibHash(bytes16,uint256)",
	"fd218468": "getFeedbackByOrcId(bytes16,uint256)",
	"3b6b3298": "getFeedbackCountByBibHash(bytes16)",
	"b8c2177c": "getFeedbackCountByOrcId(bytes16)",
	"3c68a762": "getTotalFeedbackByBibHash(bytes16)",
}

OpenFeedbackFuncSigs maps the 4-byte function signature to its string representation.

Functions

This section is empty.

Types

type Ledger

type Ledger struct {
	Client     *ethclient.Client
	PrivateKey *ecdsa.PrivateKey
	Contract   *OpenFeedback
}

Ledger defines an abstraction to the Ethereum blockchain, that includes the contract and the private key for the GoZer client node.

func Open

func Open(conf *config.LedgerConfiguration) *Ledger

Open initializes the ledger accordingly to the provided global configuration and connects to the Ethereum blockchain.

func (*Ledger) AddFeedback

func (st *Ledger) AddFeedback(orcId string, bibHash string, relevance uint8, presentation uint8, methodology uint8) (err error)

AddFeedback publishes a user's feedback about a publication to the Ethereum blockchain. In the blockchain a user is identified by its ORCiD and the publication by its bibliographic hash. The feedback consists of a binary flag about the quality of relevance, presentation and methodology. The idea is, that feedback about a scientific publication is public and accessible to anyone.

func (*Ledger) Close

func (st *Ledger) Close()

Close finishes open transaction and disconnects then from the Ethereum blockchain.

type OpenFeedback

type OpenFeedback struct {
	OpenFeedbackCaller     // Read-only binding to the contract
	OpenFeedbackTransactor // Write-only binding to the contract
	OpenFeedbackFilterer   // Log filterer for contract events
}

OpenFeedback is an auto generated Go binding around an Ethereum contract.

func DeployOpenFeedback

func DeployOpenFeedback(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *OpenFeedback, error)

DeployOpenFeedback deploys a new Ethereum contract, binding an instance of OpenFeedback to it.

func NewOpenFeedback

func NewOpenFeedback(address common.Address, backend bind.ContractBackend) (*OpenFeedback, error)

NewOpenFeedback creates a new instance of OpenFeedback, bound to a specific deployed contract.

type OpenFeedbackCaller

type OpenFeedbackCaller struct {
	// contains filtered or unexported fields
}

OpenFeedbackCaller is an auto generated read-only Go binding around an Ethereum contract.

func NewOpenFeedbackCaller

func NewOpenFeedbackCaller(address common.Address, caller bind.ContractCaller) (*OpenFeedbackCaller, error)

NewOpenFeedbackCaller creates a new read-only instance of OpenFeedback, bound to a specific deployed contract.

func (*OpenFeedbackCaller) GetFeedbackByBibHash

func (_OpenFeedback *OpenFeedbackCaller) GetFeedbackByBibHash(opts *bind.CallOpts, _bibhash [16]byte, _index *big.Int) (struct {
	ServiceAddress common.Address
	OrcId          [16]byte
	Timestamp      *big.Int
	Relevance      uint8
	Presentation   uint8
	Methodology    uint8
}, error)

GetFeedbackByBibHash is a free data retrieval call binding the contract method 0xaa80c06e.

Solidity: function getFeedbackByBibHash(bytes16 _bibhash, uint256 _index) constant returns(address serviceAddress_, bytes16 orcId_, uint256 timestamp_, uint8 relevance_, uint8 presentation_, uint8 methodology_)

func (*OpenFeedbackCaller) GetFeedbackByOrcId

func (_OpenFeedback *OpenFeedbackCaller) GetFeedbackByOrcId(opts *bind.CallOpts, _orcid [16]byte, _index *big.Int) (struct {
	ServiceAddress common.Address
	BibHash        [16]byte
	Timestamp      *big.Int
	Relevance      uint8
	Presentation   uint8
	Methodology    uint8
}, error)

GetFeedbackByOrcId is a free data retrieval call binding the contract method 0xfd218468.

Solidity: function getFeedbackByOrcId(bytes16 _orcid, uint256 _index) constant returns(address serviceAddress_, bytes16 bibHash_, uint256 timestamp_, uint8 relevance_, uint8 presentation_, uint8 methodology_)

func (*OpenFeedbackCaller) GetFeedbackCountByBibHash

func (_OpenFeedback *OpenFeedbackCaller) GetFeedbackCountByBibHash(opts *bind.CallOpts, _bibHash [16]byte) (*big.Int, error)

GetFeedbackCountByBibHash is a free data retrieval call binding the contract method 0x3b6b3298.

Solidity: function getFeedbackCountByBibHash(bytes16 _bibHash) constant returns(uint256 count_)

func (*OpenFeedbackCaller) GetFeedbackCountByOrcId

func (_OpenFeedback *OpenFeedbackCaller) GetFeedbackCountByOrcId(opts *bind.CallOpts, _orcid [16]byte) (*big.Int, error)

GetFeedbackCountByOrcId is a free data retrieval call binding the contract method 0xb8c2177c.

Solidity: function getFeedbackCountByOrcId(bytes16 _orcid) constant returns(uint256 count_)

func (*OpenFeedbackCaller) GetTotalFeedbackByBibHash

func (_OpenFeedback *OpenFeedbackCaller) GetTotalFeedbackByBibHash(opts *bind.CallOpts, _bibhash [16]byte) (struct {
	FeedbackCount     *big.Int
	RelevanceTotal    *big.Int
	PresentationTotal *big.Int
	MethodologyTotal  *big.Int
}, error)

GetTotalFeedbackByBibHash is a free data retrieval call binding the contract method 0x3c68a762.

Solidity: function getTotalFeedbackByBibHash(bytes16 _bibhash) constant returns(uint256 feedbackCount_, uint256 relevanceTotal_, uint256 presentationTotal_, uint256 methodologyTotal_)

type OpenFeedbackCallerRaw

type OpenFeedbackCallerRaw struct {
	Contract *OpenFeedbackCaller // Generic read-only contract binding to access the raw methods on
}

OpenFeedbackCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract.

func (*OpenFeedbackCallerRaw) Call

func (_OpenFeedback *OpenFeedbackCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error

Call invokes the (constant) contract method with params as input values and sets the output to result. The result type might be a single field for simple returns, a slice of interfaces for anonymous returns and a struct for named returns.

type OpenFeedbackCallerSession

type OpenFeedbackCallerSession struct {
	Contract *OpenFeedbackCaller // Generic contract caller binding to set the session for
	CallOpts bind.CallOpts       // Call options to use throughout this session
}

OpenFeedbackCallerSession is an auto generated read-only Go binding around an Ethereum contract, with pre-set call options.

func (*OpenFeedbackCallerSession) GetFeedbackByBibHash

func (_OpenFeedback *OpenFeedbackCallerSession) GetFeedbackByBibHash(_bibhash [16]byte, _index *big.Int) (struct {
	ServiceAddress common.Address
	OrcId          [16]byte
	Timestamp      *big.Int
	Relevance      uint8
	Presentation   uint8
	Methodology    uint8
}, error)

GetFeedbackByBibHash is a free data retrieval call binding the contract method 0xaa80c06e.

Solidity: function getFeedbackByBibHash(bytes16 _bibhash, uint256 _index) constant returns(address serviceAddress_, bytes16 orcId_, uint256 timestamp_, uint8 relevance_, uint8 presentation_, uint8 methodology_)

func (*OpenFeedbackCallerSession) GetFeedbackByOrcId

func (_OpenFeedback *OpenFeedbackCallerSession) GetFeedbackByOrcId(_orcid [16]byte, _index *big.Int) (struct {
	ServiceAddress common.Address
	BibHash        [16]byte
	Timestamp      *big.Int
	Relevance      uint8
	Presentation   uint8
	Methodology    uint8
}, error)

GetFeedbackByOrcId is a free data retrieval call binding the contract method 0xfd218468.

Solidity: function getFeedbackByOrcId(bytes16 _orcid, uint256 _index) constant returns(address serviceAddress_, bytes16 bibHash_, uint256 timestamp_, uint8 relevance_, uint8 presentation_, uint8 methodology_)

func (*OpenFeedbackCallerSession) GetFeedbackCountByBibHash

func (_OpenFeedback *OpenFeedbackCallerSession) GetFeedbackCountByBibHash(_bibHash [16]byte) (*big.Int, error)

GetFeedbackCountByBibHash is a free data retrieval call binding the contract method 0x3b6b3298.

Solidity: function getFeedbackCountByBibHash(bytes16 _bibHash) constant returns(uint256 count_)

func (*OpenFeedbackCallerSession) GetFeedbackCountByOrcId

func (_OpenFeedback *OpenFeedbackCallerSession) GetFeedbackCountByOrcId(_orcid [16]byte) (*big.Int, error)

GetFeedbackCountByOrcId is a free data retrieval call binding the contract method 0xb8c2177c.

Solidity: function getFeedbackCountByOrcId(bytes16 _orcid) constant returns(uint256 count_)

func (*OpenFeedbackCallerSession) GetTotalFeedbackByBibHash

func (_OpenFeedback *OpenFeedbackCallerSession) GetTotalFeedbackByBibHash(_bibhash [16]byte) (struct {
	FeedbackCount     *big.Int
	RelevanceTotal    *big.Int
	PresentationTotal *big.Int
	MethodologyTotal  *big.Int
}, error)

GetTotalFeedbackByBibHash is a free data retrieval call binding the contract method 0x3c68a762.

Solidity: function getTotalFeedbackByBibHash(bytes16 _bibhash) constant returns(uint256 feedbackCount_, uint256 relevanceTotal_, uint256 presentationTotal_, uint256 methodologyTotal_)

type OpenFeedbackFilterer

type OpenFeedbackFilterer struct {
	// contains filtered or unexported fields
}

OpenFeedbackFilterer is an auto generated log filtering Go binding around an Ethereum contract events.

func NewOpenFeedbackFilterer

func NewOpenFeedbackFilterer(address common.Address, filterer bind.ContractFilterer) (*OpenFeedbackFilterer, error)

NewOpenFeedbackFilterer creates a new log filterer instance of OpenFeedback, bound to a specific deployed contract.

type OpenFeedbackRaw

type OpenFeedbackRaw struct {
	Contract *OpenFeedback // Generic contract binding to access the raw methods on
}

OpenFeedbackRaw is an auto generated low-level Go binding around an Ethereum contract.

func (*OpenFeedbackRaw) Call

func (_OpenFeedback *OpenFeedbackRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error

Call invokes the (constant) contract method with params as input values and sets the output to result. The result type might be a single field for simple returns, a slice of interfaces for anonymous returns and a struct for named returns.

func (*OpenFeedbackRaw) Transact

func (_OpenFeedback *OpenFeedbackRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error)

Transact invokes the (paid) contract method with params as input values.

func (*OpenFeedbackRaw) Transfer

func (_OpenFeedback *OpenFeedbackRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error)

Transfer initiates a plain transaction to move funds to the contract, calling its default method if one is available.

type OpenFeedbackSession

type OpenFeedbackSession struct {
	Contract     *OpenFeedback     // Generic contract binding to set the session for
	CallOpts     bind.CallOpts     // Call options to use throughout this session
	TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session
}

OpenFeedbackSession is an auto generated Go binding around an Ethereum contract, with pre-set call and transact options.

func (*OpenFeedbackSession) AddFeedback

func (_OpenFeedback *OpenFeedbackSession) AddFeedback(_orcId [16]byte, _bibHash [16]byte, _relevance uint8, _presentation uint8, _methodology uint8) (*types.Transaction, error)

AddFeedback is a paid mutator transaction binding the contract method 0x22b70c85.

Solidity: function addFeedback(bytes16 _orcId, bytes16 _bibHash, uint8 _relevance, uint8 _presentation, uint8 _methodology) returns()

func (*OpenFeedbackSession) GetFeedbackByBibHash

func (_OpenFeedback *OpenFeedbackSession) GetFeedbackByBibHash(_bibhash [16]byte, _index *big.Int) (struct {
	ServiceAddress common.Address
	OrcId          [16]byte
	Timestamp      *big.Int
	Relevance      uint8
	Presentation   uint8
	Methodology    uint8
}, error)

GetFeedbackByBibHash is a free data retrieval call binding the contract method 0xaa80c06e.

Solidity: function getFeedbackByBibHash(bytes16 _bibhash, uint256 _index) constant returns(address serviceAddress_, bytes16 orcId_, uint256 timestamp_, uint8 relevance_, uint8 presentation_, uint8 methodology_)

func (*OpenFeedbackSession) GetFeedbackByOrcId

func (_OpenFeedback *OpenFeedbackSession) GetFeedbackByOrcId(_orcid [16]byte, _index *big.Int) (struct {
	ServiceAddress common.Address
	BibHash        [16]byte
	Timestamp      *big.Int
	Relevance      uint8
	Presentation   uint8
	Methodology    uint8
}, error)

GetFeedbackByOrcId is a free data retrieval call binding the contract method 0xfd218468.

Solidity: function getFeedbackByOrcId(bytes16 _orcid, uint256 _index) constant returns(address serviceAddress_, bytes16 bibHash_, uint256 timestamp_, uint8 relevance_, uint8 presentation_, uint8 methodology_)

func (*OpenFeedbackSession) GetFeedbackCountByBibHash

func (_OpenFeedback *OpenFeedbackSession) GetFeedbackCountByBibHash(_bibHash [16]byte) (*big.Int, error)

GetFeedbackCountByBibHash is a free data retrieval call binding the contract method 0x3b6b3298.

Solidity: function getFeedbackCountByBibHash(bytes16 _bibHash) constant returns(uint256 count_)

func (*OpenFeedbackSession) GetFeedbackCountByOrcId

func (_OpenFeedback *OpenFeedbackSession) GetFeedbackCountByOrcId(_orcid [16]byte) (*big.Int, error)

GetFeedbackCountByOrcId is a free data retrieval call binding the contract method 0xb8c2177c.

Solidity: function getFeedbackCountByOrcId(bytes16 _orcid) constant returns(uint256 count_)

func (*OpenFeedbackSession) GetTotalFeedbackByBibHash

func (_OpenFeedback *OpenFeedbackSession) GetTotalFeedbackByBibHash(_bibhash [16]byte) (struct {
	FeedbackCount     *big.Int
	RelevanceTotal    *big.Int
	PresentationTotal *big.Int
	MethodologyTotal  *big.Int
}, error)

GetTotalFeedbackByBibHash is a free data retrieval call binding the contract method 0x3c68a762.

Solidity: function getTotalFeedbackByBibHash(bytes16 _bibhash) constant returns(uint256 feedbackCount_, uint256 relevanceTotal_, uint256 presentationTotal_, uint256 methodologyTotal_)

type OpenFeedbackTransactor

type OpenFeedbackTransactor struct {
	// contains filtered or unexported fields
}

OpenFeedbackTransactor is an auto generated write-only Go binding around an Ethereum contract.

func NewOpenFeedbackTransactor

func NewOpenFeedbackTransactor(address common.Address, transactor bind.ContractTransactor) (*OpenFeedbackTransactor, error)

NewOpenFeedbackTransactor creates a new write-only instance of OpenFeedback, bound to a specific deployed contract.

func (*OpenFeedbackTransactor) AddFeedback

func (_OpenFeedback *OpenFeedbackTransactor) AddFeedback(opts *bind.TransactOpts, _orcId [16]byte, _bibHash [16]byte, _relevance uint8, _presentation uint8, _methodology uint8) (*types.Transaction, error)

AddFeedback is a paid mutator transaction binding the contract method 0x22b70c85.

Solidity: function addFeedback(bytes16 _orcId, bytes16 _bibHash, uint8 _relevance, uint8 _presentation, uint8 _methodology) returns()

type OpenFeedbackTransactorRaw

type OpenFeedbackTransactorRaw struct {
	Contract *OpenFeedbackTransactor // Generic write-only contract binding to access the raw methods on
}

OpenFeedbackTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract.

func (*OpenFeedbackTransactorRaw) Transact

func (_OpenFeedback *OpenFeedbackTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error)

Transact invokes the (paid) contract method with params as input values.

func (*OpenFeedbackTransactorRaw) Transfer

func (_OpenFeedback *OpenFeedbackTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error)

Transfer initiates a plain transaction to move funds to the contract, calling its default method if one is available.

type OpenFeedbackTransactorSession

type OpenFeedbackTransactorSession struct {
	Contract     *OpenFeedbackTransactor // Generic contract transactor binding to set the session for
	TransactOpts bind.TransactOpts       // Transaction auth options to use throughout this session
}

OpenFeedbackTransactorSession is an auto generated write-only Go binding around an Ethereum contract, with pre-set transact options.

func (*OpenFeedbackTransactorSession) AddFeedback

func (_OpenFeedback *OpenFeedbackTransactorSession) AddFeedback(_orcId [16]byte, _bibHash [16]byte, _relevance uint8, _presentation uint8, _methodology uint8) (*types.Transaction, error)

AddFeedback is a paid mutator transaction binding the contract method 0x22b70c85.

Solidity: function addFeedback(bytes16 _orcId, bytes16 _bibHash, uint8 _relevance, uint8 _presentation, uint8 _methodology) returns()

Jump to

Keyboard shortcuts

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