整合TCR、CPM和海洋代币
keeper-contracts的Python项目详细描述
保管人合同
? Integration of SEAs, DID and OceanToken in Solidity oceanprotocol.com
Dockerhub | TravisCI | Ascribe | Greenkeeper |
---|---|---|---|
有龙和乌贼。这是在alpha状态,你可以预期会遇到问题。如果你碰到他们,请打开a new issue。_
目录
开始
对于keeper-contracts
的本地开发,可以使用Docker,也可以在计算机上设置开发环境。
Docker
最简单的入门方法是barge,一个docker组合应用程序来运行海洋协议。
地方发展
作为先决条件,您需要:
- node.js
- 净现值
克隆项目并安装所有依赖项:
git clone git@github.com:oceanprotocol/keeper-contracts.git cd keeper-contracts/ # install dependencies npm i # install RPC client globally npm install -g ganache-cli
编制固化合同:
npm run compile
在新终端中,启动以太坊rpc客户端,例如ganache-cli:
ganache-cli
切换回另一个终端并部署合同:
npm run deploy:development
# for redeployment run this instead
npm run clean
npm run compile
npm run deploy:development
升级contracts[可选]:
npm run upgrade
测试
使用npm run test
运行测试,例如:
npm run test -- test/unit/agreements/AgreementStoreManager.Test.js
代码linting
使用ESLint和Ethlint为JavaScript
设置绒布。
代码样式是通过ci测试过程强制执行的,如果存在任何linting错误,生成将失败。
网络
测试网络
Duero测试网
部署在Ocean Duero测试网络上的合同地址:
Contract | Version | Address |
---|---|---|
AccessSecretStoreCondition | v0.11.1 | ^{ |
AgreementStoreManager | v0.11.1 | ^{ |
ConditionStoreManager | v0.11.1 | ^{ |
DIDRegistry | v0.11.1 | ^{ |
DIDRegistryLibrary | v0.11.1 | ^{ |
Dispenser | v0.11.1 | ^{ |
EpochLibrary | v0.11.1 | ^{ |
EscrowAccessSecretStoreTemplate | v0.11.1 | ^{ |
EscrowReward | v0.11.1 | ^{ |
HashLockCondition | v0.11.1 | ^{ |
LockRewardCondition | v0.11.1 | ^{ |
OceanToken | v0.11.1 | ^{ |
SignCondition | v0.11.1 | ^{ |
TemplateStoreManager | v0.11.1 | ^{ |
ThresholdCondition | v0.11.1 | ^{ |
WhitelistingCondition | v0.11.1 | ^{ |
尼罗河试验网
部署在Ocean的Nile Beta网络上的合同地址:
Contract | Version | Address |
---|---|---|
AccessSecretStoreCondition | v0.11.1 | ^{ |
AgreementStoreManager | v0.11.1 | ^{ |
ConditionStoreManager | v0.11.1 | ^{ |
DIDRegistry | v0.11.1 | ^{ |
DIDRegistryLibrary | v0.11.1 | ^{ |
Dispenser | v0.11.1 | ^{ |
EpochLibrary | v0.11.1 | ^{ |
EscrowAccessSecretStoreTemplate | v0.11.1 | ^{ |
EscrowReward | v0.11.1 | ^{ |
HashLockCondition | v0.11.1 | ^{ |
LockRewardCondition | v0.11.1 | ^{ |
OceanToken | v0.11.1 | ^{ |
SignCondition | v0.11.1 | ^{ |
TemplateStoreManager | v0.11.1 | ^{ |
ThresholdCondition | v0.11.1 | ^{ |
WhitelistingCondition | v0.11.1 | ^{ |
科万测试网
已弃用:已弃用kovan
网络,并将在下一版本中删除。
部署在kovan testnet上的合同地址:
Contract | Version | Address |
---|---|---|
AccessSecretStoreCondition | v0.10.3 | ^{ |
AgreementStoreManager | v0.10.3 | ^{ |
ConditionStoreManager | v0.10.3 | ^{ |
DIDRegistry | v0.10.3 | ^{ |
DIDRegistryLibrary | v0.10.3 | ^{ |
Dispenser | v0.10.3 | ^{ |
EpochLibrary | v0.10.3 | ^{ |
EscrowAccessSecretStoreTemplate | v0.10.3 | ^{ |
EscrowReward | v0.10.3 | ^{ |
HashLockCondition | v0.10.3 | ^{ |
LockRewardCondition | v0.10.3 | ^{ |
OceanToken | v0.10.3 | ^{ |
SignCondition | v0.10.3 | ^{ |
TemplateStoreManager | v0.10.3 | ^{ |
主机
太平洋主干网
部署在太平洋主网上的合同地址:
Contract | Version | Address |
---|---|---|
AccessSecretStoreCondition | v0.11.1 | ^{ |
AgreementStoreManager | v0.11.1 | ^{ |
ConditionStoreManager | v0.11.1 | ^{ |
DIDRegistry | v0.11.1 | ^{ |
DIDRegistryLibrary | v0.11.1 | ^{ |
EpochLibrary | v0.11.1 | ^{ |
EscrowAccessSecretStoreTemplate | v0.11.1 | ^{ |
EscrowReward | v0.11.1 | ^{ |
HashLockCondition | v0.11.1 | ^{ |
LockRewardCondition | v0.11.1 | ^{ |
OceanToken | v0.11.1 | ^{ |
SignCondition | v0.11.1 | ^{ |
TemplateStoreManager | v0.11.1 | ^{ |
ThresholdCondition | v0.11.1 | ^{ |
WhitelistingCondition | v0.11.1 | ^{ |
以太坊主网
已弃用:已弃用ethereum mainnet
网络,并将在下一版本中删除。
部署在以太坊主网上的合同地址:
Contract | Version | Address |
---|---|---|
AccessSecretStoreCondition | v0.10.3 | ^{ |
AgreementStoreManager | v0.10.3 | ^{ |
ConditionStoreManager | v0.10.3 | ^{ |
DIDRegistry | v0.10.3 | ^{ |
DIDRegistryLibrary | v0.10.3 | ^{ |
EpochLibrary | v0.10.3 | ^{ |
EscrowAccessSecretStoreTemplate | v0.10.3 | ^{ |
EscrowReward | v0.10.3 | ^{ |
HashLockCondition | v0.10.3 | ^{ |
LockRewardCondition | v0.10.3 | ^{ |
SignCondition | v0.10.3 | ^{ |
TemplateStoreManager | v0.10.3 | ^{ |
套餐
为了便于集成海洋协议的keeper-contracts
,有Python
、JavaScript
和Java
包可以集成。这些库包括智能合约abi。
使用这些包有助于避免编译智能合约并将abi手动复制到项目中。这样集成就更干净、更容易了。
当前提供的软件包是:
- javascript
npm
包-作为@oceanprotocol npm organization的一部分,npm keeper-contracts package提供要从JavaScript
代码导入的abi。 - python
Pypi
包Pypi keeper-contracts package提供了从Python
使用的相同abi。 - java
Maven
包Maven keeper-contracts package提供了从Java
使用的相同abi。
这些包包含doc/
和artifacts/
文件夹中的所有内容。
在JavaScript
中,它们可以这样使用:
安装keeper-contracts
npm
包。
npm install @oceanprotocol/keeper-contracts
在nile
网络上加载OceanToken
合同的abi:
constOceanToken=require('@oceanprotocol/keeper-contracts/artifacts/OceanToken.nile.json')
artifacts
的结构是:
{"abi":"...","bytecode":"0x60806040523...","address":"0x45DE141F8Efc355F1451a102FB6225F1EDd2921d","version":"v0.9.1"}
文档
贡献
请参阅海洋协议文档中标题为“Ways to Contribute”的页面。
现有技术
这个项目建立在开源项目的基础上:
许可证
Copyright 2018 Ocean Protocol Foundation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.