diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index b4abbe9bd1cd21db3023d582cc922ca58973f574..f2f9ab2e74c77d8fe2dee144c7c77eb11a4d84f6 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -1,6 +1,10 @@ -# Contributing to `eris-db`: +# Contributing to `burrow`: Forked from Docker's [contributing guidelines](https://github.com/docker/docker/blob/master/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/). + ## 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! diff --git a/.github/DEVELOPER_CERTIFICATE_OF_ORIGIN.md b/.github/DEVELOPER_CERTIFICATE_OF_ORIGIN.md new file mode 100644 index 0000000000000000000000000000000000000000..0cdce0c397f01a8749cf6052289e9275ddd8652e --- /dev/null +++ b/.github/DEVELOPER_CERTIFICATE_OF_ORIGIN.md @@ -0,0 +1,37 @@ +Developer Certificate of Origin +Version 1.1 + +Copyright (C) 2004, 2006 The Linux Foundation and its contributors. +1 Letterman Drive +Suite D4700 +San Francisco, CA, 94129 + +Everyone is permitted to copy and distribute verbatim copies of this +license document, but changing it is not allowed. + + +Developer's Certificate of Origin 1.1 + +By making a contribution to this project, I certify that: + +(a) The contribution was created in whole or in part by me and I + have the right to submit it under the open source license + indicated in the file; or + +(b) The contribution is based upon previous work that, to the best + of my knowledge, is covered under an appropriate open source + license and I have the right under that license to submit that + work with modifications, whether created in whole or in part + by me, under the same open source license (unless I am + permitted to submit under a different license), as indicated + in the file; or + +(c) The contribution was provided directly to me by some other + person who certified (a), (b) or (c) and I have not modified + it. + +(d) I understand and agree that this project and the contribution + are public and that a record of the contribution (including all + personal information I submit with it, including my sign-off) is + maintained indefinitely and may be redistributed consistent with + this project or the open source license(s) involved. \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index e3867662dde61707fc52857e4a110850585c352b..ffb75927078ac3a74ecc6e897f25c19673bf2db3 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -1,7 +1,7 @@ Please include in your bug report: -- [ ] `eris-db version` (docker image tag or branch if built from source) -- [ ] `eris version` (if applicable) +- [ ] `burrow version` (docker image tag or branch if built from source) +- [ ] `monax version` (if applicable) - [ ] `go version` (if applicable) - [ ] `docker version` (if applicable) - [ ] operating system details (osx/windows/linux) diff --git a/CHANGELOG.md b/CHANGELOG.md index ddb14c99ed147b7a35e68754219dcac339c509d6..52282d50ef337d35df3b62689da8494e1fb949a6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,36 +1,36 @@ -# Eris-db changelog +# burrow changelog ## v0.16.0 This is a consolidation release that fixes various bugs and improves elements -of the architecture across the Eris Platform to support a quicker release +of the architecture across the Monax Platform to support a quicker release cadence. #### Features and improvements (among others) -- [pull-510](https://github.com/monax/eris-db/pull/510) upgrade consensus engine to Tendermint v0.8.0 -- [pull-507](https://github.com/monax/eris-db/pull/507) use sha3 for snative addresses for future-proofing -- [pull-506](https://github.com/monax/eris-db/pull/506) alignment and consolidation for genesis and config between tooling and chains -- [pull-504](https://github.com/monax/eris-db/pull/504) relicense eris-db to Apache 2.0 -- [pull-500](https://github.com/monax/eris-db/pull/500) introduce more strongly types secure native contracts -- [pull-499](https://github.com/monax/eris-db/pull/499) introduce word256 and remove dependency on tendermint/go-common -- [pull-493](https://github.com/monax/eris-db/pull/493) re-introduce GenesisTime in GenesisDoc +- [pull-510](https://github.com/monax/burrow/pull/510) upgrade consensus engine to Tendermint v0.8.0 +- [pull-507](https://github.com/monax/burrow/pull/507) use sha3 for snative addresses for future-proofing +- [pull-506](https://github.com/monax/burrow/pull/506) alignment and consolidation for genesis and config between tooling and chains +- [pull-504](https://github.com/monax/burrow/pull/504) relicense burrow to Apache 2.0 +- [pull-500](https://github.com/monax/burrow/pull/500) introduce more strongly types secure native contracts +- [pull-499](https://github.com/monax/burrow/pull/499) introduce word256 and remove dependency on tendermint/go-common +- [pull-493](https://github.com/monax/burrow/pull/493) re-introduce GenesisTime in GenesisDoc -- Logging system overhauled based on the central logging interface of go-kit log. Configuration lacking in this release but should be in 0.16.1. Allows powerful routing, filtering, and output options for better operations and increasing the observability of an eris blockchain. More to follow. -- Genesis making is improved and moved into eris-db. -- Config templating is moved into eris-db for better synchronisation of server config between the consumer of it (eris-db) and the producers of it (eris cli and other tools). +- Logging system overhauled based on the central logging interface of go-kit log. Configuration lacking in this release but should be in 0.16.1. Allows powerful routing, filtering, and output options for better operations and increasing the observability of a burrow blockchain. More to follow. +- Genesis making is improved and moved into burrow. +- Config templating is moved into burrow for better synchronisation of server config between the consumer of it (burrow) and the producers of it (cli and other tools). - Some documentation updates in code and in specs. -- [pull-462](https://github.com/monax/eris-db/pull/499) Makefile added to capture conventions around building and testing and replicate them across different environments such as continuous integration systems. +- [pull-462](https://github.com/monax/burrow/pull/499) Makefile added to capture conventions around building and testing and replicate them across different environments such as continuous integration systems. #### Bugfixes (among others) -- [pull-516](https://github.com/monax/eris-db/pull/516) Organize and add unit tests for rpc/v0 -- [pull-453](https://github.com/monax/eris-db/pull/453) Fix deserialisation for BroadcastTx on rpc/v0 -- [pull-476](https://github.com/monax/eris-db/pull/476) patch EXTCODESIZE for native contracts as solc ^v0.4 performs a safety check for non-zero contract code -- [pull-468](https://github.com/monax/eris-db/pull/468) correct specifications for params on unsubscribe on rpc/tendermint -- [pull-465](https://github.com/monax/eris-db/pull/465) fix divergence from JSON-RPC spec for Response object -- [pull-366](https://github.com/monax/eris-db/pull/366) correction to circle ci script -- [pull-379](https://github.com/monax/eris-db/pull/379) more descriptive error message for eris-client +- [pull-516](https://github.com/monax/burrow/pull/516) Organize and add unit tests for rpc/v0 +- [pull-453](https://github.com/monax/burrow/pull/453) Fix deserialisation for BroadcastTx on rpc/v0 +- [pull-476](https://github.com/monax/burrow/pull/476) patch EXTCODESIZE for native contracts as solc ^v0.4 performs a safety check for non-zero contract code +- [pull-468](https://github.com/monax/burrow/pull/468) correct specifications for params on unsubscribe on rpc/tendermint +- [pull-465](https://github.com/monax/burrow/pull/465) fix divergence from JSON-RPC spec for Response object +- [pull-366](https://github.com/monax/burrow/pull/366) correction to circle ci script +- [pull-379](https://github.com/monax/burrow/pull/379) more descriptive error message for burrow-client ## v0.12.0 -This release marks the start of Eris-DB as the full permissioned blockchain node - of the Eris platform with the Tendermint permissioned consensus engine. +This release marks the start of burrow as the full permissioned blockchain node + of the Monax Platform with the Tendermint permissioned consensus engine. This involved significant refactoring of almost all parts of the code, but provides a solid foundation to build the next generation of advanced permissioned smart contract blockchains. @@ -43,8 +43,7 @@ This release marks the start of Eris-DB as the full permissioned blockchain node - Support DELEGATECALL opcode in Ethereum Virtual Machine (important for solidity library calls) - ARM support - Docker image size reduced - - Introduction of eris-client companion library for interacting with - eris:db + - Introduction of burrow-client companion library for interacting with burrow - Improved single configuration file for all components written by eris-cm - Allow multiple event subscriptions from same host under rpc/tendermint diff --git a/Dockerfile b/Dockerfile index 540a0dc8b9f2bee36c3e20c90f1854c36a88ad67..10ca8c7b9310a28235d59f9c834f2429ba007840 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,7 @@ -FROM quay.io/eris/build +FROM quay.io/monax/build:0.16 MAINTAINER Monax <support@monax.io> -# Install eris-db, a go app that manages relationships -ENV TARGET eris-db +ENV TARGET burrow ENV REPO $GOPATH/src/github.com/monax/$TARGET ADD ./glide.yaml $REPO/ @@ -15,5 +14,5 @@ RUN cd $REPO/cmd/$TARGET && \ go build --ldflags '-extldflags "-static"' -o $INSTALL_BASE/$TARGET # build customizations start here -RUN cd $REPO/client/cmd/eris-client && \ - go build --ldflags '-extldflags "-static"' -o $INSTALL_BASE/eris-client +RUN cd $REPO/client/cmd/burrow-client && \ + go build --ldflags '-extldflags "-static"' -o $INSTALL_BASE/burrow-client diff --git a/Dockerfile.armhf b/Dockerfile.armhf deleted file mode 100644 index caff84703052021a14d1b8a72ac3fac6f9b65e5a..0000000000000000000000000000000000000000 --- a/Dockerfile.armhf +++ /dev/null @@ -1,61 +0,0 @@ -# Pull base image. -FROM quay.io/eris/build:arm -MAINTAINER Monax Industries <support@monax.io> - -# Expose ports for 1337:eris-db API; 46656:tendermint-peer; 46657:tendermint-rpc -EXPOSE 1337 -EXPOSE 46656 -EXPOSE 46657 - -#----------------------------------------------------------------------------- -# install eris-db - -# set the source code path and copy the repository in -ENV ERIS_DB_SRC_PATH $GOPATH/src/github.com/monax/eris-db -COPY . $ERIS_DB_SRC_PATH - -# fetch and install eris-db and its dependencies - # install glide for dependency management -RUN go get github.com/Masterminds/glide \ - # build the main eris-db target - && cd $ERIS_DB_SRC_PATH/cmd/eris-db \ - && go build \ - && cp eris-db $INSTALL_BASE/eris-db \ - # copy the start script for eris-db \ - && cp $ERIS_DB_SRC_PATH/bin/start_eris_db $INSTALL_BASE/erisdb-wrapper \ - && chmod 755 $INSTALL_BASE/erisdb-wrapper - -#----------------------------------------------------------------------------- -# install mint-client [to be deprecated] - -ENV ERIS_DB_MINT_REPO github.com/monax/mint-client -ENV ERIS_DB_MINT_SRC_PATH $GOPATH/src/$ERIS_DB_MINT_REPO - -WORKDIR $ERIS_DB_MINT_SRC_PATH - -RUN git clone --quiet https://$ERIS_DB_MINT_REPO . \ - && git checkout --quiet master \ - && go build -o $INSTALL_BASE/mintx ./mintx \ - && go build -o $INSTALL_BASE/mintconfig ./mintconfig \ - && go build -o $INSTALL_BASE/mintkey ./mintkey - # restrict build targets for re-evaluation - # && go build -o $INSTALL_BASE/mintdump ./mintdump \ - # && go build -o $INSTALL_BASE/mintperms ./mintperms \ - # && go build -o $INSTALL_BASE/mintunsafe ./mintunsafe \ - # && go build -o $INSTALL_BASE/mintgen ./mintgen \ - # && go build -o $INSTALL_BASE/mintsync ./mintsync - -#----------------------------------------------------------------------------- -# clean up [build container needs to be separated from shipped container] - - RUN unset ERIS_DB_SRC_PATH \ - && unset ERIS_DB_MINT_SRC_PATH \ - && apk del --purge go git musl-dev \ - && rm -rf $GOPATH - -# mount the data container on the eris directory -VOLUME $ERIS - -WORKDIR $ERIS - -ENTRYPOINT ["erisdb-wrapper"] \ No newline at end of file diff --git a/Dockerfile.deploy b/Dockerfile.deploy index dfe3b3e8a632a1c8af4c5590592202b60f7edaa4..8df703505fa669f198dcd8e4675718d5bd1480c7 100644 --- a/Dockerfile.deploy +++ b/Dockerfile.deploy @@ -1,7 +1,8 @@ -FROM quay.io/eris/base:alpine +FROM quay.io/monax/base:0.16 MAINTAINER Monax <support@monax.io> -ENV TARGET eris-db +ENV TARGET burrow + # Get the binary from the artefact in pwd/target/docker COPY ./target/docker/"$TARGET".dockerartefact $INSTALL_BASE/$TARGET @@ -9,14 +10,14 @@ RUN chmod +x --recursive $INSTALL_BASE # Finalize RUN chown --recursive $USER:$USER /home/$USER -VOLUME $ERIS -WORKDIR $ERIS +VOLUME $MONAX_PATH +WORKDIR $MONAX_PATH USER $USER # runtime customization start here -# Expose ports for 1337:eris-db API; 46656:tendermint-peer; 46657:tendermint-rpc +# Expose ports for 1337:burrow API; 46656:tendermint-peer; 46657:tendermint-rpc EXPOSE 1337 EXPOSE 46656 EXPOSE 46657 -CMD [ "eris-db", "serve" ] +CMD [ "burrow", "serve" ] diff --git a/Makefile b/Makefile index acb6590ffc88b75014ff6c24f0ef41bcdbf08c49..d24d60488a862314d9e3a4bd45a3bd8d3332848a 100644 --- a/Makefile +++ b/Makefile @@ -9,17 +9,17 @@ SHELL := /bin/bash REPO := $(shell pwd) GOFILES_NOVENDOR := $(shell find ${REPO} -type f -name '*.go' -not -path "${REPO}/vendor/*") -PACKAGES_NOVENDOR := $(shell go list github.com/monax/eris-db/... | grep -v /vendor/) +PACKAGES_NOVENDOR := $(shell go list github.com/monax/burrow/... | grep -v /vendor/) VERSION := $(shell cat ${REPO}/version/version.go | tail -n 1 | cut -d \ -f 4 | tr -d '"') VERSION_MIN := $(shell echo ${VERSION} | cut -d . -f 1-2) COMMIT_SHA := $(shell echo `git rev-parse --short --verify HEAD`) -DOCKER_NAMESPACE := quay.io/eris +DOCKER_NAMESPACE := quay.io/monax .PHONY: greet greet: - @echo "Hi! I'm the marmot that will help you with eris-db v${VERSION}" + @echo "Hi! I'm the marmot that will help you with burrow v${VERSION}" ### Formatting, linting and vetting @@ -54,7 +54,7 @@ vet: @echo "Running go vet." @go vet ${PACKAGES_NOVENDOR} -### Dependency management for github.com/monax/eris-db +### Dependency management for github.com/monax/burrow # erase vendor wipes the full vendor directory .PHONY: erase_vendor @@ -78,76 +78,66 @@ hell: snatives: @go run ./util/snatives/cmd/main.go -### Building github.com/monax/eris-db +### Building github.com/monax/burrow -# build all targets in github.com/monax/eris-db +# build all targets in github.com/monax/burrow .PHONY: build -build: check build_db build_client build_keys +build: check build_db build_client -# build all targets in github.com/monax/eris-db with checks for race conditions +# build all targets in github.com/monax/burrow with checks for race conditions .PHONY: build_race build_race: check build_race_db build_race_client build_race_keys -# build eris-db +# build burrow .PHONY: build_db build_db: - go build -o ${REPO}/target/eris-db-${COMMIT_SHA} ./cmd/eris-db + go build -o ${REPO}/target/burrow-${COMMIT_SHA} ./cmd/burrow -# build eris-client +# build burrow-client .PHONY: build_client build_client: - go build -o ${REPO}/target/eris-client-${COMMIT_SHA} ./client/cmd/eris-client + go build -o ${REPO}/target/burrow-client-${COMMIT_SHA} ./client/cmd/burrow-client -# build eris-keys -.PHONY: build_keys -build_keys: - @echo "Marmots need to complete moving repository eris-keys into eris-db." - -# build eris-db with checks for race conditions +# build burrow with checks for race conditions .PHONY: build_race_db build_race_db: - go build -race -o ${REPO}/target/eris-db-${COMMIT_SHA} ./cmd/eris-db + go build -race -o ${REPO}/target/burrow-${COMMIT_SHA} ./cmd/burrow -# build eris-client with checks for race conditions +# build burrow-client with checks for race conditions .PHONY: build_race_client build_race_client: - go build -race -o ${REPO}/target/eris-client-${COMMIT_SHA} ./client/cmd/eris-client - -# build eris-keys with checks for race conditions -.PHONY: build_race_keys -build_race_keys: - @echo "Marmots need to complete moving repository eris-keys into eris-db." + go build -race -o ${REPO}/target/burrow-client-${COMMIT_SHA} ./client/cmd/burrow-client -### Testing github.com/monax/eris-db +### Testing github.com/monax/burrow -# test eris-db +# test burrow .PHONY: test test: build @go test ${PACKAGES_NOVENDOR} -tags integration -# test eris-db with checks for race conditions +# test burrow with checks for race conditions .PHONY: test_race test_race: build_race @go test -race ${PACKAGES_NOVENDOR} -### Build docker images for github.com/monax/eris-db +### Build docker images for github.com/monax/burrow -# build docker image for eris-db +# build docker image for burrow .PHONY: build_docker_db build_docker_db: check @mkdir -p ${REPO}/target/docker docker build -t ${DOCKER_NAMESPACE}/db:build-${COMMIT_SHA} ${REPO} - docker run --rm --entrypoint cat ${DOCKER_NAMESPACE}/db:build-${COMMIT_SHA} /usr/local/bin/eris-db > ${REPO}/target/docker/eris-db.dockerartefact - docker run --rm --entrypoint cat ${DOCKER_NAMESPACE}/db:build-${COMMIT_SHA} /usr/local/bin/eris-client > ${REPO}/target/docker/eris-client.dockerartefact + docker run --rm --entrypoint cat ${DOCKER_NAMESPACE}/db:build-${COMMIT_SHA} /usr/local/bin/burrow > ${REPO}/target/docker/burrow.dockerartefact + docker run --rm --entrypoint cat ${DOCKER_NAMESPACE}/db:build-${COMMIT_SHA} /usr/local/bin/burrow-client > ${REPO}/target/docker/burrow-client.dockerartefact docker build -t ${DOCKER_NAMESPACE}/db:${VERSION} -f Dockerfile.deploy ${REPO} - @rm ${REPO}/target/docker/eris-db.dockerartefact - @rm ${REPO}/target/docker/eris-client.dockerartefact + @rm ${REPO}/target/docker/burrow.dockerartefact + @rm ${REPO}/target/docker/burrow-client.dockerartefact docker rmi ${DOCKER_NAMESPACE}/db:build-${COMMIT_SHA} -### Test docker images for github.com/monax/eris-db +### Test docker images for github.com/monax/burrow -# test docker image for eris-db +# test docker image for burrow .PHONY: test_docker_db test_docker_db: check docker build -t ${DOCKER_NAMESPACE}/db:build-${COMMIT_SHA} ${REPO} @@ -158,4 +148,4 @@ test_docker_db: check # clean removes the target folder containing build artefacts .PHONY: clean clean: - -rm -r ./target \ No newline at end of file + -rm -r ./target diff --git a/README.md b/README.md index 90dcbf768c9181902506801b8b8b2d94cc7641ab..dbd177e1c6e796faec04781fe09842389e896e20 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,15 @@ -# Eris-DB v0.16 +# Burrow v0.16 -|[](https://godoc.org/github.com/monax/eris-db) | Linux | +|[](https://godoc.org/github.com/monax/burrow) | Linux | |---|-------| -| Master | [](https://circleci.com/gh/monax/eris-db/tree/master) | -| Develop | [](https://circleci.com/gh/monax/eris-db/tree/develop) | +| Master | [](https://circleci.com/gh/monax/burrow/tree/master) | +| Develop | [](https://circleci.com/gh/monax/burrow/tree/develop) | -Eris-db is Monax' permissioned blockchain client. It executes Ethereum smart contracts on a permissioned virtual machine. Eris-db provides transaction finality and high transaction throughput on proof-of-stake Tendermint consensus engine. For smart contract development most functionality is provided by `eris chains`, exposed through [eris](https://monax.io/docs), the entry point for the Eris Platform. +burrow is Monax' permissioned blockchain client. It executes Ethereum smart contracts on a permissioned virtual machine. burrow provides transaction finality and high transaction throughput on proof-of-stake Tendermint consensus engine. For smart contract development most functionality is provided by `monax chains`, exposed through [monax](https://monax.io/docs), the entry point for the Monax Platform. ## Table of Contents -- [What is Eris-db](#what-is-eris-db) +- [What is burrow](#what-is-burrow) - [Installation](#installation) - [For developers](#for-developers) - [Usage](#usage) @@ -18,54 +18,54 @@ Eris-db is Monax' permissioned blockchain client. It executes Ethereum smart con - [License](#license) - [Future work](#future-work) -## What is Eris-db ? +## What is Burrow ? -Eris-db is a permissioned blockchain node that executes smart contract code following the Ethereum specification. Eris-db is built for a multi-chain universe with application specific optimization in mind. Eris-db as a node is constructed out of three main components; the consensus engine, the permissioned Ethereum virtual machine and the rpc gateway. More specifically Eris-db consists of the following: +Burrow is a permissioned blockchain node that executes smart contract code following the Ethereum specification. Burrow is built for a multi-chain universe with application specific optimization in mind. Burrow as a node is constructed out of three main components; the consensus engine, the permissioned Ethereum virtual machine and the rpc gateway. More specifically Burrow consists of the following: - **Consensus Engine:** transactions are ordered and finalised with the Byzantine fault-tolerant Tendermint protocol. The Tendermint protocol provides high transaction throughput over a set of known validators and prevents the blockchain from forking. - **Application Blockchain Interface (ABCI):** The smart contract application interfaces with the consensus engine over the ABCI. The ABCI allows for the consensus engine to remain agnostic from the smart contract application. -- **Smart Contract Application:** transactions are validated and applied to the application state in the order that the consensus engine has finalised them. The application state consists of all accounts, the validator set and the name registry. Accounts in eris-db have permissions and either contain smart contract code or correspond to a public-private key pair. A transaction that calls on the smart contract code in a given account will activate the execution of that account’s code in a permissioned virtual machine. +- **Smart Contract Application:** transactions are validated and applied to the application state in the order that the consensus engine has finalised them. The application state consists of all accounts, the validator set and the name registry. Accounts in Burrow have permissions and either contain smart contract code or correspond to a public-private key pair. A transaction that calls on the smart contract code in a given account will activate the execution of that account’s code in a permissioned virtual machine. - **Permissioned Ethereum Virtual Machine:** This virtual machine is built to observe the Ethereum operation code specification and additionally asserts the correct permissions have been granted. Permissioning is enforced through secure native functions and underlies all smart contract code. An arbitrary but finite amount of gas is handed out for every execution to ensure a finite execution duration - “You don’t need money to play, when you have permission to playâ€. -- **Application Binary Interface (ABI):** transactions need to be formulated in a binary format that can be processed by the blockchain node. Currently tooling provides functionality to compile, deploy and link solidity smart contracts and formulate transactions to call smart contracts on the chain. For proof-of-concept purposes we provide a eris-contracts.js library that automatically mirrors the smart contracts deployed on the chain and to develop middleware solutions against the blockchain network. Future work on the light client will be aware of the ABI to natively translate calls on the API into signed transactions that can be broadcast on the network. -- **API Gateway:** eris-db exposes REST and JSON-RPC endpoints to interact with the blockchain network and the application state through broadcasting transactions, or querying the current state of the application. Websockets allow to subscribe to events, which is particularly valuable as the consensus engine and smart contract application can give unambiguously finalised results to transactions within one blocktime of about one second. +- **Application Binary Interface (ABI):** transactions need to be formulated in a binary format that can be processed by the blockchain node. Currently tooling provides functionality to compile, deploy and link solidity smart contracts and formulate transactions to call smart contracts on the chain. For proof-of-concept purposes we provide a monax-contracts.js library that automatically mirrors the smart contracts deployed on the chain and to develop middleware solutions against the blockchain network. Future work on the light client will be aware of the ABI to natively translate calls on the API into signed transactions that can be broadcast on the network. +- **API Gateway:** Burrow exposes REST and JSON-RPC endpoints to interact with the blockchain network and the application state through broadcasting transactions, or querying the current state of the application. Websockets allow to subscribe to events, which is particularly valuable as the consensus engine and smart contract application can give unambiguously finalised results to transactions within one blocktime of about one second. -Eris-db has been architected with a longer term vision on security and data privacy from the outset: +Burrow has been architected with a longer term vision on security and data privacy from the outset: - **Cryptographically Secured Consensus:** proof-of-stake Tendermint protocol achieves consensus over a known set of validators where every block is closed with cryptographic signatures from a majority of validators only. No unknown variables come into play while reaching consensus on the network (as is the case for proof-of-work consensus). This guarantees that all actions on the network are fully cryptographically verified and traceable. -- **Remote Signing:** transactions can be signed by elliptic curve cryptographic algorithms, either ed25519/sha512 or secp256k1/sha256 are currently supported. Eris-db connects to a remote signing solution to generate key pairs and request signatures. Eris-keys is a placeholder for a reverse proxy into your secure signing solution. This has always been the case for transaction formulation and work continues to enable remote signing for the validator block signatures too. +- **Remote Signing:** transactions can be signed by elliptic curve cryptographic algorithms, either ed25519/sha512 or secp256k1/sha256 are currently supported. Burrow connects to a remote signing solution to generate key pairs and request signatures. Monax-keys is a placeholder for a reverse proxy into your secure signing solution. This has always been the case for transaction formulation and work continues to enable remote signing for the validator block signatures too. - **Secure Signing:** Monax is a legal engineering company; we partner with expert companies to natively support secure signing solutions going forward. -- **Multi-chain Universe (Step 1 of 3):** from the start the eris platform has been conceived for orchestrating many chains, as exemplified by the command “eris chains make†or by that transactions are only valid on the intended chain. Separating state into different chains is only the first of three steps towards privacy on smart contract chains (see future work below). +- **Multi-chain Universe (Step 1 of 3):** from the start the monax platform has been conceived for orchestrating many chains, as exemplified by the command “monax chains make†or by that transactions are only valid on the intended chain. Separating state into different chains is only the first of three steps towards privacy on smart contract chains (see future work below). ## Installation -`eris-db` is intended to be used by the `eris chains` command via [eris](https://monax.io/docs). Available commands such as `make | start | stop | logs | inspect | update` are used for chain lifecycle management. +`burrow` is intended to be used by the `monax chains` command via [monax](https://monax.io/docs). Available commands such as `make | start | stop | logs | inspect | update` are used for chain lifecycle management. ### For Developers -Dependency management for eris-db is managed with [glide](github.com/Masterminds/glide), and you can build eris-db from source by following +Dependency management for Burrow is managed with [glide](github.com/Masterminds/glide), and you can build Burrow from source by following - [Install go](https://golang.org/doc/install) - Ensure you have `gmp` installed (`sudo apt-get install libgmp3-dev || brew install gmp`) - and execute following commands in a terminal: - `go get github.com/Masterminds/glide` -- `go get -d github.com/monax/eris-db` -- `REPO=$($GOPATH/src/github.com/monax/eris-db)` +- `go get -d github.com/monax/burrow` +- `REPO=$($GOPATH/src/github.com/monax/burrow)` - `cd $REPO && glide install` -- `cd $REPO/cmd/eris-db && go install` +- `cd $REPO/cmd/burrow && go install` -To run `eris-db`, just type `$ eris-db serve --work-dir <path to chain directory>`, where the chain directory needs to contain the configuration, genesis file, and private validator file as generated by `eris chains make`. +To run `burrow`, just type `$ burrow serve --work-dir <path to chain directory>`, where the chain directory needs to contain the configuration, genesis file, and private validator file as generated by `monax chains make`. -This will start the node using the provided folder as working dir. If the path is omitted it defaults to `~/.erisdb`. +This will start the node using the provided folder as working dir. If the path is omitted it defaults to `~/.monax`. -For a Vagrant file see [eris-vagrant](https://github.com/monax/eris-vagrant) for drafts or soon this repo for [Vagrant](https://github.com/monax/eris-db/issues/514) and Packer files. +For a Vagrant file see [monax-vagrant](https://github.com/monax/monax-vagrant) for drafts or soon this repo for [Vagrant](https://github.com/monax/burrow/issues/514) and Packer files. ## Usage -Once the server has started, it will begin syncing up with the network. At that point you may begin using it. The preferred way is through our [javascript api](https://github.com/monax/eris-db.js), but it is possible to connect directly via HTTP or websocket. +Once the server has started, it will begin syncing up with the network. At that point you may begin using it. The preferred way is through our [javascript api](https://github.com/monax/burrow.js), but it is possible to connect directly via HTTP or websocket. ## Configuration -A commented template config will be written as part of the `eris chains make` [process](https://monax.io/docs/getting-started) and can be edited prior to the `eris chains start` [process](https://monax.io/docs/getting-started). +A commented template config will be written as part of the `monax chains make` [process](https://monax.io/docs/getting-started) and can be edited prior to the `monax chains start` [process](https://monax.io/docs/getting-started). ## Contribute @@ -73,7 +73,7 @@ We welcome all contributions and have submitted the code base to the Hyperledger You can find us on: - [the Marmot Den (slack)](http://slack.monax.io) -- [here on Github](http://github.com/monax/eris-db/issues) +- [here on Github](http://github.com/monax/burrow/issues) - [support.monax.io](http://support.monax.io) - read the [Contributor file](.github/CONTRIBUTING.md) @@ -83,4 +83,4 @@ Some burrows marmots have already started digging to build the enterprise ecosys ## License -[Apache 2.0](license.md) +[Apache 2.0](LICENSE.md) diff --git a/account/account.go b/account/account.go index 73ae59748b9454ac4f5e63e9958d79dd908b8675..69f0ded86c9323d8ae328e2be138910d77765a2a 100644 --- a/account/account.go +++ b/account/account.go @@ -16,15 +16,15 @@ package account // TODO: [ben] Account and PrivateAccount need to become a pure interface // and then move the implementation to the manager types. -// Eg, Geth has its accounts, different from ErisMint +// Eg, Geth has its accounts, different from BurrowMint import ( "bytes" "fmt" "io" - "github.com/monax/eris-db/common/sanity" - ptypes "github.com/monax/eris-db/permission/types" + "github.com/monax/burrow/common/sanity" + ptypes "github.com/monax/burrow/permission/types" "github.com/tendermint/go-crypto" "github.com/tendermint/go-wire" diff --git a/account/priv_account.go b/account/priv_account.go index 41961f208bd43f1a3423a90d596f1434fcc7eaa6..5a57687f7eb2f27f82881a1d2785b665ee2831c7 100644 --- a/account/priv_account.go +++ b/account/priv_account.go @@ -16,12 +16,12 @@ package account // TODO: [ben] Account and PrivateAccount need to become a pure interface // and then move the implementation to the manager types. -// Eg, Geth has its accounts, different from ErisMint +// Eg, Geth has its accounts, different from BurrowMint import ( "fmt" - "github.com/monax/eris-db/common/sanity" + "github.com/monax/burrow/common/sanity" "github.com/tendermint/ed25519" "github.com/tendermint/go-crypto" diff --git a/blockchain/filter.go b/blockchain/filter.go index c33ad3ce114e64ae03fcb5b88788238fd3dc9885..6e05a27f6f032edbc01dbe163d28458156300f7a 100644 --- a/blockchain/filter.go +++ b/blockchain/filter.go @@ -21,10 +21,10 @@ import ( "sync" - blockchain_types "github.com/monax/eris-db/blockchain/types" - core_types "github.com/monax/eris-db/core/types" - "github.com/monax/eris-db/event" - "github.com/monax/eris-db/util/architecture" + blockchain_types "github.com/monax/burrow/blockchain/types" + core_types "github.com/monax/burrow/core/types" + "github.com/monax/burrow/event" + "github.com/monax/burrow/util/architecture" tendermint_types "github.com/tendermint/tendermint/types" ) diff --git a/blockchain/types/blockchain.go b/blockchain/types/blockchain.go index 317e2a9f8680a4e4b4cff10420f098beb7d3c3bd..b7d323e655831e29014cbca77723a21b64209be2 100644 --- a/blockchain/types/blockchain.go +++ b/blockchain/types/blockchain.go @@ -16,8 +16,8 @@ package types -// Blockchain is part of the pipe for ErisMint and provides the implementation -// for the pipe to call into the ErisMint application +// Blockchain is part of the pipe for BurrowMint and provides the implementation +// for the pipe to call into the BurrowMint application type Blockchain interface { BlockStore ChainId() string diff --git a/circle.yml b/circle.yml index e27b3135d445f145272a7608737cde8314943ce4..ba5109360bc34fb2b4e91a9357a127de605ae4a4 100644 --- a/circle.yml +++ b/circle.yml @@ -4,7 +4,6 @@ machine: REPO: ${GOPATH}/src/github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME} DOCKER_VERSION: 1.9.1 DOCKER_MACHINE_VERSION: 0.6.0 - ERIS_CLI_BRANCH: develop GO15VENDOREXPERIMENT: 1 post: - git config --global user.email "billings@monax.io" @@ -17,25 +16,21 @@ dependencies: override: - sudo curl -L -o /usr/bin/docker http://s3-external-1.amazonaws.com/circle-downloads/docker-$DOCKER_VERSION-circleci; sudo chmod 0775 /usr/bin/docker; sudo usermod -a -G docker $USER; true - sudo service docker start - # - sudo curl -sSL -o /usr/local/bin/docker-machine https://github.com/docker/machine/releases/download/v$DOCKER_MACHINE_VERSION/docker-machine-linux-x86_64; sudo chmod 0755 /usr/local/bin/docker-machine - # - "go get github.com/monax/eris/cmd/eris; cd ${GOPATH%%:*}/src/github.com/monax/eris && git checkout origin/$ERIS_CLI_BRANCH && go install ./cmd/eris" - - "sudo apt-get update && sudo apt-get install -y libgmp3-dev" - # jq and curl is a dependency for the integration framework + - sudo apt-get update && sudo apt-get install -y libgmp3-dev - sudo apt-get install jq curl && go get github.com/Masterminds/glide test: pre: - cd $REPO && glide install - # Test the build target for eris-db - - echo "Build target eris-db..." && cd $REPO && go install ./cmd/eris-db && eris-db --help - # Test the build target for eris-client - - echo "Build target eris-client..." && cd $REPO && go install ./client/cmd/eris-client && eris-client --help + # Test the build target for burrow + - echo "Build target burrow..." && cd $REPO && go install ./cmd/burrow && burrow --help + # Test the build target for burrow-client + - echo "Build target burrow-client..." && cd $REPO && go install ./client/cmd/burrow-client && burrow-client --help override: # We only wish to test our packages not vendored ones - echo "Running unit tests..." && cd $REPO && glide novendor | xargs go test -tags integration # - echo "Running integration tests..." && cd $REPO && "tests/circle_test.sh" # | tee $CIRCLE_ARTIFACTS/output.log; test ${PIPESTATUS[0]} -eq 0" - deployment: release-0.12: branch: release-0.12 @@ -43,21 +38,21 @@ deployment: - docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS quay.io # build docker image and tag the image with the version - tests/build_tool.sh - - docker push quay.io/eris/db + - docker push quay.io/monax/db release-0.16: branch: release-0.16 commands: - docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS quay.io # build docker image and tag the image with the version - tests/build_tool.sh - - docker push quay.io/eris/db + - docker push quay.io/monax/db develop: branch: develop commands: - docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS quay.io # build docker image and tag the image with the version - tests/build_tool.sh - - docker push quay.io/eris/db + - docker push quay.io/monax/db master: branch: master commands: @@ -66,7 +61,7 @@ deployment: # builds on master are considered immutable so we do not push the version # tag to allow for hotfixes - tests/build_tool.sh latest - - docker push quay.io/eris/db + - docker push quay.io/monax/db tagged-releases: tag: /v[0-9]+(\.[0-9]+)*/ commands: @@ -75,4 +70,4 @@ deployment: # once the commit is tagged the docker image for this version tag is # considered immutable. - tests/build_tool.sh - - docker push quay.io/eris/db + - docker push quay.io/monax/db diff --git a/client/cmd/eris-client.go b/client/cmd/burrow-client.go similarity index 63% rename from client/cmd/eris-client.go rename to client/cmd/burrow-client.go index d65551173449e900e9b63350f3b0546a2934ac8a..9bb113884b14ecdc7ef341b8c0b9e1e672c445c4 100644 --- a/client/cmd/eris-client.go +++ b/client/cmd/burrow-client.go @@ -21,17 +21,17 @@ import ( "github.com/spf13/cobra" - "github.com/monax/eris-db/definitions" - "github.com/monax/eris-db/version" + "github.com/monax/burrow/definitions" + "github.com/monax/burrow/version" ) // Global flags for persistent flags var clientDo *definitions.ClientDo -var ErisClientCmd = &cobra.Command{ - Use: "eris-client", - Short: "Eris-client interacts with a running Eris chain.", - Long: `Eris-client interacts with a running Eris chain. +var BurrowClientCmd = &cobra.Command{ + Use: "burrow-client", + Short: "burrow-client interacts with a running burrow chain.", + Long: `burrow-client interacts with a running burrow chain. Made with <3 by Monax Industries. @@ -41,44 +41,44 @@ Complete documentation is available at https://monax.io/docs } func Execute() { - InitErisClientInit() + InitBurrowClientInit() AddGlobalFlags() AddClientCommands() - ErisClientCmd.Execute() + BurrowClientCmd.Execute() } -func InitErisClientInit() { +func InitBurrowClientInit() { // initialise an empty ClientDo struct for command execution clientDo = definitions.NewClientDo() } func AddGlobalFlags() { - ErisClientCmd.PersistentFlags().BoolVarP(&clientDo.Verbose, "verbose", "v", defaultVerbose(), "verbose output; more output than no output flags; less output than debug level; default respects $ERIS_CLIENT_VERBOSE") - ErisClientCmd.PersistentFlags().BoolVarP(&clientDo.Debug, "debug", "d", defaultDebug(), "debug level output; the most output available for eris-client; if it is too chatty use verbose flag; default respects $ERIS_CLIENT_DEBUG") + BurrowClientCmd.PersistentFlags().BoolVarP(&clientDo.Verbose, "verbose", "v", defaultVerbose(), "verbose output; more output than no output flags; less output than debug level; default respects $BURROW_CLIENT_VERBOSE") + BurrowClientCmd.PersistentFlags().BoolVarP(&clientDo.Debug, "debug", "d", defaultDebug(), "debug level output; the most output available for burrow-client; if it is too chatty use verbose flag; default respects $BURROW_CLIENT_DEBUG") } func AddClientCommands() { - ErisClientCmd.AddCommand(buildTransactionCommand()) - ErisClientCmd.AddCommand(buildStatusCommand()) + BurrowClientCmd.AddCommand(buildTransactionCommand()) + BurrowClientCmd.AddCommand(buildStatusCommand()) buildGenesisGenCommand() - ErisClientCmd.AddCommand(GenesisGenCmd) + BurrowClientCmd.AddCommand(GenesisGenCmd) } //------------------------------------------------------------------------------ // Defaults -// defaultVerbose is set to false unless the ERIS_CLIENT_VERBOSE environment +// defaultVerbose is set to false unless the BURROW_CLIENT_VERBOSE environment // variable is set to a parsable boolean. func defaultVerbose() bool { - return setDefaultBool("ERIS_CLIENT_VERBOSE", false) + return setDefaultBool("BURROW_CLIENT_VERBOSE", false) } -// defaultDebug is set to false unless the ERIS_CLIENT_DEBUG environment +// defaultDebug is set to false unless the BURROW_CLIENT_DEBUG environment // variable is set to a parsable boolean. func defaultDebug() bool { - return setDefaultBool("ERIS_CLIENT_DEBUG", false) + return setDefaultBool("BURROW_CLIENT_DEBUG", false) } // setDefaultBool returns the provided default value if the environment variable diff --git a/client/cmd/eris-client/main.go b/client/cmd/burrow-client/main.go similarity index 93% rename from client/cmd/eris-client/main.go rename to client/cmd/burrow-client/main.go index 3f89792603a2a4d6fec6593f24d111ebab3861d4..be211672e3f98795aead6b57e7035777413eef36 100644 --- a/client/cmd/eris-client/main.go +++ b/client/cmd/burrow-client/main.go @@ -15,7 +15,7 @@ package main import ( - commands "github.com/monax/eris-db/client/cmd" + commands "github.com/monax/burrow/client/cmd" ) func main() { diff --git a/client/cmd/genesis.go b/client/cmd/genesis.go index 9082eec88185fb9b521eb9c48d7c29784ff9ff74..43d649e14382d4398d4f16d65536d645ae460fc1 100644 --- a/client/cmd/genesis.go +++ b/client/cmd/genesis.go @@ -17,8 +17,8 @@ package commands import ( "fmt" - "github.com/monax/eris-db/common/sanity" - "github.com/monax/eris-db/genesis" + "github.com/monax/burrow/common/sanity" + "github.com/monax/burrow/genesis" "github.com/spf13/cobra" ) @@ -31,8 +31,8 @@ var ( var GenesisGenCmd = &cobra.Command{ Use: "make-genesis", - Short: "eris-client make-genesis creates a genesis.json with known inputs", - Long: "eris-client make-genesis creates a genesis.json with known inputs", + Short: "burrow-client make-genesis creates a genesis.json with known inputs", + Long: "burrow-client make-genesis creates a genesis.json with known inputs", Run: func(cmd *cobra.Command, args []string) { // TODO refactor to not panic diff --git a/client/cmd/status.go b/client/cmd/status.go index 556db5e982c6b9d0472e31e8059b82c911c8315f..910839d45b736bf94e27058838cecb698a486cb4 100644 --- a/client/cmd/status.go +++ b/client/cmd/status.go @@ -17,15 +17,15 @@ package commands import ( "github.com/spf13/cobra" - "github.com/monax/eris-db/client/methods" - "github.com/monax/eris-db/util" + "github.com/monax/burrow/client/methods" + "github.com/monax/burrow/util" ) func buildStatusCommand() *cobra.Command { statusCmd := &cobra.Command{ Use: "status", - Short: "eris-client status returns the current status from a chain.", - Long: `eris-client status returns the current status from a chain. + Short: "burrow-client status returns the current status from a chain.", + Long: `burrow-client status returns the current status from a chain. `, Run: func(cmd *cobra.Command, args []string) { err := methods.Status(clientDo) @@ -34,13 +34,13 @@ func buildStatusCommand() *cobra.Command { } }, } - statusCmd.PersistentFlags().StringVarP(&clientDo.NodeAddrFlag, "node-addr", "", defaultNodeRpcAddress(), "set the eris-db node rpc server address (default respects $ERIS_CLIENT_NODE_ADDRESS)") - // TransactionCmd.PersistentFlags().StringVarP(&clientDo.PubkeyFlag, "pubkey", "", defaultPublicKey(), "specify the public key to sign with (defaults to $ERIS_CLIENT_PUBLIC_KEY)") - // TransactionCmd.PersistentFlags().StringVarP(&clientDo.AddrFlag, "addr", "", defaultAddress(), "specify the account address (for which the public key can be found at eris-keys) (default respects $ERIS_CLIENT_ADDRESS)") + statusCmd.PersistentFlags().StringVarP(&clientDo.NodeAddrFlag, "node-addr", "", defaultNodeRpcAddress(), "set the burrow node rpc server address (default respects $BURROW_CLIENT_NODE_ADDRESS)") + // TransactionCmd.PersistentFlags().StringVarP(&clientDo.PubkeyFlag, "pubkey", "", defaultPublicKey(), "specify the public key to sign with (defaults to $BURROW_CLIENT_PUBLIC_KEY)") + // TransactionCmd.PersistentFlags().StringVarP(&clientDo.AddrFlag, "addr", "", defaultAddress(), "specify the account address (for which the public key can be found at monax-keys) (default respects $BURROW_CLIENT_ADDRESS)") // TransactionCmd.PersistentFlags().StringVarP(&clientDo.ChainidFlag, "chain-id", "", defaultChainId(), "specify the chainID (default respects $CHAIN_ID)") // TransactionCmd.PersistentFlags().StringVarP(&clientDo.NonceFlag, "nonce", "", "", "specify the nonce to use for the transaction (should equal the sender account's nonce + 1)") - // // TransactionCmd.PersistentFlags().BoolVarP(&clientDo.SignFlag, "sign", "s", false, "sign the transaction using the eris-keys daemon") + // // TransactionCmd.PersistentFlags().BoolVarP(&clientDo.SignFlag, "sign", "s", false, "sign the transaction using the monax-keys daemon") // TransactionCmd.PersistentFlags().BoolVarP(&clientDo.BroadcastFlag, "broadcast", "b", true, "broadcast the transaction to the blockchain") // TransactionCmd.PersistentFlags().BoolVarP(&clientDo.WaitFlag, "wait", "w", false, "wait for the transaction to be committed in a block") diff --git a/client/cmd/transaction.go b/client/cmd/transaction.go index d7fcb83fd9419200789e2069ef0b22d54e8f7585..79152b3ad42a576281f262bd61f9874420a21938 100644 --- a/client/cmd/transaction.go +++ b/client/cmd/transaction.go @@ -19,8 +19,8 @@ import ( "github.com/spf13/cobra" - "github.com/monax/eris-db/client/methods" - "github.com/monax/eris-db/util" + "github.com/monax/burrow/client/methods" + "github.com/monax/burrow/util" ) func buildTransactionCommand() *cobra.Command { @@ -28,8 +28,8 @@ func buildTransactionCommand() *cobra.Command { // unbond, rebond, permissions. Dupeout transaction is not accessible through the command line. transactionCmd := &cobra.Command{ Use: "tx", - Short: "eris-client tx formulates and signs a transaction to a chain", - Long: "eris-client tx formulates and signs a transaction to a chain.", + Short: "burrow-client tx formulates and signs a transaction to a chain", + Long: "burrow-client tx formulates and signs a transaction to a chain.", Run: func(cmd *cobra.Command, args []string) { cmd.Help() }, } @@ -38,8 +38,8 @@ func buildTransactionCommand() *cobra.Command { // SendTx sendCmd := &cobra.Command{ Use: "send", - Short: "eris-client tx send --amt <amt> --to <addr>", - Long: "eris-client tx send --amt <amt> --to <addr>", + Short: "burrow-client tx send --amt <amt> --to <addr>", + Long: "burrow-client tx send --amt <amt> --to <addr>", Run: func(cmd *cobra.Command, args []string) { err := methods.Send(clientDo) if err != nil { @@ -54,8 +54,8 @@ func buildTransactionCommand() *cobra.Command { // NameTx nameCmd := &cobra.Command{ Use: "name", - Short: "eris-client tx name --amt <amt> --name <name> --data <data>", - Long: "eris-client tx name --amt <amt> --name <name> --data <data>", + Short: "burrow-client tx name --amt <amt> --name <name> --data <data>", + Long: "burrow-client tx name --amt <amt> --name <name> --data <data>", Run: func(cmd *cobra.Command, args []string) { // transaction.Name(clientDo) }, @@ -70,8 +70,8 @@ func buildTransactionCommand() *cobra.Command { // CallTx callCmd := &cobra.Command{ Use: "call", - Short: "eris-client tx call --amt <amt> --fee <fee> --gas <gas> --to <contract addr> --data <data>", - Long: "eris-client tx call --amt <amt> --fee <fee> --gas <gas> --to <contract addr> --data <data>", + Short: "burrow-client tx call --amt <amt> --fee <fee> --gas <gas> --to <contract addr> --data <data>", + Long: "burrow-client tx call --amt <amt> --fee <fee> --gas <gas> --to <contract addr> --data <data>", Run: func(cmd *cobra.Command, args []string) { err := methods.Call(clientDo) if err != nil { @@ -89,8 +89,8 @@ func buildTransactionCommand() *cobra.Command { // BondTx bondCmd := &cobra.Command{ Use: "bond", - Short: "eris-client tx bond --pubkey <pubkey> --amt <amt> --unbond-to <address>", - Long: "eris-client tx bond --pubkey <pubkey> --amt <amt> --unbond-to <address>", + Short: "burrow-client tx bond --pubkey <pubkey> --amt <amt> --unbond-to <address>", + Long: "burrow-client tx bond --pubkey <pubkey> --amt <amt> --unbond-to <address>", Run: func(cmd *cobra.Command, args []string) { // transaction.Bond(clientDo) }, @@ -102,8 +102,8 @@ func buildTransactionCommand() *cobra.Command { // UnbondTx unbondCmd := &cobra.Command{ Use: "unbond", - Short: "eris-client tx unbond --addr <address> --height <block_height>", - Long: "eris-client tx unbond --addr <address> --height <block_height>", + Short: "burrow-client tx unbond --addr <address> --height <block_height>", + Long: "burrow-client tx unbond --addr <address> --height <block_height>", Run: func(cmd *cobra.Command, args []string) { // transaction.Unbond(clientDo) }, @@ -115,8 +115,8 @@ func buildTransactionCommand() *cobra.Command { // RebondTx var rebondCmd = &cobra.Command{ Use: "rebond", - Short: "eris-client tx rebond --addr <address> --height <block_height>", - Long: "eris-client tx rebond --addr <address> --height <block_height>", + Short: "burrow-client tx rebond --addr <address> --height <block_height>", + Long: "burrow-client tx rebond --addr <address> --height <block_height>", Run: func(cmd *cobra.Command, args []string) { // transaction.Rebond(clientDo) }, @@ -128,8 +128,8 @@ func buildTransactionCommand() *cobra.Command { // PermissionsTx permissionsCmd := &cobra.Command{ Use: "permission", - Short: "eris-client tx perm <function name> <args ...>", - Long: "eris-client tx perm <function name> <args ...>", + Short: "burrow-client tx perm <function name> <args ...>", + Long: "burrow-client tx perm <function name> <args ...>", Run: func(cmd *cobra.Command, args []string) { // transaction.Permsissions(clientDo) }, @@ -141,14 +141,14 @@ func buildTransactionCommand() *cobra.Command { } func addTransactionPersistentFlags(transactionCmd *cobra.Command) { - transactionCmd.PersistentFlags().StringVarP(&clientDo.SignAddrFlag, "sign-addr", "", defaultKeyDaemonAddress(), "set eris-keys daemon address (default respects $ERIS_CLIENT_SIGN_ADDRESS)") - transactionCmd.PersistentFlags().StringVarP(&clientDo.NodeAddrFlag, "node-addr", "", defaultNodeRpcAddress(), "set the eris-db node rpc server address (default respects $ERIS_CLIENT_NODE_ADDRESS)") - transactionCmd.PersistentFlags().StringVarP(&clientDo.PubkeyFlag, "pubkey", "", defaultPublicKey(), "specify the public key to sign with (defaults to $ERIS_CLIENT_PUBLIC_KEY)") - transactionCmd.PersistentFlags().StringVarP(&clientDo.AddrFlag, "addr", "", defaultAddress(), "specify the account address (for which the public key can be found at eris-keys) (default respects $ERIS_CLIENT_ADDRESS)") + transactionCmd.PersistentFlags().StringVarP(&clientDo.SignAddrFlag, "sign-addr", "", defaultKeyDaemonAddress(), "set monax-keys daemon address (default respects $BURROW_CLIENT_SIGN_ADDRESS)") + transactionCmd.PersistentFlags().StringVarP(&clientDo.NodeAddrFlag, "node-addr", "", defaultNodeRpcAddress(), "set the burrow node rpc server address (default respects $BURROW_CLIENT_NODE_ADDRESS)") + transactionCmd.PersistentFlags().StringVarP(&clientDo.PubkeyFlag, "pubkey", "", defaultPublicKey(), "specify the public key to sign with (defaults to $BURROW_CLIENT_PUBLIC_KEY)") + transactionCmd.PersistentFlags().StringVarP(&clientDo.AddrFlag, "addr", "", defaultAddress(), "specify the account address (for which the public key can be found at monax-keys) (default respects $BURROW_CLIENT_ADDRESS)") transactionCmd.PersistentFlags().StringVarP(&clientDo.ChainidFlag, "chain-id", "", defaultChainId(), "specify the chainID (default respects $CHAIN_ID)") transactionCmd.PersistentFlags().StringVarP(&clientDo.NonceFlag, "nonce", "", "", "specify the nonce to use for the transaction (should equal the sender account's nonce + 1)") - // transactionCmd.PersistentFlags().BoolVarP(&clientDo.SignFlag, "sign", "s", false, "sign the transaction using the eris-keys daemon") + // transactionCmd.PersistentFlags().BoolVarP(&clientDo.SignFlag, "sign", "s", false, "sign the transaction using the monax-keys daemon") transactionCmd.PersistentFlags().BoolVarP(&clientDo.BroadcastFlag, "broadcast", "b", true, "broadcast the transaction to the blockchain") transactionCmd.PersistentFlags().BoolVarP(&clientDo.WaitFlag, "wait", "w", true, "wait for the transaction to be committed in a block") } @@ -161,19 +161,19 @@ func defaultChainId() string { } func defaultKeyDaemonAddress() string { - return setDefaultString("ERIS_CLIENT_SIGN_ADDRESS", "http://127.0.0.1:4767") + return setDefaultString("BURROW_CLIENT_SIGN_ADDRESS", "http://127.0.0.1:4767") } func defaultNodeRpcAddress() string { - return setDefaultString("ERIS_CLIENT_NODE_ADDRESS", "tcp://127.0.0.1:46657") + return setDefaultString("BURROW_CLIENT_NODE_ADDRESS", "tcp://127.0.0.1:46657") } func defaultPublicKey() string { - return setDefaultString("ERIS_CLIENT_PUBLIC_KEY", "") + return setDefaultString("BURROW_CLIENT_PUBLIC_KEY", "") } func defaultAddress() string { - return setDefaultString("ERIS_CLIENT_ADDRESS", "") + return setDefaultString("BURROW_CLIENT_ADDRESS", "") } //------------------------------------------------------------------------------ diff --git a/client/methods/call.go b/client/methods/call.go index ebfcf25f97eede6587f09be7821cbbeba3c33055..76e52b726daccf4ecb4d1413f8ac984d2f4abc64 100644 --- a/client/methods/call.go +++ b/client/methods/call.go @@ -17,10 +17,10 @@ package methods import ( "fmt" - "github.com/monax/eris-db/client" - "github.com/monax/eris-db/client/rpc" - "github.com/monax/eris-db/definitions" - "github.com/monax/eris-db/keys" + "github.com/monax/burrow/client" + "github.com/monax/burrow/client/rpc" + "github.com/monax/burrow/definitions" + "github.com/monax/burrow/keys" ) func Call(do *definitions.ClientDo) error { @@ -30,10 +30,10 @@ func Call(do *definitions.ClientDo) error { if err != nil { return fmt.Errorf("Could not generate logging config from ClientDo: %s", err) } - erisKeyClient := keys.NewErisKeyClient(do.SignAddrFlag, logger) - erisNodeClient := client.NewErisNodeClient(do.NodeAddrFlag, logger) + burrowKeyClient := keys.NewBurrowKeyClient(do.SignAddrFlag, logger) + burrowNodeClient := client.NewBurrowNodeClient(do.NodeAddrFlag, logger) // form the call transaction - callTransaction, err := rpc.Call(erisNodeClient, erisKeyClient, + callTransaction, err := rpc.Call(burrowNodeClient, burrowKeyClient, do.PubkeyFlag, do.AddrFlag, do.ToFlag, do.AmtFlag, do.NonceFlag, do.GasFlag, do.FeeFlag, do.DataFlag) if err != nil { @@ -42,7 +42,7 @@ func Call(do *definitions.ClientDo) error { // TODO: [ben] we carry over the sign bool, but always set it to true, // as we move away from and deprecate the api that allows sending unsigned // transactions and relying on (our) receiving node to sign it. - txResult, err := rpc.SignAndBroadcast(do.ChainidFlag, erisNodeClient, erisKeyClient, + txResult, err := rpc.SignAndBroadcast(do.ChainidFlag, burrowNodeClient, burrowKeyClient, callTransaction, true, do.BroadcastFlag, do.WaitFlag) if err != nil { diff --git a/client/methods/helpers.go b/client/methods/helpers.go index 88861be6b9c5dde7b47d5019d37b58d829806557..061ea9939ec61f9e2cb8020da9af9d7d70ad4135 100644 --- a/client/methods/helpers.go +++ b/client/methods/helpers.go @@ -15,12 +15,12 @@ package methods import ( - "github.com/monax/eris-db/client/rpc" - "github.com/monax/eris-db/core" - "github.com/monax/eris-db/definitions" - "github.com/monax/eris-db/logging" - "github.com/monax/eris-db/logging/lifecycle" - "github.com/monax/eris-db/logging/loggers" + "github.com/monax/burrow/client/rpc" + "github.com/monax/burrow/core" + "github.com/monax/burrow/definitions" + "github.com/monax/burrow/logging" + "github.com/monax/burrow/logging/lifecycle" + "github.com/monax/burrow/logging/loggers" ) func unpackSignAndBroadcast(result *rpc.TxResult, logger loggers.InfoTraceLogger) { diff --git a/client/methods/send.go b/client/methods/send.go index e0c608d8487a16d9ec677d0f59a500733b62dcc5..77b3ed1e689637be3fce2121b228d2b3c3af0e63 100644 --- a/client/methods/send.go +++ b/client/methods/send.go @@ -17,10 +17,10 @@ package methods import ( "fmt" - "github.com/monax/eris-db/client" - "github.com/monax/eris-db/client/rpc" - "github.com/monax/eris-db/definitions" - "github.com/monax/eris-db/keys" + "github.com/monax/burrow/client" + "github.com/monax/burrow/client/rpc" + "github.com/monax/burrow/definitions" + "github.com/monax/burrow/keys" ) func Send(do *definitions.ClientDo) error { @@ -30,10 +30,10 @@ func Send(do *definitions.ClientDo) error { if err != nil { return fmt.Errorf("Could not generate logging config from ClientDo: %s", err) } - erisKeyClient := keys.NewErisKeyClient(do.SignAddrFlag, logger) - erisNodeClient := client.NewErisNodeClient(do.NodeAddrFlag, logger) + burrowKeyClient := keys.NewBurrowKeyClient(do.SignAddrFlag, logger) + burrowNodeClient := client.NewBurrowNodeClient(do.NodeAddrFlag, logger) // form the send transaction - sendTransaction, err := rpc.Send(erisNodeClient, erisKeyClient, + sendTransaction, err := rpc.Send(burrowNodeClient, burrowKeyClient, do.PubkeyFlag, do.AddrFlag, do.ToFlag, do.AmtFlag, do.NonceFlag) if err != nil { fmt.Errorf("Failed on forming Send Transaction: %s", err) @@ -41,7 +41,7 @@ func Send(do *definitions.ClientDo) error { // TODO: [ben] we carry over the sign bool, but always set it to true, // as we move away from and deprecate the api that allows sending unsigned // transactions and relying on (our) receiving node to sign it. - txResult, err := rpc.SignAndBroadcast(do.ChainidFlag, erisNodeClient, erisKeyClient, + txResult, err := rpc.SignAndBroadcast(do.ChainidFlag, burrowNodeClient, burrowKeyClient, sendTransaction, true, do.BroadcastFlag, do.WaitFlag) if err != nil { return fmt.Errorf("Failed on signing (and broadcasting) transaction: %s", err) diff --git a/client/methods/status.go b/client/methods/status.go index 070d8c4bdbb4de1a60303c5878718125db309824..da74605fc97d5601b5f5ffa08b7c5c2a3e21be08 100644 --- a/client/methods/status.go +++ b/client/methods/status.go @@ -17,8 +17,8 @@ package methods import ( "fmt" - "github.com/monax/eris-db/client" - "github.com/monax/eris-db/definitions" + "github.com/monax/burrow/client" + "github.com/monax/burrow/definitions" ) func Status(do *definitions.ClientDo) error { @@ -26,13 +26,13 @@ func Status(do *definitions.ClientDo) error { if err != nil { return fmt.Errorf("Could not generate logging config from ClientDo: %s", err) } - erisNodeClient := client.NewErisNodeClient(do.NodeAddrFlag, logger) - genesisHash, validatorPublicKey, latestBlockHash, latestBlockHeight, latestBlockTime, err := erisNodeClient.Status() + burrowNodeClient := client.NewBurrowNodeClient(do.NodeAddrFlag, logger) + genesisHash, validatorPublicKey, latestBlockHash, latestBlockHeight, latestBlockTime, err := burrowNodeClient.Status() if err != nil { return fmt.Errorf("Error requesting status from chain at (%s): %s", do.NodeAddrFlag, err) } - chainName, chainId, genesisHashfromChainId, err := erisNodeClient.ChainId() + chainName, chainId, genesisHashfromChainId, err := burrowNodeClient.ChainId() if err != nil { return fmt.Errorf("Error requesting chainId from chain at (%s): %s", do.NodeAddrFlag, err) } diff --git a/client/mock/client_mock.go b/client/mock/client_mock.go index b8d6e55826d156b977f6e8d4b9f80399d3b60994..292f31c6e3cd48ba6423b584e2f36bebf3c43ebb 100644 --- a/client/mock/client_mock.go +++ b/client/mock/client_mock.go @@ -17,16 +17,14 @@ package mock import ( "github.com/tendermint/go-crypto" - acc "github.com/monax/eris-db/account" - . "github.com/monax/eris-db/client" - consensus_types "github.com/monax/eris-db/consensus/types" - core_types "github.com/monax/eris-db/core/types" - "github.com/monax/eris-db/logging/loggers" - "github.com/monax/eris-db/txs" + acc "github.com/monax/burrow/account" + . "github.com/monax/burrow/client" + consensus_types "github.com/monax/burrow/consensus/types" + core_types "github.com/monax/burrow/core/types" + "github.com/monax/burrow/logging/loggers" + "github.com/monax/burrow/txs" ) -// NOTE [ben] Compiler check to ensure ErisMockClient successfully implements -// eris-db/client.NodeClient var _ NodeClient = (*MockNodeClient)(nil) type MockNodeClient struct { diff --git a/client/node_client.go b/client/node_client.go index ab71bd678623e8572514b6b3087b358700ee5614..206c7f9ea4408df76f44ce16f291f54c3e62c153 100644 --- a/client/node_client.go +++ b/client/node_client.go @@ -20,14 +20,14 @@ import ( "github.com/tendermint/go-rpc/client" - acc "github.com/monax/eris-db/account" - consensus_types "github.com/monax/eris-db/consensus/types" - core_types "github.com/monax/eris-db/core/types" - "github.com/monax/eris-db/logging" - "github.com/monax/eris-db/logging/loggers" - tendermint_client "github.com/monax/eris-db/rpc/tendermint/client" - tendermint_types "github.com/monax/eris-db/rpc/tendermint/core/types" - "github.com/monax/eris-db/txs" + acc "github.com/monax/burrow/account" + consensus_types "github.com/monax/burrow/consensus/types" + core_types "github.com/monax/burrow/core/types" + "github.com/monax/burrow/logging" + "github.com/monax/burrow/logging/loggers" + tendermint_client "github.com/monax/burrow/rpc/tendermint/client" + tendermint_types "github.com/monax/burrow/rpc/tendermint/core/types" + "github.com/monax/burrow/txs" tmLog15 "github.com/tendermint/log15" ) @@ -57,22 +57,22 @@ type NodeWebsocketClient interface { Close() } -// NOTE [ben] Compiler check to ensure erisNodeClient successfully implements -// eris-db/client.NodeClient -var _ NodeClient = (*erisNodeClient)(nil) +// NOTE [ben] Compiler check to ensure burrowNodeClient successfully implements +// burrow/client.NodeClient +var _ NodeClient = (*burrowNodeClient)(nil) -// Eris-Client is a simple struct exposing the client rpc methods -type erisNodeClient struct { +// burrow-client is a simple struct exposing the client rpc methods +type burrowNodeClient struct { broadcastRPC string logger loggers.InfoTraceLogger } -// ErisKeyClient.New returns a new eris-keys client for provided rpc location -// Eris-keys connects over http request-responses -func NewErisNodeClient(rpcString string, logger loggers.InfoTraceLogger) *erisNodeClient { - return &erisNodeClient{ +// BurrowKeyClient.New returns a new monax-keys client for provided rpc location +// Monax-keys connects over http request-responses +func NewBurrowNodeClient(rpcString string, logger loggers.InfoTraceLogger) *burrowNodeClient { + return &burrowNodeClient{ broadcastRPC: rpcString, - logger: logging.WithScope(logger, "ErisNodeClient"), + logger: logging.WithScope(logger, "BurrowNodeClient"), } } @@ -85,11 +85,9 @@ func init() { //------------------------------------------------------------------------------------ // broadcast to blockchain node -// NOTE: [ben] Eris Client first continues from tendermint rpc, but will have handshake to negotiate -// protocol version for moving towards rpc/v1 -func (erisNodeClient *erisNodeClient) Broadcast(tx txs.Tx) (*txs.Receipt, error) { - client := rpcclient.NewClientURI(erisNodeClient.broadcastRPC) +func (burrowNodeClient *burrowNodeClient) Broadcast(tx txs.Tx) (*txs.Receipt, error) { + client := rpcclient.NewClientURI(burrowNodeClient.broadcastRPC) receipt, err := tendermint_client.BroadcastTx(client, tx) if err != nil { return nil, err @@ -97,10 +95,10 @@ func (erisNodeClient *erisNodeClient) Broadcast(tx txs.Tx) (*txs.Receipt, error) return &receipt, nil } -func (erisNodeClient *erisNodeClient) DeriveWebsocketClient() (nodeWsClient NodeWebsocketClient, err error) { +func (burrowNodeClient *burrowNodeClient) DeriveWebsocketClient() (nodeWsClient NodeWebsocketClient, err error) { var wsAddr string // TODO: clean up this inherited mess on dealing with the address prefixes. - nodeAddr := erisNodeClient.broadcastRPC + nodeAddr := burrowNodeClient.broadcastRPC // if strings.HasPrefix(nodeAddr, "http://") { // wsAddr = strings.TrimPrefix(nodeAddr, "http://") // } @@ -115,7 +113,7 @@ func (erisNodeClient *erisNodeClient) DeriveWebsocketClient() (nodeWsClient Node // } // wsAddr = "ws://" + wsAddr wsAddr = nodeAddr - logging.TraceMsg(erisNodeClient.logger, "Subscribing to websocket address", + logging.TraceMsg(burrowNodeClient.logger, "Subscribing to websocket address", "websocket address", wsAddr, "endpoint", "/websocket", ) @@ -123,11 +121,11 @@ func (erisNodeClient *erisNodeClient) DeriveWebsocketClient() (nodeWsClient Node if _, err = wsClient.Start(); err != nil { return nil, err } - derivedErisNodeWebsocketClient := &erisNodeWebsocketClient{ + derivedBurrowNodeWebsocketClient := &burrowNodeWebsocketClient{ tendermintWebsocket: wsClient, - logger: logging.WithScope(erisNodeClient.logger, "ErisNodeWebsocketClient"), + logger: logging.WithScope(burrowNodeClient.logger, "BurrowNodeWebsocketClient"), } - return derivedErisNodeWebsocketClient, nil + return derivedBurrowNodeWebsocketClient, nil } //------------------------------------------------------------------------------------ @@ -135,12 +133,12 @@ func (erisNodeClient *erisNodeClient) DeriveWebsocketClient() (nodeWsClient Node // Status returns the ChainId (GenesisHash), validator's PublicKey, latest block hash // the block height and the latest block time. -func (erisNodeClient *erisNodeClient) Status() (GenesisHash []byte, ValidatorPublicKey []byte, LatestBlockHash []byte, LatestBlockHeight int, LatestBlockTime int64, err error) { - client := rpcclient.NewClientJSONRPC(erisNodeClient.broadcastRPC) +func (burrowNodeClient *burrowNodeClient) Status() (GenesisHash []byte, ValidatorPublicKey []byte, LatestBlockHash []byte, LatestBlockHeight int, LatestBlockTime int64, err error) { + client := rpcclient.NewClientJSONRPC(burrowNodeClient.broadcastRPC) res, err := tendermint_client.Status(client) if err != nil { err = fmt.Errorf("Error connecting to node (%s) to get status: %s", - erisNodeClient.broadcastRPC, err.Error()) + burrowNodeClient.broadcastRPC, err.Error()) return nil, nil, nil, int(0), int64(0), err } @@ -153,12 +151,12 @@ func (erisNodeClient *erisNodeClient) Status() (GenesisHash []byte, ValidatorPub return } -func (erisNodeClient *erisNodeClient) ChainId() (ChainName, ChainId string, GenesisHash []byte, err error) { - client := rpcclient.NewClientJSONRPC(erisNodeClient.broadcastRPC) +func (burrowNodeClient *burrowNodeClient) ChainId() (ChainName, ChainId string, GenesisHash []byte, err error) { + client := rpcclient.NewClientJSONRPC(burrowNodeClient.broadcastRPC) chainIdResult, err := tendermint_client.ChainId(client) if err != nil { err = fmt.Errorf("Error connecting to node (%s) to get chain id: %s", - erisNodeClient.broadcastRPC, err.Error()) + burrowNodeClient.broadcastRPC, err.Error()) return "", "", nil, err } // unwrap results @@ -171,42 +169,42 @@ func (erisNodeClient *erisNodeClient) ChainId() (ChainName, ChainId string, Gene // QueryContract executes the contract code at address with the given data // NOTE: there is no check on the caller; -func (erisNodeClient *erisNodeClient) QueryContract(callerAddress, calleeAddress, data []byte) (ret []byte, gasUsed int64, err error) { - client := rpcclient.NewClientJSONRPC(erisNodeClient.broadcastRPC) +func (burrowNodeClient *burrowNodeClient) QueryContract(callerAddress, calleeAddress, data []byte) (ret []byte, gasUsed int64, err error) { + client := rpcclient.NewClientJSONRPC(burrowNodeClient.broadcastRPC) callResult, err := tendermint_client.Call(client, callerAddress, calleeAddress, data) if err != nil { err = fmt.Errorf("Error connnecting to node (%s) to query contract at (%X) with data (%X)", - erisNodeClient.broadcastRPC, calleeAddress, data, err.Error()) + burrowNodeClient.broadcastRPC, calleeAddress, data, err.Error()) return nil, int64(0), err } return callResult.Return, callResult.GasUsed, nil } // QueryContractCode executes the contract code at address with the given data but with provided code -func (erisNodeClient *erisNodeClient) QueryContractCode(address, code, data []byte) (ret []byte, gasUsed int64, err error) { - client := rpcclient.NewClientJSONRPC(erisNodeClient.broadcastRPC) +func (burrowNodeClient *burrowNodeClient) QueryContractCode(address, code, data []byte) (ret []byte, gasUsed int64, err error) { + client := rpcclient.NewClientJSONRPC(burrowNodeClient.broadcastRPC) // TODO: [ben] Call and CallCode have an inconsistent signature; it makes sense for both to only // have a single address that is the contract to query. callResult, err := tendermint_client.CallCode(client, address, code, data) if err != nil { err = fmt.Errorf("Error connnecting to node (%s) to query contract code at (%X) with data (%X) and code (%X)", - erisNodeClient.broadcastRPC, address, data, code, err.Error()) + burrowNodeClient.broadcastRPC, address, data, code, err.Error()) return nil, int64(0), err } return callResult.Return, callResult.GasUsed, nil } // GetAccount returns a copy of the account -func (erisNodeClient *erisNodeClient) GetAccount(address []byte) (*acc.Account, error) { - client := rpcclient.NewClientJSONRPC(erisNodeClient.broadcastRPC) +func (burrowNodeClient *burrowNodeClient) GetAccount(address []byte) (*acc.Account, error) { + client := rpcclient.NewClientJSONRPC(burrowNodeClient.broadcastRPC) account, err := tendermint_client.GetAccount(client, address) if err != nil { err = fmt.Errorf("Error connecting to node (%s) to fetch account (%X): %s", - erisNodeClient.broadcastRPC, address, err.Error()) + burrowNodeClient.broadcastRPC, address, err.Error()) return nil, err } if account == nil { - err = fmt.Errorf("Unknown account %X at node (%s)", address, erisNodeClient.broadcastRPC) + err = fmt.Errorf("Unknown account %X at node (%s)", address, burrowNodeClient.broadcastRPC) return nil, err } @@ -214,12 +212,12 @@ func (erisNodeClient *erisNodeClient) GetAccount(address []byte) (*acc.Account, } // DumpStorage returns the full storage for an account. -func (erisNodeClient *erisNodeClient) DumpStorage(address []byte) (storage *core_types.Storage, err error) { - client := rpcclient.NewClientJSONRPC(erisNodeClient.broadcastRPC) +func (burrowNodeClient *burrowNodeClient) DumpStorage(address []byte) (storage *core_types.Storage, err error) { + client := rpcclient.NewClientJSONRPC(burrowNodeClient.broadcastRPC) resultStorage, err := tendermint_client.DumpStorage(client, address) if err != nil { err = fmt.Errorf("Error connecting to node (%s) to get storage for account (%X): %s", - erisNodeClient.broadcastRPC, address, err.Error()) + burrowNodeClient.broadcastRPC, address, err.Error()) return nil, err } // UnwrapResultDumpStorage is an inefficient full deep copy, @@ -232,12 +230,12 @@ func (erisNodeClient *erisNodeClient) DumpStorage(address []byte) (storage *core //-------------------------------------------------------------------------------------------- // Name registry -func (erisNodeClient *erisNodeClient) GetName(name string) (owner []byte, data string, expirationBlock int, err error) { - client := rpcclient.NewClientJSONRPC(erisNodeClient.broadcastRPC) +func (burrowNodeClient *burrowNodeClient) GetName(name string) (owner []byte, data string, expirationBlock int, err error) { + client := rpcclient.NewClientJSONRPC(burrowNodeClient.broadcastRPC) entryResult, err := tendermint_client.GetName(client, name) if err != nil { err = fmt.Errorf("Error connecting to node (%s) to get name registrar entry for name (%s)", - erisNodeClient.broadcastRPC, name) + burrowNodeClient.broadcastRPC, name) return nil, "", 0, err } // unwrap return results @@ -249,13 +247,13 @@ func (erisNodeClient *erisNodeClient) GetName(name string) (owner []byte, data s //-------------------------------------------------------------------------------------------- -func (erisNodeClient *erisNodeClient) ListValidators() (blockHeight int, +func (burrowNodeClient *burrowNodeClient) ListValidators() (blockHeight int, bondedValidators []consensus_types.Validator, unbondingValidators []consensus_types.Validator, err error) { - client := rpcclient.NewClientJSONRPC(erisNodeClient.broadcastRPC) + client := rpcclient.NewClientJSONRPC(burrowNodeClient.broadcastRPC) validatorsResult, err := tendermint_client.ListValidators(client) if err != nil { err = fmt.Errorf("Error connecting to node (%s) to get validators", - erisNodeClient.broadcastRPC) + burrowNodeClient.broadcastRPC) return 0, nil, nil, err } // unwrap return results @@ -265,6 +263,6 @@ func (erisNodeClient *erisNodeClient) ListValidators() (blockHeight int, return } -func (erisNodeClient *erisNodeClient) Logger() loggers.InfoTraceLogger { - return erisNodeClient.logger +func (burrowNodeClient *burrowNodeClient) Logger() loggers.InfoTraceLogger { + return burrowNodeClient.logger } diff --git a/client/rpc/client.go b/client/rpc/client.go index 02cf9594c41f1de1902d4b53072cb5e990f4afbb..0e3f40582fa600dff330f154185db5dd2b85c1c9 100644 --- a/client/rpc/client.go +++ b/client/rpc/client.go @@ -19,11 +19,11 @@ import ( "fmt" "strconv" - ptypes "github.com/monax/eris-db/permission/types" + ptypes "github.com/monax/burrow/permission/types" - "github.com/monax/eris-db/client" - "github.com/monax/eris-db/keys" - "github.com/monax/eris-db/txs" + "github.com/monax/burrow/client" + "github.com/monax/burrow/keys" + "github.com/monax/burrow/txs" ) //------------------------------------------------------------------------------------ diff --git a/client/rpc/client_test.go b/client/rpc/client_test.go index 1b32dfeb60f04bea9b14a904c059d9ba2293f78b..5fc4418db6a83e62e47bb26bc9c0c5eb06a1fe1c 100644 --- a/client/rpc/client_test.go +++ b/client/rpc/client_test.go @@ -20,8 +20,8 @@ import ( // "github.com/stretchr/testify/assert" - mockclient "github.com/monax/eris-db/client/mock" - mockkeys "github.com/monax/eris-db/keys/mock" + mockclient "github.com/monax/burrow/client/mock" + mockkeys "github.com/monax/burrow/keys/mock" ) func Test(t *testing.T) { diff --git a/client/rpc/client_util.go b/client/rpc/client_util.go index 2dd92b5c91e94770ac2b71cf5135ac67e18f4773..1025c16837bfcb6212ff0debc17bdfd8f7df4dc2 100644 --- a/client/rpc/client_util.go +++ b/client/rpc/client_util.go @@ -21,12 +21,12 @@ import ( "github.com/tendermint/go-crypto" - acc "github.com/monax/eris-db/account" - "github.com/monax/eris-db/client" - "github.com/monax/eris-db/keys" - "github.com/monax/eris-db/logging" - ptypes "github.com/monax/eris-db/permission/types" - "github.com/monax/eris-db/txs" + acc "github.com/monax/burrow/account" + "github.com/monax/burrow/client" + "github.com/monax/burrow/keys" + "github.com/monax/burrow/logging" + ptypes "github.com/monax/burrow/permission/types" + "github.com/monax/burrow/txs" ) //------------------------------------------------------------------------------------ @@ -109,7 +109,7 @@ func checkCommon(nodeClient client.NodeClient, keyClient keys.KeyClient, pubkey, return } } else { - // grab the pubkey from eris-keys + // grab the pubkey from monax-keys addressBytes, err2 := hex.DecodeString(addr) if err2 != nil { err = fmt.Errorf("Bad hex string for address (%s): %v", addr, err) @@ -139,7 +139,7 @@ func checkCommon(nodeClient client.NodeClient, keyClient keys.KeyClient, pubkey, if nonceS == "" { if nodeClient == nil { - err = fmt.Errorf("input must specify a nonce with the --nonce flag or use --node-addr (or ERIS_CLIENT_NODE_ADDR) to fetch the nonce from a node") + err = fmt.Errorf("input must specify a nonce with the --nonce flag or use --node-addr (or BURROW_CLIENT_NODE_ADDR) to fetch the nonce from a node") return } // fetch nonce from node diff --git a/client/websocket_client.go b/client/websocket_client.go index 2019e2dbdee7232053f03ff3f59c673714fed573..aab9d14a2f41055f6d3b4e47434664b60160bfa6 100644 --- a/client/websocket_client.go +++ b/client/websocket_client.go @@ -22,10 +22,10 @@ import ( "github.com/tendermint/go-rpc/client" "github.com/tendermint/go-wire" - "github.com/monax/eris-db/logging" - "github.com/monax/eris-db/logging/loggers" - ctypes "github.com/monax/eris-db/rpc/tendermint/core/types" - "github.com/monax/eris-db/txs" + "github.com/monax/burrow/logging" + "github.com/monax/burrow/logging/loggers" + ctypes "github.com/monax/burrow/rpc/tendermint/core/types" + "github.com/monax/burrow/txs" ) const ( @@ -39,32 +39,32 @@ type Confirmation struct { Error error } -// NOTE [ben] Compiler check to ensure erisNodeClient successfully implements -// eris-db/client.NodeClient -var _ NodeWebsocketClient = (*erisNodeWebsocketClient)(nil) +// NOTE [ben] Compiler check to ensure burrowNodeClient successfully implements +// burrow/client.NodeClient +var _ NodeWebsocketClient = (*burrowNodeWebsocketClient)(nil) -type erisNodeWebsocketClient struct { +type burrowNodeWebsocketClient struct { // TODO: assert no memory leak on closing with open websocket tendermintWebsocket *rpcclient.WSClient logger loggers.InfoTraceLogger } // Subscribe to an eventid -func (erisNodeWebsocketClient *erisNodeWebsocketClient) Subscribe(eventid string) error { +func (burrowNodeWebsocketClient *burrowNodeWebsocketClient) Subscribe(eventid string) error { // TODO we can in the background listen to the subscription id and remember it to ease unsubscribing later. - return erisNodeWebsocketClient.tendermintWebsocket.Subscribe(eventid) + return burrowNodeWebsocketClient.tendermintWebsocket.Subscribe(eventid) } // Unsubscribe from an eventid -func (erisNodeWebsocketClient *erisNodeWebsocketClient) Unsubscribe(subscriptionId string) error { - return erisNodeWebsocketClient.tendermintWebsocket.Unsubscribe(subscriptionId) +func (burrowNodeWebsocketClient *burrowNodeWebsocketClient) Unsubscribe(subscriptionId string) error { + return burrowNodeWebsocketClient.tendermintWebsocket.Unsubscribe(subscriptionId) } // Returns a channel that will receive a confirmation with a result or the exception that // has been confirmed; or an error is returned and the confirmation channel is nil. -func (erisNodeWebsocketClient *erisNodeWebsocketClient) WaitForConfirmation(tx txs.Tx, chainId string, inputAddr []byte) (chan Confirmation, error) { +func (burrowNodeWebsocketClient *burrowNodeWebsocketClient) WaitForConfirmation(tx txs.Tx, chainId string, inputAddr []byte) (chan Confirmation, error) { // check no errors are reported on the websocket - if err := erisNodeWebsocketClient.assertNoErrors(); err != nil { + if err := burrowNodeWebsocketClient.assertNoErrors(); err != nil { return nil, err } @@ -73,21 +73,21 @@ func (erisNodeWebsocketClient *erisNodeWebsocketClient) WaitForConfirmation(tx t var latestBlockHash []byte eid := txs.EventStringAccInput(inputAddr) - if err := erisNodeWebsocketClient.tendermintWebsocket.Subscribe(eid); err != nil { + if err := burrowNodeWebsocketClient.tendermintWebsocket.Subscribe(eid); err != nil { return nil, fmt.Errorf("Error subscribing to AccInput event (%s): %v", eid, err) } - if err := erisNodeWebsocketClient.tendermintWebsocket.Subscribe(txs.EventStringNewBlock()); err != nil { + if err := burrowNodeWebsocketClient.tendermintWebsocket.Subscribe(txs.EventStringNewBlock()); err != nil { return nil, fmt.Errorf("Error subscribing to NewBlock event: %v", err) } // Read the incoming events go func() { var err error for { - resultBytes := <-erisNodeWebsocketClient.tendermintWebsocket.ResultsCh - result := new(ctypes.ErisDBResult) + resultBytes := <-burrowNodeWebsocketClient.tendermintWebsocket.ResultsCh + result := new(ctypes.BurrowResult) if wire.ReadJSONPtr(result, resultBytes, &err); err != nil { // keep calm and carry on - logging.InfoMsg(erisNodeWebsocketClient.logger, "Failed to unmarshal json bytes for websocket event", + logging.InfoMsg(burrowNodeWebsocketClient.logger, "Failed to unmarshal json bytes for websocket event", "error", err) continue } @@ -97,7 +97,7 @@ func (erisNodeWebsocketClient *erisNodeWebsocketClient) WaitForConfirmation(tx t // Received confirmation of subscription to event streams // TODO: collect subscription IDs, push into channel and on completion // unsubscribe - logging.InfoMsg(erisNodeWebsocketClient.logger, "Received confirmation for event", + logging.InfoMsg(burrowNodeWebsocketClient.logger, "Received confirmation for event", "event", subscription.Event, "subscription_id", subscription.SubscriptionId) continue @@ -106,7 +106,7 @@ func (erisNodeWebsocketClient *erisNodeWebsocketClient) WaitForConfirmation(tx t event, ok := (*result).(*ctypes.ResultEvent) if !ok { // keep calm and carry on - logging.InfoMsg(erisNodeWebsocketClient.logger, "Failed to cast to ResultEvent for websocket event", + logging.InfoMsg(burrowNodeWebsocketClient.logger, "Failed to cast to ResultEvent for websocket event", "event", event.Event) continue } @@ -114,22 +114,27 @@ func (erisNodeWebsocketClient *erisNodeWebsocketClient) WaitForConfirmation(tx t blockData, ok := event.Data.(txs.EventDataNewBlock) if ok { latestBlockHash = blockData.Block.Hash() - logging.TraceMsg(erisNodeWebsocketClient.logger, "Registered new block", + logging.TraceMsg(burrowNodeWebsocketClient.logger, "Registered new block", "block", blockData.Block, "latest_block_hash", latestBlockHash, ) continue } + // NOTE: [ben] hotfix on 0.16.1 because NewBlock events to arrive seemingly late + // we now miss events because of this redundant check; This check is safely removed + // because for CallTx on checking the transaction is not run in the EVM and no false + // positive event can be sent; neither is this check a good check for that. + // we don't accept events unless they came after a new block (ie. in) - if latestBlockHash == nil { - logging.InfoMsg(erisNodeWebsocketClient.logger, "First block has not been registered so ignoring event", - "event", event.Event) - continue - } + // if latestBlockHash == nil { + // logging.InfoMsg(burrowNodeWebsocketClient.logger, "First block has not been registered so ignoring event", + // "event", event.Event) + // continue + // } if event.Event != eid { - logging.InfoMsg(erisNodeWebsocketClient.logger, "Received unsolicited event", + logging.InfoMsg(burrowNodeWebsocketClient.logger, "Received unsolicited event", "event_received", event.Event, "event_expected", eid) continue @@ -148,7 +153,7 @@ func (erisNodeWebsocketClient *erisNodeWebsocketClient) WaitForConfirmation(tx t } if !bytes.Equal(txs.TxHash(chainId, data.Tx), txs.TxHash(chainId, tx)) { - logging.TraceMsg(erisNodeWebsocketClient.logger, "Received different event", + logging.TraceMsg(burrowNodeWebsocketClient.logger, "Received different event", // TODO: consider re-implementing TxID again, or other more clear debug "received transaction event", txs.TxHash(chainId, data.Tx)) continue @@ -192,21 +197,21 @@ func (erisNodeWebsocketClient *erisNodeWebsocketClient) WaitForConfirmation(tx t return confirmationChannel, nil } -func (erisNodeWebsocketClient *erisNodeWebsocketClient) Close() { - if erisNodeWebsocketClient.tendermintWebsocket != nil { - erisNodeWebsocketClient.tendermintWebsocket.Stop() +func (burrowNodeWebsocketClient *burrowNodeWebsocketClient) Close() { + if burrowNodeWebsocketClient.tendermintWebsocket != nil { + burrowNodeWebsocketClient.tendermintWebsocket.Stop() } } -func (erisNodeWebsocketClient *erisNodeWebsocketClient) assertNoErrors() error { - if erisNodeWebsocketClient.tendermintWebsocket != nil { +func (burrowNodeWebsocketClient *burrowNodeWebsocketClient) assertNoErrors() error { + if burrowNodeWebsocketClient.tendermintWebsocket != nil { select { - case err := <-erisNodeWebsocketClient.tendermintWebsocket.ErrorsCh: + case err := <-burrowNodeWebsocketClient.tendermintWebsocket.ErrorsCh: return err default: return nil } } else { - return fmt.Errorf("Eris-client has no websocket initialised.") + return fmt.Errorf("burrow-client has no websocket initialised.") } } diff --git a/cmd/eris-db.go b/cmd/burrow.go similarity index 70% rename from cmd/eris-db.go rename to cmd/burrow.go index 0530d7524bbd022bcf0c9a08828f11c9a2f146c2..3c101ff6b02467abf8faa420ad44ee6f0a899239 100644 --- a/cmd/eris-db.go +++ b/cmd/burrow.go @@ -21,14 +21,14 @@ import ( "github.com/spf13/cobra" - "github.com/monax/eris-db/definitions" - "github.com/monax/eris-db/version" + "github.com/monax/burrow/definitions" + "github.com/monax/burrow/version" ) -var ErisDbCmd = &cobra.Command{ - Use: "eris-db", - Short: "Eris-DB is the server side of the eris chain.", - Long: `Eris-DB is the server side of the eris chain. Eris-DB combines +var BurrowCmd = &cobra.Command{ + Use: "burrow", + Short: "burrow is the node server of a burrow chain", + Long: `burrow is the node server of a burrow chain. burrow combines a modular consensus engine and application manager to run a chain to suit your needs. @@ -43,34 +43,34 @@ func Execute() { do := definitions.NewDo() AddGlobalFlags(do) AddCommands(do) - ErisDbCmd.Execute() + BurrowCmd.Execute() } func AddGlobalFlags(do *definitions.Do) { - ErisDbCmd.PersistentFlags().BoolVarP(&do.Verbose, "verbose", "v", + BurrowCmd.PersistentFlags().BoolVarP(&do.Verbose, "verbose", "v", defaultVerbose(), - "verbose output; more output than no output flags; less output than debug level; default respects $ERIS_DB_VERBOSE") - ErisDbCmd.PersistentFlags().BoolVarP(&do.Debug, "debug", "d", defaultDebug(), - "debug level output; the most output available for eris-db; if it is too chatty use verbose flag; default respects $ERIS_DB_DEBUG") + "verbose output; more output than no output flags; less output than debug level; default respects $BURROW_VERBOSE") + BurrowCmd.PersistentFlags().BoolVarP(&do.Debug, "debug", "d", defaultDebug(), + "debug level output; the most output available for burrow; if it is too chatty use verbose flag; default respects $BURROW_DEBUG") } func AddCommands(do *definitions.Do) { - ErisDbCmd.AddCommand(buildServeCommand(do)) + BurrowCmd.AddCommand(buildServeCommand(do)) } //------------------------------------------------------------------------------ // Defaults -// defaultVerbose is set to false unless the ERIS_DB_VERBOSE environment +// defaultVerbose is set to false unless the BURROW_VERBOSE environment // variable is set to a parsable boolean. func defaultVerbose() bool { - return setDefaultBool("ERIS_DB_VERBOSE", false) + return setDefaultBool("BURROW_VERBOSE", false) } -// defaultDebug is set to false unless the ERIS_DB_DEBUG environment +// defaultDebug is set to false unless the BURROW_DEBUG environment // variable is set to a parsable boolean. func defaultDebug() bool { - return setDefaultBool("ERIS_DB_DEBUG", false) + return setDefaultBool("BURROW_DEBUG", false) } // setDefaultBool returns the provided default value if the environment variable diff --git a/cmd/eris-db/main.go b/cmd/burrow/main.go similarity index 94% rename from cmd/eris-db/main.go rename to cmd/burrow/main.go index 1366258ce126e8a46c9f7b590534ca965df808b4..6a391ea8af7260c9a5b74a26f1efb7b1c500b89f 100644 --- a/cmd/eris-db/main.go +++ b/cmd/burrow/main.go @@ -15,7 +15,7 @@ package main import ( - commands "github.com/monax/eris-db/cmd" + commands "github.com/monax/burrow/cmd" ) func main() { diff --git a/cmd/serve.go b/cmd/serve.go index 6090be57763c55c6ff9c6bb7a823c784152a1efb..d7bef47253cd695b5de6e978daa3b06716402343 100644 --- a/cmd/serve.go +++ b/cmd/serve.go @@ -21,11 +21,12 @@ import ( "path" "syscall" - "github.com/monax/eris-db/core" - "github.com/monax/eris-db/definitions" - "github.com/monax/eris-db/logging" - "github.com/monax/eris-db/logging/lifecycle" - "github.com/monax/eris-db/util" + "github.com/monax/burrow/core" + "github.com/monax/burrow/definitions" + "github.com/monax/burrow/logging" + "github.com/monax/burrow/logging/lifecycle" + vm "github.com/monax/burrow/manager/burrow-mint/evm" + "github.com/monax/burrow/util" "github.com/spf13/cobra" ) @@ -43,18 +44,18 @@ var DefaultConfigFilename = fmt.Sprintf("%s.%s", func buildServeCommand(do *definitions.Do) *cobra.Command { cmd := &cobra.Command{ Use: "serve", - Short: "Eris-DB serve starts an eris-db node with client API enabled by default.", - Long: `Eris-DB serve starts an eris-db node with client API enabled by default. -The Eris-DB node is modularly configured for the consensus engine and application + Short: "burrow serve starts a burrow node with client API enabled by default.", + Long: `burrow serve starts a burrow node with client API enabled by default. +The burrow node is modularly configured for the consensus engine and application manager. The client API can be disabled.`, - Example: fmt.Sprintf(`$ eris-db serve -- will start the Eris-DB node based on the configuration file "%s" in the current working directory -$ eris-db serve --work-dir <path-to-working-directory> -- will start the Eris-DB node based on the configuration file "%s" in the provided working directory -$ eris-db serve --chain-id <CHAIN_ID> -- will overrule the configuration entry assert_chain_id`, + Example: fmt.Sprintf(`$ burrow serve -- will start the burrow node based on the configuration file "%s" in the current working directory +$ burrow serve --work-dir <path-to-working-directory> -- will start the burrow node based on the configuration file "%s" in the provided working directory +$ burrow serve --chain-id <CHAIN_ID> -- will overrule the configuration entry assert_chain_id`, DefaultConfigFilename, DefaultConfigFilename), PreRun: func(cmd *cobra.Command, args []string) { - // if WorkDir was not set by a flag or by $ERIS_DB_WORKDIR + // if WorkDir was not set by a flag or by $BURROW_WORKDIR // NOTE [ben]: we can consider an `Explicit` flag that eliminates - // the use of any assumptions while starting Eris-DB + // the use of any assumptions while starting burrow if do.WorkDir == "" { if currentDirectory, err := os.Getwd(); err != nil { panic(fmt.Sprintf("No directory provided and failed to get current "+ @@ -80,11 +81,11 @@ func addServeFlags(do *definitions.Do, serveCmd *cobra.Command) { serveCmd.PersistentFlags().StringVarP(&do.ChainId, "chain-id", "c", defaultChainId(), "specify the chain id to use for assertion against the genesis file or the existing state. If omitted, and no id is set in $CHAIN_ID, then assert_chain_id is used from the configuration file.") serveCmd.PersistentFlags().StringVarP(&do.WorkDir, "work-dir", "w", - defaultWorkDir(), "specify the working directory for the chain to run. If omitted, and no path set in $ERIS_DB_WORKDIR, the current working directory is taken.") + defaultWorkDir(), "specify the working directory for the chain to run. If omitted, and no path set in $BURROW_WORKDIR, the current working directory is taken.") serveCmd.PersistentFlags().StringVarP(&do.DataDir, "data-dir", "", - defaultDataDir(), "specify the data directory. If omitted and not set in $ERIS_DB_DATADIR, <working_directory>/data is taken.") + defaultDataDir(), "specify the data directory. If omitted and not set in $BURROW_DATADIR, <working_directory>/data is taken.") serveCmd.PersistentFlags().BoolVarP(&do.DisableRpc, "disable-rpc", "", - defaultDisableRpc(), "indicate for the RPC to be disabled. If omitted the RPC is enabled by default, unless (deprecated) $ERISDB_API is set to false.") + defaultDisableRpc(), "indicate for the RPC to be disabled. If omitted the RPC is enabled by default, unless (deprecated) $BURROW_API is set to false.") } //------------------------------------------------------------------------------ @@ -149,7 +150,7 @@ func NewCoreFromDo(do *definitions.Do) (*core.Core, error) { } // ServeRunner() returns a command runner that prepares the environment and sets -// up the core for Eris-DB to run. After the setup succeeds, it starts the core +// up the core for burrow to run. After the setup succeeds, it starts the core // and waits for the core to terminate. func ServeRunner(do *definitions.Do) func(*cobra.Command, []string) { return func(cmd *cobra.Command, args []string) { @@ -161,6 +162,8 @@ func ServeRunner(do *definitions.Do) func(*cobra.Command, []string) { DefaultConfigFilename) } + vm.SetDebug(do.Debug) + newCore, err := NewCoreFromDo(do) if err != nil { @@ -203,21 +206,21 @@ func defaultChainId() string { } func defaultWorkDir() string { - // if ERIS_DB_WORKDIR environment variable is not set, keep do.WorkDir empty + // if BURROW_WORKDIR environment variable is not set, keep do.WorkDir empty // as do.WorkDir is set by the PreRun - return setDefaultString("ERIS_DB_WORKDIR", "") + return setDefaultString("BURROW_WORKDIR", "") } func defaultDataDir() string { // As the default data directory depends on the default working directory, // wait setting a default value, and initialise the data directory from serve() - return setDefaultString("ERIS_DB_DATADIR", "") + return setDefaultString("BURROW_DATADIR", "") } func defaultDisableRpc() bool { - // we currently observe environment variable ERISDB_API (true = enable) + // we currently observe environment variable BURROW_API (true = enable) // and default to enabling the RPC if it is not set. - // TODO: [ben] deprecate ERISDB_API across the stack for 0.12.1, and only disable + // TODO: [ben] deprecate BURROW_API across the stack for 0.12.1, and only disable // the rpc through a command line flag --disable-rpc - return !setDefaultBool("ERISDB_API", true) + return !setDefaultBool("BURROW_API", true) } diff --git a/common/random/random.go b/common/random/random.go index cfa3b58f94b8e7cdcd959eacd7f7be9cdd5a1912..b040189dcee2f0b73c90f0f810b20dbac4a2cb6c 100644 --- a/common/random/random.go +++ b/common/random/random.go @@ -19,7 +19,7 @@ import ( "math/rand" "time" - "github.com/monax/eris-db/common/sanity" + "github.com/monax/burrow/common/sanity" ) const ( diff --git a/config/config.go b/config/config.go index 97141bd4d34940e281f1b460756dad6781b4c7fb..fb6f1260059d04013d9d02786fa5346567c192eb 100644 --- a/config/config.go +++ b/config/config.go @@ -30,8 +30,8 @@ type ConfigServiceGeneral struct { // TODO: [ben] increase the configurability upon need type ConfigChainGeneral struct { AssertChainId string - ErisdbMajorVersion uint8 - ErisdbMinorVersion uint8 + BurrowMajorVersion uint8 + BurrowMinorVersion uint8 GenesisRelativePath string } @@ -74,23 +74,23 @@ func init() { } // NOTE: [ben] for 0.12.0-rc3 we only have a single configuration path -// with Tendermint in-process as the consensus engine and ErisMint +// with Tendermint in-process as the consensus engine and BurrowMint // in-process as the application manager, so we hard-code the few // parameters that are already templated. // Let's learn to walk before we can run. func GetConfigurationFileBytes(chainId, moniker, seeds string, chainImageName string, useDataContainer bool, exportedPortsString, containerEntrypoint string) ([]byte, error) { - erisdbService := &ConfigServiceGeneral{ + burrowService := &ConfigServiceGeneral{ ChainImageName: chainImageName, UseDataContainer: useDataContainer, ExportedPorts: exportedPortsString, ContainerEntrypoint: containerEntrypoint, } - erisdbChain := &ConfigChainGeneral{ + burrowChain := &ConfigChainGeneral{ AssertChainId: chainId, - ErisdbMajorVersion: uint8(0), - ErisdbMinorVersion: uint8(17), + BurrowMajorVersion: uint8(0), + BurrowMinorVersion: uint8(17), GenesisRelativePath: "genesis.json", } chainConsensusModule := &ConfigChainModule{ @@ -100,10 +100,10 @@ func GetConfigurationFileBytes(chainId, moniker, seeds string, chainImageName st ModuleRelativeRoot: "tendermint", } chainApplicationManagerModule := &ConfigChainModule{ - Name: "erismint", + Name: "burrowmint", MajorVersion: uint8(0), MinorVersion: uint8(17), - ModuleRelativeRoot: "erismint", + ModuleRelativeRoot: "burrowmint", } tendermintModule := &ConfigTendermint{ Moniker: moniker, @@ -121,16 +121,16 @@ func GetConfigurationFileBytes(chainId, moniker, seeds string, chainImageName st buffer.WriteString(headerCopyright) // write section [service] - if err := serviceGeneralTemplate.Execute(&buffer, erisdbService); err != nil { + if err := serviceGeneralTemplate.Execute(&buffer, burrowService); err != nil { return nil, fmt.Errorf("Failed to write template service general for %s: %s", chainId, err) } // write section for service dependencies; this is currently a static section - // with a fixed dependency on eris-keys + // with a fixed dependency on monax-keys buffer.WriteString(sectionServiceDependencies) // write section [chain] - if err := chainGeneralTemplate.Execute(&buffer, erisdbChain); err != nil { + if err := chainGeneralTemplate.Execute(&buffer, burrowChain); err != nil { return nil, fmt.Errorf("Failed to write template chain general for %s: %s", chainId, err) } @@ -167,8 +167,8 @@ func GetConfigurationFileBytes(chainId, moniker, seeds string, chainImageName st chainId, moniker, err) } - // write static section erismint - buffer.WriteString(sectionErisMint) + // write static section burrowmint + buffer.WriteString(sectionBurrowMint) return buffer.Bytes(), nil } @@ -181,5 +181,5 @@ func GetExampleConfigFileBytes() ([]byte, error) { "db:latest", true, "46657", - "eris-db") + "burrow") } diff --git a/config/config_test.go b/config/config_test.go index 1f5a95c1963a726173813cb84a0f1f920b84accd..67da505fd3d9346eac7fb575cf747d9bebcfb598 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -22,8 +22,6 @@ import ( "github.com/stretchr/testify/assert" ) -// Since the logic for generating configuration files (in eris-cm) is split from -// the logic for consuming them func TestGeneratedConfigIsUsable(t *testing.T) { bs, err := GetExampleConfigFileBytes() assert.NoError(t, err, "Should be able to create example config") diff --git a/config/templates.go b/config/templates.go index 433d8c8adec8e5c4ab05f695cc4e829ebebd9ea8..c53c43f0ce00a0b0bf50d21b75c8cf25c2202baa 100644 --- a/config/templates.go +++ b/config/templates.go @@ -28,16 +28,16 @@ const headerCopyright = `# Copyright 2017 Monax Industries Limited # See the License for the specific language governing permissions and # limitations under the License. -# This is a TOML configuration for Eris-DB chains generated by Eris. +# This is a TOML configuration for burrow chains generated by burrow config. ` const sectionServiceGeneral = `[service] -# NOTE: this section is read by Eris tooling, and ignored by eris-db. -# Image specifies the image name eris-cli needs to pull +# NOTE: this section is read by CLI tooling, and ignored by burrow. +# Image specifies the image name monax needs to pull # for running the chain. image = "{{.ChainImageName}}" -# Define whether eris-cli needs to attach the data container +# Define whether monax needs to attach the data container # for the chain. data_container = {{.UseDataContainer}} # Specify a list of ports that need to be exported on the container. @@ -49,8 +49,8 @@ entry_point = "{{.ContainerEntrypoint}}"{{ end }} ` const sectionServiceDependencies = `[dependencies] -# NOTE: this section is read by Eris tooling, and ignored by eris-db. -# Eris-db expects these services to be available; eric-cli tooling will +# NOTE: this section is read by Monax tooling, and ignored by burrow. +# burrow expects these services to be available; eric-cli tooling will # automatically set these services up for you. # Services to boot with/required by the chain services = [ "keys" ] @@ -64,9 +64,9 @@ const sectionChainGeneral = `[chain] # and the assertion here provides a safe-guard on misconfiguring chains. assert_chain_id = "{{.AssertChainId}}" # semantic major and minor version -major_version = {{.ErisdbMajorVersion}} -minor_version = {{.ErisdbMinorVersion}} -# genesis file, relative path is to eris-db working directory +major_version = {{.BurrowMajorVersion}} +minor_version = {{.BurrowMinorVersion}} +# genesis file, relative path is to burrow working directory genesis_file = "{{.GenesisRelativePath}}" ` @@ -105,7 +105,7 @@ const separatorChainApplicationManager = ` const sectionChainApplicationManager = ` [chain.manager] # application manager name defines the module to use for handling - # the transactions. Supported names are "erismint" + # the transactions. Supported names are "burrowmint" name = "{{.Name}}" # version is the major and minor semantic version; # the version will be asserted on @@ -127,7 +127,7 @@ const separatorServerConfiguration = ` ` -// TODO: [ben] map entries to structure defined in eris-db +// TODO: [ben] map entries to structure defined in burrow const sectionServers = `[servers] [servers.bind] @@ -195,14 +195,14 @@ const sectionTendermint = ` # private validator file is used by tendermint to keep the status # of the private validator, but also (currently) holds the private key # for the private vaildator to sign with. This private key needs to be moved -# out and directly managed by eris-keys +# out and directly managed by monax-keys # This file needs to be in the root directory private_validator_file = "priv_validator.json" # Tendermint requires additional configuration parameters. - # Eris-DB's tendermint consensus module will load [tendermint.configuration] + # burrow's tendermint consensus module will load [tendermint.configuration] # as the configuration for Tendermint. - # Eris-DB will respect the configurations set in this file where applicable, + # burrow will respect the configurations set in this file where applicable, # but reserves the option to override or block conflicting settings. [tendermint.configuration] # moniker is the name of the node on the tendermint p2p network @@ -276,10 +276,10 @@ private_validator_file = "priv_validator.json" ` -const sectionErisMint = ` +const sectionBurrowMint = ` ################################################################################ ## -## Eris-Mint +## Burrow-Mint ## version 0.17 ## ## The original Ethereum virtual machine with IAVL merkle trees @@ -287,8 +287,8 @@ const sectionErisMint = ` ## ################################################################################ -[erismint] -# Database backend to use for ErisMint state database. +[burrowmint] +# Database backend to use for BurrowMint state database. # Supported "leveldb" and "memdb". db_backend = "leveldb" # tendermint host address needs to correspond to tendermints configuration diff --git a/consensus/config.go b/consensus/config.go index c5039719dc60b26d43944dd249dcc7e45b8ced34..72bb13d6ec82782111411ffd7937c9cb05ded937 100644 --- a/consensus/config.go +++ b/consensus/config.go @@ -15,8 +15,8 @@ package consensus import ( - // noops "github.com/monax/eris-db/consensus/noops" - tendermint "github.com/monax/eris-db/consensus/tendermint" + // noops "github.com/monax/burrow/consensus/noops" + tendermint "github.com/monax/burrow/consensus/tendermint" ) //------------------------------------------------------------------------------ diff --git a/consensus/consensus.go b/consensus/consensus.go index df94a4580dcd7a1bbac22114b87f66e9b55c29aa..bbae9a5c88bde17afee0ba4af47bcb2b171085ce 100644 --- a/consensus/consensus.go +++ b/consensus/consensus.go @@ -17,9 +17,9 @@ package consensus import ( "fmt" - config "github.com/monax/eris-db/config" - tendermint "github.com/monax/eris-db/consensus/tendermint" - definitions "github.com/monax/eris-db/definitions" + config "github.com/monax/burrow/config" + tendermint "github.com/monax/burrow/consensus/tendermint" + definitions "github.com/monax/burrow/definitions" ) func LoadConsensusEngineInPipe(moduleConfig *config.ModuleConfig, diff --git a/consensus/tendermint/config.go b/consensus/tendermint/config.go index 1ee8c13e0bb9f55424dcfaa76c4eee318eaad405..4d905e62309081348ca7582d8c1b352178af684c 100644 --- a/consensus/tendermint/config.go +++ b/consensus/tendermint/config.go @@ -21,7 +21,7 @@ import ( "github.com/spf13/viper" tendermintConfig "github.com/tendermint/go-config" - "github.com/monax/eris-db/config" + "github.com/monax/burrow/config" ) // NOTE [ben] Compiler check to ensure TendermintConfig successfully implements @@ -31,9 +31,9 @@ var _ tendermintConfig.Config = (*TendermintConfig)(nil) // Tendermint has a self-rolled configuration type defined // in tendermint/go-config but over an interface type, which is implemented // by default in tendermint/tendermint/config/tendermint.go -// However, for Eris-DB purposes we can choose different rules for how to load +// However, for burrow purposes we can choose different rules for how to load // the tendermint configuration and set the defaults. Hence we re-implement -// go-config.Config on a viper subtree of the loaded Eris-DB configuration file. +// go-config.Config on a viper subtree of the loaded burrow configuration file. type TendermintConfig struct { subTree *viper.Viper } diff --git a/consensus/tendermint/tendermint.go b/consensus/tendermint/tendermint.go index 89008be0e7a61f1795ae20f4d883f273ebab3792..bf135266b88aa7faafcf0141e482840ec6d98ee2 100644 --- a/consensus/tendermint/tendermint.go +++ b/consensus/tendermint/tendermint.go @@ -27,16 +27,16 @@ import ( proxy "github.com/tendermint/tendermint/proxy" tendermint_types "github.com/tendermint/tendermint/types" - edb_event "github.com/monax/eris-db/event" - - config "github.com/monax/eris-db/config" - manager_types "github.com/monax/eris-db/manager/types" - // files "github.com/monax/eris-db/files" - blockchain_types "github.com/monax/eris-db/blockchain/types" - consensus_types "github.com/monax/eris-db/consensus/types" - "github.com/monax/eris-db/logging" - "github.com/monax/eris-db/logging/loggers" - "github.com/monax/eris-db/txs" + edb_event "github.com/monax/burrow/event" + + config "github.com/monax/burrow/config" + manager_types "github.com/monax/burrow/manager/types" + // files "github.com/monax/burrow/files" + blockchain_types "github.com/monax/burrow/blockchain/types" + consensus_types "github.com/monax/burrow/consensus/types" + "github.com/monax/burrow/logging" + "github.com/monax/burrow/logging/loggers" + "github.com/monax/burrow/txs" "github.com/tendermint/go-wire" ) @@ -48,7 +48,7 @@ type Tendermint struct { } // Compiler checks to ensure Tendermint successfully implements -// eris-db/definitions Consensus and Blockchain +// burrow/definitions Consensus and Blockchain var _ consensus_types.ConsensusEngine = (*Tendermint)(nil) var _ blockchain_types.Blockchain = (*Tendermint)(nil) @@ -103,7 +103,7 @@ func NewTendermint(moduleConfig *config.ModuleConfig, "privValFile", moduleConfig.Config.GetString("private_validator_file")) // TODO: [ben] do not "or Generate Validator keys", rather fail directly - // TODO: [ben] implement the signer for Private validator over eris-keys + // TODO: [ben] implement the signer for Private validator over monax-keys // TODO: [ben] copy from rootDir to tendermint workingDir; privateValidator := tendermint_types.LoadOrGenPrivValidator( path.Join(moduleConfig.RootDir, diff --git a/consensus/tendermint/version.go b/consensus/tendermint/version.go index 1729a2d19227f23af12a034d64fd3f111ff4a011..98bc8ddb8d6a39f2c17743171bbee87cedce7d41 100644 --- a/consensus/tendermint/version.go +++ b/consensus/tendermint/version.go @@ -19,7 +19,7 @@ import ( tendermint_version "github.com/tendermint/tendermint/version" - version "github.com/monax/eris-db/version" + version "github.com/monax/burrow/version" ) const ( diff --git a/consensus/types/consensus_engine.go b/consensus/types/consensus_engine.go index 03de76f7d05305878a31621942c247da799a7459..8bbde159014f27640aa766aa5ebef780530a083b 100644 --- a/consensus/types/consensus_engine.go +++ b/consensus/types/consensus_engine.go @@ -15,8 +15,8 @@ package types import ( - "github.com/monax/eris-db/event" - "github.com/monax/eris-db/txs" + "github.com/monax/burrow/event" + "github.com/monax/burrow/txs" abci_types "github.com/tendermint/abci/types" "github.com/tendermint/go-crypto" "github.com/tendermint/go-p2p" diff --git a/core/config.go b/core/config.go index 6c81d1b1947296a8468bc8a9742cd69bc2dd6599..41ac8a97a9cf4701c00f1e51027e38905a7384d5 100644 --- a/core/config.go +++ b/core/config.go @@ -13,7 +13,7 @@ // limitations under the License. // config.go keeps explicit structures on the runtime configuration of -// Eris-DB and all modules. It loads these from the Viper configuration +// burrow and all modules. It loads these from the Viper configuration // loaded in `definitions.Do` package core @@ -23,14 +23,14 @@ import ( "os" "path" - "github.com/monax/eris-db/config" - "github.com/monax/eris-db/consensus" - "github.com/monax/eris-db/definitions" - "github.com/monax/eris-db/logging" - "github.com/monax/eris-db/manager" - "github.com/monax/eris-db/server" - "github.com/monax/eris-db/util" - "github.com/monax/eris-db/version" + "github.com/monax/burrow/config" + "github.com/monax/burrow/consensus" + "github.com/monax/burrow/definitions" + "github.com/monax/burrow/logging" + "github.com/monax/burrow/manager" + "github.com/monax/burrow/server" + "github.com/monax/burrow/util" + "github.com/monax/burrow/version" "github.com/spf13/viper" ) @@ -91,7 +91,7 @@ func LoadModuleConfig(conf *viper.Viper, rootWorkDir, rootDataDir, Version: minorVersionString, WorkDir: workDir, DataDir: dataDir, - RootDir: rootWorkDir, // Eris-DB's working directory + RootDir: rootWorkDir, // burrow's working directory ChainId: chainId, GenesisFile: genesisFile, Config: subConfig, diff --git a/core/core.go b/core/core.go index 5efbe8c35a20bfb2b269c9904e40523ff90c4fec..35c25e8fa143e43a6043144d9fd1d561bae811f1 100644 --- a/core/core.go +++ b/core/core.go @@ -17,22 +17,22 @@ package core import ( "fmt" - // TODO: [ben] swap out go-events with eris-db/event (currently unused) + // TODO: [ben] swap out go-events with burrow/event (currently unused) events "github.com/tendermint/go-events" - "github.com/monax/eris-db/config" - "github.com/monax/eris-db/consensus" - "github.com/monax/eris-db/definitions" - "github.com/monax/eris-db/event" - "github.com/monax/eris-db/manager" - // rpc_v0 is carried over from Eris-DBv0.11 and before on port 1337 - rpc_v0 "github.com/monax/eris-db/rpc/v0" - // rpc_tendermint is carried over from Eris-DBv0.11 and before on port 46657 + "github.com/monax/burrow/config" + "github.com/monax/burrow/consensus" + "github.com/monax/burrow/definitions" + "github.com/monax/burrow/event" + "github.com/monax/burrow/manager" + // rpc_v0 is carried over from burrowv0.11 and before on port 1337 + rpc_v0 "github.com/monax/burrow/rpc/v0" + // rpc_tendermint is carried over from burrowv0.11 and before on port 46657 - "github.com/monax/eris-db/logging" - "github.com/monax/eris-db/logging/loggers" - rpc_tendermint "github.com/monax/eris-db/rpc/tendermint/core" - "github.com/monax/eris-db/server" + "github.com/monax/burrow/logging" + "github.com/monax/burrow/logging/loggers" + rpc_tendermint "github.com/monax/burrow/rpc/tendermint/core" + "github.com/monax/burrow/server" ) // Core is the high-level structure @@ -47,7 +47,7 @@ func NewCore(chainId string, consensusConfig *config.ModuleConfig, managerConfig *config.ModuleConfig, logger loggers.InfoTraceLogger) (*Core, error) { - // start new event switch, TODO: [ben] replace with eris-db/event + // start new event switch, TODO: [ben] replace with burrow/event evsw := events.NewEventSwitch() evsw.Start() logger = logging.WithScope(logger, "Core") @@ -86,15 +86,15 @@ func NewCore(chainId string, //------------------------------------------------------------------------------ // Server functions // NOTE: [ben] in phase 0 we exactly take over the full server architecture -// from Eris-DB and Tendermint; This is a draft and will be overhauled. +// from burrow and Tendermint; This is a draft and will be overhauled. func (core *Core) NewGatewayV0(config *server.ServerConfig) (*server.ServeProcess, error) { codec := &rpc_v0.TCodec{} eventSubscriptions := event.NewEventSubscriptions(core.pipe.Events()) // The services. - tmwss := rpc_v0.NewErisDbWsService(codec, core.pipe) - tmjs := rpc_v0.NewErisDbJsonService(codec, core.pipe, eventSubscriptions) + tmwss := rpc_v0.NewBurrowWsService(codec, core.pipe) + tmjs := rpc_v0.NewBurrowJsonService(codec, core.pipe, eventSubscriptions) // The servers. jsonServer := rpc_v0.NewJsonRpcServer(tmjs) restServer := rpc_v0.NewRestServer(codec, core.pipe, eventSubscriptions) diff --git a/core/types/types.go b/core/types/types.go index 6e970dab7c955cc55be66dfee0bfb30c208345f8..130be6d63f2f0c370dcac25a2b86efbc1a0f0370 100644 --- a/core/types/types.go +++ b/core/types/types.go @@ -15,14 +15,14 @@ package types // TODO: [ben] this is poorly constructed but copied over -// from eris-db/erisdb/pipe/types to make incremental changes and allow +// from burrow/burrow/pipe/types to make incremental changes and allow // for a discussion around the proper defintion of the needed types. import ( // NodeInfo (drop this!) "github.com/tendermint/tendermint/types" - account "github.com/monax/eris-db/account" + account "github.com/monax/burrow/account" ) type ( diff --git a/definitions/client_do.go b/definitions/client_do.go index dc7c9c7e2f534a7eae150aac095bf40ba249012c..fc0f25faf9bf4329996acd0360d9d303caf02ee0 100644 --- a/definitions/client_do.go +++ b/definitions/client_do.go @@ -17,17 +17,17 @@ package definitions type ClientDo struct { // Persistent flags not reflected in the configuration files // only set through command line flags or environment variables - Debug bool // ERIS_DB_DEBUG - Verbose bool // ERIS_DB_VERBOSE + Debug bool // BURROW_DEBUG + Verbose bool // BURROW_VERBOSE - // Following parameters are global flags for eris-client tx + // Following parameters are global flags for burrow-client tx SignAddrFlag string NodeAddrFlag string PubkeyFlag string AddrFlag string ChainidFlag string - // signFlag bool // TODO: remove; unsafe signing without eris-keys + // signFlag bool // TODO: remove; unsafe signing without monax-keys BroadcastFlag bool WaitFlag bool diff --git a/definitions/do.go b/definitions/do.go index 4a99734afda53bbb7e378f65c4cca8837bab695c..56ff9e6c5a4d6558cd4079c79aaf07f6f2e1d008 100644 --- a/definitions/do.go +++ b/definitions/do.go @@ -20,21 +20,21 @@ import ( viper "github.com/spf13/viper" - util "github.com/monax/eris-db/util" + util "github.com/monax/burrow/util" ) type Do struct { // Persistent flags not reflected in the configuration files // only set through command line flags or environment variables - Debug bool // ERIS_DB_DEBUG - Verbose bool // ERIS_DB_VERBOSE + Debug bool // BURROW_DEBUG + Verbose bool // BURROW_VERBOSE - // Work directory is the root directory for Eris-DB to act in - WorkDir string // ERIS_DB_WORKDIR + // Work directory is the root directory for burrow to act in + WorkDir string // BURROW_WORKDIR // Data directory is defaulted to WorkDir + `/data`. - // If Eris-CLI maps a data container, DataDir is intended to point + // If cli maps a data container, DataDir is intended to point // to that mapped data directory. - DataDir string // ERIS_DB_DATADIR + DataDir string // BURROW_DATADIR // Capital configuration options explicitly extracted from the Viper config ChainId string // has to be set to non-empty string, @@ -65,13 +65,13 @@ func NewDo() *Do { } // ReadConfig uses Viper to set the configuration file name, file format -// where Eris-DB currently only uses `toml`. +// where burrow currently only uses `toml`. // The search directory is explicitly limited to a single location to // minimise the chance of loading the wrong configuration file. func (d *Do) ReadConfig(directory string, name string, configType string) error { // name of the configuration file without extension d.Config.SetConfigName(name) - // Eris-DB currently only uses "toml" + // burrow currently only uses "toml" d.Config.SetConfigType(configType) // look for configuration file in the working directory d.Config.AddConfigPath(directory) diff --git a/definitions/pipe.go b/definitions/pipe.go index d771f3b9f6faac072c62b390db047857a6715a1f..a474a27111726e81bdadcef2de4eeacd38c7ea67 100644 --- a/definitions/pipe.go +++ b/definitions/pipe.go @@ -14,24 +14,24 @@ package definitions -// TODO: [ben] This respects the old Pipe interface from Eris-DB. +// TODO: [ben] This respects the old Pipe interface from burrow. // This made sense as a wrapper around the old Tendermint, but now // it strongly reflects the internal details of old Tendermint outwards // and provides little value as an abstraction. -// The refactor needed here for eris-db-0.12.1 is to expose a language +// The refactor needed here for burrow-0.12.1 is to expose a language // of transactions, block verification and accounts, grouping // these interfaces into an Engine, Communicator, NameReg, Permissions (suggestion) import ( - account "github.com/monax/eris-db/account" - blockchain_types "github.com/monax/eris-db/blockchain/types" - consensus_types "github.com/monax/eris-db/consensus/types" - core_types "github.com/monax/eris-db/core/types" - types "github.com/monax/eris-db/core/types" - event "github.com/monax/eris-db/event" - "github.com/monax/eris-db/logging/loggers" - manager_types "github.com/monax/eris-db/manager/types" - "github.com/monax/eris-db/txs" + account "github.com/monax/burrow/account" + blockchain_types "github.com/monax/burrow/blockchain/types" + consensus_types "github.com/monax/burrow/consensus/types" + core_types "github.com/monax/burrow/core/types" + types "github.com/monax/burrow/core/types" + event "github.com/monax/burrow/event" + "github.com/monax/burrow/logging/loggers" + manager_types "github.com/monax/burrow/manager/types" + "github.com/monax/burrow/txs" ) type Pipe interface { diff --git a/definitions/tendermint_pipe.go b/definitions/tendermint_pipe.go index b36257813d8d56d79f794fc3de934a70566964b6..176a8596f2934be83b9ecef1e1d2ff97c47a26be 100644 --- a/definitions/tendermint_pipe.go +++ b/definitions/tendermint_pipe.go @@ -15,15 +15,15 @@ package definitions import ( - "github.com/monax/eris-db/account" - rpc_tm_types "github.com/monax/eris-db/rpc/tendermint/core/types" - "github.com/monax/eris-db/txs" + "github.com/monax/burrow/account" + rpc_tm_types "github.com/monax/burrow/rpc/tendermint/core/types" + "github.com/monax/burrow/txs" ) // NOTE: [ben] TendermintPipe is the additional pipe to carry over -// the RPC exposed by old Tendermint on port `46657` (eris-db-0.11.4 and before) +// the RPC exposed by old Tendermint on port `46657` (burrow-0.11.4 and before) // This TendermintPipe interface should be deprecated and work towards a generic -// collection of RPC routes for Eris-DB-1.0.0 +// collection of RPC routes for burrow-1.0.0 type TendermintPipe interface { Pipe @@ -32,7 +32,7 @@ type TendermintPipe interface { // the event named event. The Event result is written to rpcResponseWriter // which must be non-blocking Subscribe(event string, - rpcResponseWriter func(result rpc_tm_types.ErisDBResult)) (*rpc_tm_types.ResultSubscribe, error) + rpcResponseWriter func(result rpc_tm_types.BurrowResult)) (*rpc_tm_types.ResultSubscribe, error) Unsubscribe(subscriptionId string) (*rpc_tm_types.ResultUnsubscribe, error) // Net diff --git a/deployment/README.md b/deployment/README.md new file mode 100644 index 0000000000000000000000000000000000000000..61e4a0cc92e46aad95f2120f9bbaebaa5acda6e8 --- /dev/null +++ b/deployment/README.md @@ -0,0 +1,18 @@ +### Deployment +Included in this directory are some template files for running Burrow in a +cluster orchestration environment. [start_in_cluster](start_in_cluster) +is a general purpose script and the files in [kubernetes](kubernetes) are some +example Service and Deployment files that illustrates its possible usage. + +#### start_in_cluster +[start_in_cluster](start_in_cluster) takes its parameters as environment variables. + +You can find the variables used at the top of the file along with their defaults. + +#### Kubernetes +[all_nodes.yml](kubernetes/all_nodes.yaml) is a Kubernetes Service definition +that launches an entire network of nodes based on Deployment definitions like the +example [node000-deploy.yaml](kubernetes/node000-deploy.yaml). Each validating +node should have it's own Deployment defintion like the one found in +[node000-deploy.yaml](kubernetes/node000-deploy.yaml) + diff --git a/deployment/kubernetes/all_nodes.yaml b/deployment/kubernetes/all_nodes.yaml new file mode 100644 index 0000000000000000000000000000000000000000..91a73702abf97499c8fe6c342b7e5e46b7fb13f0 --- /dev/null +++ b/deployment/kubernetes/all_nodes.yaml @@ -0,0 +1,37 @@ +# All Nodes - Load balanced API ports +kind: Service +apiVersion: v1 +metadata: + name: your-app-chain-api + labels: + app: your-app + tier: chain + chain_name: your-chain + vendor: monax +spec: + sessionAffinity: ClientIP + selector: + app: your-app + tier: chain + # node_number: "001" + ports: + - protocol: TCP + port: 1337 + targetPort: 1337 + name: your-app-chain-api + +# All Nodes - genesis.json as ConfigMap +--- +kind: ConfigMap +apiVersion: v1 +metadata: + name: your-app-ecosystem-chain-genesis + labels: + app: your-app-ecosystem + tier: chain + chain_name: your-app + vendor: monax +data: + chain-genesis: | + {"chain_id":"your-chain","accounts":[{"address":"BD1EA8ABA4B44094A406092922AF7CD92E01E5FE","amount":99999999999999,"name":"your-app_root_000","permissions":{"base":{"perms":16383,"set":16383},"roles":[]}},{"address":"E69B68990FECA85E06421859DBD4B2958C80A0D5","amount":9999999999,"name":"your-app_participant_000","permissions":{"base":{"perms":2118,"set":16383},"roles":[]}},{"address":"15416FC158C2D106B2994C82724B3DBBA47CDF79","amount":9999999999,"name":"your-app_participant_001","permissions":{"base":{"perms":2118,"set":16383},"roles":[]}},{"address":"EA6EBC0569495F98F159D533E8DD7D1D3DCFC80C","amount":9999999999,"name":"your-app_participant_002","permissions":{"base":{"perms":2118,"set":16383},"roles":[]}},{"address":"242075F27576B80F2A2805488E23203CBCBCBDFB","amount":99999999999999,"name":"your-app_validator_000","permissions":{"base":{"perms":16383,"set":16383},"roles":[]}},{"address":"8B84E223A42DEDC8C62A19F99C45C94B807BDFB6","amount":9999999999,"name":"your-app_validator_001","permissions":{"base":{"perms":32,"set":16383},"roles":[]}},{"address":"68AFC7ADB01A8CF8F9B93166D749F0067D250981","amount":9999999999,"name":"your-app_validator_002","permissions":{"base":{"perms":32,"set":16383},"roles":[]}},{"address":"443BAD24961BEE41F052C6B55AF58BDE9A4DB75F","amount":9999999999,"name":"your-app_validator_003","permissions":{"base":{"perms":32,"set":16383},"roles":[]}}],"validators":[{"pub_key":[1,"ED3EAEAAA735EC41A3625BB8AAC754A381A5726269E584B77A594E4197F2B516"],"name":"your-app_validator_000","amount":9999999998,"unbond_to":[{"address":"242075F27576B80F2A2805488E23203CBCBCBDFB","amount":9999999998}]},{"pub_key":[1,"F8F98DE0E65FBF8FBA5CE0813898F4E2FAFC34DD37FDB45B58D73B6D75DCB9AE"],"name":"your-app_validator_001","amount":9999999998,"unbond_to":[{"address":"8B84E223A42DEDC8C62A19F99C45C94B807BDFB6","amount":9999999998}]},{"pub_key":[1,"31D592F81F688AEE06B3124CBAC5AE3E04B5398A34325D4D32A25105B9588385"],"name":"your-app_validator_002","amount":9999999998,"unbond_to":[{"address":"68AFC7ADB01A8CF8F9B93166D749F0067D250981","amount":9999999998}]},{"pub_key":[1,"A1562215F9025DAA180B06C4DD9254D6B92C9F6C19219A359956941EB5924148"],"name":"your-app_validator_003","amount":9999999998,"unbond_to":[{"address":"443BAD24961BEE41F052C6B55AF58BDE9A4DB75F","amount":9999999998}]}]} + diff --git a/deployment/kubernetes/node000-deploy.yaml b/deployment/kubernetes/node000-deploy.yaml new file mode 100644 index 0000000000000000000000000000000000000000..b1d0dad538175382a2778589fe0237b62324346d --- /dev/null +++ b/deployment/kubernetes/node000-deploy.yaml @@ -0,0 +1,64 @@ +# Node 000 - Deployment +--- +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + name: your-app-ecosystem-chain-000 +spec: + replicas: 1 + template: + metadata: + labels: + app: your-app-ecosystem + tier: chain + node_number: "000" + chain_name: your-app + vendor: monax + spec: + containers: + - name: your-app-ecosystem-chain-000 + image: "your-app-ecosystem-chain:latest" + imagePullPolicy: IfNotPresent + env: + - name: CHAIN_NAME + value: your-chain + - name: CHAIN_NODE_NUMBER + value: "000" + - name: CHAIN_SEEDS + value: "your-app-chain-000:46656,your-app-chain-001:46656,your-app-chain-002:46656,your-app-chain-003:46656" + - name: CHAIN_API_PORT + value: "1337" + - name: CHAIN_PEER_PORT + value: "46656" + - name: CHAIN_RPC_PORT + value: "46657" + - name: CHAIN_LOG_LEVEL + value: notice + - name: CHAIN_GENESIS + valueFrom: + configMapKeyRef: + name: your-app-ecosystem-chain-genesis + key: chain-genesis + - name: KEY_ADDRESS + valueFrom: + secretKeyRef: + name: your-app-ecosystem-chain-000-keys + key: address + - name: KEY_PUBLIC + valueFrom: + secretKeyRef: + name: your-app-ecosystem-chain-000-keys + key: public-key + - name: KEY_PRIVATE + valueFrom: + secretKeyRef: + name: your-app-ecosystem-chain-000-keys + key: private-key + - name: ORGANIZATION_NAME + value: allianz + ports: + - containerPort: 46656 + - containerPort: 46657 + - containerPort: 1337 + restartPolicy: Always + diff --git a/deployment/start_in_cluster b/deployment/start_in_cluster new file mode 100755 index 0000000000000000000000000000000000000000..964edd9fbb1bb5637a20c3a56bda82f341e23be4 --- /dev/null +++ b/deployment/start_in_cluster @@ -0,0 +1,184 @@ +#!/usr/bin/env bash +set -e + +# This script is a wrapper for running burrow in a cluster, that is by a cluster +# orchestration environment like Kubernetes or Mesos + +# For why this is necessary see -> +# https://github.com/kubernetes/kubernetes/issues/23404 +CHAIN_NAME=$(echo $CHAIN_NAME | tr -d '\n') +CHAIN_NODE_NUMBER=$(echo $CHAIN_NODE_NUMBER | tr -d '\n') +CHAIN_SEEDS=$(echo $CHAIN_SEEDS | tr -d '\n') +MONAX_PATH=${MONAX_PATH:-$HOME/.monax} +MONAX_PATH=$(echo $MONAX_PATH | tr -d '\n') +KEY_ADDRESS=$(echo $KEY_ADDRESS | tr -d '\n') +KEY_PUBLIC=$(echo $KEY_PUBLIC | tr -d '\n') +KEY_PRIVATE=$(echo $KEY_PRIVATE | tr -d '\n') +ORG_NAME=$(echo $ORG_NAME | tr -d '\n') + +# Normal var setting +CHAIN_DIR=$MONAX_PATH/chains/$CHAIN_NAME +CHAIN_ID=${CHAIN_ID:-$CHAIN_NAME} +CHAIN_API_PORT=${CHAIN_API_PORT:-1337} +CHAIN_PEER_PORT=${CHAIN_PEER_PORT:-46656} +CHAIN_RPC_PORT=${CHAIN_RPC_PORT:-46657} +CHAIN_NODE_NUMBER=${CHAIN_NODE_NUMBER:-"000"} +CHAIN_SEEDS=${CHAIN_SEEDS:-""} +ORG_NAME=${ORG_NAME:-"myGreatOrg"} + +# All known variables should either have defaults set above, or checks here. +check() { + echo -e "\tChecking address of key." + [ -z "$KEY_ADDRESS" ] && { echo "Sad marmot face. Please set KEY_ADDRESS and re-run me."; exit 1; } + echo -e "\tChecking public key." + [ -z "$KEY_PUBLIC" ] && { echo "Sad marmot face. Please set KEY_PUBLIC and re-run me."; exit 1; } + echo -e "\tChecking private key." + [ -z "$KEY_PRIVATE" ] && { echo "Sad marmot face. Please set KEY_PRIVATE and re-run me."; exit 1; } + echo -e "\tChecking chain name." + [ -z "$CHAIN_NAME" ] && { echo "Sad marmot face. Please set CHAIN_NAME and re-run me."; exit 1; } + echo -e "\tChecking genesis." + if [ -z "$CHAIN_GENESIS" ] + then + if [ ! -e "$CHAIN_DIR"/genesis.json ] + then + echo "Sad marmot face. Please set CHAIN_GENESIS and re-run me." + exit 1 + fi + fi + echo -e "\tChecks complete." +} + +setup_dir() { + if [ ! -d "$CHAIN_DIR" ] + then + echo -e "\tChain dir does not exist. Creating." + mkdir -p $CHAIN_DIR + else + echo -e "\tChain dir exists. Not creating." + fi + cd $CHAIN_DIR + echo -e "\tChain dir setup." +} + +write_config() { + cat <<EOF > config.toml +[chain] +assert_chain_id = "$CHAIN_ID" +major_version = 0 +minor_version = 12 +genesis_file = "genesis.json" + [chain.consensus] + name = "tendermint" + major_version = 0 + minor_version = 6 + relative_root = "tendermint" + [chain.manager] + name = "burrowmint" + major_version = 0 + minor_version = 12 + relative_root = "burrowmint" +[servers] + [servers.bind] + address = "" + port = $CHAIN_API_PORT + [servers.tls] + tls = false + cert_path = "" + key_path = "" + [servers.cors] + enable = false + allow_origins = [] + allow_credentials = false + allow_methods = [] + allow_headers = [] + expose_headers = [] + max_age = 0 + [servers.http] + json_rpc_endpoint = "/rpc" + [servers.websocket] + endpoint = "/socketrpc" + max_sessions = 50 + read_buffer_size = 4096 + write_buffer_size = 4096 + [servers.tendermint] + rpc_local_address = "0.0.0.0:$CHAIN_RPC_PORT" + endpoint = "/websocket" +[tendermint] +private_validator_file = "priv_validator.json" + [tendermint.configuration] + moniker = "$CHAIN_NAME-$ORG_NAME-validator-$CHAIN_NODE_NUMBER" + seeds = "$CHAIN_SEEDS" + fast_sync = false + db_backend = "leveldb" + log_level = "$CHAIN_LOG_LEVEL" + node_laddr = "0.0.0.0:$CHAIN_PEER_PORT" + rpc_laddr = "0.0.0.0:$CHAIN_RPC_PORT" + proxy_app = "tcp://127.0.0.1:46658" + [tendermint.configuration.p2p] + dial_timeout_seconds = 3 + handshake_timeout_seconds = 20 + max_num_peers = 20 + authenticated_encryption = true + send_rate = 512000 + recv_rate = 512000 + fuzz_enable = false # use the fuzz wrapped conn + fuzz_active = false # toggle fuzzing + fuzz_mode = "drop" # eg. drop, delay + fuzz_max_delay_milliseconds = 3000 + fuzz_prob_drop_rw = 0.2 + fuzz_prob_drop_conn = 0.00 + fuzz_prob_sleep = 0.00 +[burrowmint] +db_backend = "leveldb" +tendermint_host = "0.0.0.0:$CHAIN_RPC_PORT" +EOF + echo -e "\tConfig file written." +} + +write_key_file() { + cat <<EOF > priv_validator.json +{ + "address": "$KEY_ADDRESS", + "pub_key": [ + 1, + "$KEY_PUBLIC" + ], + "priv_key": [ + 1, + "$KEY_PRIVATE" + ], + "last_height": 0, + "last_round": 0, + "last_step": 0 +} +EOF + echo -e "\tKey file written." +} + +write_genesis_file() { + [ -z "$CHAIN_GENESIS" ] && echo -e "\tUsing preloaded genesis file." && return 0 + echo -e "\tWriting genesis file from environment variables." + echo $CHAIN_GENESIS > genesis.json +} + +main() { + echo "Running pre-boot checks." + check + + echo "Setting up chain directory." + setup_dir + + echo "Writing config file." + write_config + + echo "Writing key file." + write_key_file + + echo "Writing genesis file." + write_genesis_file + + sleep 2 # hack to let the cluster provision echo "Starting burrow" + burrow serve +} + +main $@ \ No newline at end of file diff --git a/docs/PROPOSALS.md b/docs/PROPOSALS.md index 35cf450a7e304dd78522939496a6ff4bea93d504..fc2b5371123098c75f779e9066abea7fd6d8dd8d 100644 --- a/docs/PROPOSALS.md +++ b/docs/PROPOSALS.md @@ -1,4 +1,4 @@ -# Eris-db proposals for future work +# burrow proposals for future work The following list is extra-ordinarily uncommitted to and deliberately incomplete, but we thought it may be worthwhile sharing with you for soliciting your input and collaboration going forward: @@ -12,6 +12,6 @@ The following list is extra-ordinarily uncommitted to and deliberately incomplet #### Scalability and Governance - **Read-cache Optimisation and Queryability:** subjectively pipe the application state and event logs to a data warehousing solution. Building upon the read-cache the SQLsol prototype can be integrated as an SQL-opinionated transformation layer of smart contract events and data into a relational database. -- **Chain life-cycle management:** the tooling is the starting point for chain life-cycle management and will be extended with exporting snapshots of chain state. These snapshots can be used to administratively start a new network with an updated version of eris-db software as cold upgrade. In a second phase the Cosmos proposal is ideally suited to run a new version of the node software in parallel to existing chain and the validators of the network can atomically cast their vote of approval through the Cosmos hub to dynamically move the voting power over to the updated chain (hot upgrade) until a full vote of confidence is achieved. It is important to note that chain life-cycle management is complementary to and will support smart contract life-cycle management, known to some as DOUG, our marmot mascot. +- **Chain life-cycle management:** the tooling is the starting point for chain life-cycle management and will be extended with exporting snapshots of chain state. These snapshots can be used to administratively start a new network with an updated version of burrow software as cold upgrade. In a second phase the Cosmos proposal is ideally suited to run a new version of the node software in parallel to existing chain and the validators of the network can atomically cast their vote of approval through the Cosmos hub to dynamically move the voting power over to the updated chain (hot upgrade) until a full vote of confidence is achieved. It is important to note that chain life-cycle management is complementary to and will support smart contract life-cycle management, known to some as DOUG, our marmot mascot. - **Sharding and scalability framework:** interblockchain communication through the exchange of proofs leverages the peer-to-peer network - rather than oracles - to distribute the load across parallel chains and removes oracle-bridges as potential bottlenecks and security risks. -- **Light-client and ABI integration:** a significant usability upgrade of smart contract chains will be achieved through the ability for the ABI definition of the deployed smart contracts to be verifiably linked to the smart contract accounts. The introduction of the EIP-141 will enable the injection of an ABI fingerprint into smart contract code such that a light client, eris-worker can dynamically expose the smart contract functionality through API calls. As an aside it is worth noting that the tendermint consensus protocol provides a distinctive advantage for light-clients as the last block signed by a majority of validators is unambiguously the current state; +- **Light-client and ABI integration:** a significant usability upgrade of smart contract chains will be achieved through the ability for the ABI definition of the deployed smart contracts to be verifiably linked to the smart contract accounts. The introduction of the EIP-141 will enable the injection of an ABI fingerprint into smart contract code such that a light client, burrow-worker can dynamically expose the smart contract functionality through API calls. As an aside it is worth noting that the tendermint consensus protocol provides a distinctive advantage for light-clients as the last block signed by a majority of validators is unambiguously the current state; diff --git a/docs/specs/api.md b/docs/specs/api.md index 4454d792230555361e3a031a121418242dfb978a..11ec3a644cde70fa0f05027ce88d6cf1fdc6cea2 100644 --- a/docs/specs/api.md +++ b/docs/specs/api.md @@ -1,8 +1,8 @@ -# Eris DB web APIs (draft) +# Burrow web APIs (draft) -### for eris-db version 0.11.x +### for burrow version 0.11.x -Eris DB allows remote access to its functionality over http and websocket. It currently supports [JSON-RPC 2.0](http://www.jsonrpc.org/specification), and REST-like http. There is also javascript bindings available in the [erisdb-js](https://github.com/monax/eris-db.js) library. +Burrow allows remote access to its functionality over http and websocket. It currently supports [JSON-RPC 2.0](http://www.jsonrpc.org/specification), and REST-like http. There is also javascript bindings available in the [burrow-js](https://github.com/monax/burrow.js) library. ## TOC @@ -23,7 +23,7 @@ The only data format supported is JSON. All post requests needs to use `Content- <a name="json-rpc"></a> ## JSON RPC 2.0 -The default endpoints for JSON-RPC (2.0) is `/rpc` for http based, and `/socketrpc` for websocket. The namespace for the JSON-RPC service is `erisdb`. +The default endpoints for JSON-RPC (2.0) is `/rpc` for http based, and `/socketrpc` for websocket. The namespace for the JSON-RPC service is `burrow`. It does not yet support notifications or batched requests. @@ -79,7 +79,7 @@ Request: ``` { jsonrpc: "2.0", - method: "erisdb.getAccount", + method: "burrow.getAccount", params: {address: "37236DF251AB70022B1DA351F08A20FB52443E37"}, id="25" } @@ -473,73 +473,73 @@ See the [TransactNameReg](#transact-name-reg) method for more info about adding ###Accounts | Name | RPC method name | HTTP method | HTTP endpoint | | :--- | :-------------- | :---------: | :------------ | -| [GetAccounts](#get-accounts) | erisdb.getAccounts | GET | `/accounts` | -| [GetAccount](#get-account) | erisdb.getAccount | GET | `/accounts/:address` | -| [GetStorage](#get-storage) | erisdb.getStorage | GET | `/accounts/:address/storage` | -| [GetStorageAt](#get-storage-at) | erisdb.getStorageAt | GET | `/accounts/:address/storage/:key` | +| [GetAccounts](#get-accounts) | burrow.getAccounts | GET | `/accounts` | +| [GetAccount](#get-account) | burrow.getAccount | GET | `/accounts/:address` | +| [GetStorage](#get-storage) | burrow.getStorage | GET | `/accounts/:address/storage` | +| [GetStorageAt](#get-storage-at) | burrow.getStorageAt | GET | `/accounts/:address/storage/:key` | ###Blockchain | Name | RPC method name | HTTP method | HTTP endpoint | | :--- | :-------------- | :---------: | :------------ | -| [GetBlockchainInfo](#get-blockchain-info) | erisdb.getBlockchainInfo | GET | `/blockchain` | -| [GetChainId](#get-chain-id) | erisdb.getChainId | GET | `/blockchain/chain_id` | -| [GetGenesisHash](#get-genesis-hash) | erisdb.getGenesisHash | GET | `/blockchain/genesis_hash` | -| [GetLatestBlockHeight](#get-latest-block-height) | erisdb.getLatestBlockHeight | GET | `/blockchain/latest_block/height` | -| [GetLatestBlock](#get-latest-block) | erisdb.getLatestBlock | GET | `/blockchain/latest_block` | -| [GetBlocks](#get-blocks) | erisdb.getBlocks | GET | `/blockchain/blocks` | -| [GetBlock](#get-block) | erisdb.getBlock | GET | `/blockchain/blocks/:height` | +| [GetBlockchainInfo](#get-blockchain-info) | burrow.getBlockchainInfo | GET | `/blockchain` | +| [GetChainId](#get-chain-id) | burrow.getChainId | GET | `/blockchain/chain_id` | +| [GetGenesisHash](#get-genesis-hash) | burrow.getGenesisHash | GET | `/blockchain/genesis_hash` | +| [GetLatestBlockHeight](#get-latest-block-height) | burrow.getLatestBlockHeight | GET | `/blockchain/latest_block/height` | +| [GetLatestBlock](#get-latest-block) | burrow.getLatestBlock | GET | `/blockchain/latest_block` | +| [GetBlocks](#get-blocks) | burrow.getBlocks | GET | `/blockchain/blocks` | +| [GetBlock](#get-block) | burrow.getBlock | GET | `/blockchain/blocks/:height` | ###Consensus | Name | RPC method name | HTTP method | HTTP endpoint | | :--- | :-------------- | :---------: | :------------ | -| [GetConsensusState](#get-consensus-state) | erisdb.getConsensusState | GET | `/consensus` | -| [GetValidators](#get-validators) | erisdb.getValidators | GET | `/consensus/validators` | +| [GetConsensusState](#get-consensus-state) | burrow.getConsensusState | GET | `/consensus` | +| [GetValidators](#get-validators) | burrow.getValidators | GET | `/consensus/validators` | ###Events | Name | RPC method name | HTTP method | HTTP endpoint | | :--- | :-------------- | :---------: | :------------ | -| [EventSubscribe](#event-subscribe) | erisdb.eventSubscribe | POST | `/event_subs` | -| [EventUnsubscribe](#event-unsubscribe) | erisdb.eventUnsubscribe | DELETE | `/event_subs/:id` | -| [EventPoll](#event-poll) | erisdb.eventPoll | GET | `/event_subs/:id` | +| [EventSubscribe](#event-subscribe) | burrow.eventSubscribe | POST | `/event_subs` | +| [EventUnsubscribe](#event-unsubscribe) | burrow.eventUnsubscribe | DELETE | `/event_subs/:id` | +| [EventPoll](#event-poll) | burrow.eventPoll | GET | `/event_subs/:id` | ###Name-registry | Name | RPC method name | HTTP method | HTTP endpoint | | :--- | :-------------- | :---------: | :------------ | -| [GetNameRegEntry](#get-namereg-entry) | erisdb.getNameRegEntry | GET | `/namereg/:key` | -| [GetNameRegEntries](#get-namereg-entries) | erisdb.getNameRegEntries | GET | `/namereg` | +| [GetNameRegEntry](#get-namereg-entry) | burrow.getNameRegEntry | GET | `/namereg/:key` | +| [GetNameRegEntries](#get-namereg-entries) | burrow.getNameRegEntries | GET | `/namereg` | ###Network | Name | RPC method name | HTTP method | HTTP endpoint | | :--- | :-------------- | :---------: | :------------ | -| [GetNetworkInfo](#get-network-info) | erisdb.getNetworkInfo | GET | `/network` | -| [GetClientVersion](#get-client-version) | erisdb.getClientVersion | GET | `/network/client_version` | -| [GetMoniker](#get-moniker) | erisdb.getMoniker | GET | `/network/moniker` | -| [IsListening](#is-listening) | erisdb.isListening | GET | `/network/listening` | -| [GetListeners](#get-listeners) | erisdb.getListeners | GET | `/network/listeners` | -| [GetPeers](#get-peers) | erisdb.getPeers | GET | `/network/peers` | -| [GetPeer](#get-peer) | erisdb.getPeer | GET | `/network/peer/:address` | +| [GetNetworkInfo](#get-network-info) | burrow.getNetworkInfo | GET | `/network` | +| [GetClientVersion](#get-client-version) | burrow.getClientVersion | GET | `/network/client_version` | +| [GetMoniker](#get-moniker) | burrow.getMoniker | GET | `/network/moniker` | +| [IsListening](#is-listening) | burrow.isListening | GET | `/network/listening` | +| [GetListeners](#get-listeners) | burrow.getListeners | GET | `/network/listeners` | +| [GetPeers](#get-peers) | burrow.getPeers | GET | `/network/peers` | +| [GetPeer](#get-peer) | burrow.getPeer | GET | `/network/peer/:address` | NOTE: Get peer is not fully implemented. ###Transactions | Name | RPC method name | HTTP method | HTTP endpoint | | :--- | :-------------- | :---------: | :------------ | -| [BroadcastTx](#broadcast-tx) | erisdb.broadcastTx | POST | `/txpool` | -| [GetUnconfirmedTxs](#get-unconfirmed-txs) | erisdb.getUnconfirmedTxs | GET | `/txpool` | +| [BroadcastTx](#broadcast-tx) | burrow.broadcastTx | POST | `/txpool` | +| [GetUnconfirmedTxs](#get-unconfirmed-txs) | burrow.getUnconfirmedTxs | GET | `/txpool` | ###Code execution | Name | RPC method name | HTTP method | HTTP endpoint | | :--- | :-------------- | :---------: | :------------ | -| [Call](#call) | erisdb.call | POST | `/calls` | -| [CallCode](#call-code) | erisdb.callCode | POST | `/codecalls` | +| [Call](#call) | burrow.call | POST | `/calls` | +| [CallCode](#call-code) | burrow.callCode | POST | `/codecalls` | ####Unsafe | Name | RPC method name | HTTP method | HTTP endpoint | | :--- | :-------------- | :---------: | :------------ | -| [Transact](#transact) | erisdb.transact | POST | `/unsafe/txpool` | -| [Transact](#transact-and-hold) | erisdb.transactAndHold | POST | `/unsafe/txpool?hold=true` | -| [TransactNameReg](#transact-name-reg) | erisdb.transactNameReg | POST | `/unsafe/namereg/txpool` | -| [GenPrivAccount](#gen-priv-account) | erisdb.genPrivAccount | GET | `/unsafe/pa_generator` | +| [Transact](#transact) | burrow.transact | POST | `/unsafe/txpool` | +| [Transact](#transact-and-hold) | burrow.transactAndHold | POST | `/unsafe/txpool?hold=true` | +| [TransactNameReg](#transact-name-reg) | burrow.transactNameReg | POST | `/unsafe/namereg/txpool` | +| [GenPrivAccount](#gen-priv-account) | burrow.genPrivAccount | GET | `/unsafe/pa_generator` | Here are the catagories. @@ -577,7 +577,7 @@ Endpoint: `/accounts` #####JSON-RPC -Method: `erisdb.getAccounts` +Method: `burrow.getAccounts` Parameter: @@ -626,7 +626,7 @@ Params: The public `address` as a hex string. #####JSON-RPC -Method: `erisdb.getAccount` +Method: `burrow.getAccount` Parameter: @@ -678,7 +678,7 @@ Params: The public `address` as a hex string. #####JSON-RPC -Method: `erisdb.getStorage` +Method: `burrow.getStorage` Parameter: @@ -719,7 +719,7 @@ Params: The public `address` as a hex string, and the `key` as a hex string. #####JSON-RPC -Method: `erisdb.getStorageAt` +Method: `burrow.getStorageAt` Parameter: @@ -761,7 +761,7 @@ Endpoint: `/blockchain` #####JSON-RPC -Method: `erisdb.getBlockchainInfo` +Method: `burrow.getBlockchainInfo` Parameter: - @@ -802,7 +802,7 @@ Endpoint: `/blockchain/chain_id` #####JSON-RPC -Method: `erisdb.getChainId` +Method: `burrow.getChainId` Parameter: - @@ -828,7 +828,7 @@ Endpoint: `/blockchain/genesis_hash` #####JSON-RPC -Method: `erisdb.getGenesisHash` +Method: `burrow.getGenesisHash` Parameter: - @@ -855,7 +855,7 @@ Endpoint: `/blockchain/latest_block/height` #####JSON-RPC -Method: `erisdb.getLatestBlockHeight` +Method: `burrow.getLatestBlockHeight` Parameter: - @@ -882,7 +882,7 @@ Endpoint: `/blockchain/latest_block` #####JSON-RPC -Method: `erisdb.getLatestBlock` +Method: `burrow.getLatestBlock` Parameter: - @@ -913,7 +913,7 @@ Endpoint: `/blockchain/blocks` #####JSON-RPC -Method: `erisdb.getBlocks` +Method: `burrow.getBlocks` Parameter: @@ -991,7 +991,7 @@ Endpoint: `/blockchain/block/:number` #####JSON-RPC -Method: `erisdb.getBlock` +Method: `burrow.getBlock` Parameter: @@ -1066,7 +1066,7 @@ Endpoint: `/consensus` #####JSON-RPC -Method: `erisdb.getConsensusState` +Method: `burrow.getConsensusState` Parameter: - @@ -1117,7 +1117,7 @@ Endpoint: `/consensus/validators` #####JSON-RPC -Method: `erisdb.getValidators` +Method: `burrow.getValidators` Parameter: - @@ -1171,7 +1171,7 @@ Body: See JSON-RPC parameter. #####JSON-RPC -Method: `erisdb.eventSubscribe` +Method: `burrow.eventSubscribe` Parameter: @@ -1208,7 +1208,7 @@ Endpoint: `/event_subs/:id` #####JSON-RPC -Method: `erisdb.eventUnsubscribe` +Method: `burrow.eventUnsubscribe` Parameter: ``` @@ -1244,7 +1244,7 @@ Endpoint: `/event_subs/:id` #####JSON-RPC -Method: `erisdb.eventPoll` +Method: `burrow.eventPoll` #####Return value @@ -1277,7 +1277,7 @@ Endpoint: `/namereg` #####JSON-RPC -Method: `erisdb.getNameRegEntries` +Method: `burrow.getNameRegEntries` Parameter: @@ -1331,7 +1331,7 @@ Params: The key (a string) #####JSON-RPC -Method: `erisdb.getNameRegEntry` +Method: `burrow.getNameRegEntry` Parameter: @@ -1372,7 +1372,7 @@ Endpoint: `/network` #####JSON-RPC -Method: `erisdb.getNetworkInfo` +Method: `burrow.getNetworkInfo` Parameters: - @@ -1413,7 +1413,7 @@ Endpoint: `/network/client_version` #####JSON-RPC -Method: `erisdb.getClientVersion` +Method: `burrow.getClientVersion` Parameters: - @@ -1440,7 +1440,7 @@ Endpoint: `/network/moniker` #####JSON-RPC -Method: `erisdb.getMoniker` +Method: `burrow.getMoniker` Parameters: - @@ -1467,7 +1467,7 @@ Endpoint: `/network/listening` #####JSON-RPC -Method: `erisdb.isListening` +Method: `burrow.isListening` Parameters: - @@ -1494,7 +1494,7 @@ Endpoint: `/network/listeners` #####JSON-RPC -Method: `erisdb.getListeners` +Method: `burrow.getListeners` Parameters: - @@ -1521,7 +1521,7 @@ Endpoint: `/network/peers` #####JSON-RPC -Method: `erisdb.getPeers` +Method: `burrow.getPeers` Parameters: - @@ -1550,7 +1550,7 @@ Endpoint: `/network/peer/:address` #####JSON-RPC -Method: `erisdb.getPeer` +Method: `burrow.getPeer` Parameters: @@ -1609,7 +1609,7 @@ Body: #####JSON-RPC -Method: `erisdb.BroadcastTx` +Method: `burrow.BroadcastTx` Parameters: @@ -1652,7 +1652,7 @@ Endpoint: `/txpool` #####JSON-RPC -Method: `erisdb.getUnconfirmedTxs` +Method: `burrow.getUnconfirmedTxs` Parameters: - @@ -1691,7 +1691,7 @@ Body: See JSON-RPC parameter. #####JSON-RPC -Method: `erisdb.call` +Method: `burrow.call` Parameters: @@ -1732,7 +1732,7 @@ Body: See JSON-RPC parameter. #####JSON-RPC -Method: `erisdb.callCode` +Method: `burrow.callCode` Parameters: @@ -1755,7 +1755,7 @@ Parameters: #####Additional info `code` is a hex-string representation of compiled contract code. -`data` is a string of data formatted in accordance with the [contract ABI](https://github.com/monax/eris-contracts.js). +`data` is a string of data formatted in accordance with the [contract ABI](https://github.com/monax/legacy-contracts.js) *** @@ -1786,7 +1786,7 @@ Body: See JSON-RPC parameters. #####JSON-RPC -Method: `erisdb.transact` +Method: `burrow.transact` Parameters: @@ -1847,7 +1847,7 @@ Body: See JSON-RPC parameters. #####JSON-RPC -Method: `erisdb.transactAndHold` +Method: `burrow.transactAndHold` Parameters: @@ -1909,7 +1909,7 @@ Body: See JSON-RPC parameters. #####JSON-RPC -Method: `erisdb.transactNameReg` +Method: `burrow.transactNameReg` Parameters: @@ -1953,7 +1953,7 @@ Method: POST Endpoint: `/unsafe/pa_generator` #####JSON-RPC -Method: `erisdb.genPrivAccount` +Method: `burrow.genPrivAccount` Parameters: - diff --git a/event/event_cache.go b/event/event_cache.go index d5cc469c578022974a4dfd51d8727811de48d7b7..61c39e4833b801e39d6f076dcebd3a9ef395b161 100644 --- a/event/event_cache.go +++ b/event/event_cache.go @@ -19,7 +19,7 @@ import ( "sync" "time" - "github.com/monax/eris-db/txs" + "github.com/monax/burrow/txs" ) var ( diff --git a/event/event_cache_test.go b/event/event_cache_test.go index 56ba5a996a30db63f1e2a93e7882345bc5d7f365..79846039ee9d1c9040f2db1a2176766036e77c8d 100644 --- a/event/event_cache_test.go +++ b/event/event_cache_test.go @@ -23,7 +23,7 @@ import ( "sync" - "github.com/monax/eris-db/txs" + "github.com/monax/burrow/txs" "github.com/stretchr/testify/assert" ) diff --git a/event/events.go b/event/events.go index 1cb16e61f99cd52b12c0cb49001dcdc48f6ae43c..c59b30491622873b357a9fe9a8700349baec38bb 100644 --- a/event/events.go +++ b/event/events.go @@ -21,9 +21,9 @@ import ( "fmt" - "github.com/monax/eris-db/logging" - "github.com/monax/eris-db/logging/loggers" - "github.com/monax/eris-db/txs" + "github.com/monax/burrow/logging" + "github.com/monax/burrow/logging/loggers" + "github.com/monax/burrow/txs" go_events "github.com/tendermint/go-events" tm_types "github.com/tendermint/tendermint/types" ) diff --git a/event/events_test.go b/event/events_test.go index f516c835bc6ec09604e0ad202ec49fda0c695484..129bd54a54baafcf60060260d38c82ec4e52e394 100644 --- a/event/events_test.go +++ b/event/events_test.go @@ -20,7 +20,7 @@ import ( "sync" "time" - "github.com/monax/eris-db/txs" + "github.com/monax/burrow/txs" "github.com/stretchr/testify/assert" ) diff --git a/files/log.go b/files/log.go index 3914c6c7b80df67fb9ad47a2f9e3714a81a4d19a..b07f421feff655f01a8762505ab1d5ff31a09391 100644 --- a/files/log.go +++ b/files/log.go @@ -18,4 +18,4 @@ import ( "github.com/tendermint/log15" ) -var log = log15.New("module", "eris/server/files") +var log = log15.New("module", "server/files") diff --git a/genesis/genesis.go b/genesis/genesis.go index 79d679121e53160815ef5dab82a475635a27746b..84b1a456cc3e99e62122a72e0ebd3f4c1b5e72d5 100644 --- a/genesis/genesis.go +++ b/genesis/genesis.go @@ -19,7 +19,7 @@ import ( "encoding/json" "time" - ptypes "github.com/monax/eris-db/permission/types" + ptypes "github.com/monax/burrow/permission/types" wire "github.com/tendermint/go-wire" ) diff --git a/genesis/make_genesis_file.go b/genesis/make_genesis_file.go index a8af9c20d9dad23f287d7f692caec048e4d5d05d..4ff28c04939417a7f0014707ec36f603823d18c9 100644 --- a/genesis/make_genesis_file.go +++ b/genesis/make_genesis_file.go @@ -24,8 +24,8 @@ import ( "strconv" "time" - ptypes "github.com/monax/eris-db/permission/types" - "github.com/monax/eris-db/util" + ptypes "github.com/monax/burrow/permission/types" + "github.com/monax/burrow/util" "github.com/tendermint/go-crypto" wire "github.com/tendermint/go-wire" diff --git a/genesis/maker.go b/genesis/maker.go index 5deaaed49a2f127f7d02cd74d3d5f498c26da138..89ade705d5504fdc1630f7ab25b4195cedea8309 100644 --- a/genesis/maker.go +++ b/genesis/maker.go @@ -17,7 +17,7 @@ package genesis import ( "fmt" - ptypes "github.com/monax/eris-db/permission/types" + ptypes "github.com/monax/burrow/permission/types" "github.com/tendermint/go-crypto" ) diff --git a/genesis/types.go b/genesis/types.go index 849f6e4dd507239580404cb236547ffee0b39d97..efa06b8d2316e1ad2a9731f3f8080d183ff134ce 100644 --- a/genesis/types.go +++ b/genesis/types.go @@ -19,7 +19,7 @@ import ( "os" "time" - ptypes "github.com/monax/eris-db/permission/types" + ptypes "github.com/monax/burrow/permission/types" "github.com/tendermint/go-crypto" "github.com/tendermint/go-wire" diff --git a/glide.lock b/glide.lock index 697d406e51da1399b2baef709925c2774e1801b6..10bcdcad4c5ac8966a9786a9952e5f7194b471b1 100644 --- a/glide.lock +++ b/glide.lock @@ -78,7 +78,7 @@ imports: - name: github.com/manucorporat/sse version: ee05b128a739a0fb76c7ebd3ae4810c1de808d6d - name: github.com/Masterminds/glide - version: 84607742b10f492430762d038e954236bbaf23f7 + version: 869001d1571ce5f03fd0078bff188b9d3f272807 - name: github.com/mattn/go-colorable version: d228849504861217f796da67fae4f6e347643f15 - name: github.com/mattn/go-isatty @@ -245,5 +245,5 @@ imports: - name: gopkg.in/tylerb/graceful.v1 version: ecde8c8f16df93a994dda8936c8f60f0c26c28ab - name: gopkg.in/yaml.v2 - version: a83829b6f1293c91addabc89d0571c246397bbf4 + version: a5b47d31c556af34a302ce5d659e6fea44d90de0 testImports: [] diff --git a/glide.yaml b/glide.yaml index 684e3a38e2ef810aebb99a90b8582efb2e99d9d1..507eaf1221100abbac1dad1f090f898a6f37100e 100644 --- a/glide.yaml +++ b/glide.yaml @@ -1,4 +1,4 @@ -package: github.com/monax/eris-db +package: github.com/monax/burrow import: - package: github.com/spf13/cobra - package: github.com/spf13/viper diff --git a/keys/key_client.go b/keys/key_client.go index 42dbafae2b1002217237600cee9437a11af4ea60..b96fa35b085d8e485733554a1b2bc85c30d15388 100644 --- a/keys/key_client.go +++ b/keys/key_client.go @@ -18,8 +18,8 @@ import ( "encoding/hex" "fmt" - "github.com/monax/eris-db/logging" - "github.com/monax/eris-db/logging/loggers" + "github.com/monax/burrow/logging" + "github.com/monax/burrow/logging/loggers" ) type KeyClient interface { @@ -30,33 +30,33 @@ type KeyClient interface { PublicKey(address []byte) (publicKey []byte, err error) } -// NOTE [ben] Compiler check to ensure erisKeyClient successfully implements -// eris-db/keys.KeyClient -var _ KeyClient = (*erisKeyClient)(nil) +// NOTE [ben] Compiler check to ensure monaxKeyClient successfully implements +// burrow/keys.KeyClient +var _ KeyClient = (*monaxKeyClient)(nil) -type erisKeyClient struct { +type monaxKeyClient struct { rpcString string logger loggers.InfoTraceLogger } -// erisKeyClient.New returns a new eris-keys client for provided rpc location -// Eris-keys connects over http request-responses -func NewErisKeyClient(rpcString string, logger loggers.InfoTraceLogger) *erisKeyClient { - return &erisKeyClient{ +// monaxKeyClient.New returns a new monax-keys client for provided rpc location +// Monax-keys connects over http request-responses +func NewBurrowKeyClient(rpcString string, logger loggers.InfoTraceLogger) *monaxKeyClient { + return &monaxKeyClient{ rpcString: rpcString, - logger: logging.WithScope(logger, "ErisKeysClient"), + logger: logging.WithScope(logger, "BurrowKeyClient"), } } -// Eris-keys client Sign requests the signature from ErisKeysClient over rpc for the given +// Monax-keys client Sign requests the signature from BurrowKeysClient over rpc for the given // bytes to be signed and the address to sign them with. -func (erisKeys *erisKeyClient) Sign(signBytesString string, signAddress []byte) (signature []byte, err error) { +func (monaxKeys *monaxKeyClient) Sign(signBytesString string, signAddress []byte) (signature []byte, err error) { args := map[string]string{ "msg": signBytesString, "hash": signBytesString, // TODO:[ben] backwards compatibility "addr": fmt.Sprintf("%X", signAddress), } - sigS, err := RequestResponse(erisKeys.rpcString, "sign", args, erisKeys.logger) + sigS, err := RequestResponse(monaxKeys.rpcString, "sign", args, monaxKeys.logger) if err != nil { return } @@ -67,13 +67,13 @@ func (erisKeys *erisKeyClient) Sign(signBytesString string, signAddress []byte) return sigBytes, err } -// Eris-keys client PublicKey requests the public key associated with an address from -// the eris-keys server. -func (erisKeys *erisKeyClient) PublicKey(address []byte) (publicKey []byte, err error) { +// Monax-keys client PublicKey requests the public key associated with an address from +// the monax-keys server. +func (monaxKeys *monaxKeyClient) PublicKey(address []byte) (publicKey []byte, err error) { args := map[string]string{ "addr": fmt.Sprintf("%X", address), } - pubS, err := RequestResponse(erisKeys.rpcString, "pub", args, erisKeys.logger) + pubS, err := RequestResponse(monaxKeys.rpcString, "pub", args, monaxKeys.logger) if err != nil { return } diff --git a/keys/key_client_util.go b/keys/key_client_util.go index 174523b40223e71d2f5688d5da19adb1cc752a2b..0777d7a1f0b3f605f5a41c68a670e50f81272ee3 100644 --- a/keys/key_client_util.go +++ b/keys/key_client_util.go @@ -21,11 +21,11 @@ import ( "io/ioutil" "net/http" - "github.com/monax/eris-db/logging" - "github.com/monax/eris-db/logging/loggers" + "github.com/monax/burrow/logging" + "github.com/monax/burrow/logging/loggers" ) -// Eris-Keys server connects over http request-response structures +// Monax-Keys server connects over http request-response structures type HTTPResponse struct { Response string @@ -49,10 +49,10 @@ func RequestResponse(addr, method string, args map[string]string, logger loggers req.Header.Add("Content-Type", "application/json") res, errS, err := requestResponse(req) if err != nil { - return "", fmt.Errorf("Error calling eris-keys at %s: %s", endpoint, err.Error()) + return "", fmt.Errorf("Error calling monax-keys at %s: %s", endpoint, err.Error()) } if errS != "" { - return "", fmt.Errorf("Error (string) calling eris-keys at %s: %s", endpoint, errS) + return "", fmt.Errorf("Error (string) calling monax-keys at %s: %s", endpoint, errS) } logging.TraceMsg(logger, "Received response from key server", "endpoint", endpoint, diff --git a/keys/mock/key_client_mock.go b/keys/mock/key_client_mock.go index d71e1bdc5f53103b346e97546e9759d6520e7c82..7a3619d6fed2973122c367e7bd17afd21b3a3881 100644 --- a/keys/mock/key_client_mock.go +++ b/keys/mock/key_client_mock.go @@ -19,7 +19,7 @@ import ( "encoding/hex" "fmt" - . "github.com/monax/eris-db/keys" + . "github.com/monax/burrow/keys" // NOTE: prior to building out /crypto, use // tendermint/go-crypto for the mock client @@ -67,7 +67,7 @@ func (mockKey *MockKey) Sign(message []byte) ([]byte, error) { } //--------------------------------------------------------------------- -// Mock client for replacing signing done by eris-keys +// Mock client for replacing signing done by monax-keys // Implementation assertion var _ KeyClient = (*MockKeyClient)(nil) diff --git a/logging/adapters/stdlib/capture.go b/logging/adapters/stdlib/capture.go index 5e8670f2266ac08129b02db09d3e3810373ae0d2..c338556ac31a28d8a8e9714d579f78bd034d9a07 100644 --- a/logging/adapters/stdlib/capture.go +++ b/logging/adapters/stdlib/capture.go @@ -19,7 +19,7 @@ import ( "log" kitlog "github.com/go-kit/kit/log" - "github.com/monax/eris-db/logging/loggers" + "github.com/monax/burrow/logging/loggers" ) func Capture(stdLibLogger log.Logger, diff --git a/logging/adapters/tendermint_log15/capture.go b/logging/adapters/tendermint_log15/capture.go index 46053ae4722894a6823cc53a69ab23d475c63625..f7bcfc9608be72292ba96578adef02dc7fa6f311 100644 --- a/logging/adapters/tendermint_log15/capture.go +++ b/logging/adapters/tendermint_log15/capture.go @@ -16,7 +16,7 @@ package adapters import ( kitlog "github.com/go-kit/kit/log" - "github.com/monax/eris-db/logging/loggers" + "github.com/monax/burrow/logging/loggers" "github.com/tendermint/log15" ) diff --git a/logging/adapters/tendermint_log15/convert.go b/logging/adapters/tendermint_log15/convert.go index f30f36e0e39049f51816ab4d881ee80db9e06ee8..419548a27be7a6f5e4a86ffa1d75aabebc082025 100644 --- a/logging/adapters/tendermint_log15/convert.go +++ b/logging/adapters/tendermint_log15/convert.go @@ -18,9 +18,9 @@ import ( "time" "github.com/go-stack/stack" - "github.com/monax/eris-db/logging/loggers" - "github.com/monax/eris-db/logging/structure" - . "github.com/monax/eris-db/util/slice" + "github.com/monax/burrow/logging/loggers" + "github.com/monax/burrow/logging/structure" + . "github.com/monax/burrow/util/slice" "github.com/tendermint/log15" ) diff --git a/logging/convention.go b/logging/convention.go index 230e4ed9ec5127cc2f6c07da68c4327083f1d72f..23d56ca1f9cfdac6445d816f9969f3329d7e94aa 100644 --- a/logging/convention.go +++ b/logging/convention.go @@ -16,9 +16,9 @@ package logging import ( kitlog "github.com/go-kit/kit/log" - "github.com/monax/eris-db/logging/loggers" - "github.com/monax/eris-db/logging/structure" - "github.com/monax/eris-db/util/slice" + "github.com/monax/burrow/logging/loggers" + "github.com/monax/burrow/logging/structure" + "github.com/monax/burrow/util/slice" ) // Helper functions for InfoTraceLoggers, sort of extension methods to loggers diff --git a/logging/lifecycle/lifecycle.go b/logging/lifecycle/lifecycle.go index 9d824232eb9bcef6241d7e4cedabd37a27a1a751..7f1b0e32e94d79662e9bedd988ffc314f7d1c42f 100644 --- a/logging/lifecycle/lifecycle.go +++ b/logging/lifecycle/lifecycle.go @@ -20,18 +20,18 @@ import ( "time" - "github.com/monax/eris-db/logging" - "github.com/monax/eris-db/logging/adapters/stdlib" - tmLog15adapter "github.com/monax/eris-db/logging/adapters/tendermint_log15" - "github.com/monax/eris-db/logging/loggers" - "github.com/monax/eris-db/logging/structure" + "github.com/monax/burrow/logging" + "github.com/monax/burrow/logging/adapters/stdlib" + tmLog15adapter "github.com/monax/burrow/logging/adapters/tendermint_log15" + "github.com/monax/burrow/logging/loggers" + "github.com/monax/burrow/logging/structure" kitlog "github.com/go-kit/kit/log" "github.com/streadway/simpleuuid" tmLog15 "github.com/tendermint/log15" ) -// Lifecycle provides a canonical source for eris loggers. Components should use the functions here +// Lifecycle provides a canonical source for burrow loggers. Components should use the functions here // to set up their root logger and capture any other logging output. // Obtain a logger from a LoggingConfig @@ -45,12 +45,12 @@ func NewStdErrLogger() loggers.InfoTraceLogger { return NewLogger(logger, logger) } -// Provided a standard eris logger that outputs to the supplied underlying info and trace +// Provided a standard burrow logger that outputs to the supplied underlying info and trace // loggers func NewLogger(infoLogger, traceLogger kitlog.Logger) loggers.InfoTraceLogger { infoTraceLogger := loggers.NewInfoTraceLogger( - loggers.ErisFormatLogger(infoLogger), - loggers.ErisFormatLogger(traceLogger)) + loggers.MonaxFormatLogger(infoLogger), + loggers.MonaxFormatLogger(traceLogger)) // Create a random ID based on start time uuid, _ := simpleuuid.NewTime(time.Now()) var runId string diff --git a/logging/loggers/eris_format_logger.go b/logging/loggers/eris_format_logger.go index e311306b1c3b5948198d6696712545aff7dd862d..d9347a2b109be3d837e48d62a95e12715559c435 100644 --- a/logging/loggers/eris_format_logger.go +++ b/logging/loggers/eris_format_logger.go @@ -17,27 +17,27 @@ package loggers import ( "fmt" - "github.com/monax/eris-db/logging/structure" + "github.com/monax/burrow/logging/structure" kitlog "github.com/go-kit/kit/log" ) -// Logger that implements some formatting conventions for eris-db and eris-client +// Logger that implements some formatting conventions for burrow and burrow-client // This is intended for applying consistent value formatting before the final 'output' logger; // we should avoid prematurely formatting values here if it is useful to let the output logger // decide how it wants to display values. Ideal candidates for 'early' formatting here are types that // we control and generic output loggers are unlikely to know about. -type erisFormatLogger struct { +type burrowFormatLogger struct { logger kitlog.Logger } -var _ kitlog.Logger = &erisFormatLogger{} +var _ kitlog.Logger = &burrowFormatLogger{} -func (efl *erisFormatLogger) Log(keyvals ...interface{}) error { - return efl.logger.Log(structure.MapKeyValues(keyvals, erisFormatKeyValueMapper)...) +func (efl *burrowFormatLogger) Log(keyvals ...interface{}) error { + return efl.logger.Log(structure.MapKeyValues(keyvals, burrowFormatKeyValueMapper)...) } -func erisFormatKeyValueMapper(key, value interface{}) (interface{}, interface{}) { +func burrowFormatKeyValueMapper(key, value interface{}) (interface{}, interface{}) { switch key { default: switch v := value.(type) { @@ -48,6 +48,6 @@ func erisFormatKeyValueMapper(key, value interface{}) (interface{}, interface{}) return key, value } -func ErisFormatLogger(logger kitlog.Logger) *erisFormatLogger { - return &erisFormatLogger{logger: logger} +func MonaxFormatLogger(logger kitlog.Logger) *burrowFormatLogger { + return &burrowFormatLogger{logger: logger} } diff --git a/logging/loggers/info_trace_logger.go b/logging/loggers/info_trace_logger.go index 9cba501e2df1c556aed194fc94437d51232eeb5e..c937bd9e0230bb5ace44f18b4bfc750f07f36a95 100644 --- a/logging/loggers/info_trace_logger.go +++ b/logging/loggers/info_trace_logger.go @@ -16,7 +16,7 @@ package loggers import ( kitlog "github.com/go-kit/kit/log" - "github.com/monax/eris-db/logging/structure" + "github.com/monax/burrow/logging/structure" ) const ( diff --git a/logging/loggers/multiple_channel_logger.go b/logging/loggers/multiple_channel_logger.go index 348d2c3cfa917b61c485417db8dea84b9bd979af..5d04ce3eb39b2775b985d533001522c1762fdd4d 100644 --- a/logging/loggers/multiple_channel_logger.go +++ b/logging/loggers/multiple_channel_logger.go @@ -18,7 +18,7 @@ import ( "fmt" kitlog "github.com/go-kit/kit/log" - "github.com/monax/eris-db/logging/structure" + "github.com/monax/burrow/logging/structure" ) // This represents a 'SELECT ONE' type logger. When logged to it will search diff --git a/logging/loggers/multiple_channel_logger_test.go b/logging/loggers/multiple_channel_logger_test.go index de5f779ac5ee96c9e19ac077065505e5fe615b09..107ce8e437bacd627047a143b8345d64200641be 100644 --- a/logging/loggers/multiple_channel_logger_test.go +++ b/logging/loggers/multiple_channel_logger_test.go @@ -20,7 +20,7 @@ import ( "time" kitlog "github.com/go-kit/kit/log" - "github.com/monax/eris-db/logging/structure" + "github.com/monax/burrow/logging/structure" "github.com/stretchr/testify/assert" ) diff --git a/logging/loggers/vector_valued_logger.go b/logging/loggers/vector_valued_logger.go index 6d693d48c11149d18ea6ae173bcae23a552f053a..dd521e1095a661ee3da7654e75b833cc2704febf 100644 --- a/logging/loggers/vector_valued_logger.go +++ b/logging/loggers/vector_valued_logger.go @@ -16,7 +16,7 @@ package loggers import ( kitlog "github.com/go-kit/kit/log" - "github.com/monax/eris-db/logging/structure" + "github.com/monax/burrow/logging/structure" ) // Treat duplicate key-values as consecutive entries in a vector-valued lookup diff --git a/logging/loggers/vector_valued_logger_test.go b/logging/loggers/vector_valued_logger_test.go index 01dd90c1c500feff15f0dea6c3066b774baa4278..e4d1812350ccdd3e68ebd17119726fee77b72d01 100644 --- a/logging/loggers/vector_valued_logger_test.go +++ b/logging/loggers/vector_valued_logger_test.go @@ -17,7 +17,7 @@ package loggers import ( "testing" - . "github.com/monax/eris-db/util/slice" + . "github.com/monax/burrow/util/slice" "github.com/stretchr/testify/assert" ) diff --git a/logging/metadata.go b/logging/metadata.go index d82ca2e265e596d0af86a7dfd16561b43c526b29..c1c7d71cc897d41bfe7807334d6e36966c41ef75 100644 --- a/logging/metadata.go +++ b/logging/metadata.go @@ -19,8 +19,8 @@ import ( kitlog "github.com/go-kit/kit/log" "github.com/go-stack/stack" - "github.com/monax/eris-db/logging/loggers" - "github.com/monax/eris-db/logging/structure" + "github.com/monax/burrow/logging/loggers" + "github.com/monax/burrow/logging/structure" ) const ( diff --git a/logging/structure/structure.go b/logging/structure/structure.go index 19c6f1502f761f024cbdb9e59a63761da6e60b51..d1eab959a0c1996b7c4edb92bdde53585dacf0ef 100644 --- a/logging/structure/structure.go +++ b/logging/structure/structure.go @@ -17,7 +17,7 @@ package structure import ( "reflect" - . "github.com/monax/eris-db/util/slice" + . "github.com/monax/burrow/util/slice" ) const ( diff --git a/logging/structure/structure_test.go b/logging/structure/structure_test.go index c5335125c6449320634787472a54ff8dd9412aa4..c3b4e68f7d0f3f36d4232c06e8a03c726461abd0 100644 --- a/logging/structure/structure_test.go +++ b/logging/structure/structure_test.go @@ -17,7 +17,7 @@ package structure import ( "testing" - . "github.com/monax/eris-db/util/slice" + . "github.com/monax/burrow/util/slice" "github.com/stretchr/testify/assert" ) diff --git a/logging/terminal.go b/logging/terminal.go index 24747c5209233669a8d4c803beeb5e783bfb92dd..de4180fbd2fcfd9a24586c66ced09713fbfd738e 100644 --- a/logging/terminal.go +++ b/logging/terminal.go @@ -16,7 +16,7 @@ package logging import ( "github.com/go-kit/kit/log/term" - "github.com/monax/eris-db/logging/structure" + "github.com/monax/burrow/logging/structure" ) func Colors(keyvals ...interface{}) term.FgBgColor { diff --git a/manager/eris-mint/accounts.go b/manager/burrow-mint/accounts.go similarity index 88% rename from manager/eris-mint/accounts.go rename to manager/burrow-mint/accounts.go index a48733dd6e7b0966a88bca208cf28f86ad032743..035586ee19b309152f883811cd1f1134ae6b3880 100644 --- a/manager/eris-mint/accounts.go +++ b/manager/burrow-mint/accounts.go @@ -12,10 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -package erismint +package burrowmint -// Accounts is part of the pipe for ErisMint and provides the implementation -// for the pipe to call into the ErisMint application +// Accounts is part of the pipe for BurrowMint and provides the implementation +// for the pipe to call into the BurrowMint application import ( "bytes" @@ -23,24 +23,24 @@ import ( "fmt" "sync" - account "github.com/monax/eris-db/account" - core_types "github.com/monax/eris-db/core/types" - definitions "github.com/monax/eris-db/definitions" - event "github.com/monax/eris-db/event" - word256 "github.com/monax/eris-db/word256" + account "github.com/monax/burrow/account" + core_types "github.com/monax/burrow/core/types" + definitions "github.com/monax/burrow/definitions" + event "github.com/monax/burrow/event" + word256 "github.com/monax/burrow/word256" ) // NOTE [ben] Compiler check to ensure Accounts successfully implements -// eris-db/definitions.Accounts +// burrow/definitions.Accounts var _ definitions.Accounts = (*accounts)(nil) // The accounts struct has methods for working with accounts. type accounts struct { - erisMint *ErisMint + burrowMint *BurrowMint filterFactory *event.FilterFactory } -func newAccounts(erisMint *ErisMint) *accounts { +func newAccounts(burrowMint *BurrowMint) *accounts { ff := event.NewFilterFactory() ff.RegisterFilterPool("code", &sync.Pool{ @@ -55,7 +55,7 @@ func newAccounts(erisMint *ErisMint) *accounts { }, }) - return &accounts{erisMint, ff} + return &accounts{burrowMint, ff} } @@ -80,7 +80,7 @@ func (this *accounts) GenPrivAccountFromKey(privKey []byte) ( func (this *accounts) Accounts(fda []*event.FilterData) ( *core_types.AccountList, error) { accounts := make([]*account.Account, 0) - state := this.erisMint.GetState() + state := this.burrowMint.GetState() filter, err := this.filterFactory.NewFilter(fda) if err != nil { return nil, fmt.Errorf("Error in query: " + err.Error()) @@ -97,7 +97,7 @@ func (this *accounts) Accounts(fda []*event.FilterData) ( // Get an account. func (this *accounts) Account(address []byte) (*account.Account, error) { - cache := this.erisMint.GetState() // NOTE: we want to read from mempool! + cache := this.burrowMint.GetState() // NOTE: we want to read from mempool! acc := cache.GetAccount(address) if acc == nil { acc = this.newAcc(address) @@ -109,7 +109,7 @@ func (this *accounts) Account(address []byte) (*account.Account, error) { // Both the key and value is returned. func (this *accounts) StorageAt(address, key []byte) (*core_types.StorageItem, error) { - state := this.erisMint.GetState() + state := this.burrowMint.GetState() account := state.GetAccount(address) if account == nil { return &core_types.StorageItem{key, []byte{}}, nil @@ -127,7 +127,7 @@ func (this *accounts) StorageAt(address, key []byte) (*core_types.StorageItem, // Get the storage of the account with address 'address'. func (this *accounts) Storage(address []byte) (*core_types.Storage, error) { - state := this.erisMint.GetState() + state := this.burrowMint.GetState() account := state.GetAccount(address) storageItems := make([]core_types.StorageItem, 0) if account == nil { diff --git a/manager/eris-mint/eris-mint.go b/manager/burrow-mint/burrow-mint.go similarity index 79% rename from manager/eris-mint/eris-mint.go rename to manager/burrow-mint/burrow-mint.go index d7d430a12d2f526931241a669139470e930453af..c75486a464ff374f8eff883962cd9bcc0e967c46 100644 --- a/manager/eris-mint/eris-mint.go +++ b/manager/burrow-mint/burrow-mint.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package erismint +package burrowmint import ( "bytes" @@ -24,20 +24,20 @@ import ( tendermint_events "github.com/tendermint/go-events" wire "github.com/tendermint/go-wire" - "github.com/monax/eris-db/logging" - "github.com/monax/eris-db/logging/loggers" + "github.com/monax/burrow/logging" + "github.com/monax/burrow/logging/loggers" - sm "github.com/monax/eris-db/manager/eris-mint/state" - manager_types "github.com/monax/eris-db/manager/types" - "github.com/monax/eris-db/txs" + sm "github.com/monax/burrow/manager/burrow-mint/state" + manager_types "github.com/monax/burrow/manager/types" + "github.com/monax/burrow/txs" ) //-------------------------------------------------------------------------------- -// ErisMint holds the current state, runs transactions, computes hashes. +// BurrowMint holds the current state, runs transactions, computes hashes. // Typically two connections are opened by the tendermint core: // one for mempool, one for consensus. -type ErisMint struct { +type BurrowMint struct { mtx sync.Mutex state *sm.State @@ -51,15 +51,15 @@ type ErisMint struct { logger loggers.InfoTraceLogger } -// NOTE [ben] Compiler check to ensure ErisMint successfully implements -// eris-db/manager/types.Application -var _ manager_types.Application = (*ErisMint)(nil) +// NOTE [ben] Compiler check to ensure BurrowMint successfully implements +// burrow/manager/types.Application +var _ manager_types.Application = (*BurrowMint)(nil) // NOTE: [ben] also automatically implements abci.Application, // undesired but unharmful -// var _ abci.Application = (*ErisMint)(nil) +// var _ abci.Application = (*BurrowMint)(nil) -func (app *ErisMint) GetState() *sm.State { +func (app *BurrowMint) GetState() *sm.State { app.mtx.Lock() defer app.mtx.Unlock() return app.state.Copy() @@ -68,33 +68,33 @@ func (app *ErisMint) GetState() *sm.State { // TODO: this is used for call/callcode and to get nonces during mempool. // the former should work on last committed state only and the later should // be handled by the client, or a separate wallet-like nonce tracker thats not part of the app -func (app *ErisMint) GetCheckCache() *sm.BlockCache { +func (app *BurrowMint) GetCheckCache() *sm.BlockCache { return app.checkCache } -func NewErisMint(s *sm.State, evsw tendermint_events.EventSwitch, logger loggers.InfoTraceLogger) *ErisMint { - return &ErisMint{ +func NewBurrowMint(s *sm.State, evsw tendermint_events.EventSwitch, logger loggers.InfoTraceLogger) *BurrowMint { + return &BurrowMint{ state: s, cache: sm.NewBlockCache(s), checkCache: sm.NewBlockCache(s), evc: tendermint_events.NewEventCache(evsw), evsw: evsw, - logger: logging.WithScope(logger, "ErisMint"), + logger: logging.WithScope(logger, "BurrowMint"), } } // Implements manager/types.Application -func (app *ErisMint) Info() (info abci.ResponseInfo) { +func (app *BurrowMint) Info() (info abci.ResponseInfo) { return abci.ResponseInfo{} } // Implements manager/types.Application -func (app *ErisMint) SetOption(key string, value string) (log string) { +func (app *BurrowMint) SetOption(key string, value string) (log string) { return "" } // Implements manager/types.Application -func (app *ErisMint) DeliverTx(txBytes []byte) abci.Result { +func (app *BurrowMint) DeliverTx(txBytes []byte) abci.Result { app.nTxs += 1 // XXX: if we had tx ids we could cache the decoded txs on CheckTx @@ -118,7 +118,7 @@ func (app *ErisMint) DeliverTx(txBytes []byte) abci.Result { } // Implements manager/types.Application -func (app *ErisMint) CheckTx(txBytes []byte) abci.Result { +func (app *BurrowMint) CheckTx(txBytes []byte) abci.Result { var n int var err error tx := new(txs.Tx) @@ -142,7 +142,7 @@ func (app *ErisMint) CheckTx(txBytes []byte) abci.Result { // Commit the state (called at end of block) // NOTE: CheckTx/AppendTx must not run concurrently with Commit - // the mempool should run during AppendTxs, but lock for Commit and Update -func (app *ErisMint) Commit() (res abci.Result) { +func (app *BurrowMint) Commit() (res abci.Result) { app.mtx.Lock() // the lock protects app.state defer app.mtx.Unlock() @@ -176,6 +176,6 @@ func (app *ErisMint) Commit() (res abci.Result) { return abci.NewResultOK(appHash, "Success") } -func (app *ErisMint) Query(query []byte) (res abci.Result) { +func (app *BurrowMint) Query(query []byte) (res abci.Result) { return abci.NewResultOK(nil, "Success") } diff --git a/manager/eris-mint/eris-mint_test.go b/manager/burrow-mint/burrow-mint_test.go similarity index 98% rename from manager/eris-mint/eris-mint_test.go rename to manager/burrow-mint/burrow-mint_test.go index b37c89532caeac8ffcaa7346419487bc973f97c8..9c1a647c2f3f4f532b55f12c49250e6e7368cfd9 100644 --- a/manager/eris-mint/eris-mint_test.go +++ b/manager/burrow-mint/burrow-mint_test.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package erismint +package burrowmint import ( "testing" diff --git a/manager/eris-mint/evm/abi/types.go b/manager/burrow-mint/evm/abi/types.go similarity index 100% rename from manager/eris-mint/evm/abi/types.go rename to manager/burrow-mint/evm/abi/types.go diff --git a/manager/eris-mint/evm/common.go b/manager/burrow-mint/evm/common.go similarity index 100% rename from manager/eris-mint/evm/common.go rename to manager/burrow-mint/evm/common.go diff --git a/manager/eris-mint/evm/fake_app_state.go b/manager/burrow-mint/evm/fake_app_state.go similarity index 96% rename from manager/eris-mint/evm/fake_app_state.go rename to manager/burrow-mint/evm/fake_app_state.go index 5b59f076cc8b547c9fa10b9689b76f923cd2af14..828acd2f8881ef194be0cabe5c59a9ecf76225c6 100644 --- a/manager/eris-mint/evm/fake_app_state.go +++ b/manager/burrow-mint/evm/fake_app_state.go @@ -17,8 +17,8 @@ package vm import ( "fmt" - "github.com/monax/eris-db/manager/eris-mint/evm/sha3" - . "github.com/monax/eris-db/word256" + "github.com/monax/burrow/manager/burrow-mint/evm/sha3" + . "github.com/monax/burrow/word256" ) type FakeAppState struct { diff --git a/manager/eris-mint/evm/gas.go b/manager/burrow-mint/evm/gas.go similarity index 100% rename from manager/eris-mint/evm/gas.go rename to manager/burrow-mint/evm/gas.go diff --git a/manager/eris-mint/evm/log.go b/manager/burrow-mint/evm/log.go similarity index 100% rename from manager/eris-mint/evm/log.go rename to manager/burrow-mint/evm/log.go diff --git a/manager/eris-mint/evm/log_event_test.go b/manager/burrow-mint/evm/log_event_test.go similarity index 95% rename from manager/eris-mint/evm/log_event_test.go rename to manager/burrow-mint/evm/log_event_test.go index 7a541477d15fec3bd46eb8e5d3fba4a965023d00..e576c338b1556283dee0a47ceefdec6d859b1c01 100644 --- a/manager/eris-mint/evm/log_event_test.go +++ b/manager/burrow-mint/evm/log_event_test.go @@ -19,9 +19,9 @@ import ( "reflect" "testing" - . "github.com/monax/eris-db/manager/eris-mint/evm/opcodes" - "github.com/monax/eris-db/txs" - . "github.com/monax/eris-db/word256" + . "github.com/monax/burrow/manager/burrow-mint/evm/opcodes" + "github.com/monax/burrow/txs" + . "github.com/monax/burrow/word256" "github.com/tendermint/go-events" ) diff --git a/manager/eris-mint/evm/native.go b/manager/burrow-mint/evm/native.go similarity index 98% rename from manager/eris-mint/evm/native.go rename to manager/burrow-mint/evm/native.go index 5daf3fc93068a1082404d29fa2c7efb1175dfa87..3d788e5e4dff8c43db2265461960d1b691731593 100644 --- a/manager/eris-mint/evm/native.go +++ b/manager/burrow-mint/evm/native.go @@ -17,7 +17,7 @@ package vm import ( "crypto/sha256" - . "github.com/monax/eris-db/word256" + . "github.com/monax/burrow/word256" "golang.org/x/crypto/ripemd160" ) diff --git a/manager/eris-mint/evm/opcodes/opcodes.go b/manager/burrow-mint/evm/opcodes/opcodes.go similarity index 99% rename from manager/eris-mint/evm/opcodes/opcodes.go rename to manager/burrow-mint/evm/opcodes/opcodes.go index bc889091632692a0ce8f1e90b4c214ab03f80710..02a0441ea58a51a45dfcc154d40c4c2a9edfda32 100644 --- a/manager/eris-mint/evm/opcodes/opcodes.go +++ b/manager/burrow-mint/evm/opcodes/opcodes.go @@ -17,7 +17,7 @@ package opcodes import ( "fmt" - "github.com/monax/eris-db/word256" + "github.com/monax/burrow/word256" "gopkg.in/fatih/set.v0" ) diff --git a/manager/eris-mint/evm/sha3/keccakf.go b/manager/burrow-mint/evm/sha3/keccakf.go similarity index 100% rename from manager/eris-mint/evm/sha3/keccakf.go rename to manager/burrow-mint/evm/sha3/keccakf.go diff --git a/manager/eris-mint/evm/sha3/sha3.go b/manager/burrow-mint/evm/sha3/sha3.go similarity index 100% rename from manager/eris-mint/evm/sha3/sha3.go rename to manager/burrow-mint/evm/sha3/sha3.go diff --git a/manager/eris-mint/evm/snative.go b/manager/burrow-mint/evm/snative.go similarity index 98% rename from manager/eris-mint/evm/snative.go rename to manager/burrow-mint/evm/snative.go index 64b48b31957d0f934d45d1d5870eb9c756e48d39..7becc614153f17734705da24beab9e3514526d81 100644 --- a/manager/eris-mint/evm/snative.go +++ b/manager/burrow-mint/evm/snative.go @@ -17,14 +17,14 @@ package vm import ( "fmt" - "github.com/monax/eris-db/common/sanity" - "github.com/monax/eris-db/manager/eris-mint/evm/sha3" - ptypes "github.com/monax/eris-db/permission/types" - . "github.com/monax/eris-db/word256" + "github.com/monax/burrow/common/sanity" + "github.com/monax/burrow/manager/burrow-mint/evm/sha3" + ptypes "github.com/monax/burrow/permission/types" + . "github.com/monax/burrow/word256" "strings" - "github.com/monax/eris-db/manager/eris-mint/evm/abi" + "github.com/monax/burrow/manager/burrow-mint/evm/abi" ) // @@ -76,7 +76,7 @@ func SNativeContracts() map[string]*SNativeContractDescription { contracts := []*SNativeContractDescription{ NewSNativeContract(` * Interface for managing Secure Native authorizations. - * @dev This interface describes the functions exposed by the SNative permissions layer in the Monax blockchain (ErisDB). + * @dev This interface describes the functions exposed by the SNative permissions layer in burrow. `, "Permissions", &SNativeFunctionDescription{` diff --git a/manager/eris-mint/evm/snative_test.go b/manager/burrow-mint/evm/snative_test.go similarity index 94% rename from manager/eris-mint/evm/snative_test.go rename to manager/burrow-mint/evm/snative_test.go index c0fc286ed0a78ea4fa98be217ff91094174d9cd3..bc119e577b97c08d83440d9b4f42fa6c3d5b8d90 100644 --- a/manager/eris-mint/evm/snative_test.go +++ b/manager/burrow-mint/evm/snative_test.go @@ -20,11 +20,11 @@ import ( "strings" - "github.com/monax/eris-db/manager/eris-mint/evm/abi" - . "github.com/monax/eris-db/manager/eris-mint/evm/opcodes" - "github.com/monax/eris-db/manager/eris-mint/evm/sha3" - ptypes "github.com/monax/eris-db/permission/types" - . "github.com/monax/eris-db/word256" + "github.com/monax/burrow/manager/burrow-mint/evm/abi" + . "github.com/monax/burrow/manager/burrow-mint/evm/opcodes" + "github.com/monax/burrow/manager/burrow-mint/evm/sha3" + ptypes "github.com/monax/burrow/permission/types" + . "github.com/monax/burrow/word256" "github.com/stretchr/testify/assert" ) diff --git a/manager/eris-mint/evm/stack.go b/manager/burrow-mint/evm/stack.go similarity index 95% rename from manager/eris-mint/evm/stack.go rename to manager/burrow-mint/evm/stack.go index f9ed59164b5a2b7160291d56878001dae7ccbaeb..471ff5792ca4f7922f5395fe42540b261fb9a6b0 100644 --- a/manager/eris-mint/evm/stack.go +++ b/manager/burrow-mint/evm/stack.go @@ -17,9 +17,9 @@ package vm import ( "fmt" - "github.com/monax/eris-db/common/math/integral" - "github.com/monax/eris-db/common/sanity" - . "github.com/monax/eris-db/word256" + "github.com/monax/burrow/common/math/integral" + "github.com/monax/burrow/common/sanity" + . "github.com/monax/burrow/word256" ) // Not goroutine safe diff --git a/manager/eris-mint/evm/types.go b/manager/burrow-mint/evm/types.go similarity index 94% rename from manager/eris-mint/evm/types.go rename to manager/burrow-mint/evm/types.go index ad699c9c7a82c78af418030eb8b46e62768f5bbe..3dfc2b9bcce6ee05f208670e37cbdc0f32ef0d6a 100644 --- a/manager/eris-mint/evm/types.go +++ b/manager/burrow-mint/evm/types.go @@ -17,8 +17,8 @@ package vm import ( "fmt" - ptypes "github.com/monax/eris-db/permission/types" - . "github.com/monax/eris-db/word256" + ptypes "github.com/monax/burrow/permission/types" + . "github.com/monax/burrow/word256" ) const ( diff --git a/manager/eris-mint/evm/vm.go b/manager/burrow-mint/evm/vm.go similarity index 98% rename from manager/eris-mint/evm/vm.go rename to manager/burrow-mint/evm/vm.go index 80ab3693de9ef250be61da8055fabbec68e4e783..cc1bce4ce4d54b55a2b579f0cb12289586d2be2c 100644 --- a/manager/eris-mint/evm/vm.go +++ b/manager/burrow-mint/evm/vm.go @@ -20,13 +20,13 @@ import ( "fmt" "math/big" - "github.com/monax/eris-db/common/math/integral" - "github.com/monax/eris-db/common/sanity" - . "github.com/monax/eris-db/manager/eris-mint/evm/opcodes" - "github.com/monax/eris-db/manager/eris-mint/evm/sha3" - ptypes "github.com/monax/eris-db/permission/types" - "github.com/monax/eris-db/txs" - . "github.com/monax/eris-db/word256" + "github.com/monax/burrow/common/math/integral" + "github.com/monax/burrow/common/sanity" + . "github.com/monax/burrow/manager/burrow-mint/evm/opcodes" + "github.com/monax/burrow/manager/burrow-mint/evm/sha3" + ptypes "github.com/monax/burrow/permission/types" + "github.com/monax/burrow/txs" + . "github.com/monax/burrow/word256" "github.com/tendermint/go-events" ) diff --git a/manager/eris-mint/evm/vm_test.go b/manager/burrow-mint/evm/vm_test.go similarity index 97% rename from manager/eris-mint/evm/vm_test.go rename to manager/burrow-mint/evm/vm_test.go index 724886da8a5ae838377a2a640f5bbad6dfd25b8c..a954115cb9506521678a8851ca7933920ad52436 100644 --- a/manager/eris-mint/evm/vm_test.go +++ b/manager/burrow-mint/evm/vm_test.go @@ -24,10 +24,10 @@ import ( "errors" - . "github.com/monax/eris-db/manager/eris-mint/evm/opcodes" - ptypes "github.com/monax/eris-db/permission/types" - "github.com/monax/eris-db/txs" - . "github.com/monax/eris-db/word256" + . "github.com/monax/burrow/manager/burrow-mint/evm/opcodes" + ptypes "github.com/monax/burrow/permission/types" + "github.com/monax/burrow/txs" + . "github.com/monax/burrow/word256" "github.com/stretchr/testify/assert" "github.com/tendermint/go-events" ) @@ -193,8 +193,7 @@ func TestSendCall(t *testing.T) { } // This test was introduced to cover an issues exposed in our handling of the -// gas limit passed from caller to callee on various forms of CALL -// this ticket gives some background: https://github.com/monax/eris-pm/issues/212 +// gas limit passed from caller to callee on various forms of CALL. // The idea of this test is to implement a simple DelegateCall in EVM code // We first run the DELEGATECALL with _just_ enough gas expecting a simple return, // and then run it with 1 gas unit less, expecting a failure diff --git a/manager/eris-mint/namereg.go b/manager/burrow-mint/namereg.go similarity index 91% rename from manager/eris-mint/namereg.go rename to manager/burrow-mint/namereg.go index 884e486b7ff5aa9de9daeaaffe444e1f5b3b936c..3de4ed6031ce0433ea76af90e26bfcb4a534d6bb 100644 --- a/manager/eris-mint/namereg.go +++ b/manager/burrow-mint/namereg.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package erismint +package burrowmint import ( "bytes" @@ -20,21 +20,21 @@ import ( "fmt" "sync" - sm "github.com/monax/eris-db/manager/eris-mint/state" + sm "github.com/monax/burrow/manager/burrow-mint/state" - core_types "github.com/monax/eris-db/core/types" - event "github.com/monax/eris-db/event" + core_types "github.com/monax/burrow/core/types" + event "github.com/monax/burrow/event" ) -// NameReg is part of the pipe for ErisMint and provides the implementation -// for the pipe to call into the ErisMint application +// NameReg is part of the pipe for BurrowMint and provides the implementation +// for the pipe to call into the BurrowMint application type namereg struct { - erisMint *ErisMint + burrowMint *BurrowMint filterFactory *event.FilterFactory } -func newNameReg(erisMint *ErisMint) *namereg { +func newNameReg(burrowMint *BurrowMint) *namereg { ff := event.NewFilterFactory() @@ -62,11 +62,11 @@ func newNameReg(erisMint *ErisMint) *namereg { }, }) - return &namereg{erisMint, ff} + return &namereg{burrowMint, ff} } func (this *namereg) Entry(key string) (*core_types.NameRegEntry, error) { - st := this.erisMint.GetState() // performs a copy + st := this.burrowMint.GetState() // performs a copy entry := st.GetNameRegEntry(key) if entry == nil { return nil, fmt.Errorf("Entry %s not found", key) @@ -77,7 +77,7 @@ func (this *namereg) Entry(key string) (*core_types.NameRegEntry, error) { func (this *namereg) Entries(filters []*event.FilterData) (*core_types.ResultListNames, error) { var blockHeight int var names []*core_types.NameRegEntry - state := this.erisMint.GetState() + state := this.burrowMint.GetState() blockHeight = state.LastBlockHeight filter, err := this.filterFactory.NewFilter(filters) if err != nil { diff --git a/manager/eris-mint/pipe.go b/manager/burrow-mint/pipe.go similarity index 76% rename from manager/eris-mint/pipe.go rename to manager/burrow-mint/pipe.go index 9c9ed24f79111ba17371e138ac85a3b6a962da34..0d7d7653cdb620f605aad4aaedfa4518169b42b9 100644 --- a/manager/eris-mint/pipe.go +++ b/manager/burrow-mint/pipe.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package erismint +package burrowmint import ( "bytes" @@ -25,28 +25,28 @@ import ( wire "github.com/tendermint/go-wire" tm_types "github.com/tendermint/tendermint/types" - "github.com/monax/eris-db/account" - blockchain_types "github.com/monax/eris-db/blockchain/types" - imath "github.com/monax/eris-db/common/math/integral" - "github.com/monax/eris-db/config" - consensus_types "github.com/monax/eris-db/consensus/types" - core_types "github.com/monax/eris-db/core/types" - "github.com/monax/eris-db/definitions" - edb_event "github.com/monax/eris-db/event" - genesis "github.com/monax/eris-db/genesis" - "github.com/monax/eris-db/logging" - "github.com/monax/eris-db/logging/loggers" - vm "github.com/monax/eris-db/manager/eris-mint/evm" - "github.com/monax/eris-db/manager/eris-mint/state" - manager_types "github.com/monax/eris-db/manager/types" - rpc_tm_types "github.com/monax/eris-db/rpc/tendermint/core/types" - "github.com/monax/eris-db/txs" - "github.com/monax/eris-db/word256" + "github.com/monax/burrow/account" + blockchain_types "github.com/monax/burrow/blockchain/types" + imath "github.com/monax/burrow/common/math/integral" + "github.com/monax/burrow/config" + consensus_types "github.com/monax/burrow/consensus/types" + core_types "github.com/monax/burrow/core/types" + "github.com/monax/burrow/definitions" + edb_event "github.com/monax/burrow/event" + genesis "github.com/monax/burrow/genesis" + "github.com/monax/burrow/logging" + "github.com/monax/burrow/logging/loggers" + vm "github.com/monax/burrow/manager/burrow-mint/evm" + "github.com/monax/burrow/manager/burrow-mint/state" + manager_types "github.com/monax/burrow/manager/types" + rpc_tm_types "github.com/monax/burrow/rpc/tendermint/core/types" + "github.com/monax/burrow/txs" + "github.com/monax/burrow/word256" ) -type erisMintPipe struct { - erisMintState *state.State - erisMint *ErisMint +type burrowMintPipe struct { + burrowMintState *state.State + burrowMint *BurrowMint // Pipe implementations accounts *accounts blockchain blockchain_types.Blockchain @@ -60,17 +60,14 @@ type erisMintPipe struct { logger loggers.InfoTraceLogger } -// NOTE [ben] Compiler check to ensure erisMintPipe successfully implements -// eris-db/definitions.Pipe -var _ definitions.Pipe = (*erisMintPipe)(nil) +// Interface type assertions +var _ definitions.Pipe = (*burrowMintPipe)(nil) -// NOTE [ben] Compiler check to ensure erisMintPipe successfully implements -// eris-db/definitions.erisTendermintPipe -var _ definitions.TendermintPipe = (*erisMintPipe)(nil) +var _ definitions.TendermintPipe = (*burrowMintPipe)(nil) -func NewErisMintPipe(moduleConfig *config.ModuleConfig, +func NewBurrowMintPipe(moduleConfig *config.ModuleConfig, eventSwitch go_events.EventSwitch, - logger loggers.InfoTraceLogger) (*erisMintPipe, error) { + logger loggers.InfoTraceLogger) (*burrowMintPipe, error) { startedState, genesisDoc, err := startState(moduleConfig.DataDir, moduleConfig.Config.GetString("db_backend"), moduleConfig.GenesisFile, @@ -78,26 +75,26 @@ func NewErisMintPipe(moduleConfig *config.ModuleConfig, if err != nil { return nil, fmt.Errorf("Failed to start state: %v", err) } - logger = logging.WithScope(logger, "ErisMintPipe") + logger = logging.WithScope(logger, "BurrowMintPipe") // assert ChainId matches genesis ChainId logging.InfoMsg(logger, "Loaded state", "chainId", startedState.ChainID, "lastBlockHeight", startedState.LastBlockHeight, "lastBlockHash", startedState.LastBlockHash) // start the application - erisMint := NewErisMint(startedState, eventSwitch, logger) + burrowMint := NewBurrowMint(startedState, eventSwitch, logger) // initialise the components of the pipe events := edb_event.NewEvents(eventSwitch, logger) - accounts := newAccounts(erisMint) - namereg := newNameReg(erisMint) - - pipe := &erisMintPipe{ - erisMintState: startedState, - erisMint: erisMint, - accounts: accounts, - events: events, - namereg: namereg, + accounts := newAccounts(burrowMint) + namereg := newNameReg(burrowMint) + + pipe := &burrowMintPipe{ + burrowMintState: startedState, + burrowMint: burrowMint, + accounts: accounts, + events: events, + namereg: namereg, // We need to set transactor later since we are introducing a mutual dependency // NOTE: this will be cleaned up when the RPC is unified transactor: nil, @@ -120,7 +117,7 @@ func NewErisMintPipe(moduleConfig *config.ModuleConfig, // like a reasonably minimal and flexible way of providing transactor with the // broadcast function it needs, without making it explicitly // aware of/depend on Pipe. - transactor := newTransactor(moduleConfig.ChainId, eventSwitch, erisMint, + transactor := newTransactor(moduleConfig.ChainId, eventSwitch, burrowMint, events, func(tx txs.Tx) error { _, err := pipe.BroadcastTxSync(tx) @@ -145,10 +142,10 @@ func startState(dataDir, backend, genesisFile, chainId string) (*state.State, if backend != db.MemDBBackendStr && backend != db.LevelDBBackendStr { return nil, nil, fmt.Errorf("Database backend %s is not supported by %s", - backend, GetErisMintVersion) + backend, GetBurrowMintVersion) } - stateDB := db.NewDB("erismint", backend, dataDir) + stateDB := db.NewDB("burrowmint", backend, dataDir) newState := state.LoadState(stateDB) var genesisDoc *genesis.GenesisDoc if newState == nil { @@ -178,37 +175,37 @@ func startState(dataDir, backend, genesisFile, chainId string) (*state.State, } //------------------------------------------------------------------------------ -// Implement definitions.Pipe for erisMintPipe +// Implement definitions.Pipe for burrowMintPipe -func (pipe *erisMintPipe) Logger() loggers.InfoTraceLogger { +func (pipe *burrowMintPipe) Logger() loggers.InfoTraceLogger { return pipe.logger } -func (pipe *erisMintPipe) Accounts() definitions.Accounts { +func (pipe *burrowMintPipe) Accounts() definitions.Accounts { return pipe.accounts } -func (pipe *erisMintPipe) Blockchain() blockchain_types.Blockchain { +func (pipe *burrowMintPipe) Blockchain() blockchain_types.Blockchain { return pipe.blockchain } -func (pipe *erisMintPipe) Events() edb_event.EventEmitter { +func (pipe *burrowMintPipe) Events() edb_event.EventEmitter { return pipe.events } -func (pipe *erisMintPipe) NameReg() definitions.NameReg { +func (pipe *burrowMintPipe) NameReg() definitions.NameReg { return pipe.namereg } -func (pipe *erisMintPipe) Transactor() definitions.Transactor { +func (pipe *burrowMintPipe) Transactor() definitions.Transactor { return pipe.transactor } -func (pipe *erisMintPipe) GetApplication() manager_types.Application { - return pipe.erisMint +func (pipe *burrowMintPipe) GetApplication() manager_types.Application { + return pipe.burrowMint } -func (pipe *erisMintPipe) SetBlockchain( +func (pipe *burrowMintPipe) SetBlockchain( blockchain blockchain_types.Blockchain) error { if pipe.blockchain == nil { pipe.blockchain = blockchain @@ -218,11 +215,11 @@ func (pipe *erisMintPipe) SetBlockchain( return nil } -func (pipe *erisMintPipe) GetBlockchain() blockchain_types.Blockchain { +func (pipe *burrowMintPipe) GetBlockchain() blockchain_types.Blockchain { return pipe.blockchain } -func (pipe *erisMintPipe) SetConsensusEngine( +func (pipe *burrowMintPipe) SetConsensusEngine( consensusEngine consensus_types.ConsensusEngine) error { if pipe.consensusEngine == nil { pipe.consensusEngine = consensusEngine @@ -232,25 +229,25 @@ func (pipe *erisMintPipe) SetConsensusEngine( return nil } -func (pipe *erisMintPipe) GetConsensusEngine() consensus_types.ConsensusEngine { +func (pipe *burrowMintPipe) GetConsensusEngine() consensus_types.ConsensusEngine { return pipe.consensusEngine } -func (pipe *erisMintPipe) GetTendermintPipe() (definitions.TendermintPipe, +func (pipe *burrowMintPipe) GetTendermintPipe() (definitions.TendermintPipe, error) { return definitions.TendermintPipe(pipe), nil } -func (pipe *erisMintPipe) consensusAndManagerEvents() edb_event.EventEmitter { +func (pipe *burrowMintPipe) consensusAndManagerEvents() edb_event.EventEmitter { // NOTE: [Silas] We could initialise this lazily and use the cached instance, // but for the time being that feels like a premature optimisation return edb_event.Multiplex(pipe.events, pipe.consensusEngine.Events()) } //------------------------------------------------------------------------------ -// Implement definitions.TendermintPipe for erisMintPipe -func (pipe *erisMintPipe) Subscribe(event string, - rpcResponseWriter func(result rpc_tm_types.ErisDBResult)) (*rpc_tm_types.ResultSubscribe, error) { +// Implement definitions.TendermintPipe for burrowMintPipe +func (pipe *burrowMintPipe) Subscribe(event string, + rpcResponseWriter func(result rpc_tm_types.BurrowResult)) (*rpc_tm_types.ResultSubscribe, error) { subscriptionId, err := edb_event.GenerateSubId() if err != nil { return nil, err @@ -259,7 +256,7 @@ func (pipe *erisMintPipe) Subscribe(event string, } pipe.consensusAndManagerEvents().Subscribe(subscriptionId, event, func(eventData txs.EventData) { - result := rpc_tm_types.ErisDBResult(&rpc_tm_types.ResultEvent{event, + result := rpc_tm_types.BurrowResult(&rpc_tm_types.ResultEvent{event, txs.EventData(eventData)}) // NOTE: EventSwitch callbacks must be nonblocking rpcResponseWriter(result) @@ -270,13 +267,13 @@ func (pipe *erisMintPipe) Subscribe(event string, }, nil } -func (pipe *erisMintPipe) Unsubscribe(subscriptionId string) (*rpc_tm_types.ResultUnsubscribe, error) { +func (pipe *burrowMintPipe) Unsubscribe(subscriptionId string) (*rpc_tm_types.ResultUnsubscribe, error) { logging.InfoMsg(pipe.logger, "Unsubscribing from event", "subscriptionId", subscriptionId) pipe.consensusAndManagerEvents().Unsubscribe(subscriptionId) return &rpc_tm_types.ResultUnsubscribe{SubscriptionId: subscriptionId}, nil } -func (pipe *erisMintPipe) GenesisState() *state.State { +func (pipe *burrowMintPipe) GenesisState() *state.State { if pipe.genesisState == nil { memoryDatabase := db.NewMemDB() pipe.genesisState = state.MakeGenesisState(memoryDatabase, pipe.genesisDoc) @@ -284,13 +281,13 @@ func (pipe *erisMintPipe) GenesisState() *state.State { return pipe.genesisState } -func (pipe *erisMintPipe) GenesisHash() []byte { +func (pipe *burrowMintPipe) GenesisHash() []byte { return pipe.GenesisState().Hash() } -func (pipe *erisMintPipe) Status() (*rpc_tm_types.ResultStatus, error) { +func (pipe *burrowMintPipe) Status() (*rpc_tm_types.ResultStatus, error) { if pipe.consensusEngine == nil { - return nil, fmt.Errorf("Consensus Engine not initialised in Erismint pipe.") + return nil, fmt.Errorf("Consensus Engine not initialised in burrowmint pipe.") } latestHeight := pipe.blockchain.Height() var ( @@ -312,9 +309,9 @@ func (pipe *erisMintPipe) Status() (*rpc_tm_types.ResultStatus, error) { LatestBlockTime: latestBlockTime}, nil } -func (pipe *erisMintPipe) ChainId() (*rpc_tm_types.ResultChainId, error) { +func (pipe *burrowMintPipe) ChainId() (*rpc_tm_types.ResultChainId, error) { if pipe.blockchain == nil { - return nil, fmt.Errorf("Blockchain not initialised in Erismint pipe.") + return nil, fmt.Errorf("Blockchain not initialised in burrowmint pipe.") } chainId := pipe.blockchain.ChainId() @@ -325,7 +322,7 @@ func (pipe *erisMintPipe) ChainId() (*rpc_tm_types.ResultChainId, error) { }, nil } -func (pipe *erisMintPipe) NetInfo() (*rpc_tm_types.ResultNetInfo, error) { +func (pipe *burrowMintPipe) NetInfo() (*rpc_tm_types.ResultNetInfo, error) { listening := pipe.consensusEngine.IsListening() listeners := []string{} for _, listener := range pipe.consensusEngine.Listeners() { @@ -339,7 +336,7 @@ func (pipe *erisMintPipe) NetInfo() (*rpc_tm_types.ResultNetInfo, error) { }, nil } -func (pipe *erisMintPipe) Genesis() (*rpc_tm_types.ResultGenesis, error) { +func (pipe *burrowMintPipe) Genesis() (*rpc_tm_types.ResultGenesis, error) { return &rpc_tm_types.ResultGenesis{ // TODO: [ben] sharing pointer to unmutated GenesisDoc, but is not immutable Genesis: pipe.genesisDoc, @@ -347,17 +344,17 @@ func (pipe *erisMintPipe) Genesis() (*rpc_tm_types.ResultGenesis, error) { } // Accounts -func (pipe *erisMintPipe) GetAccount(address []byte) (*rpc_tm_types.ResultGetAccount, +func (pipe *burrowMintPipe) GetAccount(address []byte) (*rpc_tm_types.ResultGetAccount, error) { - cache := pipe.erisMint.GetCheckCache() + cache := pipe.burrowMint.GetCheckCache() account := cache.GetAccount(address) return &rpc_tm_types.ResultGetAccount{Account: account}, nil } -func (pipe *erisMintPipe) ListAccounts() (*rpc_tm_types.ResultListAccounts, error) { +func (pipe *burrowMintPipe) ListAccounts() (*rpc_tm_types.ResultListAccounts, error) { var blockHeight int var accounts []*account.Account - state := pipe.erisMint.GetState() + state := pipe.burrowMint.GetState() blockHeight = state.LastBlockHeight state.GetAccounts().Iterate(func(key []byte, value []byte) bool { accounts = append(accounts, account.DecodeAccount(value)) @@ -366,9 +363,9 @@ func (pipe *erisMintPipe) ListAccounts() (*rpc_tm_types.ResultListAccounts, erro return &rpc_tm_types.ResultListAccounts{blockHeight, accounts}, nil } -func (pipe *erisMintPipe) GetStorage(address, key []byte) (*rpc_tm_types.ResultGetStorage, +func (pipe *burrowMintPipe) GetStorage(address, key []byte) (*rpc_tm_types.ResultGetStorage, error) { - state := pipe.erisMint.GetState() + state := pipe.burrowMint.GetState() // state := consensusState.GetState() account := state.GetAccount(address) if account == nil { @@ -386,9 +383,9 @@ func (pipe *erisMintPipe) GetStorage(address, key []byte) (*rpc_tm_types.ResultG return &rpc_tm_types.ResultGetStorage{key, value}, nil } -func (pipe *erisMintPipe) DumpStorage(address []byte) (*rpc_tm_types.ResultDumpStorage, +func (pipe *burrowMintPipe) DumpStorage(address []byte) (*rpc_tm_types.ResultDumpStorage, error) { - state := pipe.erisMint.GetState() + state := pipe.burrowMint.GetState() account := state.GetAccount(address) if account == nil { return nil, fmt.Errorf("UnknownAddress: %X", address) @@ -408,9 +405,9 @@ func (pipe *erisMintPipe) DumpStorage(address []byte) (*rpc_tm_types.ResultDumpS // NOTE: this function is used from 46657 and has sibling on 1337 // in transactor.go // TODO: [ben] resolve incompatibilities in byte representation for 0.12.0 release -func (pipe *erisMintPipe) Call(fromAddress, toAddress, data []byte) (*rpc_tm_types.ResultCall, +func (pipe *burrowMintPipe) Call(fromAddress, toAddress, data []byte) (*rpc_tm_types.ResultCall, error) { - st := pipe.erisMint.GetState() + st := pipe.burrowMint.GetState() cache := state.NewBlockCache(st) outAcc := cache.GetAccount(toAddress) if outAcc == nil { @@ -442,10 +439,10 @@ func (pipe *erisMintPipe) Call(fromAddress, toAddress, data []byte) (*rpc_tm_typ return &rpc_tm_types.ResultCall{Return: ret, GasUsed: gasUsed}, nil } -func (pipe *erisMintPipe) CallCode(fromAddress, code, data []byte) (*rpc_tm_types.ResultCall, +func (pipe *burrowMintPipe) CallCode(fromAddress, code, data []byte) (*rpc_tm_types.ResultCall, error) { - st := pipe.erisMint.GetState() - cache := pipe.erisMint.GetCheckCache() + st := pipe.burrowMint.GetState() + cache := pipe.burrowMint.GetCheckCache() callee := &vm.Account{Address: word256.LeftPadWord256(fromAddress)} caller := &vm.Account{Address: word256.LeftPadWord256(fromAddress)} txCache := state.NewTxCache(cache) @@ -470,7 +467,7 @@ func (pipe *erisMintPipe) CallCode(fromAddress, code, data []byte) (*rpc_tm_type // TODO: [ben] deprecate as we should not allow unsafe behaviour // where a user is allowed to send a private key over the wire, // especially unencrypted. -func (pipe *erisMintPipe) SignTransaction(tx txs.Tx, +func (pipe *burrowMintPipe) SignTransaction(tx txs.Tx, privAccounts []*account.PrivAccount) (*rpc_tm_types.ResultSignTx, error) { @@ -510,8 +507,8 @@ func (pipe *erisMintPipe) SignTransaction(tx txs.Tx, } // Name registry -func (pipe *erisMintPipe) GetName(name string) (*rpc_tm_types.ResultGetName, error) { - currentState := pipe.erisMint.GetState() +func (pipe *burrowMintPipe) GetName(name string) (*rpc_tm_types.ResultGetName, error) { + currentState := pipe.burrowMint.GetState() entry := currentState.GetNameRegEntry(name) if entry == nil { return nil, fmt.Errorf("Name %s not found", name) @@ -519,10 +516,10 @@ func (pipe *erisMintPipe) GetName(name string) (*rpc_tm_types.ResultGetName, err return &rpc_tm_types.ResultGetName{entry}, nil } -func (pipe *erisMintPipe) ListNames() (*rpc_tm_types.ResultListNames, error) { +func (pipe *burrowMintPipe) ListNames() (*rpc_tm_types.ResultListNames, error) { var blockHeight int var names []*core_types.NameRegEntry - currentState := pipe.erisMint.GetState() + currentState := pipe.burrowMint.GetState() blockHeight = currentState.LastBlockHeight currentState.GetNames().Iterate(func(key []byte, value []byte) bool { names = append(names, state.DecodeNameRegEntry(value)) @@ -531,7 +528,7 @@ func (pipe *erisMintPipe) ListNames() (*rpc_tm_types.ResultListNames, error) { return &rpc_tm_types.ResultListNames{blockHeight, names}, nil } -func (pipe *erisMintPipe) broadcastTx(tx txs.Tx, +func (pipe *burrowMintPipe) broadcastTx(tx txs.Tx, callback func(res *abci_types.Response)) (*rpc_tm_types.ResultBroadcastTx, error) { txBytes, err := txs.EncodeTx(tx) @@ -547,11 +544,11 @@ func (pipe *erisMintPipe) broadcastTx(tx txs.Tx, // Memory pool // NOTE: txs must be signed -func (pipe *erisMintPipe) BroadcastTxAsync(tx txs.Tx) (*rpc_tm_types.ResultBroadcastTx, error) { +func (pipe *burrowMintPipe) BroadcastTxAsync(tx txs.Tx) (*rpc_tm_types.ResultBroadcastTx, error) { return pipe.broadcastTx(tx, nil) } -func (pipe *erisMintPipe) BroadcastTxSync(tx txs.Tx) (*rpc_tm_types.ResultBroadcastTx, error) { +func (pipe *burrowMintPipe) BroadcastTxSync(tx txs.Tx) (*rpc_tm_types.ResultBroadcastTx, error) { responseChannel := make(chan *abci_types.Response, 1) _, err := pipe.broadcastTx(tx, func(res *abci_types.Response) { @@ -561,8 +558,8 @@ func (pipe *erisMintPipe) BroadcastTxSync(tx txs.Tx) (*rpc_tm_types.ResultBroadc return nil, err } // NOTE: [ben] This Response is set in /consensus/tendermint/local_client.go - // a call to Application, here implemented by ErisMint, over local callback, - // or abci RPC call. Hence the result is determined by ErisMint/erismint.go + // a call to Application, here implemented by BurrowMint, over local callback, + // or abci RPC call. Hence the result is determined by BurrowMint/burrowmint.go // CheckTx() Result (Result converted to ReqRes into Response returned here) // NOTE: [ben] BroadcastTx just calls CheckTx in Tendermint (oddly... [Silas]) response := <-responseChannel @@ -584,7 +581,7 @@ func (pipe *erisMintPipe) BroadcastTxSync(tx txs.Tx) (*rpc_tm_types.ResultBroadc return resultBroadCastTx, fmt.Errorf(resultBroadCastTx.Log) default: logging.InfoMsg(pipe.logger, "Unknown error returned from Tendermint CheckTx on BroadcastTxSync", - "application", GetErisMintVersion().GetVersionString(), + "application", GetBurrowMintVersion().GetVersionString(), "abci_code_type", responseCheckTx.Code, "abci_log", responseCheckTx.Log, ) @@ -592,7 +589,7 @@ func (pipe *erisMintPipe) BroadcastTxSync(tx txs.Tx) (*rpc_tm_types.ResultBroadc } } -func (pipe *erisMintPipe) ListUnconfirmedTxs(maxTxs int) (*rpc_tm_types.ResultListUnconfirmedTxs, error) { +func (pipe *burrowMintPipe) ListUnconfirmedTxs(maxTxs int) (*rpc_tm_types.ResultListUnconfirmedTxs, error) { // Get all transactions for now transactions, err := pipe.consensusEngine.ListUnconfirmedTxs(maxTxs) if err != nil { @@ -609,7 +606,7 @@ func (pipe *erisMintPipe) ListUnconfirmedTxs(maxTxs int) (*rpc_tm_types.ResultLi // from the top of the range of blocks. // Passing 0 for maxHeight sets the upper height of the range to the current // blockchain height. -func (pipe *erisMintPipe) BlockchainInfo(minHeight, maxHeight, +func (pipe *burrowMintPipe) BlockchainInfo(minHeight, maxHeight, maxBlockLookback int) (*rpc_tm_types.ResultBlockchainInfo, error) { latestHeight := pipe.blockchain.Height() @@ -635,14 +632,14 @@ func (pipe *erisMintPipe) BlockchainInfo(minHeight, maxHeight, }, nil } -func (pipe *erisMintPipe) GetBlock(height int) (*rpc_tm_types.ResultGetBlock, error) { +func (pipe *burrowMintPipe) GetBlock(height int) (*rpc_tm_types.ResultGetBlock, error) { return &rpc_tm_types.ResultGetBlock{ Block: pipe.blockchain.Block(height), BlockMeta: pipe.blockchain.BlockMeta(height), }, nil } -func (pipe *erisMintPipe) ListValidators() (*rpc_tm_types.ResultListValidators, error) { +func (pipe *burrowMintPipe) ListValidators() (*rpc_tm_types.ResultListValidators, error) { validators := pipe.consensusEngine.ListValidators() consensusState := pipe.consensusEngine.ConsensusState() // TODO: when we reintroduce support for bonding and unbonding update this @@ -654,7 +651,7 @@ func (pipe *erisMintPipe) ListValidators() (*rpc_tm_types.ResultListValidators, }, nil } -func (pipe *erisMintPipe) DumpConsensusState() (*rpc_tm_types.ResultDumpConsensusState, error) { +func (pipe *burrowMintPipe) DumpConsensusState() (*rpc_tm_types.ResultDumpConsensusState, error) { statesMap := pipe.consensusEngine.PeerConsensusStates() peerStates := make([]*rpc_tm_types.ResultPeerConsensusState, len(statesMap)) for key, peerState := range statesMap { diff --git a/manager/eris-mint/state/block_cache.go b/manager/burrow-mint/state/block_cache.go similarity index 97% rename from manager/eris-mint/state/block_cache.go rename to manager/burrow-mint/state/block_cache.go index 829be52377f89958022551f9949252e1380e6caa..e2e8e61dc6bc37d899763f677286223c062efa77 100644 --- a/manager/eris-mint/state/block_cache.go +++ b/manager/burrow-mint/state/block_cache.go @@ -19,10 +19,10 @@ import ( "fmt" "sort" - acm "github.com/monax/eris-db/account" - "github.com/monax/eris-db/common/sanity" - core_types "github.com/monax/eris-db/core/types" - . "github.com/monax/eris-db/word256" + acm "github.com/monax/burrow/account" + "github.com/monax/burrow/common/sanity" + core_types "github.com/monax/burrow/core/types" + . "github.com/monax/burrow/word256" dbm "github.com/tendermint/go-db" "github.com/tendermint/go-merkle" diff --git a/manager/eris-mint/state/common.go b/manager/burrow-mint/state/common.go similarity index 87% rename from manager/eris-mint/state/common.go rename to manager/burrow-mint/state/common.go index 21d82c9f7fda39cba8beef7879804770d0fe4371..b5b29b0fe332ff2505d0063650bff1df710087be 100644 --- a/manager/eris-mint/state/common.go +++ b/manager/burrow-mint/state/common.go @@ -15,9 +15,9 @@ package state import ( - acm "github.com/monax/eris-db/account" - "github.com/monax/eris-db/manager/eris-mint/evm" - . "github.com/monax/eris-db/word256" + acm "github.com/monax/burrow/account" + "github.com/monax/burrow/manager/burrow-mint/evm" + . "github.com/monax/burrow/word256" ) type AccountGetter interface { diff --git a/manager/eris-mint/state/execution.go b/manager/burrow-mint/state/execution.go similarity index 98% rename from manager/eris-mint/state/execution.go rename to manager/burrow-mint/state/execution.go index 87fb086a98a91c5b2ed10aed7523086b898d786e..cdb6ea2289fa0caf235c49c354023019eff1eb08 100644 --- a/manager/eris-mint/state/execution.go +++ b/manager/burrow-mint/state/execution.go @@ -19,13 +19,13 @@ import ( "errors" "fmt" - acm "github.com/monax/eris-db/account" - "github.com/monax/eris-db/common/sanity" - core_types "github.com/monax/eris-db/core/types" - "github.com/monax/eris-db/manager/eris-mint/evm" - ptypes "github.com/monax/eris-db/permission/types" // for GlobalPermissionAddress ... - "github.com/monax/eris-db/txs" - . "github.com/monax/eris-db/word256" + acm "github.com/monax/burrow/account" + "github.com/monax/burrow/common/sanity" + core_types "github.com/monax/burrow/core/types" + "github.com/monax/burrow/manager/burrow-mint/evm" + ptypes "github.com/monax/burrow/permission/types" // for GlobalPermissionAddress ... + "github.com/monax/burrow/txs" + . "github.com/monax/burrow/word256" "github.com/tendermint/go-events" ) diff --git a/manager/eris-mint/state/genesis_test.go b/manager/burrow-mint/state/genesis_test.go similarity index 96% rename from manager/eris-mint/state/genesis_test.go rename to manager/burrow-mint/state/genesis_test.go index 477656b200738e2915ae71b113f1a0318f9ba952..3c5a60f35162790fe6e0fc5469ec9711675c10ad 100644 --- a/manager/eris-mint/state/genesis_test.go +++ b/manager/burrow-mint/state/genesis_test.go @@ -22,10 +22,10 @@ import ( "testing" "time" - acm "github.com/monax/eris-db/account" - "github.com/monax/eris-db/common/random" - genesis "github.com/monax/eris-db/genesis" - ptypes "github.com/monax/eris-db/permission/types" + acm "github.com/monax/burrow/account" + "github.com/monax/burrow/common/random" + genesis "github.com/monax/burrow/genesis" + ptypes "github.com/monax/burrow/permission/types" tdb "github.com/tendermint/go-db" "github.com/tendermint/tendermint/types" diff --git a/manager/eris-mint/state/log.go b/manager/burrow-mint/state/log.go similarity index 100% rename from manager/eris-mint/state/log.go rename to manager/burrow-mint/state/log.go diff --git a/manager/eris-mint/state/permissions_test.go b/manager/burrow-mint/state/permissions_test.go similarity index 99% rename from manager/eris-mint/state/permissions_test.go rename to manager/burrow-mint/state/permissions_test.go index 19fb21da7e955798219cb0d0d95e593ca6e500bb..92dff5fa10c0cd779e89880c4a3cb56f86405482 100644 --- a/manager/eris-mint/state/permissions_test.go +++ b/manager/burrow-mint/state/permissions_test.go @@ -21,13 +21,13 @@ import ( "testing" "time" - acm "github.com/monax/eris-db/account" - genesis "github.com/monax/eris-db/genesis" - "github.com/monax/eris-db/manager/eris-mint/evm" - . "github.com/monax/eris-db/manager/eris-mint/evm/opcodes" - ptypes "github.com/monax/eris-db/permission/types" - "github.com/monax/eris-db/txs" - . "github.com/monax/eris-db/word256" + acm "github.com/monax/burrow/account" + genesis "github.com/monax/burrow/genesis" + "github.com/monax/burrow/manager/burrow-mint/evm" + . "github.com/monax/burrow/manager/burrow-mint/evm/opcodes" + ptypes "github.com/monax/burrow/permission/types" + "github.com/monax/burrow/txs" + . "github.com/monax/burrow/word256" "github.com/tendermint/go-crypto" dbm "github.com/tendermint/go-db" diff --git a/manager/eris-mint/state/state.go b/manager/burrow-mint/state/state.go similarity index 98% rename from manager/eris-mint/state/state.go rename to manager/burrow-mint/state/state.go index 7ff02042074d3b37eec9a33609d9caeaa1eb2b8a..3b925be530cc7b86875e190e0e1224f34bad8b65 100644 --- a/manager/eris-mint/state/state.go +++ b/manager/burrow-mint/state/state.go @@ -21,18 +21,18 @@ import ( "io/ioutil" "time" - acm "github.com/monax/eris-db/account" - genesis "github.com/monax/eris-db/genesis" - ptypes "github.com/monax/eris-db/permission/types" - "github.com/monax/eris-db/txs" + acm "github.com/monax/burrow/account" + genesis "github.com/monax/burrow/genesis" + ptypes "github.com/monax/burrow/permission/types" + "github.com/monax/burrow/txs" dbm "github.com/tendermint/go-db" "github.com/tendermint/go-events" "github.com/tendermint/go-merkle" "github.com/tendermint/go-wire" - core_types "github.com/monax/eris-db/core/types" - "github.com/monax/eris-db/util" + core_types "github.com/monax/burrow/core/types" + "github.com/monax/burrow/util" "github.com/tendermint/tendermint/types" ) diff --git a/manager/eris-mint/state/state_test.go b/manager/burrow-mint/state/state_test.go similarity index 99% rename from manager/eris-mint/state/state_test.go rename to manager/burrow-mint/state/state_test.go index 410f84ffff300f792738a691e5fa545855d5e100..72b23255af0384aacb0c377557d8df5520c76b2e 100644 --- a/manager/eris-mint/state/state_test.go +++ b/manager/burrow-mint/state/state_test.go @@ -19,10 +19,10 @@ import ( "encoding/hex" "testing" - core_types "github.com/monax/eris-db/core/types" - evm "github.com/monax/eris-db/manager/eris-mint/evm" - "github.com/monax/eris-db/txs" - "github.com/monax/eris-db/word256" + core_types "github.com/monax/burrow/core/types" + evm "github.com/monax/burrow/manager/burrow-mint/evm" + "github.com/monax/burrow/txs" + "github.com/monax/burrow/word256" "github.com/tendermint/tendermint/config/tendermint_test" ) diff --git a/manager/eris-mint/state/tx_cache.go b/manager/burrow-mint/state/tx_cache.go similarity index 95% rename from manager/eris-mint/state/tx_cache.go rename to manager/burrow-mint/state/tx_cache.go index d33e6dc4f53a44d863f7ed9907cc1479b7b6f617..43a38303296f50b681f33df0529be3cd85154771 100644 --- a/manager/eris-mint/state/tx_cache.go +++ b/manager/burrow-mint/state/tx_cache.go @@ -17,12 +17,12 @@ package state import ( "fmt" - acm "github.com/monax/eris-db/account" - "github.com/monax/eris-db/common/sanity" - "github.com/monax/eris-db/manager/eris-mint/evm" - ptypes "github.com/monax/eris-db/permission/types" // for GlobalPermissionAddress ... - "github.com/monax/eris-db/txs" - . "github.com/monax/eris-db/word256" + acm "github.com/monax/burrow/account" + "github.com/monax/burrow/common/sanity" + "github.com/monax/burrow/manager/burrow-mint/evm" + ptypes "github.com/monax/burrow/permission/types" // for GlobalPermissionAddress ... + "github.com/monax/burrow/txs" + . "github.com/monax/burrow/word256" "github.com/tendermint/go-crypto" ) diff --git a/manager/eris-mint/state/tx_cache_test.go b/manager/burrow-mint/state/tx_cache_test.go similarity index 100% rename from manager/eris-mint/state/tx_cache_test.go rename to manager/burrow-mint/state/tx_cache_test.go diff --git a/manager/eris-mint/transactor.go b/manager/burrow-mint/transactor.go similarity index 92% rename from manager/eris-mint/transactor.go rename to manager/burrow-mint/transactor.go index 2bf4ca1418f0f2ff22bb2acb10c286c95cf172db..0faa9bd8d125aa8d1377de3f33a5baac171dbcac 100644 --- a/manager/eris-mint/transactor.go +++ b/manager/burrow-mint/transactor.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package erismint +package burrowmint import ( "bytes" @@ -21,36 +21,36 @@ import ( "sync" "time" - "github.com/monax/eris-db/account" - core_types "github.com/monax/eris-db/core/types" - event "github.com/monax/eris-db/event" - "github.com/monax/eris-db/manager/eris-mint/evm" - "github.com/monax/eris-db/manager/eris-mint/state" - "github.com/monax/eris-db/txs" - "github.com/monax/eris-db/word256" + "github.com/monax/burrow/account" + core_types "github.com/monax/burrow/core/types" + event "github.com/monax/burrow/event" + "github.com/monax/burrow/manager/burrow-mint/evm" + "github.com/monax/burrow/manager/burrow-mint/state" + "github.com/monax/burrow/txs" + "github.com/monax/burrow/word256" "github.com/tendermint/go-crypto" tEvents "github.com/tendermint/go-events" ) -// Transactor is part of the pipe for ErisMint and provides the implementation -// for the pipe to call into the ErisMint application +// Transactor is part of the pipe for BurrowMint and provides the implementation +// for the pipe to call into the BurrowMint application type transactor struct { chainID string eventSwitch tEvents.Fireable - erisMint *ErisMint + burrowMint *BurrowMint eventEmitter event.EventEmitter txMtx *sync.Mutex txBroadcaster func(tx txs.Tx) error } func newTransactor(chainID string, eventSwitch tEvents.Fireable, - erisMint *ErisMint, eventEmitter event.EventEmitter, + burrowMint *BurrowMint, eventEmitter event.EventEmitter, txBroadcaster func(tx txs.Tx) error) *transactor { return &transactor{ chainID, eventSwitch, - erisMint, + burrowMint, eventEmitter, &sync.Mutex{}, txBroadcaster, @@ -65,7 +65,7 @@ func newTransactor(chainID string, eventSwitch tEvents.Fireable, func (this *transactor) Call(fromAddress, toAddress, data []byte) ( *core_types.Call, error) { - st := this.erisMint.GetState() + st := this.burrowMint.GetState() cache := state.NewBlockCache(st) // XXX: DON'T MUTATE THIS CACHE (used internally for CheckTx) outAcc := cache.GetAccount(toAddress) if outAcc == nil { @@ -105,11 +105,11 @@ func (this *transactor) CallCode(fromAddress, code, data []byte) ( if fromAddress == nil { fromAddress = []byte{} } - cache := this.erisMint.GetCheckCache() // XXX: DON'T MUTATE THIS CACHE (used internally for CheckTx) + cache := this.burrowMint.GetCheckCache() // XXX: DON'T MUTATE THIS CACHE (used internally for CheckTx) callee := &vm.Account{Address: word256.LeftPadWord256(fromAddress)} caller := &vm.Account{Address: word256.LeftPadWord256(fromAddress)} txCache := state.NewTxCache(cache) - st := this.erisMint.GetState() // for block height, time + st := this.burrowMint.GetState() // for block height, time gasLimit := st.GetGasLimit() params := vm.Params{ BlockHeight: int64(st.LastBlockHeight), @@ -168,7 +168,7 @@ func (this *transactor) Transact(privKey, address, data []byte, gasLimit, this.txMtx.Lock() defer this.txMtx.Unlock() pa := account.GenPrivAccountFromPrivKeyBytes(privKey) - cache := this.erisMint.GetCheckCache() // XXX: DON'T MUTATE THIS CACHE (used internally for CheckTx) + cache := this.burrowMint.GetCheckCache() // XXX: DON'T MUTATE THIS CACHE (used internally for CheckTx) acc := cache.GetAccount(pa.Address) var sequence int if acc == nil { @@ -274,7 +274,7 @@ func (this *transactor) Send(privKey, toAddress []byte, this.txMtx.Lock() defer this.txMtx.Unlock() pa := account.GenPrivAccountFromPrivKeyBytes(privKey) - cache := this.erisMint.GetState() + cache := this.burrowMint.GetState() acc := cache.GetAccount(pa.Address) var sequence int if acc == nil { @@ -352,7 +352,7 @@ func (this *transactor) TransactNameReg(privKey []byte, name, data string, this.txMtx.Lock() defer this.txMtx.Unlock() pa := account.GenPrivAccountFromPrivKeyBytes(privKey) - cache := this.erisMint.GetCheckCache() // XXX: DON'T MUTATE THIS CACHE (used internally for CheckTx) + cache := this.burrowMint.GetCheckCache() // XXX: DON'T MUTATE THIS CACHE (used internally for CheckTx) acc := cache.GetAccount(pa.Address) var sequence int if acc == nil { diff --git a/manager/eris-mint/version.go b/manager/burrow-mint/version.go similarity index 70% rename from manager/eris-mint/version.go rename to manager/burrow-mint/version.go index 8a888a269f7aac965f4602dff7c92b76107e5e20..d41300fae9957759b55e3fd106eb0219a5c8f513 100644 --- a/manager/eris-mint/version.go +++ b/manager/burrow-mint/version.go @@ -12,23 +12,23 @@ // See the License for the specific language governing permissions and // limitations under the License. -package erismint +package burrowmint import ( "fmt" - version "github.com/monax/eris-db/version" + version "github.com/monax/burrow/version" ) const ( // Client identifier to advertise over the network - erisMintClientIdentifier = "erismint" + burrowMintClientIdentifier = "burrowmint" // Major version component of the current release - erisMintVersionMajor = 0 + burrowMintVersionMajor = 0 // Minor version component of the current release - erisMintVersionMinor = 17 + burrowMintVersionMinor = 17 // Patch version component of the current release - erisMintVersionPatch = 0 + burrowMintVersionPatch = 0 ) // Define the compatible consensus engines this application manager @@ -37,9 +37,9 @@ var compatibleConsensus = [...]string{ "tendermint-0.8", } -func GetErisMintVersion() *version.VersionIdentifier { - return version.New(erisMintClientIdentifier, erisMintVersionMajor, - erisMintVersionMinor, erisMintVersionPatch) +func GetBurrowMintVersion() *version.VersionIdentifier { + return version.New(burrowMintClientIdentifier, burrowMintVersionMajor, + burrowMintVersionMinor, burrowMintVersionPatch) } func AssertCompatibleConsensus(consensusMinorVersion string) error { @@ -48,6 +48,6 @@ func AssertCompatibleConsensus(consensusMinorVersion string) error { return nil } } - return fmt.Errorf("ErisMint (%s) is not compatible with consensus engine %s", - GetErisMintVersion(), consensusMinorVersion) + return fmt.Errorf("BurrowMint (%s) is not compatible with consensus engine %s", + GetBurrowMintVersion(), consensusMinorVersion) } diff --git a/manager/config.go b/manager/config.go index c4eb548e8f876eb790b18677648bc60892b8c7f5..41d33712c30f289ea042c013faa4a1cf4a74bb8e 100644 --- a/manager/config.go +++ b/manager/config.go @@ -15,7 +15,7 @@ package manager import ( - erismint "github.com/monax/eris-db/manager/eris-mint" + burrowmint "github.com/monax/burrow/manager/burrow-mint" ) //------------------------------------------------------------------------------ @@ -23,8 +23,8 @@ import ( func AssertValidApplicationManagerModule(name, minorVersionString string) bool { switch name { - case "erismint": - return minorVersionString == erismint.GetErisMintVersion().GetMinorVersionString() + case "burrowmint": + return minorVersionString == burrowmint.GetBurrowMintVersion().GetMinorVersionString() case "geth": // TODO: [ben] implement Geth 1.4 as an application manager return false diff --git a/manager/manager.go b/manager/manager.go index 5abf06f962379a40b0b830f963cd8130cd9c6dc3..d014a1efc9e42c26d33de2c4479c10c7696c3a51 100644 --- a/manager/manager.go +++ b/manager/manager.go @@ -19,13 +19,13 @@ import ( events "github.com/tendermint/go-events" - config "github.com/monax/eris-db/config" - definitions "github.com/monax/eris-db/definitions" - erismint "github.com/monax/eris-db/manager/eris-mint" - // types "github.com/monax/eris-db/manager/types" + config "github.com/monax/burrow/config" + definitions "github.com/monax/burrow/definitions" + burrowmint "github.com/monax/burrow/manager/burrow-mint" + // types "github.com/monax/burrow/manager/types" - "github.com/monax/eris-db/logging" - "github.com/monax/eris-db/logging/loggers" + "github.com/monax/burrow/logging" + "github.com/monax/burrow/logging/loggers" ) // NewApplicationPipe returns an initialised Pipe interface @@ -38,14 +38,14 @@ func NewApplicationPipe(moduleConfig *config.ModuleConfig, consensusMinorVersion string) (definitions.Pipe, error) { switch moduleConfig.Name { - case "erismint": - if err := erismint.AssertCompatibleConsensus(consensusMinorVersion); err != nil { + case "burrowmint": + if err := burrowmint.AssertCompatibleConsensus(consensusMinorVersion); err != nil { return nil, err } - logging.InfoMsg(logger, "Loading ErisMint", + logging.InfoMsg(logger, "Loading BurrowMint", "compatibleConsensus", consensusMinorVersion, - "erisMintVersion", erismint.GetErisMintVersion().GetVersionString()) - return erismint.NewErisMintPipe(moduleConfig, evsw, logger) + "burrowMintVersion", burrowmint.GetBurrowMintVersion().GetVersionString()) + return burrowmint.NewBurrowMintPipe(moduleConfig, evsw, logger) } return nil, fmt.Errorf("Failed to return Pipe for %s", moduleConfig.Name) } diff --git a/manager/types/application.go b/manager/types/application.go index dbfe2b273bc5797b9ea9aec77e25b9c81e2b930a..d2eda8f38318e28b993f490a857548bfad091d84 100644 --- a/manager/types/application.go +++ b/manager/types/application.go @@ -23,7 +23,6 @@ import ( // NOTE: [ben] this interface is likely to be changed. Currently it is taken // from the tendermint socket protocol application interface; -// but for the needs of eris-rt and generalisation improvements will be made. // Application interface applies transactions to the state. type Application interface { @@ -72,8 +71,8 @@ type Application interface { // Query for state. This query request is not passed over the p2p network // and is called from Tendermint rpc directly up to the application. - // NOTE: [ben] Eris-DB will give preference to queries from the local client - // directly over the Eris-DB rpc. + // NOTE: [ben] burrow will give preference to queries from the local client + // directly over the burrow rpc. // We will support this for Tendermint compatibility. Query(query []byte) abci_types.Result } diff --git a/net_test/README.md b/net_test/README.md deleted file mode 100644 index 68d42a5a4988cb7558ec55aee846ffec18da9dd1..0000000000000000000000000000000000000000 --- a/net_test/README.md +++ /dev/null @@ -1,14 +0,0 @@ -# Network Integration Test - -Test transaction relaying with nonce-based txs - -Dependencies: eris-cli, mint-client - -Expects docker-machines to be already deployed as mach1, mach2, mach3, mach4. -Machine name (`mach`) can be changed at top of `setup.sh` - -Start the network nodes and the local proxy: `./setup.sh` - -Run the test: `./test.sh` - -Use `./dev/rm.sh` to wipe the remote containers, and `eris clean` to wipe the local ones. diff --git a/net_test/data/init.sh b/net_test/data/init.sh deleted file mode 100755 index cc026c0d4fc25f8db777c367f4eee5d6accdc667..0000000000000000000000000000000000000000 --- a/net_test/data/init.sh +++ /dev/null @@ -1,12 +0,0 @@ -#! /bin/bash -# this script installs and runs erisdb, because we don't have patience for docker - -BRANCH="fixes" - -go get -d github.com/monax/eris-db -cd $GOPATH/src/github.com/monax/eris-db -git fetch origin $BRANCH -git checkout $BRANCH -go install ./cmd/erisdb - -erisdb $CHAIN_DIR # should be exposed by docker file diff --git a/net_test/data/local/config.toml b/net_test/data/local/config.toml deleted file mode 100644 index 1a55f5107b7f6d0bbd660d6a9498c31a510aff9e..0000000000000000000000000000000000000000 --- a/net_test/data/local/config.toml +++ /dev/null @@ -1,11 +0,0 @@ -# This is a TOML config file. -# For more information, see https://github.com/toml-lang/toml - -moniker = "golden_goose" -skip_upnp = true -node_laddr = "0.0.0.0:46656" -seeds = "104.236.45.149:46656" -fast_sync = false -db_backend = "leveldb" -log_level = "debug" -rpc_laddr = "0.0.0.0:46657" diff --git a/net_test/data/local/genesis.json b/net_test/data/local/genesis.json deleted file mode 100644 index 2beb2e0e7d8cf232ec5ea93a028a30048e46bba6..0000000000000000000000000000000000000000 --- a/net_test/data/local/genesis.json +++ /dev/null @@ -1,113 +0,0 @@ -{ - "genesis_time": "2016-02-25T02:52:00.489Z", - "chain_id": "net_test", - "params": null, - "accounts": [ - { - "address": "0A73F65F86271552C4858091D3DADFE3335B9272", - "amount": 2251799813685248, - "name": "", - "permissions": { - "base": { - "perms": 2302, - "set": 2302 - }, - "roles": [] - } - }, - { - "address": "3BF0230BFE5CFB2C4609EE6893137A08A0353FCF", - "amount": 2251799813685248, - "name": "", - "permissions": { - "base": { - "perms": 2302, - "set": 2302 - }, - "roles": [] - } - }, - { - "address": "6C76BECAE4692F0E44DD780C91CDF2188658B871", - "amount": 2251799813685248, - "name": "", - "permissions": { - "base": { - "perms": 2302, - "set": 2302 - }, - "roles": [] - } - }, - { - "address": "BC7721F9DBBDDEFE3384FABB7F0EBDE7A599BCF6", - "amount": 2251799813685248, - "name": "", - "permissions": { - "base": { - "perms": 2302, - "set": 2302 - }, - "roles": [] - } - } - ], - "validators": [ - { - "pub_key": [ - 1, - "520FD1AF439F68F977E5F8AEA9F6BF6FB041CD7E3640095C5838F4CFC9CD5599" - ], - "amount": 1000, - "name": "", - "unbond_to": [ - { - "address": "BC7721F9DBBDDEFE3384FABB7F0EBDE7A599BCF6", - "amount": 1000 - } - ] - }, - { - "pub_key": [ - 1, - "5A195121671DD5D06E57A53FE4165F83E3779C270837A06CA69A9142C893F3B0" - ], - "amount": 1000, - "name": "", - "unbond_to": [ - { - "address": "3BF0230BFE5CFB2C4609EE6893137A08A0353FCF", - "amount": 1000 - } - ] - }, - { - "pub_key": [ - 1, - "7571290A33CFAE246136818BF20BE9719FEDA162D2588F8B54AC2ED27F8FFEC7" - ], - "amount": 1000, - "name": "", - "unbond_to": [ - { - "address": "6C76BECAE4692F0E44DD780C91CDF2188658B871", - "amount": 1000 - } - ] - }, - { - "pub_key": [ - 1, - "053FFACC3B1F8AD855538E7B9F8E6EE8661C8170C6E159706654E5BF7F42FEFA" - ], - "amount": 1000, - "name": "", - "unbond_to": [ - { - "address": "0A73F65F86271552C4858091D3DADFE3335B9272", - "amount": 1000 - } - ] - } - ] -} \ No newline at end of file diff --git a/net_test/data/local/priv_validator.json b/net_test/data/local/priv_validator.json deleted file mode 100644 index 49862c0abe6e043e7c3b73e3b1a6011fed774f79..0000000000000000000000000000000000000000 --- a/net_test/data/local/priv_validator.json +++ /dev/null @@ -1 +0,0 @@ -{"address":"F8C21B6934E34C25067085AAB313BBFD714393EE","pub_key":[1,"0E89C57AAE3E02476A09A1498AE219A232341CF006238581EB5BB22B10CC2364"],"last_height":0,"last_round":0,"last_step":0,"priv_key":[1,"16EF1EE7895803D7BEF04B6BEE1E6B60C995B868CDA632C96B1846C12FE9A79B0E89C57AAE3E02476A09A1498AE219A232341CF006238581EB5BB22B10CC2364"]} \ No newline at end of file diff --git a/net_test/data/local/server_conf.toml b/net_test/data/local/server_conf.toml deleted file mode 100644 index e1fa06450446dcd9f91d6f3fac0744a94502ee86..0000000000000000000000000000000000000000 --- a/net_test/data/local/server_conf.toml +++ /dev/null @@ -1,26 +0,0 @@ -[bind] -address="" -port=1337 -[TLS] -tls=false -cert_path="" -key_path="" -[CORS] -enable=false -allow_origins=[] -allow_credentials=false -allow_methods=[] -allow_headers=[] -expose_headers=[] -max_age=0 -[HTTP] -json_rpc_endpoint="/rpc" -[web_socket] -websocket_endpoint="/socketrpc" -max_websocket_sessions=50 -read_buffer_size=4096 -write_buffer_size=4096 -[logging] -console_log_level="info" -file_log_level="warn" -log_file="" diff --git a/net_test/data/local_data/config.toml b/net_test/data/local_data/config.toml deleted file mode 100644 index 1a55f5107b7f6d0bbd660d6a9498c31a510aff9e..0000000000000000000000000000000000000000 --- a/net_test/data/local_data/config.toml +++ /dev/null @@ -1,11 +0,0 @@ -# This is a TOML config file. -# For more information, see https://github.com/toml-lang/toml - -moniker = "golden_goose" -skip_upnp = true -node_laddr = "0.0.0.0:46656" -seeds = "104.236.45.149:46656" -fast_sync = false -db_backend = "leveldb" -log_level = "debug" -rpc_laddr = "0.0.0.0:46657" diff --git a/net_test/data/local_data/genesis.json b/net_test/data/local_data/genesis.json deleted file mode 100644 index 2beb2e0e7d8cf232ec5ea93a028a30048e46bba6..0000000000000000000000000000000000000000 --- a/net_test/data/local_data/genesis.json +++ /dev/null @@ -1,113 +0,0 @@ -{ - "genesis_time": "2016-02-25T02:52:00.489Z", - "chain_id": "net_test", - "params": null, - "accounts": [ - { - "address": "0A73F65F86271552C4858091D3DADFE3335B9272", - "amount": 2251799813685248, - "name": "", - "permissions": { - "base": { - "perms": 2302, - "set": 2302 - }, - "roles": [] - } - }, - { - "address": "3BF0230BFE5CFB2C4609EE6893137A08A0353FCF", - "amount": 2251799813685248, - "name": "", - "permissions": { - "base": { - "perms": 2302, - "set": 2302 - }, - "roles": [] - } - }, - { - "address": "6C76BECAE4692F0E44DD780C91CDF2188658B871", - "amount": 2251799813685248, - "name": "", - "permissions": { - "base": { - "perms": 2302, - "set": 2302 - }, - "roles": [] - } - }, - { - "address": "BC7721F9DBBDDEFE3384FABB7F0EBDE7A599BCF6", - "amount": 2251799813685248, - "name": "", - "permissions": { - "base": { - "perms": 2302, - "set": 2302 - }, - "roles": [] - } - } - ], - "validators": [ - { - "pub_key": [ - 1, - "520FD1AF439F68F977E5F8AEA9F6BF6FB041CD7E3640095C5838F4CFC9CD5599" - ], - "amount": 1000, - "name": "", - "unbond_to": [ - { - "address": "BC7721F9DBBDDEFE3384FABB7F0EBDE7A599BCF6", - "amount": 1000 - } - ] - }, - { - "pub_key": [ - 1, - "5A195121671DD5D06E57A53FE4165F83E3779C270837A06CA69A9142C893F3B0" - ], - "amount": 1000, - "name": "", - "unbond_to": [ - { - "address": "3BF0230BFE5CFB2C4609EE6893137A08A0353FCF", - "amount": 1000 - } - ] - }, - { - "pub_key": [ - 1, - "7571290A33CFAE246136818BF20BE9719FEDA162D2588F8B54AC2ED27F8FFEC7" - ], - "amount": 1000, - "name": "", - "unbond_to": [ - { - "address": "6C76BECAE4692F0E44DD780C91CDF2188658B871", - "amount": 1000 - } - ] - }, - { - "pub_key": [ - 1, - "053FFACC3B1F8AD855538E7B9F8E6EE8661C8170C6E159706654E5BF7F42FEFA" - ], - "amount": 1000, - "name": "", - "unbond_to": [ - { - "address": "0A73F65F86271552C4858091D3DADFE3335B9272", - "amount": 1000 - } - ] - } - ] -} \ No newline at end of file diff --git a/net_test/data/local_data/priv_validator.json b/net_test/data/local_data/priv_validator.json deleted file mode 100644 index 49862c0abe6e043e7c3b73e3b1a6011fed774f79..0000000000000000000000000000000000000000 --- a/net_test/data/local_data/priv_validator.json +++ /dev/null @@ -1 +0,0 @@ -{"address":"F8C21B6934E34C25067085AAB313BBFD714393EE","pub_key":[1,"0E89C57AAE3E02476A09A1498AE219A232341CF006238581EB5BB22B10CC2364"],"last_height":0,"last_round":0,"last_step":0,"priv_key":[1,"16EF1EE7895803D7BEF04B6BEE1E6B60C995B868CDA632C96B1846C12FE9A79B0E89C57AAE3E02476A09A1498AE219A232341CF006238581EB5BB22B10CC2364"]} \ No newline at end of file diff --git a/net_test/data/local_data/server_conf.toml b/net_test/data/local_data/server_conf.toml deleted file mode 100644 index e1fa06450446dcd9f91d6f3fac0744a94502ee86..0000000000000000000000000000000000000000 --- a/net_test/data/local_data/server_conf.toml +++ /dev/null @@ -1,26 +0,0 @@ -[bind] -address="" -port=1337 -[TLS] -tls=false -cert_path="" -key_path="" -[CORS] -enable=false -allow_origins=[] -allow_credentials=false -allow_methods=[] -allow_headers=[] -expose_headers=[] -max_age=0 -[HTTP] -json_rpc_endpoint="/rpc" -[web_socket] -websocket_endpoint="/socketrpc" -max_websocket_sessions=50 -read_buffer_size=4096 -write_buffer_size=4096 -[logging] -console_log_level="info" -file_log_level="warn" -log_file="" diff --git a/net_test/data/net_test_0/config.toml b/net_test/data/net_test_0/config.toml deleted file mode 100644 index 1a55f5107b7f6d0bbd660d6a9498c31a510aff9e..0000000000000000000000000000000000000000 --- a/net_test/data/net_test_0/config.toml +++ /dev/null @@ -1,11 +0,0 @@ -# This is a TOML config file. -# For more information, see https://github.com/toml-lang/toml - -moniker = "golden_goose" -skip_upnp = true -node_laddr = "0.0.0.0:46656" -seeds = "104.236.45.149:46656" -fast_sync = false -db_backend = "leveldb" -log_level = "debug" -rpc_laddr = "0.0.0.0:46657" diff --git a/net_test/data/net_test_0/genesis.json b/net_test/data/net_test_0/genesis.json deleted file mode 100644 index 2beb2e0e7d8cf232ec5ea93a028a30048e46bba6..0000000000000000000000000000000000000000 --- a/net_test/data/net_test_0/genesis.json +++ /dev/null @@ -1,113 +0,0 @@ -{ - "genesis_time": "2016-02-25T02:52:00.489Z", - "chain_id": "net_test", - "params": null, - "accounts": [ - { - "address": "0A73F65F86271552C4858091D3DADFE3335B9272", - "amount": 2251799813685248, - "name": "", - "permissions": { - "base": { - "perms": 2302, - "set": 2302 - }, - "roles": [] - } - }, - { - "address": "3BF0230BFE5CFB2C4609EE6893137A08A0353FCF", - "amount": 2251799813685248, - "name": "", - "permissions": { - "base": { - "perms": 2302, - "set": 2302 - }, - "roles": [] - } - }, - { - "address": "6C76BECAE4692F0E44DD780C91CDF2188658B871", - "amount": 2251799813685248, - "name": "", - "permissions": { - "base": { - "perms": 2302, - "set": 2302 - }, - "roles": [] - } - }, - { - "address": "BC7721F9DBBDDEFE3384FABB7F0EBDE7A599BCF6", - "amount": 2251799813685248, - "name": "", - "permissions": { - "base": { - "perms": 2302, - "set": 2302 - }, - "roles": [] - } - } - ], - "validators": [ - { - "pub_key": [ - 1, - "520FD1AF439F68F977E5F8AEA9F6BF6FB041CD7E3640095C5838F4CFC9CD5599" - ], - "amount": 1000, - "name": "", - "unbond_to": [ - { - "address": "BC7721F9DBBDDEFE3384FABB7F0EBDE7A599BCF6", - "amount": 1000 - } - ] - }, - { - "pub_key": [ - 1, - "5A195121671DD5D06E57A53FE4165F83E3779C270837A06CA69A9142C893F3B0" - ], - "amount": 1000, - "name": "", - "unbond_to": [ - { - "address": "3BF0230BFE5CFB2C4609EE6893137A08A0353FCF", - "amount": 1000 - } - ] - }, - { - "pub_key": [ - 1, - "7571290A33CFAE246136818BF20BE9719FEDA162D2588F8B54AC2ED27F8FFEC7" - ], - "amount": 1000, - "name": "", - "unbond_to": [ - { - "address": "6C76BECAE4692F0E44DD780C91CDF2188658B871", - "amount": 1000 - } - ] - }, - { - "pub_key": [ - 1, - "053FFACC3B1F8AD855538E7B9F8E6EE8661C8170C6E159706654E5BF7F42FEFA" - ], - "amount": 1000, - "name": "", - "unbond_to": [ - { - "address": "0A73F65F86271552C4858091D3DADFE3335B9272", - "amount": 1000 - } - ] - } - ] -} \ No newline at end of file diff --git a/net_test/data/net_test_0/init.sh b/net_test/data/net_test_0/init.sh deleted file mode 100755 index cc026c0d4fc25f8db777c367f4eee5d6accdc667..0000000000000000000000000000000000000000 --- a/net_test/data/net_test_0/init.sh +++ /dev/null @@ -1,12 +0,0 @@ -#! /bin/bash -# this script installs and runs erisdb, because we don't have patience for docker - -BRANCH="fixes" - -go get -d github.com/monax/eris-db -cd $GOPATH/src/github.com/monax/eris-db -git fetch origin $BRANCH -git checkout $BRANCH -go install ./cmd/erisdb - -erisdb $CHAIN_DIR # should be exposed by docker file diff --git a/net_test/data/net_test_0/priv_validator.json b/net_test/data/net_test_0/priv_validator.json deleted file mode 100644 index e87e544193a2bceca9ab8a2f4a3c83b587e2c2f8..0000000000000000000000000000000000000000 --- a/net_test/data/net_test_0/priv_validator.json +++ /dev/null @@ -1 +0,0 @@ -{"address":"0A73F65F86271552C4858091D3DADFE3335B9272","pub_key":[1,"053FFACC3B1F8AD855538E7B9F8E6EE8661C8170C6E159706654E5BF7F42FEFA"],"last_height":0,"last_round":0,"last_step":0,"priv_key":[1,"327E2C108827404E20686BED8A3110D8EC54B3D725430C2B0D0D461699EB8FFC053FFACC3B1F8AD855538E7B9F8E6EE8661C8170C6E159706654E5BF7F42FEFA"]} \ No newline at end of file diff --git a/net_test/data/net_test_0/server_conf.toml b/net_test/data/net_test_0/server_conf.toml deleted file mode 100644 index e1fa06450446dcd9f91d6f3fac0744a94502ee86..0000000000000000000000000000000000000000 --- a/net_test/data/net_test_0/server_conf.toml +++ /dev/null @@ -1,26 +0,0 @@ -[bind] -address="" -port=1337 -[TLS] -tls=false -cert_path="" -key_path="" -[CORS] -enable=false -allow_origins=[] -allow_credentials=false -allow_methods=[] -allow_headers=[] -expose_headers=[] -max_age=0 -[HTTP] -json_rpc_endpoint="/rpc" -[web_socket] -websocket_endpoint="/socketrpc" -max_websocket_sessions=50 -read_buffer_size=4096 -write_buffer_size=4096 -[logging] -console_log_level="info" -file_log_level="warn" -log_file="" diff --git a/net_test/data/net_test_1/config.toml b/net_test/data/net_test_1/config.toml deleted file mode 100644 index 1a55f5107b7f6d0bbd660d6a9498c31a510aff9e..0000000000000000000000000000000000000000 --- a/net_test/data/net_test_1/config.toml +++ /dev/null @@ -1,11 +0,0 @@ -# This is a TOML config file. -# For more information, see https://github.com/toml-lang/toml - -moniker = "golden_goose" -skip_upnp = true -node_laddr = "0.0.0.0:46656" -seeds = "104.236.45.149:46656" -fast_sync = false -db_backend = "leveldb" -log_level = "debug" -rpc_laddr = "0.0.0.0:46657" diff --git a/net_test/data/net_test_1/genesis.json b/net_test/data/net_test_1/genesis.json deleted file mode 100644 index 2beb2e0e7d8cf232ec5ea93a028a30048e46bba6..0000000000000000000000000000000000000000 --- a/net_test/data/net_test_1/genesis.json +++ /dev/null @@ -1,113 +0,0 @@ -{ - "genesis_time": "2016-02-25T02:52:00.489Z", - "chain_id": "net_test", - "params": null, - "accounts": [ - { - "address": "0A73F65F86271552C4858091D3DADFE3335B9272", - "amount": 2251799813685248, - "name": "", - "permissions": { - "base": { - "perms": 2302, - "set": 2302 - }, - "roles": [] - } - }, - { - "address": "3BF0230BFE5CFB2C4609EE6893137A08A0353FCF", - "amount": 2251799813685248, - "name": "", - "permissions": { - "base": { - "perms": 2302, - "set": 2302 - }, - "roles": [] - } - }, - { - "address": "6C76BECAE4692F0E44DD780C91CDF2188658B871", - "amount": 2251799813685248, - "name": "", - "permissions": { - "base": { - "perms": 2302, - "set": 2302 - }, - "roles": [] - } - }, - { - "address": "BC7721F9DBBDDEFE3384FABB7F0EBDE7A599BCF6", - "amount": 2251799813685248, - "name": "", - "permissions": { - "base": { - "perms": 2302, - "set": 2302 - }, - "roles": [] - } - } - ], - "validators": [ - { - "pub_key": [ - 1, - "520FD1AF439F68F977E5F8AEA9F6BF6FB041CD7E3640095C5838F4CFC9CD5599" - ], - "amount": 1000, - "name": "", - "unbond_to": [ - { - "address": "BC7721F9DBBDDEFE3384FABB7F0EBDE7A599BCF6", - "amount": 1000 - } - ] - }, - { - "pub_key": [ - 1, - "5A195121671DD5D06E57A53FE4165F83E3779C270837A06CA69A9142C893F3B0" - ], - "amount": 1000, - "name": "", - "unbond_to": [ - { - "address": "3BF0230BFE5CFB2C4609EE6893137A08A0353FCF", - "amount": 1000 - } - ] - }, - { - "pub_key": [ - 1, - "7571290A33CFAE246136818BF20BE9719FEDA162D2588F8B54AC2ED27F8FFEC7" - ], - "amount": 1000, - "name": "", - "unbond_to": [ - { - "address": "6C76BECAE4692F0E44DD780C91CDF2188658B871", - "amount": 1000 - } - ] - }, - { - "pub_key": [ - 1, - "053FFACC3B1F8AD855538E7B9F8E6EE8661C8170C6E159706654E5BF7F42FEFA" - ], - "amount": 1000, - "name": "", - "unbond_to": [ - { - "address": "0A73F65F86271552C4858091D3DADFE3335B9272", - "amount": 1000 - } - ] - } - ] -} \ No newline at end of file diff --git a/net_test/data/net_test_1/init.sh b/net_test/data/net_test_1/init.sh deleted file mode 100755 index cc026c0d4fc25f8db777c367f4eee5d6accdc667..0000000000000000000000000000000000000000 --- a/net_test/data/net_test_1/init.sh +++ /dev/null @@ -1,12 +0,0 @@ -#! /bin/bash -# this script installs and runs erisdb, because we don't have patience for docker - -BRANCH="fixes" - -go get -d github.com/monax/eris-db -cd $GOPATH/src/github.com/monax/eris-db -git fetch origin $BRANCH -git checkout $BRANCH -go install ./cmd/erisdb - -erisdb $CHAIN_DIR # should be exposed by docker file diff --git a/net_test/data/net_test_1/priv_validator.json b/net_test/data/net_test_1/priv_validator.json deleted file mode 100644 index 537f39f7f23b32fc230454d08cb325e17dff4bfd..0000000000000000000000000000000000000000 --- a/net_test/data/net_test_1/priv_validator.json +++ /dev/null @@ -1 +0,0 @@ -{"address":"3BF0230BFE5CFB2C4609EE6893137A08A0353FCF","pub_key":[1,"5A195121671DD5D06E57A53FE4165F83E3779C270837A06CA69A9142C893F3B0"],"priv_key":[1,"B5811A4DB066E77EB3F87DD28ADC9A55DC4816DA648898B75BBCCEC4652D207B5A195121671DD5D06E57A53FE4165F83E3779C270837A06CA69A9142C893F3B0"],"last_height":0,"last_round":0,"last_step":0} \ No newline at end of file diff --git a/net_test/data/net_test_2/config.toml b/net_test/data/net_test_2/config.toml deleted file mode 100644 index 1a55f5107b7f6d0bbd660d6a9498c31a510aff9e..0000000000000000000000000000000000000000 --- a/net_test/data/net_test_2/config.toml +++ /dev/null @@ -1,11 +0,0 @@ -# This is a TOML config file. -# For more information, see https://github.com/toml-lang/toml - -moniker = "golden_goose" -skip_upnp = true -node_laddr = "0.0.0.0:46656" -seeds = "104.236.45.149:46656" -fast_sync = false -db_backend = "leveldb" -log_level = "debug" -rpc_laddr = "0.0.0.0:46657" diff --git a/net_test/data/net_test_2/genesis.json b/net_test/data/net_test_2/genesis.json deleted file mode 100644 index 2beb2e0e7d8cf232ec5ea93a028a30048e46bba6..0000000000000000000000000000000000000000 --- a/net_test/data/net_test_2/genesis.json +++ /dev/null @@ -1,113 +0,0 @@ -{ - "genesis_time": "2016-02-25T02:52:00.489Z", - "chain_id": "net_test", - "params": null, - "accounts": [ - { - "address": "0A73F65F86271552C4858091D3DADFE3335B9272", - "amount": 2251799813685248, - "name": "", - "permissions": { - "base": { - "perms": 2302, - "set": 2302 - }, - "roles": [] - } - }, - { - "address": "3BF0230BFE5CFB2C4609EE6893137A08A0353FCF", - "amount": 2251799813685248, - "name": "", - "permissions": { - "base": { - "perms": 2302, - "set": 2302 - }, - "roles": [] - } - }, - { - "address": "6C76BECAE4692F0E44DD780C91CDF2188658B871", - "amount": 2251799813685248, - "name": "", - "permissions": { - "base": { - "perms": 2302, - "set": 2302 - }, - "roles": [] - } - }, - { - "address": "BC7721F9DBBDDEFE3384FABB7F0EBDE7A599BCF6", - "amount": 2251799813685248, - "name": "", - "permissions": { - "base": { - "perms": 2302, - "set": 2302 - }, - "roles": [] - } - } - ], - "validators": [ - { - "pub_key": [ - 1, - "520FD1AF439F68F977E5F8AEA9F6BF6FB041CD7E3640095C5838F4CFC9CD5599" - ], - "amount": 1000, - "name": "", - "unbond_to": [ - { - "address": "BC7721F9DBBDDEFE3384FABB7F0EBDE7A599BCF6", - "amount": 1000 - } - ] - }, - { - "pub_key": [ - 1, - "5A195121671DD5D06E57A53FE4165F83E3779C270837A06CA69A9142C893F3B0" - ], - "amount": 1000, - "name": "", - "unbond_to": [ - { - "address": "3BF0230BFE5CFB2C4609EE6893137A08A0353FCF", - "amount": 1000 - } - ] - }, - { - "pub_key": [ - 1, - "7571290A33CFAE246136818BF20BE9719FEDA162D2588F8B54AC2ED27F8FFEC7" - ], - "amount": 1000, - "name": "", - "unbond_to": [ - { - "address": "6C76BECAE4692F0E44DD780C91CDF2188658B871", - "amount": 1000 - } - ] - }, - { - "pub_key": [ - 1, - "053FFACC3B1F8AD855538E7B9F8E6EE8661C8170C6E159706654E5BF7F42FEFA" - ], - "amount": 1000, - "name": "", - "unbond_to": [ - { - "address": "0A73F65F86271552C4858091D3DADFE3335B9272", - "amount": 1000 - } - ] - } - ] -} \ No newline at end of file diff --git a/net_test/data/net_test_2/init.sh b/net_test/data/net_test_2/init.sh deleted file mode 100755 index cc026c0d4fc25f8db777c367f4eee5d6accdc667..0000000000000000000000000000000000000000 --- a/net_test/data/net_test_2/init.sh +++ /dev/null @@ -1,12 +0,0 @@ -#! /bin/bash -# this script installs and runs erisdb, because we don't have patience for docker - -BRANCH="fixes" - -go get -d github.com/monax/eris-db -cd $GOPATH/src/github.com/monax/eris-db -git fetch origin $BRANCH -git checkout $BRANCH -go install ./cmd/erisdb - -erisdb $CHAIN_DIR # should be exposed by docker file diff --git a/net_test/data/net_test_2/priv_validator.json b/net_test/data/net_test_2/priv_validator.json deleted file mode 100644 index 7fee99d4ce6596bfc2e642363a14209521be8705..0000000000000000000000000000000000000000 --- a/net_test/data/net_test_2/priv_validator.json +++ /dev/null @@ -1 +0,0 @@ -{"address":"6C76BECAE4692F0E44DD780C91CDF2188658B871","pub_key":[1,"7571290A33CFAE246136818BF20BE9719FEDA162D2588F8B54AC2ED27F8FFEC7"],"priv_key":[1,"35D9F61882E5E71DBE8E241EE39C0BEE5AFBEB85FF1D2D1D331D4849E4C802AA7571290A33CFAE246136818BF20BE9719FEDA162D2588F8B54AC2ED27F8FFEC7"],"last_height":0,"last_round":0,"last_step":0} \ No newline at end of file diff --git a/net_test/data/net_test_3/config.toml b/net_test/data/net_test_3/config.toml deleted file mode 100644 index 1a55f5107b7f6d0bbd660d6a9498c31a510aff9e..0000000000000000000000000000000000000000 --- a/net_test/data/net_test_3/config.toml +++ /dev/null @@ -1,11 +0,0 @@ -# This is a TOML config file. -# For more information, see https://github.com/toml-lang/toml - -moniker = "golden_goose" -skip_upnp = true -node_laddr = "0.0.0.0:46656" -seeds = "104.236.45.149:46656" -fast_sync = false -db_backend = "leveldb" -log_level = "debug" -rpc_laddr = "0.0.0.0:46657" diff --git a/net_test/data/net_test_3/genesis.json b/net_test/data/net_test_3/genesis.json deleted file mode 100644 index 2beb2e0e7d8cf232ec5ea93a028a30048e46bba6..0000000000000000000000000000000000000000 --- a/net_test/data/net_test_3/genesis.json +++ /dev/null @@ -1,113 +0,0 @@ -{ - "genesis_time": "2016-02-25T02:52:00.489Z", - "chain_id": "net_test", - "params": null, - "accounts": [ - { - "address": "0A73F65F86271552C4858091D3DADFE3335B9272", - "amount": 2251799813685248, - "name": "", - "permissions": { - "base": { - "perms": 2302, - "set": 2302 - }, - "roles": [] - } - }, - { - "address": "3BF0230BFE5CFB2C4609EE6893137A08A0353FCF", - "amount": 2251799813685248, - "name": "", - "permissions": { - "base": { - "perms": 2302, - "set": 2302 - }, - "roles": [] - } - }, - { - "address": "6C76BECAE4692F0E44DD780C91CDF2188658B871", - "amount": 2251799813685248, - "name": "", - "permissions": { - "base": { - "perms": 2302, - "set": 2302 - }, - "roles": [] - } - }, - { - "address": "BC7721F9DBBDDEFE3384FABB7F0EBDE7A599BCF6", - "amount": 2251799813685248, - "name": "", - "permissions": { - "base": { - "perms": 2302, - "set": 2302 - }, - "roles": [] - } - } - ], - "validators": [ - { - "pub_key": [ - 1, - "520FD1AF439F68F977E5F8AEA9F6BF6FB041CD7E3640095C5838F4CFC9CD5599" - ], - "amount": 1000, - "name": "", - "unbond_to": [ - { - "address": "BC7721F9DBBDDEFE3384FABB7F0EBDE7A599BCF6", - "amount": 1000 - } - ] - }, - { - "pub_key": [ - 1, - "5A195121671DD5D06E57A53FE4165F83E3779C270837A06CA69A9142C893F3B0" - ], - "amount": 1000, - "name": "", - "unbond_to": [ - { - "address": "3BF0230BFE5CFB2C4609EE6893137A08A0353FCF", - "amount": 1000 - } - ] - }, - { - "pub_key": [ - 1, - "7571290A33CFAE246136818BF20BE9719FEDA162D2588F8B54AC2ED27F8FFEC7" - ], - "amount": 1000, - "name": "", - "unbond_to": [ - { - "address": "6C76BECAE4692F0E44DD780C91CDF2188658B871", - "amount": 1000 - } - ] - }, - { - "pub_key": [ - 1, - "053FFACC3B1F8AD855538E7B9F8E6EE8661C8170C6E159706654E5BF7F42FEFA" - ], - "amount": 1000, - "name": "", - "unbond_to": [ - { - "address": "0A73F65F86271552C4858091D3DADFE3335B9272", - "amount": 1000 - } - ] - } - ] -} \ No newline at end of file diff --git a/net_test/data/net_test_3/init.sh b/net_test/data/net_test_3/init.sh deleted file mode 100755 index cc026c0d4fc25f8db777c367f4eee5d6accdc667..0000000000000000000000000000000000000000 --- a/net_test/data/net_test_3/init.sh +++ /dev/null @@ -1,12 +0,0 @@ -#! /bin/bash -# this script installs and runs erisdb, because we don't have patience for docker - -BRANCH="fixes" - -go get -d github.com/monax/eris-db -cd $GOPATH/src/github.com/monax/eris-db -git fetch origin $BRANCH -git checkout $BRANCH -go install ./cmd/erisdb - -erisdb $CHAIN_DIR # should be exposed by docker file diff --git a/net_test/data/net_test_3/priv_validator.json b/net_test/data/net_test_3/priv_validator.json deleted file mode 100644 index 620c8f80ce8ed67169d24043b0c4a48db3c1df32..0000000000000000000000000000000000000000 --- a/net_test/data/net_test_3/priv_validator.json +++ /dev/null @@ -1 +0,0 @@ -{"address":"BC7721F9DBBDDEFE3384FABB7F0EBDE7A599BCF6","pub_key":[1,"520FD1AF439F68F977E5F8AEA9F6BF6FB041CD7E3640095C5838F4CFC9CD5599"],"priv_key":[1,"640AA03CB926DAF8B4D54FCAA289976AD724AB1A95A456E65B1EA8B465FC4BAB520FD1AF439F68F977E5F8AEA9F6BF6FB041CD7E3640095C5838F4CFC9CD5599"],"last_height":0,"last_round":0,"last_step":0} \ No newline at end of file diff --git a/net_test/dev/Dockerfile b/net_test/dev/Dockerfile deleted file mode 100644 index 0973d7e7bab4fcae97c9bee8299f10c9bc0f5092..0000000000000000000000000000000000000000 --- a/net_test/dev/Dockerfile +++ /dev/null @@ -1,16 +0,0 @@ -# Pull base image. -# NOTE: to use this Dockerfile, mount the chain data, including an init.sh, to /home/eris/data -FROM quay.io/eris/base - - -ENV TMROOT /home/$USER/data -WORKDIR $TMROOT -RUN chown -R $USER:$USER $TMROOT - -# ports: 1337:eris-db API; 46656:mint-peer; 46657:mint-rpc -EXPOSE 1337 -EXPOSE 46656 -EXPOSE 46657 - -# Run tendermint -CMD ["./init.sh"] # diff --git a/net_test/dev/data.sh b/net_test/dev/data.sh deleted file mode 100644 index e145e9009a9ffbee8e4e3a557d7dba617a4bc91b..0000000000000000000000000000000000000000 --- a/net_test/dev/data.sh +++ /dev/null @@ -1,32 +0,0 @@ -#! /bin/bash - - -MACH="mempool" -NAME="net_test" -N=4 - -SEED=$(docker-machine ip ${MACH}1):46656 -echo "seed node:" $SEED - -# copy data to remotes -for i in `seq 0 $((N-1))`; -do - - dataI=$i - machI=$((i+1)) - - # lay the config with the seed for this session - mintconfig --skip-upnp --seeds=$SEED > ./data/${NAME}_$dataI/config.toml - - # copy the startup bash script into the data ... - cp ./data/init.sh ./data/${NAME}_$dataI/init.sh - - # clear and copy the node data - docker-machine ssh ${MACH}$machI rm -rf $NAME - docker-machine scp -r ./data/${NAME}_$dataI ${MACH}$machI:$NAME - - # docker-machine ssh ${MACH}$machI ls $NAME - echo "###############" -done - - diff --git a/net_test/dev/local.sh b/net_test/dev/local.sh deleted file mode 100644 index c93bb5dda9bba3f6bbab72906a5aef8af455aed0..0000000000000000000000000000000000000000 --- a/net_test/dev/local.sh +++ /dev/null @@ -1,13 +0,0 @@ -#! /bin/bash -set -e - -MACH="mempool" -NAME="net_test" - -TMROOT=data/local - -# run a local erisdb node -erisdb $TMROOT &> erisdb.log & - -# set up eris-keys -# eris-keys server & diff --git a/net_test/dev/rm.sh b/net_test/dev/rm.sh deleted file mode 100644 index d0847b80b2039e4b869d770a1a6f7d94adf28662..0000000000000000000000000000000000000000 --- a/net_test/dev/rm.sh +++ /dev/null @@ -1,14 +0,0 @@ -#! /bin/bash -set -e - -MACH="mempool" -NAME="net_test" -N=4 - -# run the erisdb on each node -for i in `seq 1 $N`; -do - docker-machine ssh ${MACH}$i docker rm -vf \$\(docker ps -aq\) - echo "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%" - echo " " -done diff --git a/net_test/dev/run.sh b/net_test/dev/run.sh deleted file mode 100644 index 5ed9e9ed076ee2650e7174873d117349fe8a2b3e..0000000000000000000000000000000000000000 --- a/net_test/dev/run.sh +++ /dev/null @@ -1,17 +0,0 @@ -#! /bin/bash -set -e - -MACH="mempool" -NAME="net_test" -N=4 - -# run the erisdb on each node -for i in `seq 1 $N`; -do - dataI=$((i-1)) - machI=$i - - docker-machine ssh ${MACH}$machI docker run --name erisdb -d -p 46656-46657:46656-46657 -p 1337:1337 -v \$\(pwd\)/net_test:/home/eris/data quay.io/eris/erisdb-dev & - echo "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%" - echo " " -done diff --git a/net_test/dev/test.sh b/net_test/dev/test.sh deleted file mode 100644 index f5324e87d01b9d4178a00f6739d97d4d4cb73104..0000000000000000000000000000000000000000 --- a/net_test/dev/test.sh +++ /dev/null @@ -1,10 +0,0 @@ -#! /bin/bash -set -e - -NAME="net_test" - -ADDR=`mintkey eris data/${NAME}_0/priv_validator.json` -MINTX_PUBKEY="" -echo $ADDR - -mintx send --to=1A73F65F86271552C4858091D3DADFE3335B9273 --addr=$ADDR --amt=1 --sign --broadcast --log=6 --chainID=$NAME diff --git a/net_test/setup.sh b/net_test/setup.sh deleted file mode 100644 index be361dbe36b563e184569c92b12580f9a4e71813..0000000000000000000000000000000000000000 --- a/net_test/setup.sh +++ /dev/null @@ -1,31 +0,0 @@ -#! /bin/bash - -MACH="mempool" -NAME="net_test" -N=4 - -SEED=$(docker-machine ip ${MACH}1):46656 -echo "seed node:" $SEED - -# run the erisdb on each node -for i in `seq 1 $N`; -do - dataI=$((i-1)) - machI=$i - - # lay the config with the seed for this session - mintconfig --skip-upnp --seeds=$SEED > ./data/${NAME}_$dataI/config.toml - - eris --machine ${MACH}$machI chains new --dir $(pwd)/data/${NAME}_$dataI $NAME - - echo "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%" - echo " " -done - - -# start the local proxy -mintconfig --skip-upnp --seeds=$SEED > ./data/local/config.toml -rm -rf ./data/local_data -cp -r ./data/local ./data/local_data # so we don't contaminate the real dir -eris chains new --dir $(pwd)/data/local_data $NAME -#erisdb ./data/local_data &> erisdb.log & diff --git a/net_test/test.sh b/net_test/test.sh deleted file mode 100644 index 18c0a6dd5a838f5ed452956a5607612fc1ba6715..0000000000000000000000000000000000000000 --- a/net_test/test.sh +++ /dev/null @@ -1,39 +0,0 @@ -#! /bin/bash -set -e - -NAME="net_test" - -ADDR=`mintkey eris data/${NAME}_0/priv_validator.json` -MINTX_PUBKEY="" -echo $ADDR - -TO=1A73F65F86271552C4858091D3DADFE3335B9273 - -set +e -START_BALANCE=`mintinfo accounts $TO` -if [[ "$?" == 1 ]]; then - START_BALANCE=0 - -else - START_BALANCE=`echo $START_BALANCE | jq .balance` -fi -set -e - -N=50 -for i in `seq 1 $N`; do - mintx send --to=$TO --addr=$ADDR --amt=1 --sign --broadcast --chainID=$NAME -done -mintx send --to=$TO --addr=$ADDR --amt=1 --sign --broadcast --chainID=$NAME --log=6 --wait - -END_BALANCE=`mintinfo accounts $TO | jq .balance` - -DIFF_BALANCE=$((${END_BALANCE}-${START_BALANCE})) - -if [[ "$DIFF_BALANCE" != $(($N+1)) ]]; then - echo "Failed! Expected $((N+1)), got $DIFF_BALANCE" - exit 1 -fi - -echo "PASS" - - diff --git a/permission/types/permissions.go b/permission/types/permissions.go index c4d3e51a1eeb803d13fc472c9aeb4ec80d032380..0fd472bbf9cd28b8772ca17ad6464c536cd3c490 100644 --- a/permission/types/permissions.go +++ b/permission/types/permissions.go @@ -18,7 +18,7 @@ import ( "fmt" "strings" - "github.com/monax/eris-db/word256" + "github.com/monax/burrow/word256" ) //------------------------------------------------------------------------------------------------ diff --git a/rpc/codec.go b/rpc/codec.go new file mode 100644 index 0000000000000000000000000000000000000000..750a5a88e8a6ea672fe635ef41c2f69d2c36274d --- /dev/null +++ b/rpc/codec.go @@ -0,0 +1,28 @@ +// Copyright 2017 Monax Industries Limited +// +// 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. + +package rpc + +import ( + "io" +) + +// Used for rpc request and response data. +type Codec interface { + EncodeBytes(interface{}) ([]byte, error) + Encode(interface{}, io.Writer) error + DecodeBytes(interface{}, []byte) error + DecodeBytesPtr(interface{}, []byte) error + Decode(interface{}, io.Reader) error +} diff --git a/rpc/rpc.go b/rpc/jsonrpc.go similarity index 94% rename from rpc/rpc.go rename to rpc/jsonrpc.go index a42e57c0ca349f11cc007fffaf3556e5c9128787..17b683beb81c67d4d9778ab15153fd9e36f6dfb8 100644 --- a/rpc/rpc.go +++ b/rpc/jsonrpc.go @@ -16,16 +16,15 @@ package rpc import ( "encoding/json" - "io" ) // JSON-RPC 2.0 error codes. const ( - PARSE_ERROR = -32700 INVALID_REQUEST = -32600 METHOD_NOT_FOUND = -32601 INVALID_PARAMS = -32602 INTERNAL_ERROR = -32603 + PARSE_ERROR = -32700 ) // Request and Response objects. Id is a string. Error data not used. @@ -65,13 +64,6 @@ type ( // Note: Data is currently unused, and the data member may be omitted // Data interface{} `json:"data"` } - - Codec interface { - EncodeBytes(interface{}) ([]byte, error) - Encode(interface{}, io.Writer) error - DecodeBytes(interface{}, []byte) error - Decode(interface{}, io.Reader) error - } ) // Create a new RPC request. This is the generic struct that is passed to RPC diff --git a/rpc/v0/json_rpc_test.go b/rpc/rpc_test.go similarity index 78% rename from rpc/v0/json_rpc_test.go rename to rpc/rpc_test.go index 8fded35bf964870aebffc2b3bbf6aba91863c599..fbdfca374c8cd4a764ea064d06e74ce5b5ca0e4b 100644 --- a/rpc/v0/json_rpc_test.go +++ b/rpc/rpc_test.go @@ -12,13 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. -package v0 +package rpc import ( "testing" - "github.com/monax/eris-db/rpc" - "github.com/stretchr/testify/assert" ) @@ -26,12 +24,12 @@ import ( func TestNewJsonRpcResponse(t *testing.T) { id := "testId" data := "a string" - resp := rpc.RPCResponse(&rpc.RPCResultResponse{ + resp := RPCResponse(&RPCResultResponse{ Result: data, Id: id, JSONRPC: "2.0", }) - respGen := rpc.NewRPCResponse(id, data) + respGen := NewRPCResponse(id, data) assert.Equal(t, respGen, resp) } @@ -40,11 +38,11 @@ func TestNewJsonRpcErrorResponse(t *testing.T) { id := "testId" code := 100 message := "the error" - resp := rpc.RPCResponse(&rpc.RPCErrorResponse{ - Error: &rpc.RPCError{code, message}, + resp := RPCResponse(&RPCErrorResponse{ + Error: &RPCError{code, message}, Id: id, JSONRPC: "2.0", }) - respGen := rpc.NewRPCErrorResponse(id, code, message) + respGen := NewRPCErrorResponse(id, code, message) assert.Equal(t, respGen, resp) } diff --git a/rpc/tendermint/client/client.go b/rpc/tendermint/client/client.go index c5532b7b00aa35b55d49d9e0f7a732c2faa58967..8195d58e453d3d6ebaf13efbcc7905dc46d3636c 100644 --- a/rpc/tendermint/client/client.go +++ b/rpc/tendermint/client/client.go @@ -18,10 +18,10 @@ import ( "errors" "fmt" - acm "github.com/monax/eris-db/account" - core_types "github.com/monax/eris-db/core/types" - rpc_types "github.com/monax/eris-db/rpc/tendermint/core/types" - "github.com/monax/eris-db/txs" + acm "github.com/monax/burrow/account" + core_types "github.com/monax/burrow/core/types" + rpc_types "github.com/monax/burrow/rpc/tendermint/core/types" + "github.com/monax/burrow/txs" rpcclient "github.com/tendermint/go-rpc/client" "github.com/tendermint/go-wire" ) @@ -182,7 +182,7 @@ func DumpConsensusState(client rpcclient.Client) (*rpc_types.ResultDumpConsensus } func performCall(client rpcclient.Client, method string, - paramKeyVals ...interface{}) (res rpc_types.ErisDBResult, err error) { + paramKeyVals ...interface{}) (res rpc_types.BurrowResult, err error) { paramsMap, paramsSlice, err := mapAndValues(paramKeyVals...) if err != nil { return diff --git a/rpc/tendermint/core/routes.go b/rpc/tendermint/core/routes.go index dd22365f30150dc1d4655bce8f6ea93c3662481b..e3d010b3054c3d1973fcca0cf7814ef61af8a118 100644 --- a/rpc/tendermint/core/routes.go +++ b/rpc/tendermint/core/routes.go @@ -17,10 +17,10 @@ package core import ( "fmt" - acm "github.com/monax/eris-db/account" - "github.com/monax/eris-db/definitions" - ctypes "github.com/monax/eris-db/rpc/tendermint/core/types" - "github.com/monax/eris-db/txs" + acm "github.com/monax/burrow/account" + "github.com/monax/burrow/definitions" + ctypes "github.com/monax/burrow/rpc/tendermint/core/types" + "github.com/monax/burrow/txs" rpc "github.com/tendermint/go-rpc/server" rpctypes "github.com/tendermint/go-rpc/types" ) @@ -66,7 +66,7 @@ func (tmRoutes *TendermintRoutes) GetRoutes() map[string]*rpc.RPCFunc { } func (tmRoutes *TendermintRoutes) Subscribe(wsCtx rpctypes.WSRPCContext, - event string) (ctypes.ErisDBResult, error) { + event string) (ctypes.BurrowResult, error) { // NOTE: RPCResponses of subscribed events have id suffix "#event" // TODO: we really ought to allow multiple subscriptions from the same client address // to the same event. The code as it stands reflects the somewhat broken tendermint @@ -75,7 +75,7 @@ func (tmRoutes *TendermintRoutes) Subscribe(wsCtx rpctypes.WSRPCContext, // subscription id if they wish to unsubscribe, but then again they can just // drop their connection result, err := tmRoutes.tendermintPipe.Subscribe(event, - func(result ctypes.ErisDBResult) { + func(result ctypes.BurrowResult) { wsCtx.GetRemoteAddr() // NOTE: EventSwitch callbacks must be nonblocking wsCtx.TryWriteRPCResponse( @@ -89,7 +89,7 @@ func (tmRoutes *TendermintRoutes) Subscribe(wsCtx rpctypes.WSRPCContext, } func (tmRoutes *TendermintRoutes) Unsubscribe(wsCtx rpctypes.WSRPCContext, - subscriptionId string) (ctypes.ErisDBResult, error) { + subscriptionId string) (ctypes.BurrowResult, error) { result, err := tmRoutes.tendermintPipe.Unsubscribe(subscriptionId) if err != nil { return nil, err @@ -98,7 +98,7 @@ func (tmRoutes *TendermintRoutes) Unsubscribe(wsCtx rpctypes.WSRPCContext, } } -func (tmRoutes *TendermintRoutes) StatusResult() (ctypes.ErisDBResult, error) { +func (tmRoutes *TendermintRoutes) StatusResult() (ctypes.BurrowResult, error) { if r, err := tmRoutes.tendermintPipe.Status(); err != nil { return nil, err } else { @@ -106,7 +106,7 @@ func (tmRoutes *TendermintRoutes) StatusResult() (ctypes.ErisDBResult, error) { } } -func (tmRoutes *TendermintRoutes) NetInfoResult() (ctypes.ErisDBResult, error) { +func (tmRoutes *TendermintRoutes) NetInfoResult() (ctypes.BurrowResult, error) { if r, err := tmRoutes.tendermintPipe.NetInfo(); err != nil { return nil, err } else { @@ -114,7 +114,7 @@ func (tmRoutes *TendermintRoutes) NetInfoResult() (ctypes.ErisDBResult, error) { } } -func (tmRoutes *TendermintRoutes) GenesisResult() (ctypes.ErisDBResult, error) { +func (tmRoutes *TendermintRoutes) GenesisResult() (ctypes.BurrowResult, error) { if r, err := tmRoutes.tendermintPipe.Genesis(); err != nil { return nil, err } else { @@ -122,7 +122,7 @@ func (tmRoutes *TendermintRoutes) GenesisResult() (ctypes.ErisDBResult, error) { } } -func (tmRoutes *TendermintRoutes) ChainIdResult() (ctypes.ErisDBResult, error) { +func (tmRoutes *TendermintRoutes) ChainIdResult() (ctypes.BurrowResult, error) { if r, err := tmRoutes.tendermintPipe.ChainId(); err != nil { return nil, err } else { @@ -130,7 +130,7 @@ func (tmRoutes *TendermintRoutes) ChainIdResult() (ctypes.ErisDBResult, error) { } } -func (tmRoutes *TendermintRoutes) GetAccountResult(address []byte) (ctypes.ErisDBResult, error) { +func (tmRoutes *TendermintRoutes) GetAccountResult(address []byte) (ctypes.BurrowResult, error) { if r, err := tmRoutes.tendermintPipe.GetAccount(address); err != nil { return nil, err } else { @@ -138,7 +138,7 @@ func (tmRoutes *TendermintRoutes) GetAccountResult(address []byte) (ctypes.ErisD } } -func (tmRoutes *TendermintRoutes) GetStorageResult(address, key []byte) (ctypes.ErisDBResult, error) { +func (tmRoutes *TendermintRoutes) GetStorageResult(address, key []byte) (ctypes.BurrowResult, error) { if r, err := tmRoutes.tendermintPipe.GetStorage(address, key); err != nil { return nil, err } else { @@ -147,7 +147,7 @@ func (tmRoutes *TendermintRoutes) GetStorageResult(address, key []byte) (ctypes. } func (tmRoutes *TendermintRoutes) CallResult(fromAddress, toAddress, - data []byte) (ctypes.ErisDBResult, error) { + data []byte) (ctypes.BurrowResult, error) { if r, err := tmRoutes.tendermintPipe.Call(fromAddress, toAddress, data); err != nil { return nil, err } else { @@ -156,7 +156,7 @@ func (tmRoutes *TendermintRoutes) CallResult(fromAddress, toAddress, } func (tmRoutes *TendermintRoutes) CallCodeResult(fromAddress, code, - data []byte) (ctypes.ErisDBResult, error) { + data []byte) (ctypes.BurrowResult, error) { if r, err := tmRoutes.tendermintPipe.CallCode(fromAddress, code, data); err != nil { return nil, err } else { @@ -164,7 +164,7 @@ func (tmRoutes *TendermintRoutes) CallCodeResult(fromAddress, code, } } -func (tmRoutes *TendermintRoutes) DumpStorageResult(address []byte) (ctypes.ErisDBResult, error) { +func (tmRoutes *TendermintRoutes) DumpStorageResult(address []byte) (ctypes.BurrowResult, error) { if r, err := tmRoutes.tendermintPipe.DumpStorage(address); err != nil { return nil, err } else { @@ -172,7 +172,7 @@ func (tmRoutes *TendermintRoutes) DumpStorageResult(address []byte) (ctypes.Eris } } -func (tmRoutes *TendermintRoutes) ListAccountsResult() (ctypes.ErisDBResult, error) { +func (tmRoutes *TendermintRoutes) ListAccountsResult() (ctypes.BurrowResult, error) { if r, err := tmRoutes.tendermintPipe.ListAccounts(); err != nil { return nil, err } else { @@ -180,7 +180,7 @@ func (tmRoutes *TendermintRoutes) ListAccountsResult() (ctypes.ErisDBResult, err } } -func (tmRoutes *TendermintRoutes) GetNameResult(name string) (ctypes.ErisDBResult, error) { +func (tmRoutes *TendermintRoutes) GetNameResult(name string) (ctypes.BurrowResult, error) { if r, err := tmRoutes.tendermintPipe.GetName(name); err != nil { return nil, err } else { @@ -188,7 +188,7 @@ func (tmRoutes *TendermintRoutes) GetNameResult(name string) (ctypes.ErisDBResul } } -func (tmRoutes *TendermintRoutes) ListNamesResult() (ctypes.ErisDBResult, error) { +func (tmRoutes *TendermintRoutes) ListNamesResult() (ctypes.BurrowResult, error) { if r, err := tmRoutes.tendermintPipe.ListNames(); err != nil { return nil, err } else { @@ -196,7 +196,7 @@ func (tmRoutes *TendermintRoutes) ListNamesResult() (ctypes.ErisDBResult, error) } } -func (tmRoutes *TendermintRoutes) GenPrivAccountResult() (ctypes.ErisDBResult, error) { +func (tmRoutes *TendermintRoutes) GenPrivAccountResult() (ctypes.BurrowResult, error) { //if r, err := tmRoutes.tendermintPipe.GenPrivAccount(); err != nil { // return nil, err //} else { @@ -206,7 +206,7 @@ func (tmRoutes *TendermintRoutes) GenPrivAccountResult() (ctypes.ErisDBResult, e } func (tmRoutes *TendermintRoutes) SignTxResult(tx txs.Tx, - privAccounts []*acm.PrivAccount) (ctypes.ErisDBResult, error) { + privAccounts []*acm.PrivAccount) (ctypes.BurrowResult, error) { // if r, err := tmRoutes.tendermintPipe.SignTx(tx, privAccounts); err != nil { // return nil, err // } else { @@ -215,7 +215,7 @@ func (tmRoutes *TendermintRoutes) SignTxResult(tx txs.Tx, return nil, fmt.Errorf("Unimplemented as poor practice to pass private account over unencrypted RPC") } -func (tmRoutes *TendermintRoutes) BroadcastTxResult(tx txs.Tx) (ctypes.ErisDBResult, error) { +func (tmRoutes *TendermintRoutes) BroadcastTxResult(tx txs.Tx) (ctypes.BurrowResult, error) { if r, err := tmRoutes.tendermintPipe.BroadcastTxSync(tx); err != nil { return nil, err } else { @@ -224,7 +224,7 @@ func (tmRoutes *TendermintRoutes) BroadcastTxResult(tx txs.Tx) (ctypes.ErisDBRes } func (tmRoutes *TendermintRoutes) BlockchainInfo(minHeight, - maxHeight int) (ctypes.ErisDBResult, error) { + maxHeight int) (ctypes.BurrowResult, error) { r, err := tmRoutes.tendermintPipe.BlockchainInfo(minHeight, maxHeight, maxBlockLookback) if err != nil { @@ -234,7 +234,7 @@ func (tmRoutes *TendermintRoutes) BlockchainInfo(minHeight, } } -func (tmRoutes *TendermintRoutes) ListUnconfirmedTxs() (ctypes.ErisDBResult, error) { +func (tmRoutes *TendermintRoutes) ListUnconfirmedTxs() (ctypes.BurrowResult, error) { // Get all Txs for now r, err := tmRoutes.tendermintPipe.ListUnconfirmedTxs(-1) if err != nil { @@ -243,7 +243,7 @@ func (tmRoutes *TendermintRoutes) ListUnconfirmedTxs() (ctypes.ErisDBResult, err return r, nil } } -func (tmRoutes *TendermintRoutes) GetBlock(height int) (ctypes.ErisDBResult, error) { +func (tmRoutes *TendermintRoutes) GetBlock(height int) (ctypes.BurrowResult, error) { r, err := tmRoutes.tendermintPipe.GetBlock(height) if err != nil { return nil, err @@ -251,7 +251,7 @@ func (tmRoutes *TendermintRoutes) GetBlock(height int) (ctypes.ErisDBResult, err return r, nil } } -func (tmRoutes *TendermintRoutes) ListValidators() (ctypes.ErisDBResult, error) { +func (tmRoutes *TendermintRoutes) ListValidators() (ctypes.BurrowResult, error) { r, err := tmRoutes.tendermintPipe.ListValidators() if err != nil { return nil, err @@ -259,6 +259,6 @@ func (tmRoutes *TendermintRoutes) ListValidators() (ctypes.ErisDBResult, error) return r, nil } } -func (tmRoutes *TendermintRoutes) DumpConsensusState() (ctypes.ErisDBResult, error) { +func (tmRoutes *TendermintRoutes) DumpConsensusState() (ctypes.BurrowResult, error) { return tmRoutes.tendermintPipe.DumpConsensusState() } diff --git a/rpc/tendermint/core/types/responses.go b/rpc/tendermint/core/types/responses.go index 8fcdb3f94d722d155b6a4397a2ec554ff76b3b68..180e278a89b669c59408ec27f84c1a337a74718e 100644 --- a/rpc/tendermint/core/types/responses.go +++ b/rpc/tendermint/core/types/responses.go @@ -15,13 +15,13 @@ package types import ( - acm "github.com/monax/eris-db/account" - core_types "github.com/monax/eris-db/core/types" - genesis "github.com/monax/eris-db/genesis" - "github.com/monax/eris-db/txs" + acm "github.com/monax/burrow/account" + core_types "github.com/monax/burrow/core/types" + genesis "github.com/monax/burrow/genesis" + "github.com/monax/burrow/txs" tendermint_types "github.com/tendermint/tendermint/types" - consensus_types "github.com/monax/eris-db/consensus/types" + consensus_types "github.com/monax/burrow/consensus/types" abcitypes "github.com/tendermint/abci/types" "github.com/tendermint/go-crypto" "github.com/tendermint/go-p2p" @@ -181,7 +181,7 @@ const ( ResultTypeChainId = byte(0x17) ) -type ErisDBResult interface { +type BurrowResult interface { rpctypes.Result } @@ -213,4 +213,4 @@ func ConcreteTypes() []wire.ConcreteType { } } -var _ = wire.RegisterInterface(struct{ ErisDBResult }{}, ConcreteTypes()...) +var _ = wire.RegisterInterface(struct{ BurrowResult }{}, ConcreteTypes()...) diff --git a/rpc/tendermint/core/types/responses_test.go b/rpc/tendermint/core/types/responses_test.go index 56837167e49756bd874cefdc79c8cdcb58bea87b..616e71d0bc15ffc25cb2a842733c2fc97d480e78 100644 --- a/rpc/tendermint/core/types/responses_test.go +++ b/rpc/tendermint/core/types/responses_test.go @@ -19,7 +19,7 @@ import ( "time" - consensus_types "github.com/monax/eris-db/consensus/types" + consensus_types "github.com/monax/burrow/consensus/types" "github.com/tendermint/go-wire" tendermint_types "github.com/tendermint/tendermint/types" ) diff --git a/rpc/tendermint/core/types/responses_util.go b/rpc/tendermint/core/types/responses_util.go index 2e49c5586015ee20ad49c8903c60238133b23897..a4eb9483fbc6bb6e580b23e959a3582ce747d331 100644 --- a/rpc/tendermint/core/types/responses_util.go +++ b/rpc/tendermint/core/types/responses_util.go @@ -15,7 +15,7 @@ package types import ( - "github.com/monax/eris-db/core/types" + "github.com/monax/burrow/core/types" ) // UnwrapResultDumpStorage does a deep copy to remove /rpc/tendermint/core/types diff --git a/rpc/tendermint/core/websocket.go b/rpc/tendermint/core/websocket.go index da18b456aeb94fa204684bd94f38b13bd9a69fcb..5ae99ad7d18dff796e09d9de315e9c3d572be153 100644 --- a/rpc/tendermint/core/websocket.go +++ b/rpc/tendermint/core/websocket.go @@ -23,8 +23,8 @@ import ( events "github.com/tendermint/go-events" rpcserver "github.com/tendermint/go-rpc/server" - definitions "github.com/monax/eris-db/definitions" - server "github.com/monax/eris-db/server" + definitions "github.com/monax/burrow/definitions" + server "github.com/monax/burrow/server" ) type TendermintWebsocketServer struct { diff --git a/rpc/tendermint/test/common.go b/rpc/tendermint/test/common.go index efa7a4234d86dcf204230bcd60455d7287f05f4e..523f3688a321e59128313468447e1b9c53b659e8 100644 --- a/rpc/tendermint/test/common.go +++ b/rpc/tendermint/test/common.go @@ -18,15 +18,15 @@ package test import ( "fmt" - vm "github.com/monax/eris-db/manager/eris-mint/evm" - rpc_core "github.com/monax/eris-db/rpc/tendermint/core" - "github.com/monax/eris-db/test/fixtures" + vm "github.com/monax/burrow/manager/burrow-mint/evm" + rpc_core "github.com/monax/burrow/rpc/tendermint/core" + "github.com/monax/burrow/test/fixtures" ) // Needs to be referenced by a *_test.go file to be picked up func TestWrapper(runner func() int) int { fmt.Println("Running with integration TestWrapper (rpc/tendermint/test/common.go)...") - ffs := fixtures.NewFileFixtures("Eris-DB") + ffs := fixtures.NewFileFixtures("burrow") defer ffs.RemoveAll() diff --git a/rpc/tendermint/test/config.go b/rpc/tendermint/test/config.go index 06f3520e1dfb8ceb4edeaf7ae42eb01f204bedef..8bc31bf8cb340b97ab35e0f3708720ab5aeeb40c 100644 --- a/rpc/tendermint/test/config.go +++ b/rpc/tendermint/test/config.go @@ -28,7 +28,7 @@ var defaultConfig = `# Copyright 2017 Monax Industries Limited # See the License for the specific language governing permissions and # limitations under the License.. -# This is a TOML configuration for Eris-DB chains +# This is a TOML configuration for burrow chains [chain] @@ -39,7 +39,7 @@ assert_chain_id = "MyChainId" # semantic major and minor version major_version = 0 minor_version = 17 -# genesis file, relative path is to eris-db working directory +# genesis file, relative path is to burrow working directory genesis_file = "genesis.json" @@ -69,13 +69,13 @@ genesis_file = "genesis.json" [chain.manager] # application manager name defines the module to use for handling - name = "erismint" + name = "burrowmint" # version is the major and minor semantic version; # the version will be asserted on major_version = 0 minor_version = 17 # relative path to application manager root folder - relative_root = "erismint" + relative_root = "burrowmint" ################################################################################ ################################################################################ @@ -137,7 +137,7 @@ genesis_file = "genesis.json" ## ## Tendermint Socket Protocol (abci) ## -## abci expects a tendermint consensus process to run and connect to Eris-DB +## abci expects a tendermint consensus process to run and connect to burrow ## ################################################################################ @@ -157,14 +157,14 @@ listener = "tcp://0.0.0.0:46658" # private validator file is used by tendermint to keep the status # of the private validator, but also (currently) holds the private key # for the private vaildator to sign with. This private key needs to be moved -# out and directly managed by eris-keys +# out and directly managed by monax-keys # This file needs to be in the root directory private_validator_file = "priv_validator.json" # Tendermint requires additional configuration parameters. - # Eris-DB's tendermint consensus module will load [tendermint.configuration] + # burrow's tendermint consensus module will load [tendermint.configuration] # as the configuration for Tendermint. - # Eris-DB will respect the configurations set in this file where applicable, + # burrow will respect the configurations set in this file where applicable, # but reserves the option to override or block conflicting settings. [tendermint.configuration] # moniker is the name of the node on the tendermint p2p network @@ -216,7 +216,7 @@ private_validator_file = "priv_validator.json" ################################################################################ ## -## Eris-Mint +## burrow-mint ## version 0.17.0 ## ## The original Ethereum virtual machine with IAVL merkle trees @@ -224,7 +224,7 @@ private_validator_file = "priv_validator.json" ## ################################################################################ -[erismint] -# Database backend to use for ErisMint state database. +[burrowmint] +# Database backend to use for BurrowMint state database. db_backend = "leveldb" ` diff --git a/rpc/tendermint/test/rpc_client_test.go b/rpc/tendermint/test/rpc_client_test.go index 3ec62b6a7984c6af4159f2ececa7b11a521e12b4..7f44a39e7982d6d9210671bbbe54abada02cbb26 100644 --- a/rpc/tendermint/test/rpc_client_test.go +++ b/rpc/tendermint/test/rpc_client_test.go @@ -20,15 +20,14 @@ package test import ( "bytes" "fmt" + "golang.org/x/crypto/ripemd160" "testing" "time" - "golang.org/x/crypto/ripemd160" - - consensus_types "github.com/monax/eris-db/consensus/types" - edbcli "github.com/monax/eris-db/rpc/tendermint/client" - "github.com/monax/eris-db/txs" - "github.com/monax/eris-db/word256" + consensus_types "github.com/monax/burrow/consensus/types" + edbcli "github.com/monax/burrow/rpc/tendermint/client" + "github.com/monax/burrow/txs" + "github.com/monax/burrow/word256" "github.com/stretchr/testify/assert" rpcclient "github.com/tendermint/go-rpc/client" diff --git a/rpc/tendermint/test/runner/main.go b/rpc/tendermint/test/runner/main.go index 92dc3b2c110d65882a8533924e1f723ee10769a9..903911d36a29cb46d6344e62d95db7071c8e917b 100644 --- a/rpc/tendermint/test/runner/main.go +++ b/rpc/tendermint/test/runner/main.go @@ -20,8 +20,8 @@ package main import ( "fmt" - rpctest "github.com/monax/eris-db/rpc/tendermint/test" - "github.com/monax/eris-db/util" + rpctest "github.com/monax/burrow/rpc/tendermint/test" + "github.com/monax/burrow/util" ) func main() { diff --git a/rpc/tendermint/test/shared.go b/rpc/tendermint/test/shared.go index 8b3e97a0dfa5d276c45b3d8d3156aa4ec69ca865..c28a9eaa69f9e7c66fcc00f4ef626698576502c3 100644 --- a/rpc/tendermint/test/shared.go +++ b/rpc/tendermint/test/shared.go @@ -21,19 +21,19 @@ import ( "strconv" "testing" - acm "github.com/monax/eris-db/account" - "github.com/monax/eris-db/core" - core_types "github.com/monax/eris-db/core/types" - "github.com/monax/eris-db/logging/lifecycle" - edbcli "github.com/monax/eris-db/rpc/tendermint/client" - rpc_core "github.com/monax/eris-db/rpc/tendermint/core" - rpc_types "github.com/monax/eris-db/rpc/tendermint/core/types" - "github.com/monax/eris-db/server" - "github.com/monax/eris-db/test/fixtures" - "github.com/monax/eris-db/txs" - "github.com/monax/eris-db/word256" - - genesis "github.com/monax/eris-db/genesis" + acm "github.com/monax/burrow/account" + "github.com/monax/burrow/core" + core_types "github.com/monax/burrow/core/types" + "github.com/monax/burrow/logging/lifecycle" + edbcli "github.com/monax/burrow/rpc/tendermint/client" + rpc_core "github.com/monax/burrow/rpc/tendermint/core" + rpc_types "github.com/monax/burrow/rpc/tendermint/core/types" + "github.com/monax/burrow/server" + "github.com/monax/burrow/test/fixtures" + "github.com/monax/burrow/txs" + "github.com/monax/burrow/word256" + + genesis "github.com/monax/burrow/genesis" "github.com/spf13/viper" "github.com/tendermint/go-crypto" rpcclient "github.com/tendermint/go-rpc/client" diff --git a/rpc/tendermint/test/websocket_client_test.go b/rpc/tendermint/test/websocket_client_test.go index acc70e69513dca983d03f417069cba86b0aa0a1d..9a3cc1f16fafbcb66d49939139e1371b55c830f5 100644 --- a/rpc/tendermint/test/websocket_client_test.go +++ b/rpc/tendermint/test/websocket_client_test.go @@ -23,8 +23,8 @@ import ( "time" - core_types "github.com/monax/eris-db/rpc/tendermint/core/types" - "github.com/monax/eris-db/txs" + core_types "github.com/monax/burrow/rpc/tendermint/core/types" + "github.com/monax/burrow/txs" "github.com/stretchr/testify/assert" _ "github.com/tendermint/tendermint/config/tendermint_test" ) diff --git a/rpc/tendermint/test/websocket_helpers.go b/rpc/tendermint/test/websocket_helpers.go index 1a66072fa0fe5e82c1d6a63e423b0596d09d73bb..ff219c8288af67b6bf682b13db47f9a7c97e6ced 100644 --- a/rpc/tendermint/test/websocket_helpers.go +++ b/rpc/tendermint/test/websocket_helpers.go @@ -20,11 +20,11 @@ import ( "testing" "time" - ctypes "github.com/monax/eris-db/rpc/tendermint/core/types" - "github.com/monax/eris-db/txs" + ctypes "github.com/monax/burrow/rpc/tendermint/core/types" + "github.com/monax/burrow/txs" tm_types "github.com/tendermint/tendermint/types" - edbcli "github.com/monax/eris-db/rpc/tendermint/client" + edbcli "github.com/monax/burrow/rpc/tendermint/client" rpcclient "github.com/tendermint/go-rpc/client" "github.com/tendermint/go-wire" ) @@ -169,7 +169,7 @@ func waitForEvent(t *testing.T, wsc *rpcclient.WSClient, eventid string, case <-shutdownEventsCh: break LOOP case r := <-wsc.ResultsCh: - result := new(ctypes.ErisDBResult) + result := new(ctypes.BurrowResult) wire.ReadJSONPtr(result, r, &err) if err != nil { errCh <- err @@ -291,9 +291,9 @@ func unmarshalValidateCall(origin, } } -func readResult(t *testing.T, bs []byte) ctypes.ErisDBResult { +func readResult(t *testing.T, bs []byte) ctypes.BurrowResult { var err error - result := new(ctypes.ErisDBResult) + result := new(ctypes.BurrowResult) wire.ReadJSONPtr(result, bs, &err) if err != nil { t.Fatal(err) diff --git a/rpc/v0/codec.go b/rpc/v0/codec.go index 7e15207db17d0f21ba309d8e9f4ee8155f642bee..c26d19ee4e3bebb8756fff7c5d25708bbfe80f3a 100644 --- a/rpc/v0/codec.go +++ b/rpc/v0/codec.go @@ -18,9 +18,7 @@ import ( "io" "io/ioutil" - "reflect" - - rpc "github.com/monax/eris-db/rpc" + rpc "github.com/monax/burrow/rpc" wire "github.com/tendermint/go-wire" ) @@ -47,6 +45,8 @@ func (this *TCodec) EncodeBytes(v interface{}) ([]byte, error) { return wire.JSONBytes(v), nil } +// TODO: [ben] implement EncodeBytesPtr ? + // Decode from an io.Reader. func (this *TCodec) Decode(v interface{}, r io.Reader) error { bts, errR := ioutil.ReadAll(r) @@ -61,11 +61,13 @@ func (this *TCodec) Decode(v interface{}, r io.Reader) error { // Decode from a byte array. func (this *TCodec) DecodeBytes(v interface{}, bts []byte) error { var err error - rv := reflect.ValueOf(v) - if rv.Kind() == reflect.Ptr { - wire.ReadJSONPtr(v, bts, &err) - } else { - wire.ReadJSON(v, bts, &err) - } + wire.ReadJSON(v, bts, &err) + return err +} + +// Decode from a byte array pointer. +func (this *TCodec) DecodeBytesPtr(v interface{}, bts []byte) error { + var err error + wire.ReadJSONPtr(v, bts, &err) return err } diff --git a/rpc/v0/json_rpc_server.go b/rpc/v0/json_service.go similarity index 84% rename from rpc/v0/json_rpc_server.go rename to rpc/v0/json_service.go index 946845059087b15cdfcf8ffe9469b40166a4641f..98f841ede730d616a4fed25b47f6eadc408dba84 100644 --- a/rpc/v0/json_rpc_server.go +++ b/rpc/v0/json_service.go @@ -18,10 +18,10 @@ import ( "encoding/json" "net/http" - definitions "github.com/monax/eris-db/definitions" - event "github.com/monax/eris-db/event" - rpc "github.com/monax/eris-db/rpc" - server "github.com/monax/eris-db/server" + definitions "github.com/monax/burrow/definitions" + event "github.com/monax/burrow/event" + rpc "github.com/monax/burrow/rpc" + server "github.com/monax/burrow/server" "github.com/gin-gonic/gin" ) @@ -63,20 +63,20 @@ func (this *JsonRpcServer) handleFunc(c *gin.Context) { this.service.Process(r, w) } -// Used for ErisDb. Implements server.HttpService -type ErisDbJsonService struct { +// Used for Burrow. Implements server.HttpService +type BurrowJsonService struct { codec rpc.Codec pipe definitions.Pipe eventSubs *event.EventSubscriptions defaultHandlers map[string]RequestHandlerFunc } -// Create a new JSON-RPC 2.0 service for erisdb (tendermint). -func NewErisDbJsonService(codec rpc.Codec, pipe definitions.Pipe, +// Create a new JSON-RPC 2.0 service for burrow (tendermint). +func NewBurrowJsonService(codec rpc.Codec, pipe definitions.Pipe, eventSubs *event.EventSubscriptions) server.HttpService { - tmhttps := &ErisDbJsonService{codec: codec, pipe: pipe, eventSubs: eventSubs} - mtds := NewErisDbMethods(codec, pipe) + tmhttps := &BurrowJsonService{codec: codec, pipe: pipe, eventSubs: eventSubs} + mtds := NewBurrowMethods(codec, pipe) dhMap := mtds.getMethods() // Events @@ -88,7 +88,7 @@ func NewErisDbJsonService(codec rpc.Codec, pipe definitions.Pipe, } // Process a request. -func (this *ErisDbJsonService) Process(r *http.Request, w http.ResponseWriter) { +func (this *BurrowJsonService) Process(r *http.Request, w http.ResponseWriter) { // Create new request object and unmarshal. req := &rpc.RPCRequest{} @@ -124,7 +124,7 @@ func (this *ErisDbJsonService) Process(r *http.Request, w http.ResponseWriter) { } // Helper for writing error responses. -func (this *ErisDbJsonService) writeError(msg, id string, code int, w http.ResponseWriter) { +func (this *BurrowJsonService) writeError(msg, id string, code int, w http.ResponseWriter) { response := rpc.NewRPCErrorResponse(id, code, msg) err := this.codec.Encode(response, w) // If there's an error here all bets are off. @@ -136,7 +136,7 @@ func (this *ErisDbJsonService) writeError(msg, id string, code int, w http.Respo } // Helper for writing responses. -func (this *ErisDbJsonService) writeResponse(id string, result interface{}, w http.ResponseWriter) { +func (this *BurrowJsonService) writeResponse(id string, result interface{}, w http.ResponseWriter) { response := rpc.NewRPCResponse(id, result) err := this.codec.Encode(response, w) if err != nil { @@ -149,7 +149,7 @@ func (this *ErisDbJsonService) writeResponse(id string, result interface{}, w ht // *************************************** Events ************************************ // Subscribe to an event. -func (this *ErisDbJsonService) EventSubscribe(request *rpc.RPCRequest, +func (this *BurrowJsonService) EventSubscribe(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error) { param := &EventIdParam{} err := json.Unmarshal(request.Params, param) @@ -165,7 +165,7 @@ func (this *ErisDbJsonService) EventSubscribe(request *rpc.RPCRequest, } // Un-subscribe from an event. -func (this *ErisDbJsonService) EventUnsubscribe(request *rpc.RPCRequest, +func (this *BurrowJsonService) EventUnsubscribe(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error) { param := &SubIdParam{} err := json.Unmarshal(request.Params, param) @@ -182,7 +182,7 @@ func (this *ErisDbJsonService) EventUnsubscribe(request *rpc.RPCRequest, } // Check subscription event cache for new data. -func (this *ErisDbJsonService) EventPoll(request *rpc.RPCRequest, +func (this *BurrowJsonService) EventPoll(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error) { param := &SubIdParam{} err := json.Unmarshal(request.Params, param) diff --git a/rpc/v0/codec_test.go b/rpc/v0/json_service_data_test.go similarity index 93% rename from rpc/v0/codec_test.go rename to rpc/v0/json_service_data_test.go index 143c2629d6921dbfea6cf24024bae6de0227d219..258226470e6a4ae23e1695805bced88c1be80ea2 100644 --- a/rpc/v0/codec_test.go +++ b/rpc/v0/json_service_data_test.go @@ -18,8 +18,8 @@ import ( "encoding/json" "testing" - "github.com/monax/eris-db/rpc" - "github.com/monax/eris-db/txs" + "github.com/monax/burrow/rpc" + "github.com/monax/burrow/txs" "github.com/stretchr/testify/assert" ) @@ -28,7 +28,7 @@ var testBroadcastCallTxJsonRequest = []byte(` { "id": "57EC1D39-7B3D-4F96-B286-8FC128177AFC4", "jsonrpc": "2.0", - "method": "erisdb.broadcastTx", + "method": "burrow.broadcastTx", "params": [ 2, { @@ -64,7 +64,7 @@ func TestCallTxJsonFormatCodec(t *testing.T) { request := &rpc.RPCRequest{} assert.NoError(t, json.Unmarshal(testBroadcastCallTxJsonRequest, request), "Provided JSON test data does not unmarshal to rpc.RPCRequest object.") - assert.NoError(t, codec.DecodeBytes(param, request.Params), + assert.NoError(t, codec.DecodeBytesPtr(param, request.Params), "RPC codec failed to decode params as transaction type.") _, ok := (*param).(*txs.CallTx) assert.True(t, ok, "Type byte 0x02 should unmarshal into CallTx.") diff --git a/rpc/v0/json_rpc_server_test.go b/rpc/v0/json_service_test.go similarity index 84% rename from rpc/v0/json_rpc_server_test.go rename to rpc/v0/json_service_test.go index 14df562aa48bd2157e5374445549ee2171322224..26c7cca45d3086097a8d06e4e18f081bfd589d14 100644 --- a/rpc/v0/json_rpc_server_test.go +++ b/rpc/v0/json_service_test.go @@ -17,10 +17,10 @@ package v0 import ( "testing" - "github.com/monax/eris-db/account" - "github.com/monax/eris-db/manager/eris-mint/evm/opcodes" - "github.com/monax/eris-db/rpc" - "github.com/monax/eris-db/txs" + "github.com/monax/burrow/account" + "github.com/monax/burrow/manager/burrow-mint/evm/opcodes" + "github.com/monax/burrow/rpc" + "github.com/monax/burrow/txs" "github.com/stretchr/testify/assert" "github.com/tendermint/go-wire" @@ -29,14 +29,14 @@ import ( func TestBroadcastTx(t *testing.T) { testData := LoadTestData() pipe := NewMockPipe(testData) - methods := NewErisDbMethods(NewTCodec(), pipe) + methods := NewBurrowMethods(NewTCodec(), pipe) pubKey := account.GenPrivAccount().PubKey address := []byte{1} code := opcodes.Bytecode(opcodes.PUSH1, 1, opcodes.PUSH1, 1, opcodes.ADD) var tx txs.Tx = txs.NewCallTxWithNonce(pubKey, address, code, 10, 2, 1, 0) jsonBytes := wire.JSONBytesPretty(wrappedTx{tx}) - request := rpc.NewRPCRequest("TestBroadcastTx", "BroacastTx", jsonBytes) + request := rpc.NewRPCRequest("TestBroadcastTx", "BroadcastTx", jsonBytes) result, _, err := methods.BroadcastTx(request, "TestBroadcastTx") assert.NoError(t, err) receipt, ok := result.(*txs.Receipt) diff --git a/rpc/v0/methods.go b/rpc/v0/methods.go index db417e3e3d6da04196721771ce2269eeb90a3715..6f92b784d7e175daefed52db9847980f3275df5d 100644 --- a/rpc/v0/methods.go +++ b/rpc/v0/methods.go @@ -15,18 +15,18 @@ package v0 import ( - "github.com/monax/eris-db/blockchain" - core_types "github.com/monax/eris-db/core/types" - definitions "github.com/monax/eris-db/definitions" - "github.com/monax/eris-db/event" - "github.com/monax/eris-db/rpc" - "github.com/monax/eris-db/rpc/v0/shared" - "github.com/monax/eris-db/txs" + "github.com/monax/burrow/blockchain" + core_types "github.com/monax/burrow/core/types" + definitions "github.com/monax/burrow/definitions" + "github.com/monax/burrow/event" + "github.com/monax/burrow/rpc" + "github.com/monax/burrow/rpc/v0/shared" + "github.com/monax/burrow/txs" ) // TODO use the method name definition file. const ( - SERVICE_NAME = "erisdb" + SERVICE_NAME = "burrow" GET_ACCOUNTS = SERVICE_NAME + ".getAccounts" // Accounts GET_ACCOUNT = SERVICE_NAME + ".getAccount" @@ -68,16 +68,16 @@ const ( ) // The rpc method handlers. -type ErisDbMethods struct { +type BurrowMethods struct { codec rpc.Codec pipe definitions.Pipe filterFactory *event.FilterFactory } -func NewErisDbMethods(codec rpc.Codec, - pipe definitions.Pipe) *ErisDbMethods { +func NewBurrowMethods(codec rpc.Codec, + pipe definitions.Pipe) *BurrowMethods { - return &ErisDbMethods{ + return &BurrowMethods{ codec: codec, pipe: pipe, filterFactory: blockchain.NewBlockchainFilterFactory(), @@ -88,48 +88,48 @@ func NewErisDbMethods(codec rpc.Codec, type RequestHandlerFunc func(*rpc.RPCRequest, interface{}) (interface{}, int, error) // Private. Create a method name -> method handler map. -func (erisDbMethods *ErisDbMethods) getMethods() map[string]RequestHandlerFunc { +func (burrowMethods *BurrowMethods) getMethods() map[string]RequestHandlerFunc { dhMap := make(map[string]RequestHandlerFunc) // Accounts - dhMap[GET_ACCOUNTS] = erisDbMethods.Accounts - dhMap[GET_ACCOUNT] = erisDbMethods.Account - dhMap[GET_STORAGE] = erisDbMethods.AccountStorage - dhMap[GET_STORAGE_AT] = erisDbMethods.AccountStorageAt - dhMap[GEN_PRIV_ACCOUNT] = erisDbMethods.GenPrivAccount - dhMap[GEN_PRIV_ACCOUNT_FROM_KEY] = erisDbMethods.GenPrivAccountFromKey + dhMap[GET_ACCOUNTS] = burrowMethods.Accounts + dhMap[GET_ACCOUNT] = burrowMethods.Account + dhMap[GET_STORAGE] = burrowMethods.AccountStorage + dhMap[GET_STORAGE_AT] = burrowMethods.AccountStorageAt + dhMap[GEN_PRIV_ACCOUNT] = burrowMethods.GenPrivAccount + dhMap[GEN_PRIV_ACCOUNT_FROM_KEY] = burrowMethods.GenPrivAccountFromKey // Blockchain - dhMap[GET_BLOCKCHAIN_INFO] = erisDbMethods.BlockchainInfo - dhMap[GET_GENESIS_HASH] = erisDbMethods.GenesisHash - dhMap[GET_LATEST_BLOCK_HEIGHT] = erisDbMethods.LatestBlockHeight - dhMap[GET_LATEST_BLOCK] = erisDbMethods.LatestBlock - dhMap[GET_BLOCKS] = erisDbMethods.Blocks - dhMap[GET_BLOCK] = erisDbMethods.Block + dhMap[GET_BLOCKCHAIN_INFO] = burrowMethods.BlockchainInfo + dhMap[GET_GENESIS_HASH] = burrowMethods.GenesisHash + dhMap[GET_LATEST_BLOCK_HEIGHT] = burrowMethods.LatestBlockHeight + dhMap[GET_LATEST_BLOCK] = burrowMethods.LatestBlock + dhMap[GET_BLOCKS] = burrowMethods.Blocks + dhMap[GET_BLOCK] = burrowMethods.Block // Consensus - dhMap[GET_CONSENSUS_STATE] = erisDbMethods.ConsensusState - dhMap[GET_VALIDATORS] = erisDbMethods.Validators + dhMap[GET_CONSENSUS_STATE] = burrowMethods.ConsensusState + dhMap[GET_VALIDATORS] = burrowMethods.Validators // Network - dhMap[GET_NETWORK_INFO] = erisDbMethods.NetworkInfo - dhMap[GET_CLIENT_VERSION] = erisDbMethods.ClientVersion - dhMap[GET_MONIKER] = erisDbMethods.Moniker - dhMap[GET_CHAIN_ID] = erisDbMethods.ChainId - dhMap[IS_LISTENING] = erisDbMethods.Listening - dhMap[GET_LISTENERS] = erisDbMethods.Listeners - dhMap[GET_PEERS] = erisDbMethods.Peers - dhMap[GET_PEER] = erisDbMethods.Peer + dhMap[GET_NETWORK_INFO] = burrowMethods.NetworkInfo + dhMap[GET_CLIENT_VERSION] = burrowMethods.ClientVersion + dhMap[GET_MONIKER] = burrowMethods.Moniker + dhMap[GET_CHAIN_ID] = burrowMethods.ChainId + dhMap[IS_LISTENING] = burrowMethods.Listening + dhMap[GET_LISTENERS] = burrowMethods.Listeners + dhMap[GET_PEERS] = burrowMethods.Peers + dhMap[GET_PEER] = burrowMethods.Peer // Txs - dhMap[CALL] = erisDbMethods.Call - dhMap[CALL_CODE] = erisDbMethods.CallCode - dhMap[BROADCAST_TX] = erisDbMethods.BroadcastTx - dhMap[GET_UNCONFIRMED_TXS] = erisDbMethods.UnconfirmedTxs - dhMap[SIGN_TX] = erisDbMethods.SignTx - dhMap[TRANSACT] = erisDbMethods.Transact - dhMap[TRANSACT_AND_HOLD] = erisDbMethods.TransactAndHold - dhMap[SEND] = erisDbMethods.Send - dhMap[SEND_AND_HOLD] = erisDbMethods.SendAndHold - dhMap[TRANSACT_NAMEREG] = erisDbMethods.TransactNameReg + dhMap[CALL] = burrowMethods.Call + dhMap[CALL_CODE] = burrowMethods.CallCode + dhMap[BROADCAST_TX] = burrowMethods.BroadcastTx + dhMap[GET_UNCONFIRMED_TXS] = burrowMethods.UnconfirmedTxs + dhMap[SIGN_TX] = burrowMethods.SignTx + dhMap[TRANSACT] = burrowMethods.Transact + dhMap[TRANSACT_AND_HOLD] = burrowMethods.TransactAndHold + dhMap[SEND] = burrowMethods.Send + dhMap[SEND_AND_HOLD] = burrowMethods.SendAndHold + dhMap[TRANSACT_NAMEREG] = burrowMethods.TransactNameReg // Namereg - dhMap[GET_NAMEREG_ENTRY] = erisDbMethods.NameRegEntry - dhMap[GET_NAMEREG_ENTRIES] = erisDbMethods.NameRegEntries + dhMap[GET_NAMEREG_ENTRY] = burrowMethods.NameRegEntry + dhMap[GET_NAMEREG_ENTRIES] = burrowMethods.NameRegEntries return dhMap } @@ -139,81 +139,81 @@ func (erisDbMethods *ErisDbMethods) getMethods() map[string]RequestHandlerFunc { // *************************************** Accounts *************************************** -func (erisDbMethods *ErisDbMethods) GenPrivAccount(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error) { - pac, errC := erisDbMethods.pipe.Accounts().GenPrivAccount() +func (burrowMethods *BurrowMethods) GenPrivAccount(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error) { + pac, errC := burrowMethods.pipe.Accounts().GenPrivAccount() if errC != nil { return nil, rpc.INTERNAL_ERROR, errC } return pac, 0, nil } -func (erisDbMethods *ErisDbMethods) GenPrivAccountFromKey(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error) { +func (burrowMethods *BurrowMethods) GenPrivAccountFromKey(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error) { param := &PrivKeyParam{} - err := erisDbMethods.codec.DecodeBytes(param, request.Params) + err := burrowMethods.codec.DecodeBytes(param, request.Params) if err != nil { return nil, rpc.INVALID_PARAMS, err } privKey := param.PrivKey - pac, errC := erisDbMethods.pipe.Accounts().GenPrivAccountFromKey(privKey) + pac, errC := burrowMethods.pipe.Accounts().GenPrivAccountFromKey(privKey) if errC != nil { return nil, rpc.INTERNAL_ERROR, errC } return pac, 0, nil } -func (erisDbMethods *ErisDbMethods) Account(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error) { +func (burrowMethods *BurrowMethods) Account(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error) { param := &AddressParam{} - err := erisDbMethods.codec.DecodeBytes(param, request.Params) + err := burrowMethods.codec.DecodeBytes(param, request.Params) if err != nil { return nil, rpc.INVALID_PARAMS, err } address := param.Address // TODO is address check? - account, errC := erisDbMethods.pipe.Accounts().Account(address) + account, errC := burrowMethods.pipe.Accounts().Account(address) if errC != nil { return nil, rpc.INTERNAL_ERROR, errC } return account, 0, nil } -func (erisDbMethods *ErisDbMethods) Accounts(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error) { +func (burrowMethods *BurrowMethods) Accounts(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error) { param := &AccountsParam{} - err := erisDbMethods.codec.DecodeBytes(param, request.Params) + err := burrowMethods.codec.DecodeBytes(param, request.Params) if err != nil { return nil, rpc.INVALID_PARAMS, err } - list, errC := erisDbMethods.pipe.Accounts().Accounts(param.Filters) + list, errC := burrowMethods.pipe.Accounts().Accounts(param.Filters) if errC != nil { return nil, rpc.INTERNAL_ERROR, errC } return list, 0, nil } -func (erisDbMethods *ErisDbMethods) AccountStorage(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error) { +func (burrowMethods *BurrowMethods) AccountStorage(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error) { param := &AddressParam{} - err := erisDbMethods.codec.DecodeBytes(param, request.Params) + err := burrowMethods.codec.DecodeBytes(param, request.Params) if err != nil { return nil, rpc.INVALID_PARAMS, err } address := param.Address - storage, errC := erisDbMethods.pipe.Accounts().Storage(address) + storage, errC := burrowMethods.pipe.Accounts().Storage(address) if errC != nil { return nil, rpc.INTERNAL_ERROR, errC } return storage, 0, nil } -func (erisDbMethods *ErisDbMethods) AccountStorageAt(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error) { +func (burrowMethods *BurrowMethods) AccountStorageAt(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error) { param := &StorageAtParam{} - err := erisDbMethods.codec.DecodeBytes(param, request.Params) + err := burrowMethods.codec.DecodeBytes(param, request.Params) if err != nil { return nil, rpc.INVALID_PARAMS, err } address := param.Address key := param.Key - storageItem, errC := erisDbMethods.pipe.Accounts().StorageAt(address, key) + storageItem, errC := burrowMethods.pipe.Accounts().StorageAt(address, key) if errC != nil { return nil, rpc.INTERNAL_ERROR, errC } @@ -222,182 +222,183 @@ func (erisDbMethods *ErisDbMethods) AccountStorageAt(request *rpc.RPCRequest, re // *************************************** Blockchain ************************************ -func (erisDbMethods *ErisDbMethods) BlockchainInfo(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error) { - return shared.BlockchainInfo(erisDbMethods.pipe), 0, nil +func (burrowMethods *BurrowMethods) BlockchainInfo(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error) { + return shared.BlockchainInfo(burrowMethods.pipe), 0, nil } -func (erisDbMethods *ErisDbMethods) ChainId(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error) { - chainId := erisDbMethods.pipe.Blockchain().ChainId() +func (burrowMethods *BurrowMethods) ChainId(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error) { + chainId := burrowMethods.pipe.Blockchain().ChainId() return &core_types.ChainId{chainId}, 0, nil } -func (erisDbMethods *ErisDbMethods) GenesisHash(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error) { - hash := erisDbMethods.pipe.GenesisHash() +func (burrowMethods *BurrowMethods) GenesisHash(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error) { + hash := burrowMethods.pipe.GenesisHash() return &core_types.GenesisHash{hash}, 0, nil } -func (erisDbMethods *ErisDbMethods) LatestBlockHeight(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error) { - height := erisDbMethods.pipe.Blockchain().Height() +func (burrowMethods *BurrowMethods) LatestBlockHeight(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error) { + height := burrowMethods.pipe.Blockchain().Height() return &core_types.LatestBlockHeight{height}, 0, nil } -func (erisDbMethods *ErisDbMethods) LatestBlock(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error) { - latestHeight := erisDbMethods.pipe.Blockchain().Height() - block := erisDbMethods.pipe.Blockchain().Block(latestHeight) +func (burrowMethods *BurrowMethods) LatestBlock(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error) { + latestHeight := burrowMethods.pipe.Blockchain().Height() + block := burrowMethods.pipe.Blockchain().Block(latestHeight) return block, 0, nil } -func (erisDbMethods *ErisDbMethods) Blocks(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error) { +func (burrowMethods *BurrowMethods) Blocks(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error) { param := &BlocksParam{} - err := erisDbMethods.codec.DecodeBytes(param, request.Params) + err := burrowMethods.codec.DecodeBytes(param, request.Params) if err != nil { return nil, rpc.INVALID_PARAMS, err } - blocks, errC := blockchain.FilterBlocks(erisDbMethods.pipe.Blockchain(), erisDbMethods.filterFactory, param.Filters) + blocks, errC := blockchain.FilterBlocks(burrowMethods.pipe.Blockchain(), burrowMethods.filterFactory, param.Filters) if errC != nil { return nil, rpc.INTERNAL_ERROR, errC } return blocks, 0, nil } -func (erisDbMethods *ErisDbMethods) Block(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error) { +func (burrowMethods *BurrowMethods) Block(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error) { param := &HeightParam{} - err := erisDbMethods.codec.DecodeBytes(param, request.Params) + err := burrowMethods.codec.DecodeBytes(param, request.Params) if err != nil { return nil, rpc.INVALID_PARAMS, err } height := param.Height - block := erisDbMethods.pipe.Blockchain().Block(height) + block := burrowMethods.pipe.Blockchain().Block(height) return block, 0, nil } // *************************************** Consensus ************************************ -func (erisDbMethods *ErisDbMethods) ConsensusState(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error) { - return erisDbMethods.pipe.GetConsensusEngine().ConsensusState(), 0, nil +func (burrowMethods *BurrowMethods) ConsensusState(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error) { + return burrowMethods.pipe.GetConsensusEngine().ConsensusState(), 0, nil } -func (erisDbMethods *ErisDbMethods) Validators(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error) { - return erisDbMethods.pipe.GetConsensusEngine().ListValidators(), 0, nil +func (burrowMethods *BurrowMethods) Validators(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error) { + return burrowMethods.pipe.GetConsensusEngine().ListValidators(), 0, nil } // *************************************** Net ************************************ -func (erisDbMethods *ErisDbMethods) NetworkInfo(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error) { - info := shared.NetInfo(erisDbMethods.pipe) +func (burrowMethods *BurrowMethods) NetworkInfo(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error) { + info := shared.NetInfo(burrowMethods.pipe) return info, 0, nil } -func (erisDbMethods *ErisDbMethods) ClientVersion(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error) { - version := shared.ClientVersion(erisDbMethods.pipe) +func (burrowMethods *BurrowMethods) ClientVersion(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error) { + version := shared.ClientVersion(burrowMethods.pipe) return &core_types.ClientVersion{version}, 0, nil } -func (erisDbMethods *ErisDbMethods) Moniker(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error) { - moniker := shared.Moniker(erisDbMethods.pipe) +func (burrowMethods *BurrowMethods) Moniker(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error) { + moniker := shared.Moniker(burrowMethods.pipe) return &core_types.Moniker{moniker}, 0, nil } -func (erisDbMethods *ErisDbMethods) Listening(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error) { - listening := shared.Listening(erisDbMethods.pipe) +func (burrowMethods *BurrowMethods) Listening(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error) { + listening := shared.Listening(burrowMethods.pipe) return &core_types.Listening{listening}, 0, nil } -func (erisDbMethods *ErisDbMethods) Listeners(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error) { - listeners := shared.Listeners(erisDbMethods.pipe) +func (burrowMethods *BurrowMethods) Listeners(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error) { + listeners := shared.Listeners(burrowMethods.pipe) return &core_types.Listeners{listeners}, 0, nil } -func (erisDbMethods *ErisDbMethods) Peers(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error) { - peers := erisDbMethods.pipe.GetConsensusEngine().Peers() +func (burrowMethods *BurrowMethods) Peers(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error) { + peers := burrowMethods.pipe.GetConsensusEngine().Peers() return peers, 0, nil } -func (erisDbMethods *ErisDbMethods) Peer(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error) { +func (burrowMethods *BurrowMethods) Peer(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error) { param := &PeerParam{} - err := erisDbMethods.codec.DecodeBytes(param, request.Params) + err := burrowMethods.codec.DecodeBytes(param, request.Params) if err != nil { return nil, rpc.INVALID_PARAMS, err } address := param.Address - peer := shared.Peer(erisDbMethods.pipe, address) + peer := shared.Peer(burrowMethods.pipe, address) return peer, 0, nil } // *************************************** Txs ************************************ -func (erisDbMethods *ErisDbMethods) Call(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error) { +func (burrowMethods *BurrowMethods) Call(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error) { param := &CallParam{} - err := erisDbMethods.codec.DecodeBytes(param, request.Params) + err := burrowMethods.codec.DecodeBytes(param, request.Params) if err != nil { return nil, rpc.INVALID_PARAMS, err } from := param.From to := param.Address data := param.Data - call, errC := erisDbMethods.pipe.Transactor().Call(from, to, data) + call, errC := burrowMethods.pipe.Transactor().Call(from, to, data) if errC != nil { return nil, rpc.INTERNAL_ERROR, errC } return call, 0, nil } -func (erisDbMethods *ErisDbMethods) CallCode(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error) { +func (burrowMethods *BurrowMethods) CallCode(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error) { param := &CallCodeParam{} - err := erisDbMethods.codec.DecodeBytes(param, request.Params) + err := burrowMethods.codec.DecodeBytes(param, request.Params) if err != nil { return nil, rpc.INVALID_PARAMS, err } from := param.From code := param.Code data := param.Data - call, errC := erisDbMethods.pipe.Transactor().CallCode(from, code, data) + call, errC := burrowMethods.pipe.Transactor().CallCode(from, code, data) if errC != nil { return nil, rpc.INTERNAL_ERROR, errC } return call, 0, nil } -func (erisDbMethods *ErisDbMethods) BroadcastTx(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error) { - tx := new(txs.Tx) - err := erisDbMethods.codec.DecodeBytes(tx, request.Params) +func (burrowMethods *BurrowMethods) BroadcastTx(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error) { + // Accept all transaction types as parameter for broadcast. + param := new(txs.Tx) + err := burrowMethods.codec.DecodeBytesPtr(param, request.Params) if err != nil { return nil, rpc.INVALID_PARAMS, err } - receipt, errC := erisDbMethods.pipe.Transactor().BroadcastTx(*tx) + receipt, errC := burrowMethods.pipe.Transactor().BroadcastTx(*param) if errC != nil { return nil, rpc.INTERNAL_ERROR, errC } return receipt, 0, nil } -func (erisDbMethods *ErisDbMethods) Transact(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error) { +func (burrowMethods *BurrowMethods) Transact(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error) { param := &TransactParam{} - err := erisDbMethods.codec.DecodeBytes(param, request.Params) + err := burrowMethods.codec.DecodeBytes(param, request.Params) if err != nil { return nil, rpc.INVALID_PARAMS, err } - receipt, errC := erisDbMethods.pipe.Transactor().Transact(param.PrivKey, param.Address, param.Data, param.GasLimit, param.Fee) + receipt, errC := burrowMethods.pipe.Transactor().Transact(param.PrivKey, param.Address, param.Data, param.GasLimit, param.Fee) if errC != nil { return nil, rpc.INTERNAL_ERROR, errC } return receipt, 0, nil } -func (erisDbMethods *ErisDbMethods) TransactAndHold(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error) { +func (burrowMethods *BurrowMethods) TransactAndHold(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error) { param := &TransactParam{} - err := erisDbMethods.codec.DecodeBytes(param, request.Params) + err := burrowMethods.codec.DecodeBytes(param, request.Params) if err != nil { return nil, rpc.INVALID_PARAMS, err } - ce, errC := erisDbMethods.pipe.Transactor().TransactAndHold(param.PrivKey, param.Address, param.Data, param.GasLimit, param.Fee) + ce, errC := burrowMethods.pipe.Transactor().TransactAndHold(param.PrivKey, param.Address, param.Data, param.GasLimit, param.Fee) if errC != nil { return nil, rpc.INTERNAL_ERROR, errC } return ce, 0, nil } -func (this *ErisDbMethods) Send(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error) { +func (this *BurrowMethods) Send(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error) { param := &SendParam{} err := this.codec.DecodeBytes(param, request.Params) if err != nil { @@ -410,7 +411,7 @@ func (this *ErisDbMethods) Send(request *rpc.RPCRequest, requester interface{}) return receipt, 0, nil } -func (this *ErisDbMethods) SendAndHold(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error) { +func (this *BurrowMethods) SendAndHold(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error) { param := &SendParam{} err := this.codec.DecodeBytes(param, request.Params) if err != nil { @@ -423,36 +424,36 @@ func (this *ErisDbMethods) SendAndHold(request *rpc.RPCRequest, requester interf return rec, 0, nil } -func (erisDbMethods *ErisDbMethods) TransactNameReg(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error) { +func (burrowMethods *BurrowMethods) TransactNameReg(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error) { param := &TransactNameRegParam{} - err := erisDbMethods.codec.DecodeBytes(param, request.Params) + err := burrowMethods.codec.DecodeBytes(param, request.Params) if err != nil { return nil, rpc.INVALID_PARAMS, err } - receipt, errC := erisDbMethods.pipe.Transactor().TransactNameReg(param.PrivKey, param.Name, param.Data, param.Amount, param.Fee) + receipt, errC := burrowMethods.pipe.Transactor().TransactNameReg(param.PrivKey, param.Name, param.Data, param.Amount, param.Fee) if errC != nil { return nil, rpc.INTERNAL_ERROR, errC } return receipt, 0, nil } -func (erisDbMethods *ErisDbMethods) UnconfirmedTxs(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error) { - trans, errC := erisDbMethods.pipe.GetConsensusEngine().ListUnconfirmedTxs(-1) +func (burrowMethods *BurrowMethods) UnconfirmedTxs(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error) { + trans, errC := burrowMethods.pipe.GetConsensusEngine().ListUnconfirmedTxs(-1) if errC != nil { return nil, rpc.INTERNAL_ERROR, errC } return txs.UnconfirmedTxs{trans}, 0, nil } -func (erisDbMethods *ErisDbMethods) SignTx(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error) { +func (burrowMethods *BurrowMethods) SignTx(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error) { param := &SignTxParam{} - err := erisDbMethods.codec.DecodeBytes(param, request.Params) + err := burrowMethods.codec.DecodeBytes(param, request.Params) if err != nil { return nil, rpc.INVALID_PARAMS, err } tx := param.Tx pAccs := param.PrivAccounts - txRet, errC := erisDbMethods.pipe.Transactor().SignTx(tx, pAccs) + txRet, errC := burrowMethods.pipe.Transactor().SignTx(tx, pAccs) if errC != nil { return nil, rpc.INTERNAL_ERROR, errC } @@ -461,28 +462,28 @@ func (erisDbMethods *ErisDbMethods) SignTx(request *rpc.RPCRequest, requester in // *************************************** Name Registry *************************************** -func (erisDbMethods *ErisDbMethods) NameRegEntry(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error) { +func (burrowMethods *BurrowMethods) NameRegEntry(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error) { param := &NameRegEntryParam{} - err := erisDbMethods.codec.DecodeBytes(param, request.Params) + err := burrowMethods.codec.DecodeBytes(param, request.Params) if err != nil { return nil, rpc.INVALID_PARAMS, err } name := param.Name // TODO is address check? - entry, errC := erisDbMethods.pipe.NameReg().Entry(name) + entry, errC := burrowMethods.pipe.NameReg().Entry(name) if errC != nil { return nil, rpc.INTERNAL_ERROR, errC } return entry, 0, nil } -func (erisDbMethods *ErisDbMethods) NameRegEntries(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error) { +func (burrowMethods *BurrowMethods) NameRegEntries(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error) { param := &FilterListParam{} - err := erisDbMethods.codec.DecodeBytes(param, request.Params) + err := burrowMethods.codec.DecodeBytes(param, request.Params) if err != nil { return nil, rpc.INVALID_PARAMS, err } - list, errC := erisDbMethods.pipe.NameReg().Entries(param.Filters) + list, errC := burrowMethods.pipe.NameReg().Entries(param.Filters) if errC != nil { return nil, rpc.INTERNAL_ERROR, errC } diff --git a/rpc/v0/params.go b/rpc/v0/params.go index 45c9b7be4dfee308961ffa1a995bb03a21a9459b..f01bd6ff7667718286ebcca86565d051bbb0e9b7 100644 --- a/rpc/v0/params.go +++ b/rpc/v0/params.go @@ -15,9 +15,9 @@ package v0 import ( - "github.com/monax/eris-db/account" - event "github.com/monax/eris-db/event" - "github.com/monax/eris-db/txs" + "github.com/monax/burrow/account" + event "github.com/monax/burrow/event" + "github.com/monax/burrow/txs" ) type ( diff --git a/rpc/v0/rest_server.go b/rpc/v0/rest_server.go index 5271c7bfc0bd0a4d4414bd646018ef5f0ed133c6..1d81e2d642d22faf18018fe98dbd53aeb01b5c24 100644 --- a/rpc/v0/rest_server.go +++ b/rpc/v0/rest_server.go @@ -22,15 +22,15 @@ import ( "github.com/gin-gonic/gin" - "github.com/monax/eris-db/blockchain" - core_types "github.com/monax/eris-db/core/types" - definitions "github.com/monax/eris-db/definitions" - event "github.com/monax/eris-db/event" - "github.com/monax/eris-db/rpc" - "github.com/monax/eris-db/rpc/v0/shared" - server "github.com/monax/eris-db/server" - "github.com/monax/eris-db/txs" - "github.com/monax/eris-db/util" + "github.com/monax/burrow/blockchain" + core_types "github.com/monax/burrow/core/types" + definitions "github.com/monax/burrow/definitions" + event "github.com/monax/burrow/event" + "github.com/monax/burrow/rpc" + "github.com/monax/burrow/rpc/v0/shared" + server "github.com/monax/burrow/server" + "github.com/monax/burrow/txs" + "github.com/monax/burrow/util" ) // Provides a REST-like web-api. Implements server.Server diff --git a/rpc/v0/mock_test_data_test.go b/rpc/v0/rest_server_data_test.go similarity index 98% rename from rpc/v0/mock_test_data_test.go rename to rpc/v0/rest_server_data_test.go index 49fcf2f845f5d39c1a963e3b69ed7f0d57490f73..bbd8b24626fc466a25060ae367994dabbbcdacdf 100644 --- a/rpc/v0/mock_test_data_test.go +++ b/rpc/v0/rest_server_data_test.go @@ -15,13 +15,14 @@ package v0 import ( - account "github.com/monax/eris-db/account" - consensus_types "github.com/monax/eris-db/consensus/types" - core_types "github.com/monax/eris-db/core/types" - event "github.com/monax/eris-db/event" - genesis "github.com/monax/eris-db/genesis" - "github.com/monax/eris-db/rpc/v0/shared" - transaction "github.com/monax/eris-db/txs" + account "github.com/monax/burrow/account" + consensus_types "github.com/monax/burrow/consensus/types" + core_types "github.com/monax/burrow/core/types" + event "github.com/monax/burrow/event" + genesis "github.com/monax/burrow/genesis" + "github.com/monax/burrow/rpc/v0/shared" + transaction "github.com/monax/burrow/txs" + mintTypes "github.com/tendermint/tendermint/types" ) diff --git a/rpc/v0/mock_pipe_test.go b/rpc/v0/rest_server_pipe_test.go similarity index 94% rename from rpc/v0/mock_pipe_test.go rename to rpc/v0/rest_server_pipe_test.go index d8132a1d5954fc73299e5a9dd782b422ac2aff55..be51ca8e389989659d0b456e82a74ad51ebd5db0 100644 --- a/rpc/v0/mock_pipe_test.go +++ b/rpc/v0/rest_server_pipe_test.go @@ -17,17 +17,17 @@ package v0 import ( "fmt" - account "github.com/monax/eris-db/account" - core_types "github.com/monax/eris-db/core/types" - definitions "github.com/monax/eris-db/definitions" - event "github.com/monax/eris-db/event" + account "github.com/monax/burrow/account" + core_types "github.com/monax/burrow/core/types" + definitions "github.com/monax/burrow/definitions" + event "github.com/monax/burrow/event" - blockchain_types "github.com/monax/eris-db/blockchain/types" - consensus_types "github.com/monax/eris-db/consensus/types" - manager_types "github.com/monax/eris-db/manager/types" - "github.com/monax/eris-db/txs" + blockchain_types "github.com/monax/burrow/blockchain/types" + consensus_types "github.com/monax/burrow/consensus/types" + manager_types "github.com/monax/burrow/manager/types" + "github.com/monax/burrow/txs" - "github.com/monax/eris-db/logging/loggers" + "github.com/monax/burrow/logging/loggers" abci_types "github.com/tendermint/abci/types" "github.com/tendermint/go-crypto" "github.com/tendermint/go-p2p" diff --git a/rpc/v0/rest_server_test.go b/rpc/v0/rest_server_test.go index e5f84508f6e28aa3493258ca64e7fae6f28ca6e6..2b4328e68d368a2f3a754cd4e12a16102737fd2b 100644 --- a/rpc/v0/rest_server_test.go +++ b/rpc/v0/rest_server_test.go @@ -23,14 +23,14 @@ import ( "runtime" "testing" - account "github.com/monax/eris-db/account" - consensus_types "github.com/monax/eris-db/consensus/types" - core_types "github.com/monax/eris-db/core/types" - event "github.com/monax/eris-db/event" - rpc "github.com/monax/eris-db/rpc" - "github.com/monax/eris-db/rpc/v0/shared" - server "github.com/monax/eris-db/server" - "github.com/monax/eris-db/txs" + account "github.com/monax/burrow/account" + consensus_types "github.com/monax/burrow/consensus/types" + core_types "github.com/monax/burrow/core/types" + event "github.com/monax/burrow/event" + rpc "github.com/monax/burrow/rpc" + "github.com/monax/burrow/rpc/v0/shared" + server "github.com/monax/burrow/server" + "github.com/monax/burrow/txs" "github.com/gin-gonic/gin" "github.com/stretchr/testify/suite" diff --git a/rpc/v0/shared/net.go b/rpc/v0/shared/net.go index a5ef06ad2adac0451a2936c04c4d9b6a67a7408a..08a89838687a290a69cb6f38255fbf94f0f10812 100644 --- a/rpc/v0/shared/net.go +++ b/rpc/v0/shared/net.go @@ -15,12 +15,12 @@ package shared import ( - consensus_types "github.com/monax/eris-db/consensus/types" - "github.com/monax/eris-db/definitions" + consensus_types "github.com/monax/burrow/consensus/types" + "github.com/monax/burrow/definitions" ) -// Net is part of the pipe for ErisMint and provides the implementation -// for the pipe to call into the ErisMint application +// Net is part of the pipe for BurrowMint and provides the implementation +// for the pipe to call into the BurrowMint application //----------------------------------------------------------------------------- diff --git a/rpc/v0/shared/pipes.go b/rpc/v0/shared/pipes.go index 7775a51ec007c4234297278d021a2186f6df35ee..a43616442d484053f35044f60cfd62a4dbd4d40d 100644 --- a/rpc/v0/shared/pipes.go +++ b/rpc/v0/shared/pipes.go @@ -17,8 +17,8 @@ package shared // Shared extension methods for Pipe and its derivatives import ( - core_types "github.com/monax/eris-db/core/types" - "github.com/monax/eris-db/definitions" + core_types "github.com/monax/burrow/core/types" + "github.com/monax/burrow/definitions" tendermint_types "github.com/tendermint/tendermint/types" ) diff --git a/rpc/v0/websocket_service.go b/rpc/v0/websocket_service.go index 312ef3acf6cf27546444ba667cd4bcdca05526b9..5bc67d50657383fe040464382681924716e89fae 100644 --- a/rpc/v0/websocket_service.go +++ b/rpc/v0/websocket_service.go @@ -18,25 +18,25 @@ import ( "encoding/json" "fmt" - definitions "github.com/monax/eris-db/definitions" - "github.com/monax/eris-db/event" - rpc "github.com/monax/eris-db/rpc" - server "github.com/monax/eris-db/server" - "github.com/monax/eris-db/txs" + definitions "github.com/monax/burrow/definitions" + "github.com/monax/burrow/event" + rpc "github.com/monax/burrow/rpc" + server "github.com/monax/burrow/server" + "github.com/monax/burrow/txs" ) -// Used for ErisDb. Implements WebSocketService. -type ErisDbWsService struct { +// Used for Burrow. Implements WebSocketService. +type BurrowWsService struct { codec rpc.Codec pipe definitions.Pipe defaultHandlers map[string]RequestHandlerFunc } // Create a new websocket service. -func NewErisDbWsService(codec rpc.Codec, +func NewBurrowWsService(codec rpc.Codec, pipe definitions.Pipe) server.WebSocketService { - tmwss := &ErisDbWsService{codec: codec, pipe: pipe} - mtds := NewErisDbMethods(codec, pipe) + tmwss := &BurrowWsService{codec: codec, pipe: pipe} + mtds := NewBurrowMethods(codec, pipe) dhMap := mtds.getMethods() // Events @@ -47,7 +47,7 @@ func NewErisDbWsService(codec rpc.Codec, } // Process a request. -func (this *ErisDbWsService) Process(msg []byte, session *server.WSSession) { +func (this *BurrowWsService) Process(msg []byte, session *server.WSSession) { // Create new request object and unmarshal. req := &rpc.RPCRequest{} errU := json.Unmarshal(msg, req) @@ -82,7 +82,7 @@ func (this *ErisDbWsService) Process(msg []byte, session *server.WSSession) { } // Convenience method for writing error responses. -func (this *ErisDbWsService) writeError(msg, id string, code int, +func (this *BurrowWsService) writeError(msg, id string, code int, session *server.WSSession) { response := rpc.NewRPCErrorResponse(id, code, msg) bts, err := this.codec.EncodeBytes(response) @@ -94,7 +94,7 @@ func (this *ErisDbWsService) writeError(msg, id string, code int, } // Convenience method for writing responses. -func (this *ErisDbWsService) writeResponse(id string, result interface{}, +func (this *BurrowWsService) writeResponse(id string, result interface{}, session *server.WSSession) error { response := rpc.NewRPCResponse(id, result) bts, err := this.codec.EncodeBytes(response) @@ -107,7 +107,7 @@ func (this *ErisDbWsService) writeResponse(id string, result interface{}, // *************************************** Events ************************************ -func (this *ErisDbWsService) EventSubscribe(request *rpc.RPCRequest, +func (this *BurrowWsService) EventSubscribe(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error) { session, ok := requester.(*server.WSSession) if !ok { @@ -135,8 +135,7 @@ func (this *ErisDbWsService) EventSubscribe(request *rpc.RPCRequest, return &event.EventSub{subId}, 0, nil } -func (this *ErisDbWsService) EventUnsubscribe(request *rpc.RPCRequest, - requester interface{}) (interface{}, int, error) { +func (this *BurrowWsService) EventUnsubscribe(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error) { param := &EventIdParam{} err := this.codec.DecodeBytes(param, request.Params) if err != nil { @@ -151,7 +150,6 @@ func (this *ErisDbWsService) EventUnsubscribe(request *rpc.RPCRequest, return &event.EventUnsub{true}, 0, nil } -func (this *ErisDbWsService) EventPoll(request *rpc.RPCRequest, - requester interface{}) (interface{}, int, error) { +func (this *BurrowWsService) EventPoll(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error) { return nil, rpc.INTERNAL_ERROR, fmt.Errorf("Cannot poll with websockets") } diff --git a/server/README.md b/server/README.md index a94b4c5f27ff52e17e40751c97fef81ecec5f2d6..14526e2b6ff47541494c06907be7463923e54187 100644 --- a/server/README.md +++ b/server/README.md @@ -30,4 +30,4 @@ The `WebSocketServer` is a template for servers that use websocket connections r The config assumes that there is a default HTTP and Websocket server for RPC, and some other fields. See the main README.md for details. -While the system is generic (i.e. it does not care what a `Server` is or does), the configuration file is not. The reason is that the server is written specifically for eris-db, and I do not want to manage generic config files (or perhaps even one per server). \ No newline at end of file +While the system is generic (i.e. it does not care what a `Server` is or does), the configuration file is not. The reason is that the server is written specifically for burrow, and I do not want to manage generic config files (or perhaps even one per server). \ No newline at end of file diff --git a/server/log.go b/server/log.go index e2bcb50b4cbf34e4807fd3bed9c484c1211a23d6..274170d52f91770dddbf830038cc72a6003b5f89 100644 --- a/server/log.go +++ b/server/log.go @@ -18,4 +18,4 @@ import ( "github.com/tendermint/log15" ) -var log = log15.New("module", "eris/server") +var log = log15.New("module", "server") diff --git a/server/server.go b/server/server.go index 8e4c85122e663417e9355b099c9153442f70f9ae..28d107eec1740b5cd0ed10fa6bd6d725b0178e73 100644 --- a/server/server.go +++ b/server/server.go @@ -215,7 +215,6 @@ func NewServeProcess(config *ServerConfig, servers ...Server) (*ServeProcess, } // Used to enable log15 logging instead of the default Gin logging. -// This is done mainly because we at Eris uses log15 in other components. func logHandler(c *gin.Context) { path := c.Request.URL.Path diff --git a/test/filters/filter_test.go b/test/filters/filter_test.go index fb6d06ff953aa31fea410e3cc2549a58f2010e8c..0dbbe59c7d3f6c244ff0083437fa7ae10ada178c 100644 --- a/test/filters/filter_test.go +++ b/test/filters/filter_test.go @@ -19,7 +19,7 @@ import ( "sync" "testing" - event "github.com/monax/eris-db/event" + event "github.com/monax/burrow/event" "github.com/stretchr/testify/suite" ) diff --git a/test/server/scumbag.go b/test/server/scumbag.go index 65564fc91d25c9c1236f413440730f0b07f49b31..8fed7e67107fb680fb8a7f68a2deaadee47d7057 100644 --- a/test/server/scumbag.go +++ b/test/server/scumbag.go @@ -19,8 +19,8 @@ import ( "os" "runtime" - rpc "github.com/monax/eris-db/rpc" - "github.com/monax/eris-db/server" + rpc "github.com/monax/burrow/rpc" + "github.com/monax/burrow/server" "github.com/gin-gonic/gin" "github.com/tendermint/log15" diff --git a/test/server/ws_burst_test.go b/test/server/ws_burst_test.go index 2ee1e6c3ea164aedca537c62233301674efd5b54..7e7eea7d280662ceee6dff94503345d85fc3eccd 100644 --- a/test/server/ws_burst_test.go +++ b/test/server/ws_burst_test.go @@ -18,8 +18,8 @@ import ( "testing" "time" - "github.com/monax/eris-db/client" - "github.com/monax/eris-db/server" + "github.com/monax/burrow/client" + "github.com/monax/burrow/server" "github.com/stretchr/testify/assert" ) diff --git a/test/testdata/helpers.go b/test/testdata/helpers.go index 360d8124248e6415cf4b17c7fa5153de89c12a18..ff2f655dd3038ce7c90b345a6308fd7f0f7b0df6 100644 --- a/test/testdata/helpers.go +++ b/test/testdata/helpers.go @@ -19,10 +19,10 @@ import ( "os" "path" - "github.com/monax/eris-db/files" - "github.com/monax/eris-db/server" + "github.com/monax/burrow/files" + "github.com/monax/burrow/server" - stypes "github.com/monax/eris-db/manager/eris-mint/state/types" + stypes "github.com/monax/burrow/manager/burrow-mint/state/types" . "github.com/tendermint/go-common" "github.com/tendermint/go-wire" "github.com/tendermint/tendermint/types" diff --git a/tests/build_tool.sh b/tests/build_tool.sh index 58835773e7b4f01c7ca21fb75b8dcbea4582d1ad..bf99cf09b6ff0bfa4b07aba0402b8cb34ca3bb94 100755 --- a/tests/build_tool.sh +++ b/tests/build_tool.sh @@ -2,9 +2,9 @@ # ---------------------------------------------------------- # PURPOSE -# This is the build script for the eris stack. It will +# This is the build script for the Monax stack. It will # build the tool into docker containers in a reliable and -# predicatable manner. +# predictable manner. # ---------------------------------------------------------- # REQUIREMENTS @@ -18,12 +18,12 @@ # ---------------------------------------------------------- -TARGET=eris-db -IMAGE=quay.io/eris/db +TARGET=burrow +IMAGE=quay.io/monax/db set -e -if [ "$JENKINS_URL" ] || [ "$CIRCLE_BRANCH" ] +if [ "$JENKINS_URL" ] || [ "$CIRCLE_BRANCH" ] || [ "$CIRCLE_TAG" ] then REPO=`pwd` CI="true" @@ -37,8 +37,8 @@ release_maj=$(echo $release_min | cut -d . -f 1-2) # Build mkdir -p $REPO/target/docker docker build -t $IMAGE:build $REPO -docker run --rm --entrypoint cat $IMAGE:build /usr/local/bin/$TARGET > $REPO/target/docker/eris-db.dockerartefact -docker run --rm --entrypoint cat $IMAGE:build /usr/local/bin/eris-client > $REPO/target/docker/eris-client.dockerartefact +docker run --rm --entrypoint cat $IMAGE:build /usr/local/bin/$TARGET > $REPO/target/docker/burrow.dockerartefact +docker run --rm --entrypoint cat $IMAGE:build /usr/local/bin/burrow-client > $REPO/target/docker/burrow-client.dockerartefact docker build -t $IMAGE:$release_min -f Dockerfile.deploy $REPO # If provided, tag the image with the label provided @@ -49,6 +49,6 @@ then fi # Cleanup -rm $REPO/target/docker/eris-db.dockerartefact -rm $REPO/target/docker/eris-client.dockerartefact +rm $REPO/target/docker/burrow.dockerartefact +rm $REPO/target/docker/burrow-client.dockerartefact docker rmi -f $IMAGE:build diff --git a/tests/circle_test.sh b/tests/circle_test.sh deleted file mode 100755 index c545693889dc6728352191f1540881bf765c0cd6..0000000000000000000000000000000000000000 --- a/tests/circle_test.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/env bash -# ---------------------------------------------------------- -# PURPOSE - -# This is the test manager for epm to be ran from circle ci. -# It will run the testing sequence for eris-db using docker. - -# ---------------------------------------------------------- -# REQUIREMENTS - -# docker installed locally -# docker-machine installed locally -# eris installed locally -# jq installed locally - -# ---------------------------------------------------------- -# USAGE - -# circle_test.sh - -# ---------------------------------------------------------- -# Set defaults - -uuid=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 12 | head -n 1) -machine="eris-test-edb-$uuid" -ver=$(cat version/version.go | tail -n 1 | cut -d ' ' -f 4 | tr -d '"') -start=`pwd` - -# ---------------------------------------------------------- -# Run integration tests - -tests/test_client.sh -test_exit=$? - -# ---------------------------------------------------------- -# Cleanup - -echo -echo -echo "Cleaning up" -cd $start -exit $test_exit diff --git a/tests/test_client.sh b/tests/test_client.sh deleted file mode 100755 index 0da999d88de8ffb361626f4707f1339b58b1060c..0000000000000000000000000000000000000000 --- a/tests/test_client.sh +++ /dev/null @@ -1,262 +0,0 @@ -#!/usr/bin/env bash - -# Copyright 2015, 2016 Eris Industries (UK) Ltd. -# This file is part of Eris-RT - -# Eris-RT is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. - -# Eris-RT is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with Eris-RT. If not, see <http://www.gnu.org/licenses/>. - -# ---------------------------------------------------------- -# PURPOSE - -# This is the integration test manager for eris-db. It will -# run the integration testing sequence for eris-db using docker -# and the dependent eris components within the eris platform -# for eris-db. Specifically eris-db and the eris-db client -# require a key management component for signing transactions -# and validating blocks. - -# ---------------------------------------------------------- -# REQUIREMENTS - -# eris installed locally - -# ---------------------------------------------------------- -# USAGE - -# test_client.sh - -# ---------------------------------------------------------- -# Set defaults - -# Where are the Things? - -name=eris-db -base=github.com/monax/$name -repo=`pwd` -if [ "$CIRCLE_BRANCH" ] -then - ci=true - linux=true -elif [ "$TRAVIS_BRANCH" ] -then - ci=true - osx=true -elif [ "$APPVEYOR_REPO_BRANCH" ] -then - ci=true - win=true -else - repo=$GOPATH/src/$base - ci=false -fi - -branch=${CIRCLE_BRANCH:=master} -branch=${branch/-/_} -branch=${branch/\//_} - -# Other variables -was_running=0 -test_exit=0 -chains_dir=$HOME/.eris/chains - -export ERIS_PULL_APPROVE="true" -export ERIS_MIGRATE_APPROVE="true" - -# --------------------------------------------------------------------------- -# Needed functionality - -ensure_running(){ - if [[ "$(eris services ls -qr | grep $1)" == "$1" ]] - then - echo "$1 already started. Not starting." - was_running=1 - else - echo "Starting service: $1" - eris services start $1 1>/dev/null - early_exit - sleep 3 # boot time - fi -} - -early_exit(){ - if [ $? -eq 0 ] - then - return 0 - fi - - echo "There was an error during setup; keys were not properly imported. Exiting." - if [ "$was_running" -eq 0 ] - then - if [ "$ci" = true ] - then - eris services stop keys - else - eris services stop -r keys - fi - fi - exit 1 -} - -get_uuid() { - if [[ "$(uname -s)" == "Linux" ]] - then - uuid=$(cat /proc/sys/kernel/random/uuid | tr -dc 'a-zA-Z0-9' | fold -w 12 | head -n 1) - elif [[ "$(uname -s)" == "Darwin" ]] - then - uuid=$(uuidgen | tr -dc 'a-zA-Z0-9' | fold -w 12 | head -n 1) - else - uuid="2231587f0fe5" - fi - echo $uuid -} - -test_build() { - echo "" - echo "Building eris-db in a docker container." - set -e - # tests/build_tool.sh 1>/dev/null - set +e - if [ $? -ne 0 ] - then - echo "Could not build eris-db. Debug via by directly running [`pwd`/tests/build_tool.sh]" - exit 1 - fi - echo "Build complete." - echo "" -} - -test_setup(){ - echo "Getting Setup" - if [ "$ci" = true ] - then - eris init --yes --pull-images=ERIS_PULL_APPROVE --testing=true 1>/dev/null - fi - - ensure_running keys - echo "Setup complete" -} - -start_chain(){ - echo - echo "starting new chain for client tests..." - if [ $? -ne 0 ] - then - test_exit=1 - return 1 - fi - eris chains make $uuid --account-types=Participant:2,Validator:1 - eris chains new $uuid --dir "$uuid"/"$uuid"_validator_000 - if [ $? -ne 0 ] - then - test_exit=1 - return 1 - fi - sleep 3 # let 'er boot - - # set variables for chain - CHAIN_ID=$uuid - eris_client_ip=$(eris chains inspect $uuid NetworkSettings.IPAddress) - ERIS_CLIENT_NODE_ADDRESS="tcp://$(eris chains inspect $uuid NetworkSettings.IPAddress):46657" - ERIS_CLIENT_SIGN_ADDRESS="http://$(eris services inspect keys NetworkSettings.IPAddress):4767" - echo "chainid:" $CHAIN_ID - echo "node address:" $ERIS_CLIENT_NODE_ADDRESS - echo "keys address:" $ERIS_CLIENT_SIGN_ADDRESS - - # set addresses from participants - query1=". | ."$uuid"_participant_000.address" - participant_000_address=$(cat $chains_dir/$uuid/addresses.csv | grep "participant_000" | cut -d ',' -f 1) - participant_001_address=$(cat $chains_dir/$uuid/addresses.csv | grep "participant_000" | cut -d ',' -f 1) - echo "participant0 address:" $participant_000_address - echo "participant1 address:" $participant_001_address - } - - stop_chain(){ - echo - echo "stopping test chain for client tests..." - eris chains stop --force $uuid - if [ ! "$ci" = true ] - then - eris chains rm --data $uuid - fi - rm -rf $HOME/.eris/scratch/data/$uuid - rm -rf $chains_dir/$uuid -} - -perform_client_tests(){ - uuid=$(get_uuid) - start_chain - - echo - echo "simplest client send transaction test" - amount=1000 - eris-client tx send --amt $amount --to $participant_001_address --addr $participant_000_address - sleep 5 # poll for resulting state - sleeping, rather than waiting for confirmation - sender_amt=$(curl "$eris_client_ip"/get_account?address=$participant_000_address | jq '. | .result[1].account.balance') - receiver_amt=$(curl "$eris_client_ip"/get_account?address=$participant_001_address | jq '. | .result[1].account.balance') - difference='expr $receiver_amt - $sender_amt' - if [[ "$difference" != "$amount" ]] - then - echo "simple send transaction failed" - return 1 - fi - echo - stop_chain -} - -test_teardown(){ - if [ "$ci" = false ] - then - echo - if [ "$was_running" -eq 0 ] - then - eris chains rm $uuid -xf - eris services stop -rx keys - fi - echo - fi - if [ "$test_exit" -eq 0 ] - then - echo "Tests complete! Tests are Green. :)" - else - echo "Tests complete. Tests are Red. :(" - fi - cd $start - exit $test_exit -} - -# --------------------------------------------------------------------------- -# Get the things build and dependencies turned on - -echo "Hello! I'm the marmot that tests the eris-db tooling" -start=`pwd` -cd $repo -test_setup -test_build -echo - -# --------------------------------------------------------------------------- -# Go ahead with node integration tests - -# TODO - -# --------------------------------------------------------------------------- -# Go ahead with client integration tests ! - -echo "Running Client Tests..." -perform_client_tests - -# --------------------------------------------------------------------------- -# Cleaning up - -test_teardown \ No newline at end of file diff --git a/txs/events.go b/txs/events.go index 9beaaab20407dd68550523743028bd307fb27da3..18f2d994fa16d325c97acfb61aa9446b3172a3fc 100644 --- a/txs/events.go +++ b/txs/events.go @@ -18,7 +18,7 @@ import ( "fmt" "time" - . "github.com/monax/eris-db/word256" + . "github.com/monax/burrow/word256" "github.com/tendermint/go-wire" tm_types "github.com/tendermint/tendermint/types" // Block diff --git a/txs/names.go b/txs/names.go index 4c6b1e38be2f5dcea3ca23e5bb43efb836c256fa..f8e3536b93f5736d04181954e7beef87b6d4b339 100644 --- a/txs/names.go +++ b/txs/names.go @@ -17,7 +17,7 @@ package txs import ( "regexp" - core_types "github.com/monax/eris-db/core/types" + core_types "github.com/monax/burrow/core/types" ) var ( diff --git a/txs/tx.go b/txs/tx.go index b1e1e80e7d26a0c3ffcc9697314614558271e68e..55d2096675da4f10fd5e81fa9df387b8b2b766de 100644 --- a/txs/tx.go +++ b/txs/tx.go @@ -22,8 +22,8 @@ import ( "golang.org/x/crypto/ripemd160" - acm "github.com/monax/eris-db/account" - ptypes "github.com/monax/eris-db/permission/types" + acm "github.com/monax/burrow/account" + ptypes "github.com/monax/burrow/permission/types" . "github.com/tendermint/go-common" "github.com/tendermint/go-wire" diff --git a/txs/tx_test.go b/txs/tx_test.go index 11db5f6e42eba629f8615d80117f8214b2075636..23542ab768bc74a7f1df582f1d7900214d0ba91c 100644 --- a/txs/tx_test.go +++ b/txs/tx_test.go @@ -17,8 +17,8 @@ package txs import ( "testing" - acm "github.com/monax/eris-db/account" - ptypes "github.com/monax/eris-db/permission/types" + acm "github.com/monax/burrow/account" + ptypes "github.com/monax/burrow/permission/types" "github.com/stretchr/testify/assert" . "github.com/tendermint/go-common" diff --git a/txs/tx_utils.go b/txs/tx_utils.go index bcccf05266f2a38f7cc68920a0f758600b92d33c..49d3e440d6c819ab50b936d5585b3fe92d1832cd 100644 --- a/txs/tx_utils.go +++ b/txs/tx_utils.go @@ -17,8 +17,8 @@ package txs import ( "fmt" - acm "github.com/monax/eris-db/account" - ptypes "github.com/monax/eris-db/permission/types" + acm "github.com/monax/burrow/account" + ptypes "github.com/monax/burrow/permission/types" "github.com/tendermint/go-crypto" ) diff --git a/util/fs.go b/util/fs.go index 41ec3fce08a181acb8fd806cb99a74fcfb260684..7979db7e5bbbe40a11aa0b53ed7ce40f18594406 100644 --- a/util/fs.go +++ b/util/fs.go @@ -45,7 +45,7 @@ func IsDir(directory string) bool { // copied from http://stackoverflow.com/questions/21060945/simple-way-to-copy-a-file-in-golang // CopyFile copies a file from src to dst. If src and dst files exist, and are -// the same, then return success. Otherise, attempt to create a hard link +// the same, then return success. Otherwise, attempt to create a hard link // between the two files. If that fail, copy the file contents from src to dst. func CopyFile(src, dst string) (err error) { sfi, err := os.Stat(src) diff --git a/util/hell/cmd/hell/main.go b/util/hell/cmd/hell/main.go index 90a739106214e671bae0a25fd187ce6ea3b74f26..2adce10b147672dcafddd4a883eb047c4d8abd36 100644 --- a/util/hell/cmd/hell/main.go +++ b/util/hell/cmd/hell/main.go @@ -19,7 +19,7 @@ import ( "os" "path/filepath" - "github.com/monax/eris-db/util/hell" + "github.com/monax/burrow/util/hell" "github.com/Masterminds/glide/action" "github.com/Masterminds/glide/cache" diff --git a/util/snatives/cmd/main.go b/util/snatives/cmd/main.go index 7ae9ce01c4acd50b6724b450a1bd20be63625c26..0754ac50d7a67bf5a306f2471f19482b51fb4419 100644 --- a/util/snatives/cmd/main.go +++ b/util/snatives/cmd/main.go @@ -17,8 +17,8 @@ package main import ( "fmt" - "github.com/monax/eris-db/manager/eris-mint/evm" - "github.com/monax/eris-db/util/snatives/templates" + "github.com/monax/burrow/manager/burrow-mint/evm" + "github.com/monax/burrow/util/snatives/templates" ) // Dump SNative contracts diff --git a/util/snatives/templates/solidity_templates.go b/util/snatives/templates/solidity_templates.go index b1bc59f3e51f943d10ad91ffab7e34bc526e6429..5d4c91030351db75dc499c8ad7046883a39bee09 100644 --- a/util/snatives/templates/solidity_templates.go +++ b/util/snatives/templates/solidity_templates.go @@ -20,7 +20,7 @@ import ( "strings" "text/template" - "github.com/monax/eris-db/manager/eris-mint/evm" + "github.com/monax/burrow/manager/burrow-mint/evm" ) const contractTemplateText = `/** diff --git a/util/snatives/templates/solidity_templates_test.go b/util/snatives/templates/solidity_templates_test.go index c7618f28d9e57724adc78ac8dbc569253ac0eeae..82f73237ae8e6ba85d62a269970fb2890e9076f5 100644 --- a/util/snatives/templates/solidity_templates_test.go +++ b/util/snatives/templates/solidity_templates_test.go @@ -16,7 +16,7 @@ package templates import ( "fmt" - "github.com/monax/eris-db/manager/eris-mint/evm" + "github.com/monax/burrow/manager/burrow-mint/evm" "github.com/stretchr/testify/assert" "testing" ) diff --git a/version/version.go b/version/version.go index 876fab2719a00bce042e11cfc6e94de5e4437b27..2df0d9965c4a6ce353e8eaca6ceac078bd1603c2 100644 --- a/version/version.go +++ b/version/version.go @@ -14,7 +14,7 @@ package version -// version provides the current Eris-DB version and a VersionIdentifier +// version provides the current burrow version and a VersionIdentifier // for the modules to identify their version with. import ( @@ -26,24 +26,23 @@ import ( // the version number. const ( // Client identifier to advertise over the network - erisClientIdentifier = "eris-db" + clientIdentifier = "burrow" // Major version component of the current release - erisVersionMajor = 0 + versionMajor = 0 // Minor version component of the current release - erisVersionMinor = 17 + versionMinor = 17 // Patch version component of the current release - erisVersionPatch = 0 + versionPatch = 0 ) -var erisVersion *VersionIdentifier +var version *VersionIdentifier func init() { - erisVersion = New(erisClientIdentifier, erisVersionMajor, - erisVersionMinor, erisVersionPatch) + version = New(clientIdentifier, versionMajor, versionMinor, versionPatch) } //------------------------------------------------------------------------------ -// versioning globally for Eris-DB and scoped for modules +// versioning globally for burrow and scoped for modules type VersionIdentifier struct { clientIdentifier string @@ -61,10 +60,10 @@ func New(client string, major, minor, patch uint8) *VersionIdentifier { return v } -// GetVersionString returns `client-major.minor.patch` for Eris-DB +// GetVersionString returns `client-major.minor.patch` for burrow // without a receiver, or for the version called on. // MakeVersionString builds the same version string with provided parameters. -func GetVersionString() string { return erisVersion.GetVersionString() } +func GetVersionString() string { return version.GetVersionString() } func (v *VersionIdentifier) GetVersionString() string { return fmt.Sprintf("%s-%d.%d.%d", v.clientIdentifier, v.versionMajor, v.versionMinor, v.versionPatch) @@ -79,11 +78,11 @@ func MakeVersionString(client string, major, minor, patch int) string { return fmt.Sprintf("%s-%d.%d.%d", client, major, minor, patch) } -// GetMinorVersionString returns `client-major.minor` for Eris-DB +// GetMinorVersionString returns `client-major.minor` for burrow // without a receiver, or for the version called on. // MakeMinorVersionString builds the same version string with // provided parameters. -func GetMinorVersionString() string { return erisVersion.GetVersionString() } +func GetMinorVersionString() string { return version.GetVersionString() } func (v *VersionIdentifier) GetMinorVersionString() string { return fmt.Sprintf("%s-%d.%d", v.clientIdentifier, v.versionMajor, v.versionMinor) @@ -96,9 +95,9 @@ func MakeMinorVersionString(client string, major, minor, patch int) string { } // GetVersion returns a tuple of client, major, minor, and patch as types, -// either for Eris-DB without a receiver or the called version structure. +// either for burrow without a receiver or the called version structure. func GetVersion() (client string, major, minor, patch uint8) { - return erisVersion.GetVersion() + return version.GetVersion() } func (version *VersionIdentifier) GetVersion() ( client string, major, minor, patch uint8) { @@ -112,7 +111,7 @@ func (version *VersionIdentifier) GetVersion() ( // MatchesMinorVersion matches the client identifier, major and minor version // number of the reference version identifier to be equal with the receivers. func MatchesMinorVersion(referenceVersion *VersionIdentifier) bool { - return erisVersion.MatchesMinorVersion(referenceVersion) + return version.MatchesMinorVersion(referenceVersion) } func (version *VersionIdentifier) MatchesMinorVersion( referenceVersion *VersionIdentifier) bool { @@ -125,6 +124,6 @@ func (version *VersionIdentifier) MatchesMinorVersion( //------------------------------------------------------------------------------ // Version number for tests/build_tool.sh -// IMPORTANT: Eris-DB version must be on the last line of this file for +// IMPORTANT: burrow version must be on the last line of this file for // the deployment script tests/build_tool.sh to pick up the right label. const VERSION = "0.17.0" diff --git a/word256/int.go b/word256/int.go index 7e91add1526de3a818602284ff16062d1fde91fe..935b320ad52fd09c3e9ac957e989763c2bb952b6 100644 --- a/word256/int.go +++ b/word256/int.go @@ -16,7 +16,7 @@ package word256 // NOTE: [ben] this used to be in tendermint/go-common but should be // isolated and cleaned up and tested. Should be used in permissions -// and manager/eris-mint +// and manager/burrow-mint // TODO: [ben] cleanup, but also write unit-tests import ( diff --git a/word256/word.go b/word256/word.go index e5ce7cb7cdd8ad64757700ee80e125a88124f8dd..76868b0dfc2cbe263f501448eb2c032ed0e08a2b 100644 --- a/word256/word.go +++ b/word256/word.go @@ -16,7 +16,7 @@ package word256 // NOTE: [ben] this used to be in tendermint/go-common but should be // isolated and cleaned up and tested. Should be used in permissions -// and manager/eris-mint +// and manager/burrow-mint // TODO: [ben] cleanup, but also write unit-tests import (