From 2a8041257d162869f471ae5b2f495bfcdaf5412f Mon Sep 17 00:00:00 2001 From: Silas Davis Date: Tue, 16 Mar 2021 12:32:51 +0100 Subject: [PATCH] Implement repo common structure and update contributing guidelines Move the 'one shot' prerelease build functionality from `develop` to `prerelease` to avoid confusion. Signed-off-by: Silas Davis --- .github/CONTRIBUTING.md | 28 ++-- .github/workflows/{master.yaml => main.yaml} | 4 +- .../{develop.yaml => prerelease.yaml} | 5 +- .github/workflows/test.yaml | 14 +- CHANGELOG.md | 2 +- docs/ADRs/adr-1.md | 2 +- docs/README.md | 12 +- docs/deploy.md | 4 +- docs/developers.md | 8 +- docs/js-api.md | 62 ++++---- docs/reference/kubernetes.md | 2 +- docs/reference/transactions.md | 8 +- docs/tutorials/3-contracts.md | 4 +- repolint.json | 147 ++++++++++++++++++ 14 files changed, 229 insertions(+), 73 deletions(-) rename .github/workflows/{master.yaml => main.yaml} (98%) rename .github/workflows/{develop.yaml => prerelease.yaml} (94%) create mode 100644 repolint.json diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index f2f9ab2e7..87cd84f0b 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -1,10 +1,18 @@ # Contributing to `burrow`: -Forked from Docker's [contributing guidelines](https://github.com/docker/docker/blob/master/CONTRIBUTING.md) +Forked from Docker's [contributing guidelines](https://github.com/docker/docker/blob/main/CONTRIBUTING.md) ## Developer Certificate of Origin Please always include "signed-off-by" in your commit message and note this constitutes a developer certification you are contributing a patch under Apache 2.0. Please find a verbatim copy of the Developer Certificate of Origin in this repository [here](.github/DEVELOPER_CERTIFICATE_OF_ORIGIN.md) or on [developercertificate.org](https://developercertificate.org/). +## Branches and releases + +All development happens on 'main'. Any other branches should be considered temporary and should have a corresponding pull request where they are the source to help keep track of them. Such branches can be marked WIP/draft. + +There is a special branch called 'prereleae' that is solely used to trigger a build of the JS library and docker images with a special prerelease tag based on the commit hash. This can be triggered by force pushing to 'prerelease'. If you would like a prerelease build please ask a maintainer (via an issue or on https://chat.hyperledger.org/channel/burrow) to force push for you. Since this branch may be overwritten at any time it should never be the only home for durable changes. + +Commits tagged with a 'v'-prefixed semver tag like `v0.11.1` are official releases and will trigger builds of binaries, JS library, and docker images in CI. We will try to make these regularly but will sometimes batch up a few changes and dependency upgrades (particularly Tendermint). + ## Bug Reporting A great way to contribute to the project is to send a detailed report when you encounter an issue. We always appreciate a well-written, thorough bug report, and will thank you for it! @@ -17,15 +25,15 @@ Our [ISSUE_TEMPLATE.md](ISSUE_TEMPLATE.md) will autopopulate the new issue. ## Contribution Tips and Guidelines -### Pull requests are always welcome (to `develop` rather than `master`). +### Pull requests are always welcome (always based on the `main` branch) -Not sure if that typo is worth a pull request? Found a bug and know how to fix it? Do it! We will appreciate it. Any significant improvement should be documented as a GitHub issue or discussed in [The Marmot Den](https://slack.monax.io) Slack community prior to beginning. +Not sure if that typo is worth a pull request? Found a bug and know how to fix it? Do it! We will appreciate it. We are always thrilled to receive pull requests (and bug reports!) and we do our best to process them quickly. ## Conventions -Fork the repository and make changes on your fork in a feature branch (branched from develop), create an issue outlining your feature or a bug, or use an open one. +Fork the repository and make changes on your fork in a feature branch, create an issue outlining your feature or a bug, or use an open one. If it's a bug fix branch, name it something-XXXX where XXXX is the number of the issue. If it's a feature branch, create an enhancement issue to announce your intentions, and name it something-XXXX where XXXX is the number of the issue. @@ -42,11 +50,9 @@ Commit messages must start with a short summary (max. 50 chars) written in the i Code review comments may be added to your pull request. Discuss, then make the suggested modifications and push additional commits to your feature branch. -Pull requests must be cleanly rebased on top of develop without multiple branches mixed into the PR. +Pull requests must be cleanly rebased on top of main without multiple branches mixed into the PR. -*Git tip:* If your PR no longer merges cleanly, use `git rebase develop` in your feature branch to update your pull request rather than merge develop. - -Before you make a pull request, squash your commits into logical units of work using `git rebase -i` and `git push -f`. A logical unit of work is a consistent set of patches that should be reviewed together: for example, upgrading the version of a vendored dependency and taking advantage of its now available new feature constitute two separate units of work. Implementing a new function and calling it in another file constitute a single logical unit of work. The very high majority of submissions should have a single commit, so if in doubt: squash down to one. +*Git tip:* If your PR no longer merges cleanly, use `git rebase main` in your feature branch to update your pull request rather than merge main. After every commit, make sure the test suite passes. Include documentation changes in the same pull request so that a revert would remove all traces of the feature or fix. @@ -54,10 +60,6 @@ After every commit, make sure the test suite passes. Include documentation chang We use LGTM (Looks Good To Me) in commands on the code review to indicate acceptance. -## Errors and Log Messages Style - -TODO - ## Coding Style Unless explicitly stated, we follow all coding guidelines from the Go community. While some of these standards may seem arbitrary, they somehow seem to result in a solid, consistent codebase. @@ -68,7 +70,7 @@ It is possible that the code base does not currently comply with these guideline * All code should follow the guidelines covered in [Effective Go](https://golang.org/doc/effective_go.html) and [Go Code Review Comments](https://github.com/golang/go/wiki/CodeReviewComments). * Comment the code. Tell us the why, the history and the context. * Document all declarations and methods, even private ones. Declare expectations, caveats and anything else that may be important. If a type gets exported, having the comments already there will ensure it's ready. -* Variable name length should be proportional to it's context and no longer. noCommaALongVariableNameLikeThisIsNotMoreClearWhenASimpleCommentWouldDo. In practice, short methods will have short variable names and globals will have longer names. +* Variable name length should be proportional to its context and no longer. noCommaALongVariableNameLikeThisIsNotMoreClearWhenASimpleCommentWouldDo. In practice, short methods will have short variable names and globals will have longer names. * No underscores in package names. If you need a compound name, step back, and re-examine why you need a compound name. If you still think you need a compound name, lose the underscore. * No utils or helpers packages. If a function is not general enough to warrant its own package, it has not been written generally enough to be a part of a `util` package. Just leave it unexported and well-documented. * All tests should run with `go test` and outside tooling should not be required. No, we don't need another unit testing framework. Assertion packages are acceptable if they provide real incremental value. diff --git a/.github/workflows/master.yaml b/.github/workflows/main.yaml similarity index 98% rename from .github/workflows/master.yaml rename to .github/workflows/main.yaml index 2c978a005..e139b5584 100644 --- a/.github/workflows/master.yaml +++ b/.github/workflows/main.yaml @@ -1,8 +1,8 @@ -name: master +name: main on: push: branches: - - master + - main jobs: cover: diff --git a/.github/workflows/develop.yaml b/.github/workflows/prerelease.yaml similarity index 94% rename from .github/workflows/develop.yaml rename to .github/workflows/prerelease.yaml index 5b02e8612..1730f4d22 100644 --- a/.github/workflows/develop.yaml +++ b/.github/workflows/prerelease.yaml @@ -1,8 +1,9 @@ -name: develop +# Force push to 'prerelease' to get a JS/docker build for testing etc +name: prerelease on: push: branches: - - develop + - prerelease tags-ignore: - 'v*' diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 9d5283f3a..c01a3b6f4 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -3,7 +3,7 @@ on: pull_request: push: branches: - - master + - main jobs: unit: @@ -17,7 +17,7 @@ jobs: - run: git fetch --unshallow --prune - run: make test - run: make build - - uses: actions/upload-artifact@master + - uses: actions/upload-artifact@main with: name: burrow path: bin @@ -52,7 +52,7 @@ jobs: needs: unit steps: - uses: actions/checkout@v2 - - uses: actions/download-artifact@master + - uses: actions/download-artifact@main with: name: burrow path: bin @@ -70,7 +70,7 @@ jobs: - uses: actions/setup-node@v2 with: node-version: '14' - - uses: actions/download-artifact@master + - uses: actions/download-artifact@main with: name: burrow path: bin @@ -85,7 +85,7 @@ jobs: needs: unit steps: - uses: actions/checkout@v2 - - uses: actions/download-artifact@master + - uses: actions/download-artifact@main with: name: burrow path: bin @@ -100,7 +100,7 @@ jobs: needs: unit steps: - uses: actions/checkout@v2 - - uses: actions/download-artifact@master + - uses: actions/download-artifact@main with: name: burrow path: bin @@ -118,7 +118,7 @@ jobs: - uses: actions/setup-node@v2 with: node-version: '14' - - uses: actions/download-artifact@master + - uses: actions/download-artifact@main with: name: burrow path: bin diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c280cbad..de6cb915f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -354,7 +354,7 @@ ### Added - [EVM] Implemented [CREATE2 opcode](https://eips.ethereum.org/EIPS/eip-1014) -- [EVM] Implemented [EXTCODEHASH opcode](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1052.md) +- [EVM] Implemented [EXTCODEHASH opcode](https://github.com/ethereum/EIPs/blob/main/EIPS/eip-1052.md) - [Accounts] Add account GetStats to query endpoint - [Config] Expose AddrBookStrict from Tendermint - [Deploy] burrow deploy now prints events generated during transactions diff --git a/docs/ADRs/adr-1.md b/docs/ADRs/adr-1.md index 2cb03d408..10e2347b6 100644 --- a/docs/ADRs/adr-1.md +++ b/docs/ADRs/adr-1.md @@ -5,7 +5,7 @@ discussions-to: https://chat.hyperledger.org/channel/burrow-contributors status: Draft type: Meta author: The Burrow's marmots and others - https://github.com/hyperledger/burrow/ADRs/blob/master/ADRs/adr-1.md + https://github.com/hyperledger/burrow/ADRs/blob/main/ADRs/adr-1.md created: 2018-10-09 --- diff --git a/docs/README.md b/docs/README.md index ea46fcbcc..c35f1fbd6 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,11 +1,11 @@ # [Hyperledger Burrow](https://hyperledger.github.io/burrow) -[![CI](https://github.com/hyperledger/burrow/workflows/master/badge.svg)](https://launch-editor.github.com/actions?workflowID=master&event=push&nwo=hyperledger%2Fburrow) +[![CI](https://github.com/hyperledger/burrow/workflows/main/badge.svg)](https://launch-editor.github.com/actions?workflowID=main&event=push&nwo=hyperledger%2Fburrow) [![version](https://img.shields.io/github/tag/hyperledger/burrow.svg)](https://github.com/hyperledger/burrow/releases/latest) [![GoDoc](https://godoc.org/github.com/burrow?status.png)](https://godoc.org/github.com/hyperledger/burrow) [![license](https://img.shields.io/github/license/hyperledger/burrow.svg)](../LICENSE.md) [![LoC](https://tokei.rs/b1/github/hyperledger/burrow?category=lines)](https://github.com/hyperledger/burrow) -[![codecov](https://codecov.io/gh/hyperledger/burrow/branch/master/graph/badge.svg)](https://codecov.io/gh/hyperledger/burrow) +[![codecov](https://codecov.io/gh/hyperledger/burrow/branch/main/graph/badge.svg)](https://codecov.io/gh/hyperledger/burrow) Hyperledger Burrow is a permissioned Ethereum smart-contract blockchain node. It executes Ethereum EVM and WASM smart contract code (usually written in [Solidity](https://solidity.readthedocs.io)) on a permissioned virtual machine. Burrow provides transaction finality and high transaction throughput on a proof-of-stake [Tendermint](https://tendermint.com) consensus engine. @@ -43,7 +43,7 @@ Watch the [Boring into Burrow](https://www.youtube.com/watch?v=OpbjYaGAP4k) talk ## JavaScript Client -There is a [JavaScript API](https://github.com/hyperledger/burrow/tree/master/js) +There is a [JavaScript API](https://github.com/hyperledger/burrow/tree/main/js) ## Project Roadmap @@ -52,6 +52,12 @@ Project information generally updated on a quarterly basis can be found on the [ ## Documentation Burrow getting started documentation is available on the [documentation site](https://hyperledger.github.io/burrow) (source markdown files can be found in [docs]()) and programmatic API in [GoDocs](https://godoc.org/github.com/hyperledger/burrow). +## Releases + +- **Burrow binaries**: https://github.com/hyperledger/burrow/releases +- **Burrow.js**: https://www.npmjs.com/package/@hyperledger/burrow +- **Docker**: https://hub.docker.com/repository/docker/hyperledger/burrow + ## Contribute We welcome any and all contributions. Read the [contributing file](../.github/CONTRIBUTING.md) for more information on making your first Pull Request to Burrow! diff --git a/docs/deploy.md b/docs/deploy.md index 34489590a..433266fce 100644 --- a/docs/deploy.md +++ b/docs/deploy.md @@ -11,8 +11,8 @@ The Burrow deploy toolkit can do a number of things: * create proposals or vote for a proposal burrow deploy needs a script to its commands. This script format bares some similarity to [ansible](https://www.ansible.com/). It -is in yaml format. The top level structure is an array of [jobs](https://github.com/hyperledger/burrow/blob/master/deploy/def/job.go). -The different job types are [defined here](https://github.com/hyperledger/burrow/blob/master/deploy/def/jobs.go). +is in yaml format. The top level structure is an array of [jobs](https://github.com/hyperledger/burrow/blob/main/deploy/def/job.go). +The different job types are [defined here](https://github.com/hyperledger/burrow/blob/main/deploy/def/jobs.go). You can invoke burrow from the command line: diff --git a/docs/developers.md b/docs/developers.md index 44f0ddf66..9e11c8f2e 100644 --- a/docs/developers.md +++ b/docs/developers.md @@ -7,7 +7,7 @@ - [goimports](https://godoc.org/golang.org/x/tools/cmd/goimports) - [protoc](http://google.github.io/proto-lens/installing-protoc.html) (libprotoc 3.7.1) -Please also refer to our [contributing guidelines](https://github.com/hyperledger/burrow/blob/master/.github/CONTRIBUTING.md). +Please also refer to our [contributing guidelines](https://github.com/hyperledger/burrow/blob/main/.github/CONTRIBUTING.md). ## Building @@ -25,9 +25,9 @@ Install protoc and run `make protobuf_deps`. If you make any changes to the prot ## Releasing * First of all make sure everyone is happy with doing a release now. -* Update project/history.go with the latest releases notes and version. Run `make CHANGELOG.md NOTES.md` and make sure this is merged to master. -* On the master branch, run `make ready_for_pull_request`. Check for any modified files. -* Once master is update to date, switch to master locally run `make tag_release`. This will push the tag which kicks of the release build. +* Update project/history.go with the latest releases notes and version. Run `make CHANGELOG.md NOTES.md` and make sure this is merged to main. +* On the main branch, run `make ready_for_pull_request`. Check for any modified files. +* Once main is update to date, switch to main locally run `make tag_release`. This will push the tag which kicks of the release build. * Optionally send out email on hyperledger burrow mailinglist. Agreements network email should be sent out automatically. ## Proposals diff --git a/docs/js-api.md b/docs/js-api.md index 678a94c33..f1c5341fa 100644 --- a/docs/js-api.md +++ b/docs/js-api.md @@ -56,13 +56,13 @@ The table below links to the reference schema for either the protobuf files gove | Component Name | Accessor | | :----------- | :--------------- | -| Transactions | [Burrow.transact](https://github.com/hyperledger/burrow/blob/master/protobuf/rpctransact.proto) | -| Queries | [Burrow.query](https://github.com/hyperledger/burrow/blob/master/protobuf/rpcquery.proto) | -| EventStream | [Burrow.eventStream](https://github.com/hyperledger/burrow/blob/master/protobuf/rpcevents.proto) | -| Events | [Burrow.events](https://github.com/hyperledger/burrow/blob/master/lib/events.js) | -| NameReg | [Burrow.namereg](https://github.com/hyperledger/burrow/blob/master/lib/namereg.js) | +| Transactions | [Burrow.transact](https://github.com/hyperledger/burrow/blob/main/protobuf/rpctransact.proto) | +| Queries | [Burrow.query](https://github.com/hyperledger/burrow/blob/main/protobuf/rpcquery.proto) | +| EventStream | [Burrow.eventStream](https://github.com/hyperledger/burrow/blob/main/protobuf/rpcevents.proto) | +| Events | [Burrow.events](https://github.com/hyperledger/burrow/blob/main/lib/events.js) | +| NameReg | [Burrow.namereg](https://github.com/hyperledger/burrow/blob/main/lib/namereg.js) | -| Contracts | [Burrow.contracts](https://github.com/hyperledger/burrow/blob/master/lib/contractManager.js) | +| Contracts | [Burrow.contracts](https://github.com/hyperledger/burrow/blob/main/lib/contractManager.js) | ### GRPC Access Components @@ -155,43 +155,43 @@ burrow.transact.NameTxSync(setPayload, function(error, data){ | Method | Passed | Returns | | :----- | :--------- | :---- | -| burrow.transact.BroadcastTxSync | [TxEnvelopeParam](https://github.com/hyperledger/burrow/blob/master/protobuf/rpctransact.proto#L74-L79) | [TxExecution](https://github.com/hyperledger/burrow/blob/develop/protobuf/exec.proto#L34-L56) | -| burrow.transact.BroadcastTxASync | [TxEnvelopeParam](https://github.com/hyperledger/burrow/blob/master/protobuf/rpctransact.proto#L74-L79) | [Receipt](https://github.com/hyperledger/burrow/blob/develop/protobuf/txs.proto#L38-L47) | -| burrow.transact.SignTx | [TxEnvelopeParam](https://github.com/hyperledger/burrow/blob/master/protobuf/rpctransact.proto#L74-L79) | [TxEnvelope](https://github.com/hyperledger/burrow/blob/develop/protobuf/rpctransact.proto#L70-L72) | -| burrow.transact.FormulateTx | [PayloadParam](https://github.com/hyperledger/burrow/blob/master/protobuf/rpctransact.proto#L64-L68) | [TxEnvelope](https://github.com/hyperledger/burrow/blob/develop/protobuf/rpctransact.proto#L70-L72) | -| burrow.transact.CallTxSync | [CallTx](https://github.com/hyperledger/burrow/blob/master/protobuf/payload.proto#L53-L66) | [TxExecution](https://github.com/hyperledger/burrow/blob/develop/protobuf/exec.proto#L34-L56) | -| burrow.transact.CallTxAsync | [CallTx](https://github.com/hyperledger/burrow/blob/master/protobuf/payload.proto#L53-L66) | [Receipt](https://github.com/hyperledger/burrow/blob/develop/protobuf/txs.proto#L38-L47) | -| burrow.transact.CallTxSim | [CallTx](https://github.com/hyperledger/burrow/blob/master/protobuf/payload.proto#L53-L66) | [TxExecution](https://github.com/hyperledger/burrow/blob/develop/protobuf/exec.proto#L34-L56) | -| burrow.transact.SendTxSync | [SendTx](https://github.com/hyperledger/burrow/blob/master/protobuf/payload.proto#L69-L76) | [TxExecution](https://github.com/hyperledger/burrow/blob/develop/protobuf/exec.proto#L34-L56) | -| burrow.transact.SendTxAsync | [SendTx](https://github.com/hyperledger/burrow/blob/master/protobuf/payload.proto#L69-L76) | [Receipt](https://github.com/hyperledger/burrow/blob/develop/protobuf/txs.proto#L38-L47) | -| burrow.transact.NameTxSync | [NameTx](https://github.com/hyperledger/burrow/blob/master/protobuf/payload.proto#L88-L98) | [TxExecution](https://github.com/hyperledger/burrow/blob/develop/protobuf/exec.proto#L34-L56) | -| burrow.transact.NameTxAsync | [NameTx](https://github.com/hyperledger/burrow/blob/master/protobuf/payload.proto#L88-L98) | [Receipt](https://github.com/hyperledger/burrow/blob/develop/protobuf/txs.proto#L38-L47) | +| burrow.transact.BroadcastTxSync | [TxEnvelopeParam](https://github.com/hyperledger/burrow/blob/main/protobuf/rpctransact.proto#L74-L79) | [TxExecution](https://github.com/hyperledger/burrow/blob/develop/protobuf/exec.proto#L34-L56) | +| burrow.transact.BroadcastTxASync | [TxEnvelopeParam](https://github.com/hyperledger/burrow/blob/main/protobuf/rpctransact.proto#L74-L79) | [Receipt](https://github.com/hyperledger/burrow/blob/develop/protobuf/txs.proto#L38-L47) | +| burrow.transact.SignTx | [TxEnvelopeParam](https://github.com/hyperledger/burrow/blob/main/protobuf/rpctransact.proto#L74-L79) | [TxEnvelope](https://github.com/hyperledger/burrow/blob/develop/protobuf/rpctransact.proto#L70-L72) | +| burrow.transact.FormulateTx | [PayloadParam](https://github.com/hyperledger/burrow/blob/main/protobuf/rpctransact.proto#L64-L68) | [TxEnvelope](https://github.com/hyperledger/burrow/blob/develop/protobuf/rpctransact.proto#L70-L72) | +| burrow.transact.CallTxSync | [CallTx](https://github.com/hyperledger/burrow/blob/main/protobuf/payload.proto#L53-L66) | [TxExecution](https://github.com/hyperledger/burrow/blob/develop/protobuf/exec.proto#L34-L56) | +| burrow.transact.CallTxAsync | [CallTx](https://github.com/hyperledger/burrow/blob/main/protobuf/payload.proto#L53-L66) | [Receipt](https://github.com/hyperledger/burrow/blob/develop/protobuf/txs.proto#L38-L47) | +| burrow.transact.CallTxSim | [CallTx](https://github.com/hyperledger/burrow/blob/main/protobuf/payload.proto#L53-L66) | [TxExecution](https://github.com/hyperledger/burrow/blob/develop/protobuf/exec.proto#L34-L56) | +| burrow.transact.SendTxSync | [SendTx](https://github.com/hyperledger/burrow/blob/main/protobuf/payload.proto#L69-L76) | [TxExecution](https://github.com/hyperledger/burrow/blob/develop/protobuf/exec.proto#L34-L56) | +| burrow.transact.SendTxAsync | [SendTx](https://github.com/hyperledger/burrow/blob/main/protobuf/payload.proto#L69-L76) | [Receipt](https://github.com/hyperledger/burrow/blob/develop/protobuf/txs.proto#L38-L47) | +| burrow.transact.NameTxSync | [NameTx](https://github.com/hyperledger/burrow/blob/main/protobuf/payload.proto#L88-L98) | [TxExecution](https://github.com/hyperledger/burrow/blob/develop/protobuf/exec.proto#L34-L56) | +| burrow.transact.NameTxAsync | [NameTx](https://github.com/hyperledger/burrow/blob/main/protobuf/payload.proto#L88-L98) | [Receipt](https://github.com/hyperledger/burrow/blob/develop/protobuf/txs.proto#L38-L47) | #### Queries -`Burrow.query` provides access to the burrow GRPC service `rpcquery`. As a GRPC wrapper all the endpoints take a data argument and an optional callback. The format of the data object is specified in the [protobuf files](https://github.com/hyperledger/burrow/tree/master/js/protobuf). Note that "STREAM" functions take a callback `function(error, data)` which is mandatory and is called any time data is returned. For list Accounts the queryable tags are Address, PublicKey, Sequence, Balance, Code, Permissions (Case sensitive). As an example you can get all accounts with a balance greater than 1000 by `burrow.query.ListAccounts('Balance > 1000', callback)`. Multiple tag criteria can be combined using 'AND' and 'OR' for an example of a combined query see [here](https://github.com/hyperledger/burrow/blob/develop/protobuf/rpcevents.proto#L87). Similarly for ListNames, the avaible tags are Name, Data, Owner and Exires (once again case sensitive) use is identical to List accounts. +`Burrow.query` provides access to the burrow GRPC service `rpcquery`. As a GRPC wrapper all the endpoints take a data argument and an optional callback. The format of the data object is specified in the [protobuf files](https://github.com/hyperledger/burrow/tree/main/js/protobuf). Note that "STREAM" functions take a callback `function(error, data)` which is mandatory and is called any time data is returned. For list Accounts the queryable tags are Address, PublicKey, Sequence, Balance, Code, Permissions (Case sensitive). As an example you can get all accounts with a balance greater than 1000 by `burrow.query.ListAccounts('Balance > 1000', callback)`. Multiple tag criteria can be combined using 'AND' and 'OR' for an example of a combined query see [here](https://github.com/hyperledger/burrow/blob/develop/protobuf/rpcevents.proto#L87). Similarly for ListNames, the avaible tags are Name, Data, Owner and Exires (once again case sensitive) use is identical to List accounts. | Method | Passed | Returns | Notes | | :----- | :--------- | :---- | :------- | -| burrow.query.GetAccount | [GetAccountParam](https://github.com/hyperledger/burrow/blob/master/protobuf/rpcquery.proto#L25-L27) | [ConcreteAccount](https://github.com/hyperledger/burrow/blob/develop/protobuf/acm.proto#L23-L31) | | -| burrow.query.ListAccounts | [ListAccountsParam](https://github.com/hyperledger/burrow/blob/master/protobuf/rpcquery.proto#L29-L31) | [ConcreteAccount](https://github.com/hyperledger/burrow/blob/develop/protobuf/acm.proto#L23-L31) | STREAM | -| burrow.query.GetNameParam | [GetNameParam](https://github.com/hyperledger/burrow/blob/master/protobuf/rpcquery.proto#L33-L35) | [Entry](https://github.com/hyperledger/burrow/blob/develop/protobuf/names.proto#L22-L32) | | -| burrow.query.ListNames | [ListNamesParam](https://github.com/hyperledger/burrow/blob/master/protobuf/rpcquery.proto#L37-L39) | [Entry](https://github.com/hyperledger/burrow/blob/develop/protobuf/names.proto#L22-L32) | STREAM| +| burrow.query.GetAccount | [GetAccountParam](https://github.com/hyperledger/burrow/blob/main/protobuf/rpcquery.proto#L25-L27) | [ConcreteAccount](https://github.com/hyperledger/burrow/blob/develop/protobuf/acm.proto#L23-L31) | | +| burrow.query.ListAccounts | [ListAccountsParam](https://github.com/hyperledger/burrow/blob/main/protobuf/rpcquery.proto#L29-L31) | [ConcreteAccount](https://github.com/hyperledger/burrow/blob/develop/protobuf/acm.proto#L23-L31) | STREAM | +| burrow.query.GetNameParam | [GetNameParam](https://github.com/hyperledger/burrow/blob/main/protobuf/rpcquery.proto#L33-L35) | [Entry](https://github.com/hyperledger/burrow/blob/develop/protobuf/names.proto#L22-L32) | | +| burrow.query.ListNames | [ListNamesParam](https://github.com/hyperledger/burrow/blob/main/protobuf/rpcquery.proto#L37-L39) | [Entry](https://github.com/hyperledger/burrow/blob/develop/protobuf/names.proto#L22-L32) | STREAM| #### EventStream NB: When listening to contract events it is easier to use the contract interface (described below) -`Burrow.executionEvents` provides access to the burrow GRPC service `ExecutionEvents`. As a GRPC wrapper all the endpoints take a data argument and an optional callback. The format of the data object is specified in the [protobuf files](https://github.com/hyperledger/burrow/tree/master/js/protobuf). Note that "STREAM" functions take a callback `function(error, data)` which is mandatory and is called any time data is returned. +`Burrow.executionEvents` provides access to the burrow GRPC service `ExecutionEvents`. As a GRPC wrapper all the endpoints take a data argument and an optional callback. The format of the data object is specified in the [protobuf files](https://github.com/hyperledger/burrow/tree/main/js/protobuf). Note that "STREAM" functions take a callback `function(error, data)` which is mandatory and is called any time data is returned. | Method | Passed | Returns | Notes | | :----- | :--------- | :---- | :------- | -| burrow.executionEvents.GetBlock | [GetBlockRequest](https://github.com/hyperledger/burrow/blob/master/protobuf/rpcevents.proto#L37-L42) | [BlockExecution](https://github.com/hyperledger/burrow/blob/develop/protobuf/exec.proto#L20-L27) | | -| burrow.executionEvents.GetBlocks | [BlocksRequest](https://github.com/hyperledger/burrow/blob/master/protobuf/rpcevents.proto#L51-L89) | [BlockExecution](https://github.com/hyperledger/burrow/blob/develop/protobuf/exec.proto#L20-L27) | STREAM | -| burrow.executionEvents.GetTx | [GetTxRequest](https://github.com/hyperledger/burrow/blob/master/protobuf/rpcevents.proto#L44-L49) | [TxExecution](https://github.com/hyperledger/burrow/blob/develop/protobuf/exec.proto#L34-L56) | | -| burrow.executionEvents.GetTxs | [BlocksRequest](https://github.com/hyperledger/burrow/blob/master/protobuf/rpcevents.proto#L51-L89) | [GetTxsResponse](https://github.com/hyperledger/burrow/blob/develop/protobuf/rpcevents.proto#L96-L99) | STREAM | -| burrow.executionEvents.GetEvents | [BlocksRequest](https://github.com/hyperledger/burrow/blob/master/protobuf/rpcevents.proto#L51-L89) | [GetEventsResponse](https://github.com/hyperledger/burrow/blob/develop/protobuf/rpcevents.proto#L91-L94) | STREAM | +| burrow.executionEvents.GetBlock | [GetBlockRequest](https://github.com/hyperledger/burrow/blob/main/protobuf/rpcevents.proto#L37-L42) | [BlockExecution](https://github.com/hyperledger/burrow/blob/develop/protobuf/exec.proto#L20-L27) | | +| burrow.executionEvents.GetBlocks | [BlocksRequest](https://github.com/hyperledger/burrow/blob/main/protobuf/rpcevents.proto#L51-L89) | [BlockExecution](https://github.com/hyperledger/burrow/blob/develop/protobuf/exec.proto#L20-L27) | STREAM | +| burrow.executionEvents.GetTx | [GetTxRequest](https://github.com/hyperledger/burrow/blob/main/protobuf/rpcevents.proto#L44-L49) | [TxExecution](https://github.com/hyperledger/burrow/blob/develop/protobuf/exec.proto#L34-L56) | | +| burrow.executionEvents.GetTxs | [BlocksRequest](https://github.com/hyperledger/burrow/blob/main/protobuf/rpcevents.proto#L51-L89) | [GetTxsResponse](https://github.com/hyperledger/burrow/blob/develop/protobuf/rpcevents.proto#L96-L99) | STREAM | +| burrow.executionEvents.GetEvents | [BlocksRequest](https://github.com/hyperledger/burrow/blob/main/protobuf/rpcevents.proto#L51-L89) | [GetEventsResponse](https://github.com/hyperledger/burrow/blob/develop/protobuf/rpcevents.proto#L91-L94) | STREAM | *** @@ -234,7 +234,7 @@ Sets an entry in the namereg. It returns a promise if callback not provided. 3. `int` - The number of blocks to register the name for (more blocks = larger fee) 4. `function` - (optional) Function to call upon completion of form `function(error, data)`. ###### Returns -`TxExecution` - The return data object is a [TxExecution](https://github.com/hyperledger/burrow/blob/master/protobuf/exec.proto#L34-L56). +`TxExecution` - The return data object is a [TxExecution](https://github.com/hyperledger/burrow/blob/main/protobuf/exec.proto#L34-L56). ###### Example ```javascript @@ -267,7 +267,7 @@ Listens to execution events which satisfy the filter query. 2. `Object` - Currently unused. pass `{}` 3. `function` - Signature of `function(error, data)` mandatory ###### Returns -`GetEventsResponse` - The return data object is a [GetEventsResponse](https://github.com/hyperledger/burrow/blob/master/protobuf/rpcevents.proto#L91-L94) +`GetEventsResponse` - The return data object is a [GetEventsResponse](https://github.com/hyperledger/burrow/blob/main/protobuf/rpcevents.proto#L91-L94) @@ -281,7 +281,7 @@ Listens to EVM event executions from specific contract. 3. `Object` - Currently unused. pass `{}` 4. `function` - Signature of `function(error, data)` mandatory. ###### Returns -`GetEventsResponse` - The return data object is a [GetEventsResponse](https://github.com/hyperledger/burrow/blob/master/protobuf/rpcevents.proto#L91-L94) +`GetEventsResponse` - The return data object is a [GetEventsResponse](https://github.com/hyperledger/burrow/blob/main/protobuf/rpcevents.proto#L91-L94) diff --git a/docs/reference/kubernetes.md b/docs/reference/kubernetes.md index 6b606a3bb..3059b60b9 100644 --- a/docs/reference/kubernetes.md +++ b/docs/reference/kubernetes.md @@ -4,6 +4,6 @@ Burrow ships a docker image suitable for use in Kubernetes on [Docker Hub](https ## Helm chart -A helm chart for Burrow with can be found in the main repo [here](https://github.com/hyperledger/burrow/tree/master/helm) (with further documentation). +A helm chart for Burrow with can be found in the main repo [here](https://github.com/hyperledger/burrow/tree/main/helm) (with further documentation). The helm chart allows you to bootstrap and run your own pool of validators. diff --git a/docs/reference/transactions.md b/docs/reference/transactions.md index 50bb0e55c..dd85bc1b2 100644 --- a/docs/reference/transactions.md +++ b/docs/reference/transactions.md @@ -2,9 +2,9 @@ Burrow implements a number of transaction types. Transactions will be ordered by our consensus mechanism (Tendermint) and applied to our application state machine - replicated across all Burrow nodes. Each transaction is applied atomically and runs deterministically. The transactions contain the arguments for an -[execution context](https://github.com/hyperledger/burrow/tree/master/execution/contexts). +[execution context](https://github.com/hyperledger/burrow/tree/main/execution/contexts). -Our transactions are defined in Protobuf [here](https://github.com/hyperledger/burrow/blob/master/protobuf/payload.proto). +Our transactions are defined in Protobuf [here](https://github.com/hyperledger/burrow/blob/main/protobuf/payload.proto). Transactions can be built using our GRPC client libraries programmatically, via [burrow.js](js-api.md), or with `burrow deploy` - see our [deployment guide](deploy.md). @@ -38,7 +38,7 @@ Allows [native token](reference/participants.md) to be sent from multiple inputs Provides access to a global name registry service that associates a particular string key with a data payload and an owner. The control of the name is guaranteed for the period of the lease which is a determined by a fee. -> A future revision will change the way in which leases are calculated. Currently we use a somewhat historically-rooted fixed fee, see the [`NameCostPerBlock` function](https://github.com/hyperledger/burrow/blob/master/execution/names/names.go#L83). +> A future revision will change the way in which leases are calculated. Currently we use a somewhat historically-rooted fixed fee, see the [`NameCostPerBlock` function](https://github.com/hyperledger/burrow/blob/main/execution/names/names.go#L83). ## BondTx @@ -94,4 +94,4 @@ connection requests from entries in its registry. IdentifyPeers = true ``` -For more details, see the [ADR](ADRs/adr-2_identify-tx.md). \ No newline at end of file +For more details, see the [ADR](ADRs/adr-2_identify-tx.md). diff --git a/docs/tutorials/3-contracts.md b/docs/tutorials/3-contracts.md index e5633f6c8..5b4e70bf9 100644 --- a/docs/tutorials/3-contracts.md +++ b/docs/tutorials/3-contracts.md @@ -13,7 +13,7 @@ burrow spec -v1 | burrow configure -s- | burrow start -c- ## Deploy Artifacts -For this step, we need two things: one or more solidity contracts and a deploy file. Let's take a simple example, found in [this directory](https://github.com/hyperledger/burrow/tree/master/tests/jobs_fixtures/app06-deploy_basic_contract_and_different_solc_types_packed_unpacked). +For this step, we need two things: one or more solidity contracts and a deploy file. Let's take a simple example, found in [this directory](https://github.com/hyperledger/burrow/tree/main/tests/jobs_fixtures/app06-deploy_basic_contract_and_different_solc_types_packed_unpacked). We need `deploy.yaml` and `storage.sol` in the same directory with **no other yaml or sol files**. @@ -27,4 +27,4 @@ burrow deploy --address $ADDRESS deploy.yaml Replace `$ADDRESS` with the address at the top of your `burrow.toml`. -That's it! You've successfully deployed (and tested) a Solidity contract to a Burrow node. \ No newline at end of file +That's it! You've successfully deployed (and tested) a Solidity contract to a Burrow node. diff --git a/repolint.json b/repolint.json new file mode 100644 index 000000000..1043c6f4e --- /dev/null +++ b/repolint.json @@ -0,0 +1,147 @@ +{ + "axioms": { + "linguist": "language", + "licensee": "license", + "packagers": "packager" + }, + "rules": { + "all": { + "apache-license-file:file-contents": [ + "error", + { + "files": ["LICENSE*"], + "content": "Apache License.*Version 2.0", + "fail-on-non-existent": true + } + ], + "code-of-conduct-file:file-contents": [ + "error", + { + "files": ["CODE_OF_CONDUCT*"], + "content": "https://wiki.hyperledger.org/community/hyperledger-project-code-of-conduct", + "fail-on-non-existent": true + } + ], + "security-file-matches:file-contents": [ + "error", + { + "files": ["SECURITY.md"], + "content": "https://wiki.hyperledger.org/display/SEC/Defect.Response", + "fail-on-non-existent": true + } + ], + "readme-file-exists:file-existence": [ + "error", + { + "files": ["README.md", "README"] + } + ], + "readme-references-license:file-contents": [ + "error", + { + "files": ["README.md", "README"], + "content": "license", + "flags": "i" + } + ], + "maintainers-file-exists:file-existence": [ + "error", + { + "files": ["MAINTAINERS.md", "MAINTAINERS.rst"] + } + ], + "contributing-file-exists:file-existence": [ + "error", + { + "files": ["CONTRIBUTING.md"] + } + ], + "changelog-file-exists:file-existence": [ + "error", + { + "files": ["CHANGELOG.md"] + } + ], + "integrates-with-ci:file-existence": [ + "error", + { + "files": [ + "circle.yml", + ".circleci/config.yml", + "ci/azure-pipelines.yml", + ".ci/azure-pipelines.yml", + "Jenkinsfile", + "Jenkinsfile.ci", + "Jenkinsfile.cd", + ".github/workflows/*.yml" + ] + } + ], + "notice-file-exists:file-existence": [ + "warning", + { + "files": ["NOTICE*"] + } + ], + "source-license-headers-exist:file-starts-with": [ + "warning", + { + "files": ["**/*.js", "!node_modules/**"], + "lineCount": 5, + "patterns": ["Copyright", "License"], + "flags": "i" + } + ], + "test-directory-exists:directory-existence": [ + "warning", + { + "directories": ["**/test*", "**/specs", "**/**_test.go"], + "nocase": true + } + ], + "binaries-not-present:file-type-exclusion": [ + "error", + { + "type": ["**/*.exe", "**/*.dll", "!node_modules/**"] + } + ] + }, + "language=javascript": { + "package-metadata-exists:file-existence": [ + "warning", + { + "files": ["package.json"] + } + ] + }, + "language=ruby": { + "package-metadata-exists:file-existence": [ + "warning", + { + "files": ["Gemfile"] + } + ] + }, + "language=java": { + "package-metadata-exists:file-existence": [ + "warning", + { + "files": ["pom.xml", "build.xml", "build.gradle"] + } + ] + }, + "license=*": { + "license-detectable-by-licensee": [ + "warning" + ] + }, + "language=python": { + "package-metadata-exists:file-existence": [ + "warning", + { + "files": ["setup.py", "requirements.txt"] + } + ] + } + } +}