oracle

package
v1.3.6 Latest Latest
Warning

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

Go to latest
Published: May 25, 2022 License: BSD-3-Clause Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var OracleABI = OracleMetaData.ABI

OracleABI is the input ABI used to generate the binding from. Deprecated: Use OracleMetaData.ABI instead.

View Source
var OracleMetaData = &bind.MetaData{
	ABI: "[{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"hashIMap\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\",\"constant\":true},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"oracleIMap\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\",\"constant\":true},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\",\"constant\":true},{\"inputs\":[],\"name\":\"start\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\",\"constant\":true},{\"inputs\":[],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"value\",\"type\":\"bool\"}],\"name\":\"setStart\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"hash\",\"type\":\"bytes32\"}],\"name\":\"get\",\"outputs\":[{\"internalType\":\"bytes32[]\",\"name\":\"\",\"type\":\"bytes32[]\"}],\"stateMutability\":\"view\",\"type\":\"function\",\"constant\":true},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"addr\",\"type\":\"bytes32\"}],\"name\":\"set\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"addr\",\"type\":\"bytes32\"}],\"name\":\"remove\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"hash\",\"type\":\"bytes32\"}],\"name\":\"clear\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getFileList\",\"outputs\":[{\"internalType\":\"bytes32[]\",\"name\":\"\",\"type\":\"bytes32[]\"}],\"stateMutability\":\"view\",\"type\":\"function\",\"constant\":true}]",
}

OracleMetaData contains all meta data concerning the Oracle contract.

Functions

func NewServer

func NewServer(logger logging.Logger, backend *ethclient.Client, address string, signer crypto.Signer, commonService chain.Common, subPub subscribe.SubPub) (chain.Resolver, error)

Types

type ChainOracle

type ChainOracle struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func (*ChainOracle) API added in v1.3.0

func (ora *ChainOracle) API() rpc.API

func (*ChainOracle) DataStoreFinished

func (ora *ChainOracle) DataStoreFinished(cid boson.Address, dataLen uint64, salt uint64, proof []byte, resCh chan chain.ChainResult)

func (*ChainOracle) GetCid

func (ora *ChainOracle) GetCid(aufsUri string) []byte

func (*ChainOracle) GetNodesFromCid

func (ora *ChainOracle) GetNodesFromCid(cid []byte) []boson.Address

func (*ChainOracle) GetRegisterState added in v1.2.2

func (ora *ChainOracle) GetRegisterState(ctx context.Context, rootCid boson.Address, address boson.Address) (bool, error)

func (*ChainOracle) GetSourceNodes

func (ora *ChainOracle) GetSourceNodes(aufsUri string) []boson.Address

func (*ChainOracle) OnStoreMatched

func (ora *ChainOracle) OnStoreMatched(cid boson.Address, dataLen uint64, salt uint64, address boson.Address)

func (*ChainOracle) PublishRegisterStatus added in v1.3.0

func (ora *ChainOracle) PublishRegisterStatus(rootCid boson.Address, status uint64)

func (*ChainOracle) RegisterCidAndNode added in v1.2.2

func (ora *ChainOracle) RegisterCidAndNode(ctx context.Context, rootCid boson.Address, address boson.Address) (hash common.Hash, err error)

func (*ChainOracle) RemoveCidAndNode added in v1.2.2

func (ora *ChainOracle) RemoveCidAndNode(ctx context.Context, rootCid boson.Address, address boson.Address) (hash common.Hash, err error)

func (*ChainOracle) SubscribeRegisterStatus added in v1.3.0

func (ora *ChainOracle) SubscribeRegisterStatus(notifier *rpc.Notifier, sub *rpc.Subscription, rootCids []boson.Address)

func (*ChainOracle) WaitForReceipt added in v1.2.2

func (ora *ChainOracle) WaitForReceipt(ctx context.Context, rootCid boson.Address, txHash common.Hash) (receipt *types.Receipt, err error)

type Oracle

type Oracle struct {
	OracleCaller     // Read-only binding to the contract
	OracleTransactor // Write-only binding to the contract
	OracleFilterer   // Log filterer for contract events
}

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

func NewOracle

func NewOracle(address common.Address, backend bind.ContractBackend) (*Oracle, error)

NewOracle creates a new instance of Oracle, bound to a specific deployed contract.

type OracleCaller

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

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

func NewOracleCaller

func NewOracleCaller(address common.Address, caller bind.ContractCaller) (*OracleCaller, error)

NewOracleCaller creates a new read-only instance of Oracle, bound to a specific deployed contract.

func (*OracleCaller) Get

func (_Oracle *OracleCaller) Get(opts *bind.CallOpts, hash [32]byte) ([][32]byte, error)

Get is a free data retrieval call binding the contract method 0x8eaa6ac0.

Solidity: function get(bytes32 hash) view returns(bytes32[])

func (*OracleCaller) GetFileList added in v1.2.2

func (_Oracle *OracleCaller) GetFileList(opts *bind.CallOpts) ([][32]byte, error)

GetFileList is a free data retrieval call binding the contract method 0x4cedee48.

Solidity: function getFileList() view returns(bytes32[])

func (*OracleCaller) HashIMap added in v1.2.2

func (_Oracle *OracleCaller) HashIMap(opts *bind.CallOpts, arg0 [32]byte) (*big.Int, error)

HashIMap is a free data retrieval call binding the contract method 0x64f32492.

Solidity: function hashIMap(bytes32 ) view returns(uint256)

func (*OracleCaller) OracleIMap added in v1.2.2

func (_Oracle *OracleCaller) OracleIMap(opts *bind.CallOpts, arg0 [32]byte, arg1 [32]byte) (*big.Int, error)

OracleIMap is a free data retrieval call binding the contract method 0xce9972f9.

Solidity: function oracleIMap(bytes32 , bytes32 ) view returns(uint256)

func (*OracleCaller) Owner

func (_Oracle *OracleCaller) Owner(opts *bind.CallOpts) (common.Address, error)

Owner is a free data retrieval call binding the contract method 0x8da5cb5b.

Solidity: function owner() view returns(address)

func (*OracleCaller) Start added in v1.2.2

func (_Oracle *OracleCaller) Start(opts *bind.CallOpts) (bool, error)

Start is a free data retrieval call binding the contract method 0xbe9a6555.

Solidity: function start() view returns(bool)

type OracleCallerRaw

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

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

func (*OracleCallerRaw) Call

func (_Oracle *OracleCallerRaw) 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 OracleCallerSession

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

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

func (*OracleCallerSession) Get

func (_Oracle *OracleCallerSession) Get(hash [32]byte) ([][32]byte, error)

Get is a free data retrieval call binding the contract method 0x8eaa6ac0.

Solidity: function get(bytes32 hash) view returns(bytes32[])

func (*OracleCallerSession) GetFileList added in v1.2.2

func (_Oracle *OracleCallerSession) GetFileList() ([][32]byte, error)

GetFileList is a free data retrieval call binding the contract method 0x4cedee48.

Solidity: function getFileList() view returns(bytes32[])

func (*OracleCallerSession) HashIMap added in v1.2.2

func (_Oracle *OracleCallerSession) HashIMap(arg0 [32]byte) (*big.Int, error)

HashIMap is a free data retrieval call binding the contract method 0x64f32492.

Solidity: function hashIMap(bytes32 ) view returns(uint256)

func (*OracleCallerSession) OracleIMap added in v1.2.2

func (_Oracle *OracleCallerSession) OracleIMap(arg0 [32]byte, arg1 [32]byte) (*big.Int, error)

OracleIMap is a free data retrieval call binding the contract method 0xce9972f9.

Solidity: function oracleIMap(bytes32 , bytes32 ) view returns(uint256)

func (*OracleCallerSession) Owner

func (_Oracle *OracleCallerSession) Owner() (common.Address, error)

Owner is a free data retrieval call binding the contract method 0x8da5cb5b.

Solidity: function owner() view returns(address)

func (*OracleCallerSession) Start added in v1.2.2

func (_Oracle *OracleCallerSession) Start() (bool, error)

Start is a free data retrieval call binding the contract method 0xbe9a6555.

Solidity: function start() view returns(bool)

type OracleFilterer

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

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

func NewOracleFilterer

func NewOracleFilterer(address common.Address, filterer bind.ContractFilterer) (*OracleFilterer, error)

NewOracleFilterer creates a new log filterer instance of Oracle, bound to a specific deployed contract.

type OracleRaw

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

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

func (*OracleRaw) Call

func (_Oracle *OracleRaw) 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 (*OracleRaw) Transact

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

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

func (*OracleRaw) Transfer

func (_Oracle *OracleRaw) 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 OracleSession

type OracleSession struct {
	Contract     *Oracle           // 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
}

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

func (*OracleSession) Clear

func (_Oracle *OracleSession) Clear(hash [32]byte) (*types.Transaction, error)

Clear is a paid mutator transaction binding the contract method 0x97040a45.

Solidity: function clear(bytes32 hash) returns()

func (*OracleSession) Get

func (_Oracle *OracleSession) Get(hash [32]byte) ([][32]byte, error)

Get is a free data retrieval call binding the contract method 0x8eaa6ac0.

Solidity: function get(bytes32 hash) view returns(bytes32[])

func (*OracleSession) GetFileList added in v1.2.2

func (_Oracle *OracleSession) GetFileList() ([][32]byte, error)

GetFileList is a free data retrieval call binding the contract method 0x4cedee48.

Solidity: function getFileList() view returns(bytes32[])

func (*OracleSession) HashIMap added in v1.2.2

func (_Oracle *OracleSession) HashIMap(arg0 [32]byte) (*big.Int, error)

HashIMap is a free data retrieval call binding the contract method 0x64f32492.

Solidity: function hashIMap(bytes32 ) view returns(uint256)

func (*OracleSession) Initialize added in v1.2.2

func (_Oracle *OracleSession) Initialize() (*types.Transaction, error)

Initialize is a paid mutator transaction binding the contract method 0x8129fc1c.

Solidity: function initialize() returns()

func (*OracleSession) OracleIMap added in v1.2.2

func (_Oracle *OracleSession) OracleIMap(arg0 [32]byte, arg1 [32]byte) (*big.Int, error)

OracleIMap is a free data retrieval call binding the contract method 0xce9972f9.

Solidity: function oracleIMap(bytes32 , bytes32 ) view returns(uint256)

func (*OracleSession) Owner

func (_Oracle *OracleSession) Owner() (common.Address, error)

Owner is a free data retrieval call binding the contract method 0x8da5cb5b.

Solidity: function owner() view returns(address)

func (*OracleSession) Remove

func (_Oracle *OracleSession) Remove(hash [32]byte, addr [32]byte) (*types.Transaction, error)

Remove is a paid mutator transaction binding the contract method 0xb10e4172.

Solidity: function remove(bytes32 hash, bytes32 addr) returns()

func (*OracleSession) Set

func (_Oracle *OracleSession) Set(hash [32]byte, addr [32]byte) (*types.Transaction, error)

Set is a paid mutator transaction binding the contract method 0xf71f7a25.

Solidity: function set(bytes32 hash, bytes32 addr) returns()

func (*OracleSession) SetStart added in v1.2.2

func (_Oracle *OracleSession) SetStart(value bool) (*types.Transaction, error)

SetStart is a paid mutator transaction binding the contract method 0x68e24327.

Solidity: function setStart(bool value) returns()

func (*OracleSession) Start added in v1.2.2

func (_Oracle *OracleSession) Start() (bool, error)

Start is a free data retrieval call binding the contract method 0xbe9a6555.

Solidity: function start() view returns(bool)

type OracleTransactor

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

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

func NewOracleTransactor

func NewOracleTransactor(address common.Address, transactor bind.ContractTransactor) (*OracleTransactor, error)

NewOracleTransactor creates a new write-only instance of Oracle, bound to a specific deployed contract.

func (*OracleTransactor) Clear

func (_Oracle *OracleTransactor) Clear(opts *bind.TransactOpts, hash [32]byte) (*types.Transaction, error)

Clear is a paid mutator transaction binding the contract method 0x97040a45.

Solidity: function clear(bytes32 hash) returns()

func (*OracleTransactor) Initialize added in v1.2.2

func (_Oracle *OracleTransactor) Initialize(opts *bind.TransactOpts) (*types.Transaction, error)

Initialize is a paid mutator transaction binding the contract method 0x8129fc1c.

Solidity: function initialize() returns()

func (*OracleTransactor) Remove

func (_Oracle *OracleTransactor) Remove(opts *bind.TransactOpts, hash [32]byte, addr [32]byte) (*types.Transaction, error)

Remove is a paid mutator transaction binding the contract method 0xb10e4172.

Solidity: function remove(bytes32 hash, bytes32 addr) returns()

func (*OracleTransactor) Set

func (_Oracle *OracleTransactor) Set(opts *bind.TransactOpts, hash [32]byte, addr [32]byte) (*types.Transaction, error)

Set is a paid mutator transaction binding the contract method 0xf71f7a25.

Solidity: function set(bytes32 hash, bytes32 addr) returns()

func (*OracleTransactor) SetStart added in v1.2.2

func (_Oracle *OracleTransactor) SetStart(opts *bind.TransactOpts, value bool) (*types.Transaction, error)

SetStart is a paid mutator transaction binding the contract method 0x68e24327.

Solidity: function setStart(bool value) returns()

type OracleTransactorRaw

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

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

func (*OracleTransactorRaw) Transact

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

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

func (*OracleTransactorRaw) Transfer

func (_Oracle *OracleTransactorRaw) 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 OracleTransactorSession

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

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

func (*OracleTransactorSession) Clear

func (_Oracle *OracleTransactorSession) Clear(hash [32]byte) (*types.Transaction, error)

Clear is a paid mutator transaction binding the contract method 0x97040a45.

Solidity: function clear(bytes32 hash) returns()

func (*OracleTransactorSession) Initialize added in v1.2.2

func (_Oracle *OracleTransactorSession) Initialize() (*types.Transaction, error)

Initialize is a paid mutator transaction binding the contract method 0x8129fc1c.

Solidity: function initialize() returns()

func (*OracleTransactorSession) Remove

func (_Oracle *OracleTransactorSession) Remove(hash [32]byte, addr [32]byte) (*types.Transaction, error)

Remove is a paid mutator transaction binding the contract method 0xb10e4172.

Solidity: function remove(bytes32 hash, bytes32 addr) returns()

func (*OracleTransactorSession) Set

func (_Oracle *OracleTransactorSession) Set(hash [32]byte, addr [32]byte) (*types.Transaction, error)

Set is a paid mutator transaction binding the contract method 0xf71f7a25.

Solidity: function set(bytes32 hash, bytes32 addr) returns()

func (*OracleTransactorSession) SetStart added in v1.2.2

func (_Oracle *OracleTransactorSession) SetStart(value bool) (*types.Transaction, error)

SetStart is a paid mutator transaction binding the contract method 0x68e24327.

Solidity: function setStart(bool value) returns()

type RegisterStatus added in v1.3.0

type RegisterStatus struct {
	RootCid boson.Address `json:"rootCid"`
	Status  bool          `json:"status"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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