项目作者: confio

项目描述 :
Random oracle in CosmWasm
高级语言: Rust
项目地址: git://github.com/confio/rand.git
创建时间: 2020-10-26T09:14:27Z
项目社区:https://github.com/confio/rand

开源协议:GNU Affero General Public License v3.0

下载


⚠️ This project was created as a proof of concept for an article in 2020. It served its

⚠️ purpose. It was occasionally updated but does not belong to any actively maintained software

⚠️ stack. It’s archived now to highlight that no changes are done here anymore and no contributions

⚠️ are accepted. It is likely insecure. Also please note that this code is licensed under AGPL which

⚠️ might be a problem for when you want to use it. The story of drand verificartion in CosmWasm

⚠️ is continued at Nois.

Rand – A drand client as a CosmWasm smart contract

To learn more about this project, see this article: https://medium.com/confio/when-your-blockchain-needs-to-roll-the-dice-ed9da121f590

Development build

Some fast checks

  1. cargo fmt && cargo unit-test && cargo check --tests && cargo schema && cargo clippy -- -D warnings

Integratin tests

  1. cargo wasm && cargo integration-test

Run in singlepass

In order to measure gas consumption, singlepass tests need to be used. E.g.

  1. cargo wasm
  2. cargo integration-test --no-default-features verify_valid -- --nocapture

Production build

  1. docker run --rm -v "$(pwd)":/code \
  2. --mount type=volume,source="$(basename "$(pwd)")_cache",target=/code/target \
  3. --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \
  4. cosmwasm/rust-optimizer:0.12.5

License

  1. A drand client in a smart contract for CosmWasm.
  2. Copyright (C) 2020 Confio OÜ
  3. This program is free software: you can redistribute it and/or modify
  4. it under the terms of the GNU Affero General Public License as
  5. published by the Free Software Foundation, either version 3 of the
  6. License, or (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU Affero General Public License for more details.
  11. You should have received a copy of the GNU Affero General Public License
  12. along with this program. If not, see <http://www.gnu.org/licenses></http:>.