Skip to content

Commit cc1cda5

Browse files
authored
Merge pull request #331 from bandprotocol/revisit-todo-readme
Revisit todo readme
2 parents c61d769 + f6ef705 commit cc1cda5

File tree

11 files changed

+38
-83
lines changed

11 files changed

+38
-83
lines changed

README.md

Lines changed: 22 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -21,27 +21,21 @@ BandChain - Decentralized Data Delivery Network<br/><br/>
2121
<p align="center">
2222
<a href="https://docs.bandchain.org/"><strong>Documentation »</strong></a>
2323
<br />
24-
<br/>
25-
<a href="http://docs.bandchain.org/whitepaper/introduction.html">Whitepaper</a>
26-
·
27-
<a href="http://docs.bandchain.org/technical-specifications/obi.html">Technical Specifications</a>
28-
·
29-
<a href="http://docs.bandchain.org/using-any-datasets/">Developer Documentation</a>
30-
·
31-
<a href="http://docs.bandchain.org/client-library/data.html">Client Library</a>
3224
</p>
3325

3426
<br/>
3527

3628
## What is BandChain?
3729

38-
BandChain is a **cross-chain data oracle platform** that aggregates and connects real-world data and APIs to smart contracts. It is designed to be **compatible with most smart contract and blockchain development frameworks**. It does the heavy lifting jobs of pulling data from external sources, aggregating them, and packaging them into the format that’s easy to use and verified efficiently across multiple blockchains.
30+
BandChain is a **cross-chain data oracle platform** that aggregates and connects real-world data and APIs to smart contracts. It is designed to be **compatible with most smart contract and blockchain development frameworks**. It does the heavy lifting jobs of pulling data from external sources, aggregating them, and packaging them into the format that’s easy to use and verifiable efficiently across multiple blockchains.
3931

4032
Band's flexible oracle design allows developers to **query any data** including real-world events, sports, weather, random numbers and more. Developers can create custom-made oracles using WebAssembly to connect smart contracts with traditional web APIs within minutes.
4133

4234
## Installation
4335

44-
### Building from source
36+
Please refer to [this documentation](https://docs.bandchain.org/node-validators/run-node/joining-mainnet/installation) for the most up-to-date installation guide.
37+
38+
## Building from source
4539

4640
We recommend the following for running a BandChain Validator:
4741

@@ -70,28 +64,27 @@ make install
7064
Using `bandd version` command to verify that your `bandd` has been build successfully.
7165

7266
```
73-
bandd version --long
7467
name: bandchain
7568
server_name: bandd
76-
version: 2.3.0
77-
commit: 4fe19638b33043eed4dec9861cda40962fb5b2a7
78-
build_tags: ledger
79-
go: go version go1.18.3 darwin/amd64
69+
version: 2.5.4
70+
commit: e6548bbf4793829bb8e711e5ed89ba4afc710ded
71+
build_tags: netgo,ledger
72+
go: go version go1.19.1 darwin/amd64
8073
build_deps:
8174
...
8275
```
8376

84-
### Setting Up Yoda — The Oracle Daemon
85-
86-
BandChain validators are also responsible for responding to oracle data requests. Whenever someone submits a request message to BandChain, the chain will autonomously choose a subset of active oracle validators to perform the data query.
87-
88-
The validators are chosen submit a report message to BandChain within a given timeframe as specified by a chain parameter (100 blocks in mainnet). We provide a program called yoda to do this task for you. For more information on the data request process, please see [here](https://docs.bandchain.org/whitepaper/system-overview.html#oracle-data-request).
89-
90-
Yoda uses an external executor to resolve requests to data sources. Currently, it supports [AWS Lambda](https://aws.amazon.com/lambda/) and [Google Cloud Function](https://cloud.google.com/functions) (through the REST interface). In future releases, `yoda` will support more executors and allow you to specify multiple executors to add redundancy.
77+
If you are using Mac ARM architecture (M1, M2) and face the issue of GMP library, you can run this.
78+
```
79+
brew update && brew install gmp
80+
sudo ln -s /opt/homebrew/lib/libgmp.10.dylib /usr/local/lib/
81+
```
9182

92-
You also need to set up `yoda` and activate oracle status. Here’s the [documentation](https://github.com/bandprotocol/bandchain/wiki/Instruction-for-apply-to-be-an-oracle-validator-on-Guanyu-mainnet) to get started.
83+
## Useful scripts for development
9384

94-
That’s it! You can verify that your validator is now an oracle provider via cli by using ` bandd query oracle validator <your validator address>`. Your yoda process must be responding to oracle requests assigned to your node. If the process misses a request, your oracle provider status will automatically get deactivated and you must send MsgActivate to activate again after a 10-minute waiting period and make sure that yoda is up.
85+
- `scripts/generate_genesis.sh` to create/reset the default genesis file
86+
- `scripts/start_bandd.sh` to start the bandd binary
87+
- `scripts/start_yoda.sh` to start yoda with reporter(s)
9588

9689
## Resources
9790

@@ -105,19 +98,19 @@ That’s it! You can verify that your validator is now an oracle provider via cl
10598
- [Cosmoscan Mainnet](https://cosmoscan.io)
10699
- [Big Dipper](https://band.bigdipper.live/)
107100
- Testnet:
108-
- [CosmoScan Testnet](https://laozi-testnet2.cosmoscan.io)
101+
- [CosmoScan Testnet](https://laozi-testnet6.cosmoscan.io)
109102

110103
## Community
111104

112105
- [Official Website](https://bandprotocol.com)
113-
- [Telegram](https://100.band/tg)
106+
- [Telegram](https://t.me/bandprotocol)
114107
- [Twitter](https://twitter.com/bandprotocol)
115-
- [Developer Discord](https://100x.band/discord)
108+
- [Developer Discord](https://discord.com/invite/3t4bsY7)
116109

117110
## License & Contributing
118111

119112
BandChain is licensed under the terms of the GPL 3.0 License unless otherwise specified in the LICENSE file at module's root.
120113

121-
We highly encourage participation from the community to help with D3N development. If you are interested in developing with D3N or have suggestion for protocol improvements, please open an issue, submit a pull request, or [drop as a line].
114+
We highly encourage participation from the community to help with D3N development. If you are interested in developing with D3N or have suggestions for protocol improvements, please open an issue, submit a pull request, or [drop as a line].
122115

123-
[drop as a line]: mailto:connect@bandprotocol.com
116+
[drop us a line]: mailto:connect@bandprotocol.com

app/app.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -605,8 +605,8 @@ func NewBandApp(
605605
// NOTE: Oracle module must occur before distr as it takes some fee to distribute to active oracle validators.
606606
// NOTE: During begin block slashing happens after distr.BeginBlocker so that there is nothing left
607607
// over in the validator fee pool, so as to keep the CanWithdrawInvariant invariant.
608+
// NOTE: capability module's beginblocker must come before any modules using capabilities (e.g. IBC)
608609

609-
// TODO: Recheck all Begin/End block logic order
610610
app.mm.SetOrderBeginBlockers(
611611
upgradetypes.ModuleName,
612612
capabilitytypes.ModuleName,
@@ -657,6 +657,7 @@ func NewBandApp(
657657
consensusparamtypes.ModuleName,
658658
globalfeetypes.ModuleName,
659659
)
660+
660661
// NOTE: The genutils module must occur after staking so that pools are
661662
// properly initialized with tokens from genesis accounts.
662663
// NOTE: The genutils module must also occur after auth so that it can access the params from auth.

testing/chain.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// 0.47 TODO: consider importing directly from ibc instead of forking
1+
// TODO: consider importing directly from ibc instead of forking
22
package ibctesting
33

44
import (
@@ -78,7 +78,6 @@ type TestChain struct {
7878
// Time management is handled by the Coordinator in order to ensure synchrony between chains.
7979
// Each update of any chain increments the block header time for all chains by 5 seconds.
8080
func NewTestChain(t *testing.T, coord *Coordinator, chainID string) *TestChain {
81-
// TODO: change sender
8281
signers := make([]tmtypes.PrivValidator, valSize)
8382
validators := make([]*tmtypes.Validator, valSize)
8483
genesisAccount := make([]authtypes.GenesisAccount, valSize)

testing/endpoint.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ func (endpoint *Endpoint) CreateClient() (err error) {
103103
consensusState = endpoint.Counterparty.Chain.LastHeader.ConsensusState()
104104
case exported.Solomachine:
105105
// TODO
106-
// solo := NewSolomachine(chain.t, endpoint.Chain.Codec, clientID, "", 1)
106+
// solo := NewSolomachine(endpoint.Chain.T, endpoint.Chain.Codec, clientID, "", 1)
107107
// clientState = solo.ClientState()
108108
// consensusState = solo.ConsensusState()
109109

x/globalfee/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Global fee module
22

3-
This module is the fork version of globalfee module from [Gaia](https://github.com/cosmos/gaia) and [TGrade](https://github.com/confio/tgrade) with modifications to use with the Oracle module and Cosmos-SDK 0.46.x version. All credits and big thanks go to the original authors.
3+
This module is the fork version of globalfee module from [Gaia](https://github.com/cosmos/gaia) and [TGrade](https://github.com/confio/tgrade) with modifications to use with the Oracle module and Cosmos-SDK 0.47.x version. All credits and big thanks go to the original authors.
44

x/oracle/client/cli/tx.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,6 @@ $ %s tx oracle edit-data-source 1 --name coingecko-price --description The scrip
307307
return err
308308
}
309309

310-
// TODO: Support do-not-modify fee
311310
coinStr, err := cmd.Flags().GetString(flagFee)
312311
if err != nil {
313312
return err

x/oracle/ibc_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// 0.47 TODO: write this test file by importing testing directly from ibc
1+
// TODO: write this test file by importing testing directly from ibc
22
package oracle_test
33

44
import (

x/oracle/module.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,8 @@ func NewAppModule(k keeper.Keeper, ss exported.Subspace) AppModule {
9696
}
9797
}
9898

99-
// RegisterInvariants is a noop function to satisfy SDK AppModule interface.
100-
func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry) {
101-
// TODO
102-
}
99+
// RegisterInvariants is a no-op function to satisfy SDK AppModule interface.
100+
func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {}
103101

104102
// RegisterServices registers module services.
105103
func (am AppModule) RegisterServices(cfg module.Configurator) {

yoda/README.md

Lines changed: 8 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,15 @@
1-
### Yoda
1+
# Yoda
22

3-
## Prepare environment
3+
## Introduction
44

5-
1. Install PostgresSQL `brew install postgresql`
6-
2. Install Golang
7-
3. Install Rust
8-
4. Install Docker
9-
5. run `cd owasm/chaintests/bitcoin_block_count/`
10-
6. run `wasm-pack build .`
11-
7. `make install` in chain directory
12-
8. Open 3 tabs on cmd
13-
9. run `docker pull bandprotocol/runtime:1.0.2`
5+
Yoda is a program that is used by BandChain's validator nodes to automatically fulfill data for oracle requests.
146

15-
## How to install and run Yoda
7+
Since a subset of validators who are selected for a data request must return the data they received from running the specified data source(s), each of them have to send a `MsgReportData` transaction to BandChain in order to fulfill their duty.
168

17-
1. Open first cmd tab for running the BandChain
18-
2. Open second cmd tab for running the Yoda
19-
3. Open third cmd tab for running the BandChain CLI
9+
Although the transaction can be sent manually by user, it is not convenient, and would be rather time-consuming. Furthermore, most data providers already have APIs that can be used to query data automatically by another software. Therefore, we have developed Yoda to help validators to automatically query data from data providers by executing data source script, then submit the result to fulfill the request.
2010

21-
### How to run BandChain on development mode
11+
For more detail about Yoda, please follows this [link](https://docs.bandchain.org/node-validators/yoda)
2212

23-
1. Go to chain directory
24-
2. Setup your PostgresSQL user, port and database name on `start_bandd.sh`
25-
3. run `chmod +x scripts/start_bandd.sh` to change the access permission of start_bandd.script
26-
4. run `./scripts/start_bandd.sh` to start BandChain
27-
5. If fail, try owasm pack build then run script again.
13+
## Installation
2814

29-
```
30-
cd ../owasm/chaintests/bitcoin_block_count/
31-
wasm-pack build .
32-
cd ../../../chain
33-
```
34-
35-
### How to run Yoda
36-
37-
1. Go to chain directory
38-
2. run `chmod +x scripts/start_yoda.sh` to change the access permission of start_yoda.script
39-
3. run `./scripts/start_yoda.sh validator [number of reporter]` to start Yoda
40-
41-
### Try to request data BandChain
42-
43-
After we have `BandChain` and `Yoda` running, now we can request data on BandChain.
44-
Example of requesting data on BandChain
45-
46-
```
47-
bandd tx oracle request 1 -c 0000000342544300000000000003e8 1 1 --chain-id bandchain --gas 3000000 --keyring-backend test --fee-limit 10uband --from requester
48-
```
15+
Please refer to [this documentation](https://docs.bandchain.org/node-validators/run-node/joining-mainnet/installation#step-5-setup-yoda) for the most up-to-date installation guide.

yoda/executor/executor.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ func NewExecutor(executor string) (exec Executor, err error) {
4646
return nil, fmt.Errorf("invalid executor name: %s, base: %s", name, base)
4747
}
4848

49-
// TODO: Remove hardcode in test execution
5049
res, err := exec.Exec(testProgram, "TEST_ARG", map[string]interface{}{
5150
"BAND_CHAIN_ID": "test-chain-id",
5251
"BAND_VALIDATOR": "test-validator",

yoda/gas.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ func estimateAuthAnteHandlerGas(c *Context, msgs []sdk.Msg) uint64 {
120120
}
121121

122122
func estimateGas(c *Context, l *Logger, msgs []sdk.Msg, feeEstimations []FeeEstimationData) uint64 {
123-
// TODO: Add authz validation / remove check reporter base gas
124123
gas := estimateAuthAnteHandlerGas(c, msgs)
125124

126125
for i, msg := range msgs {

0 commit comments

Comments
 (0)