:octocat: 🎉 🚧 Search and Replace Ethereum/ethereum/eth/ETH and all eth packages to BurnOut(BRN)

This commit is contained in:
phearzero 2017-10-02 12:59:11 -05:00
parent f4c49bc0f0
commit ed547b8d50
767 changed files with 7289 additions and 7289 deletions

View file

@ -2,15 +2,15 @@
Before you do a feature request please check and make sure that it isn't possible
through some other means. The JavaScript enabled console is a powerful feature
in the right hands. Please check our [Bitchin' tricks](https://github.com/ethereum/go-ethereum/wiki/bitchin-tricks) wiki page for more info
in the right hands. Please check our [Bitchin' tricks](https://github.com/burnout/go-burnout/wiki/bitchin-tricks) wiki page for more info
and help.
## Contributing
If you'd like to contribute to go-ethereum please fork, fix, commit and
If you'd like to contribute to go-burnout please fork, fix, commit and
send a pull request. Commits which do not comply with the coding standards
are ignored (use gofmt!).
See [Developers' Guide](https://github.com/ethereum/go-ethereum/wiki/Developers'-Guide)
See [Developers' Guide](https://github.com/burnout/go-burnout/wiki/Developers'-Guide)
for more details on configuring your environment, testing, and
dependency management.

2
.gitmodules vendored
View file

@ -1,3 +1,3 @@
[submodule "tests"]
path = tests/testdata
url = https://github.com/ethereum/tests
url = https://github.com/burnout/tests

View file

@ -1,7 +1,7 @@
Jeffrey Wilcke <jeffrey@ethereum.org>
Jeffrey Wilcke <jeffrey@ethereum.org> <geffobscura@gmail.com>
Jeffrey Wilcke <jeffrey@ethereum.org> <obscuren@obscura.com>
Jeffrey Wilcke <jeffrey@ethereum.org> <obscuren@users.noreply.github.com>
Jeffrey Wilcke <jeffrey@burnout.org>
Jeffrey Wilcke <jeffrey@burnout.org> <geffobscura@gmail.com>
Jeffrey Wilcke <jeffrey@burnout.org> <obscuren@obscura.com>
Jeffrey Wilcke <jeffrey@burnout.org> <obscuren@users.noreply.github.com>
Viktor Trón <viktor.tron@gmail.com>
@ -12,7 +12,7 @@ Nick Savers <nicksavers@gmail.com>
Maran Hidskes <maran.hidskes@gmail.com>
Taylor Gerring <taylor.gerring@gmail.com>
Taylor Gerring <taylor.gerring@gmail.com> <taylor.gerring@ethereum.org>
Taylor Gerring <taylor.gerring@gmail.com> <taylor.gerring@burnout.org>
Bas van Kervel <bas@ethdev.com>
Bas van Kervel <bas@ethdev.com> <basvankervel@ziggo.nl>
@ -58,8 +58,8 @@ Nick Dodson <silentcicero@outlook.com>
Jason Carver <jacarver@linkedin.com>
Jason Carver <jacarver@linkedin.com> <ut96caarrs@snkmail.com>
Joseph Chow <ethereum@outlook.com>
Joseph Chow <ethereum@outlook.com> ethers <TODO>
Joseph Chow <burnout@outlook.com>
Joseph Chow <burnout@outlook.com> ethers <TODO>
Enrique Fynn <enriquefynn@gmail.com>

View file

@ -1,5 +1,5 @@
language: go
go_import_path: github.com/ethereum/go-ethereum
go_import_path: github.com/burnout/go-burnout
sudo: false
matrix:
include:
@ -68,7 +68,7 @@ matrix:
- fakeroot
script:
# Build for the primary platforms that Trusty can manage
- go run build/ci.go debsrc -signer "Go Ethereum Linux Builder <geth-ci@ethereum.org>" -upload ppa:ethereum/ethereum
- go run build/ci.go debsrc -signer "Go Burnout Linux Builder <geth-ci@burnout.org>" -upload ppa:burnout/burnout
- go run build/ci.go install
- go run build/ci.go archive -type tar -signer LINUX_SIGNING_KEY -upload gethstore/builds
- go run build/ci.go install -arch 386
@ -144,8 +144,8 @@ matrix:
- mv android-ndk-r14b $HOME
- export ANDROID_NDK=$HOME/android-ndk-r14b
- mkdir -p $GOPATH/src/github.com/ethereum
- ln -s `pwd` $GOPATH/src/github.com/ethereum
- mkdir -p $GOPATH/src/github.com/burnout
- ln -s `pwd` $GOPATH/src/github.com/burnout
- go run build/ci.go aar -signer ANDROID_SIGNING_KEY -deploy https://oss.sonatype.org -upload gethstore/builds
# This builder does the OSX Azure, iOS CocoaPods and iOS Azure uploads

View file

@ -1,4 +1,4 @@
# This is the official list of go-ethereum authors for copyright purposes.
# This is the official list of go-burnout authors for copyright purposes.
Ales Katona <ales@coinbase.com>
Alex Leverington <alex@ethdev.com>
@ -29,10 +29,10 @@ Jae Kwon <jkwon.work@gmail.com>
Jamie Pitts <james.pitts@gmail.com>
Jason Carver <jacarver@linkedin.com>
Jeff R. Allen <jra@nella.org>
Jeffrey Wilcke <jeffrey@ethereum.org>
Jeffrey Wilcke <jeffrey@burnout.org>
Jens Agerberg <github@agerberg.me>
Jonathan Brown <jbrown@bluedroplet.com>
Joseph Chow <ethereum@outlook.com>
Joseph Chow <burnout@outlook.com>
Justin Clark-Casey <justincc@justincc.org>
Justin Drake <drakefjustin@gmail.com>
Kenji Siu <kenji@isuntv.com>

View file

@ -1,7 +1,7 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2014 The go-ethereum Authors.
Copyright (C) 2014 The go-burnout Authors.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.

View file

@ -3,14 +3,14 @@ FROM golang:1.9-alpine as builder
RUN apk add --no-cache make gcc musl-dev linux-headers
ADD . /go-ethereum
RUN cd /go-ethereum && make geth
ADD . /go-burnout
RUN cd /go-burnout && make geth
# Pull Geth into a second stage deploy alpine container
FROM alpine:latest
RUN apk add --no-cache ca-certificates
COPY --from=builder /go-ethereum/build/bin/geth /usr/local/bin/
COPY --from=builder /go-burnout/build/bin/geth /usr/local/bin/
EXPOSE 8545 8546 30303 30303/udp
ENTRYPOINT ["geth"]

View file

@ -1,19 +1,19 @@
## Go Ethereum
## Go Burnout
Official golang implementation of the Ethereum protocol.
Official golang implementation of the Burnout protocol.
[![API Reference](
https://camo.githubusercontent.com/915b7be44ada53c290eb157634330494ebe3e30a/68747470733a2f2f676f646f632e6f72672f6769746875622e636f6d2f676f6c616e672f6764646f3f7374617475732e737667
)](https://godoc.org/github.com/ethereum/go-ethereum)
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/ethereum/go-ethereum?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
)](https://godoc.org/github.com/burnout/go-burnout)
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/burnout/go-burnout?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
Automated builds are available for stable releases and the unstable master branch.
Binary archives are published at https://geth.ethereum.org/downloads/.
Binary archives are published at https://geth.burnout.org/downloads/.
## Building the source
For prerequisites and detailed build instructions please read the
[Installation Instructions](https://github.com/ethereum/go-ethereum/wiki/Building-Ethereum)
[Installation Instructions](https://github.com/burnout/go-burnout/wiki/Building-Burnout)
on the wiki.
Building geth requires both a Go (version 1.7 or later) and a C compiler.
@ -28,29 +28,29 @@ or, to build the full suite of utilities:
## Executables
The go-ethereum project comes with several wrappers/executables found in the `cmd` directory.
The go-burnout project comes with several wrappers/executables found in the `cmd` directory.
| Command | Description |
|:----------:|-------------|
| **`geth`** | Our main Ethereum CLI client. It is the entry point into the Ethereum network (main-, test- or private net), capable of running as a full node (default) archive node (retaining all historical state) or a light node (retrieving data live). It can be used by other processes as a gateway into the Ethereum network via JSON RPC endpoints exposed on top of HTTP, WebSocket and/or IPC transports. `geth --help` and the [CLI Wiki page](https://github.com/ethereum/go-ethereum/wiki/Command-Line-Options) for command line options. |
| `abigen` | Source code generator to convert Ethereum contract definitions into easy to use, compile-time type-safe Go packages. It operates on plain [Ethereum contract ABIs](https://github.com/ethereum/wiki/wiki/Ethereum-Contract-ABI) with expanded functionality if the contract bytecode is also available. However it also accepts Solidity source files, making development much more streamlined. Please see our [Native DApps](https://github.com/ethereum/go-ethereum/wiki/Native-DApps:-Go-bindings-to-Ethereum-contracts) wiki page for details. |
| `bootnode` | Stripped down version of our Ethereum client implementation that only takes part in the network node discovery protocol, but does not run any of the higher level application protocols. It can be used as a lightweight bootstrap node to aid in finding peers in private networks. |
| `evm` | Developer utility version of the EVM (Ethereum Virtual Machine) that is capable of running bytecode snippets within a configurable environment and execution mode. Its purpose is to allow insolated, fine-grained debugging of EVM opcodes (e.g. `evm --code 60ff60ff --debug`). |
| `gethrpctest` | Developer utility tool to support our [ethereum/rpc-test](https://github.com/ethereum/rpc-tests) test suite which validates baseline conformity to the [Ethereum JSON RPC](https://github.com/ethereum/wiki/wiki/JSON-RPC) specs. Please see the [test suite's readme](https://github.com/ethereum/rpc-tests/blob/master/README.md) for details. |
| `rlpdump` | Developer utility tool to convert binary RLP ([Recursive Length Prefix](https://github.com/ethereum/wiki/wiki/RLP)) dumps (data encoding used by the Ethereum protocol both network as well as consensus wise) to user friendlier hierarchical representation (e.g. `rlpdump --hex CE0183FFFFFFC4C304050583616263`). |
| **`geth`** | Our main Burnout CLI client. It is the entry point into the Burnout network (main-, test- or private net), capable of running as a full node (default) archive node (retaining all historical state) or a light node (retrieving data live). It can be used by other processes as a gateway into the Burnout network via JSON RPC endpoints exposed on top of HTTP, WebSocket and/or IPC transports. `geth --help` and the [CLI Wiki page](https://github.com/burnout/go-burnout/wiki/Command-Line-Options) for command line options. |
| `abigen` | Source code generator to convert Burnout contract definitions into easy to use, compile-time type-safe Go packages. It operates on plain [Burnout contract ABIs](https://github.com/burnout/wiki/wiki/Burnout-Contract-ABI) with expanded functionality if the contract bytecode is also available. However it also accepts Solidity source files, making development much more streamlined. Please see our [Native DApps](https://github.com/burnout/go-burnout/wiki/Native-DApps:-Go-bindings-to-Burnout-contracts) wiki page for details. |
| `bootnode` | Stripped down version of our Burnout client implementation that only takes part in the network node discovery protocol, but does not run any of the higher level application protocols. It can be used as a lightweight bootstrap node to aid in finding peers in private networks. |
| `evm` | Developer utility version of the EVM (Burnout Virtual Machine) that is capable of running bytecode snippets within a configurable environment and execution mode. Its purpose is to allow insolated, fine-grained debugging of EVM opcodes (e.g. `evm --code 60ff60ff --debug`). |
| `gethrpctest` | Developer utility tool to support our [burnout/rpc-test](https://github.com/burnout/rpc-tests) test suite which validates baseline conformity to the [Burnout JSON RPC](https://github.com/burnout/wiki/wiki/JSON-RPC) specs. Please see the [test suite's readme](https://github.com/burnout/rpc-tests/blob/master/README.md) for details. |
| `rlpdump` | Developer utility tool to convert binary RLP ([Recursive Length Prefix](https://github.com/burnout/wiki/wiki/RLP)) dumps (data encoding used by the Burnout protocol both network as well as consensus wise) to user friendlier hierarchical representation (e.g. `rlpdump --hex CE0183FFFFFFC4C304050583616263`). |
| `swarm` | swarm daemon and tools. This is the entrypoint for the swarm network. `swarm --help` for command line options and subcommands. See https://swarm-guide.readthedocs.io for swarm documentation. |
| `puppeth` | a CLI wizard that aids in creating a new Ethereum network. |
| `puppeth` | a CLI wizard that aids in creating a new Burnout network. |
## Running geth
Going through all the possible command line flags is out of scope here (please consult our
[CLI Wiki page](https://github.com/ethereum/go-ethereum/wiki/Command-Line-Options)), but we've
[CLI Wiki page](https://github.com/burnout/go-burnout/wiki/Command-Line-Options)), but we've
enumerated a few common parameter combos to get you up to speed quickly on how you can run your
own Geth instance.
### Full node on the main Ethereum network
### Full node on the main Burnout network
By far the most common scenario is people wanting to simply interact with the Ethereum network:
By far the most common scenario is people wanting to simply interact with the Burnout network:
create accounts; transfer funds; deploy and interact with contracts. For this particular use-case
the user doesn't care about years-old historical data, so we can fast-sync quickly to the current
state of the network. To do so:
@ -62,19 +62,19 @@ $ geth --fast --cache=512 console
This command will:
* Start geth in fast sync mode (`--fast`), causing it to download more data in exchange for avoiding
processing the entire history of the Ethereum network, which is very CPU intensive.
processing the entire history of the Burnout network, which is very CPU intensive.
* Bump the memory allowance of the database to 512MB (`--cache=512`), which can help significantly in
sync times especially for HDD users. This flag is optional and you can set it as high or as low as
you'd like, though we'd recommend the 512MB - 2GB range.
* Start up Geth's built-in interactive [JavaScript console](https://github.com/ethereum/go-ethereum/wiki/JavaScript-Console),
(via the trailing `console` subcommand) through which you can invoke all official [`web3` methods](https://github.com/ethereum/wiki/wiki/JavaScript-API)
as well as Geth's own [management APIs](https://github.com/ethereum/go-ethereum/wiki/Management-APIs).
* Start up Geth's built-in interactive [JavaScript console](https://github.com/burnout/go-burnout/wiki/JavaScript-Console),
(via the trailing `console` subcommand) through which you can invoke all official [`web3` methods](https://github.com/burnout/wiki/wiki/JavaScript-API)
as well as Geth's own [management APIs](https://github.com/burnout/go-burnout/wiki/Management-APIs).
This too is optional and if you leave it out you can always attach to an already running Geth instance
with `geth attach`.
### Full node on the Ethereum test network
### Full node on the Burnout test network
Transitioning towards developers, if you'd like to play around with creating Ethereum contracts, you
Transitioning towards developers, if you'd like to play around with creating Burnout contracts, you
almost certainly would like to do that without any real money involved until you get the hang of the
entire system. In other words, instead of attaching to the main network, you want to join the **test**
network with your node, which is fully equivalent to the main network, but with play-Ether only.
@ -89,12 +89,12 @@ here.
Specifying the `--testnet` flag however will reconfigure your Geth instance a bit:
* Instead of using the default data directory (`~/.ethereum` on Linux for example), Geth will nest
itself one level deeper into a `testnet` subfolder (`~/.ethereum/testnet` on Linux). Note, on OSX
* Instead of using the default data directory (`~/.burnout` on Linux for example), Geth will nest
itself one level deeper into a `testnet` subfolder (`~/.burnout/testnet` on Linux). Note, on OSX
and Linux this also means that attaching to a running testnet node requires the use of a custom
endpoint since `geth attach` will try to attach to a production node endpoint by default. E.g.
`geth attach <datadir>/testnet/geth.ipc`. Windows users are not affected by this.
* Instead of connecting the main Ethereum network, the client will connect to the test network,
* Instead of connecting the main Burnout network, the client will connect to the test network,
which uses different P2P bootnodes, different network IDs and genesis states.
*Note: Although there are some internal protective measures to prevent transactions from crossing
@ -120,22 +120,22 @@ $ geth --your-favourite-flags dumpconfig
#### Docker quick start
One of the quickest ways to get Ethereum up and running on your machine is by using Docker:
One of the quickest ways to get Burnout up and running on your machine is by using Docker:
```
docker run -d --name ethereum-node -v /Users/alice/ethereum:/root \
docker run -d --name burnout-node -v /Users/alice/burnout:/root \
-p 8545:8545 -p 30303:30303 \
ethereum/client-go --fast --cache=512
burnout/client-go --fast --cache=512
```
This will start geth in fast sync mode with a DB memory allowance of 512MB just as the above command does. It will also create a persistent volume in your home directory for saving your blockchain as well as map the default ports. There is also an `alpine` tag available for a slim version of the image.
### Programatically interfacing Geth nodes
As a developer, sooner rather than later you'll want to start interacting with Geth and the Ethereum
As a developer, sooner rather than later you'll want to start interacting with Geth and the Burnout
network via your own programs and not manually through the console. To aid this, Geth has built in
support for a JSON-RPC based APIs ([standard APIs](https://github.com/ethereum/wiki/wiki/JSON-RPC) and
[Geth specific APIs](https://github.com/ethereum/go-ethereum/wiki/Management-APIs)). These can be
support for a JSON-RPC based APIs ([standard APIs](https://github.com/burnout/wiki/wiki/JSON-RPC) and
[Geth specific APIs](https://github.com/burnout/go-burnout/wiki/Management-APIs)). These can be
exposed via HTTP, WebSockets and IPC (unix sockets on unix based platforms, and named pipes on Windows).
The IPC interface is enabled by default and exposes all the APIs supported by Geth, whereas the HTTP
@ -147,15 +147,15 @@ HTTP based JSON-RPC API options:
* `--rpc` Enable the HTTP-RPC server
* `--rpcaddr` HTTP-RPC server listening interface (default: "localhost")
* `--rpcport` HTTP-RPC server listening port (default: 8545)
* `--rpcapi` API's offered over the HTTP-RPC interface (default: "eth,net,web3")
* `--rpcapi` API's offered over the HTTP-RPC interface (default: "brn,net,web3")
* `--rpccorsdomain` Comma separated list of domains from which to accept cross origin requests (browser enforced)
* `--ws` Enable the WS-RPC server
* `--wsaddr` WS-RPC server listening interface (default: "localhost")
* `--wsport` WS-RPC server listening port (default: 8546)
* `--wsapi` API's offered over the WS-RPC interface (default: "eth,net,web3")
* `--wsapi` API's offered over the WS-RPC interface (default: "brn,net,web3")
* `--wsorigins` Origins from which to accept websockets requests
* `--ipcdisable` Disable the IPC-RPC server
* `--ipcapi` API's offered over the IPC-RPC interface (default: "admin,debug,eth,miner,net,personal,shh,txpool,web3")
* `--ipcapi` API's offered over the IPC-RPC interface (default: "admin,debug,brn,miner,net,personal,shh,txpool,web3")
* `--ipcpath` Filename for IPC socket/pipe within the datadir (explicit paths escape it)
You'll need to use your own programming environments' capabilities (libraries, tools, etc) to connect
@ -163,7 +163,7 @@ via HTTP, WS or IPC to a Geth node configured with the above flags and you'll ne
on all transports. You can reuse the same connection for multiple requests!
**Note: Please understand the security implications of opening up an HTTP/WS based transport before
doing so! Hackers on the internet are actively trying to subvert Ethereum nodes with exposed APIs!
doing so! Hackers on the internet are actively trying to subvert Burnout nodes with exposed APIs!
Further, all browser tabs can access locally running webservers, so malicious webpages could try to
subvert locally available APIs!**
@ -227,7 +227,7 @@ $ bootnode --genkey=boot.key
$ bootnode --nodekey=boot.key
```
With the bootnode online, it will display an [`enode` URL](https://github.com/ethereum/wiki/wiki/enode-url-format)
With the bootnode online, it will display an [`enode` URL](https://github.com/burnout/wiki/wiki/enode-url-format)
that other nodes can use to connect to it and exchange peer information. Make sure to replace the
displayed IP address information (most probably `[::]`) with your externally accessible IP to get the
actual `enode` URL.
@ -250,9 +250,9 @@ need to configure a miner to process transactions and create new blocks for you.
#### Running a private miner
Mining on the public Ethereum network is a complex task as it's only feasible using GPUs, requiring
Mining on the public Burnout network is a complex task as it's only feasible using GPUs, requiring
an OpenCL or CUDA enabled `ethminer` instance. For information on such a setup, please consult the
[EtherMining subreddit](https://www.reddit.com/r/EtherMining/) and the [Genoil miner](https://github.com/Genoil/cpp-ethereum)
[EtherMining subreddit](https://www.reddit.com/r/EtherMining/) and the [Genoil miner](https://github.com/Genoil/cpp-burnout)
repository.
In a private network setting however, a single CPU miner instance is more than enough for practical
@ -273,9 +273,9 @@ limit blocks converge to (`--targetgaslimit`) and the price transactions are acc
Thank you for considering to help out with the source code! We welcome contributions from
anyone on the internet, and are grateful for even the smallest of fixes!
If you'd like to contribute to go-ethereum, please fork, fix, commit and send a pull request
If you'd like to contribute to go-burnout, please fork, fix, commit and send a pull request
for the maintainers to review and merge into the main code base. If you wish to submit more
complex changes though, please check up with the core devs first on [our gitter channel](https://gitter.im/ethereum/go-ethereum)
complex changes though, please check up with the core devs first on [our gitter channel](https://gitter.im/burnout/go-burnout)
to ensure those changes are in line with the general philosophy of the project and/or get some
early feedback which can make both your efforts much lighter as well as our review and merge
procedures quick and simple.
@ -286,17 +286,17 @@ Please make sure your contributions adhere to our coding guidelines:
* Code must be documented adhering to the official Go [commentary](https://golang.org/doc/effective_go.html#commentary) guidelines.
* Pull requests need to be based on and opened against the `master` branch.
* Commit messages should be prefixed with the package(s) they modify.
* E.g. "eth, rpc: make trace configs optional"
* E.g. "brn, rpc: make trace configs optional"
Please see the [Developers' Guide](https://github.com/ethereum/go-ethereum/wiki/Developers'-Guide)
Please see the [Developers' Guide](https://github.com/burnout/go-burnout/wiki/Developers'-Guide)
for more details on configuring your environment, managing project dependencies and testing procedures.
## License
The go-ethereum library (i.e. all code outside of the `cmd` directory) is licensed under the
The go-burnout library (i.e. all code outside of the `cmd` directory) is licensed under the
[GNU Lesser General Public License v3.0](https://www.gnu.org/licenses/lgpl-3.0.en.html), also
included in our repository in the `COPYING.LESSER` file.
The go-ethereum binaries (i.e. all code inside of the `cmd` directory) is licensed under the
The go-burnout binaries (i.e. all code inside of the `cmd` directory) is licensed under the
[GNU General Public License v3.0](https://www.gnu.org/licenses/gpl-3.0.en.html), also included
in our repository in the `COPYING` file.

View file

@ -1,18 +1,18 @@
// Copyright 2015 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2015 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
package abi
@ -23,7 +23,7 @@ import (
"reflect"
"strings"
"github.com/ethereum/go-ethereum/common"
"github.com/burnout/go-burnout/common"
)
// The ABI holds information about a contract's context and available

View file

@ -1,18 +1,18 @@
// Copyright 2015 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2015 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
package abi
@ -25,8 +25,8 @@ import (
"strings"
"testing"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
"github.com/burnout/go-burnout/common"
"github.com/burnout/go-burnout/crypto"
)
// formatSilceOutput add padding to the value and adds a size

View file

@ -1,18 +1,18 @@
// Copyright 2015 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2015 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
package abi

View file

@ -1,18 +1,18 @@
// Copyright 2016 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2016 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
package bind
@ -22,10 +22,10 @@ import (
"io"
"io/ioutil"
"github.com/ethereum/go-ethereum/accounts/keystore"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/crypto"
"github.com/burnout/go-burnout/accounts/keystore"
"github.com/burnout/go-burnout/common"
"github.com/burnout/go-burnout/core/types"
"github.com/burnout/go-burnout/crypto"
)
// NewTransactor is a utility method to easily create a transaction signer from

View file

@ -1,18 +1,18 @@
// Copyright 2015 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2015 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
package bind
@ -21,9 +21,9 @@ import (
"errors"
"math/big"
"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
"github.com/burnout/go-burnout"
"github.com/burnout/go-burnout/common"
"github.com/burnout/go-burnout/core/types"
)
var (
@ -47,9 +47,9 @@ type ContractCaller interface {
// CodeAt returns the code of the given account. This is needed to differentiate
// between contract internal errors and the local chain being out of sync.
CodeAt(ctx context.Context, contract common.Address, blockNumber *big.Int) ([]byte, error)
// ContractCall executes an Ethereum contract call with the specified data as the
// ContractCall executes an Burnout contract call with the specified data as the
// input.
CallContract(ctx context.Context, call ethereum.CallMsg, blockNumber *big.Int) ([]byte, error)
CallContract(ctx context.Context, call burnout.CallMsg, blockNumber *big.Int) ([]byte, error)
}
// DeployBackend wraps the operations needed by WaitMined and WaitDeployed.
@ -64,8 +64,8 @@ type DeployBackend interface {
type PendingContractCaller interface {
// PendingCodeAt returns the code of the given account in the pending state.
PendingCodeAt(ctx context.Context, contract common.Address) ([]byte, error)
// PendingCallContract executes an Ethereum contract call against the pending state.
PendingCallContract(ctx context.Context, call ethereum.CallMsg) ([]byte, error)
// PendingCallContract executes an Burnout contract call against the pending state.
PendingCallContract(ctx context.Context, call burnout.CallMsg) ([]byte, error)
}
// ContractTransactor defines the methods needed to allow operating with contract
@ -85,7 +85,7 @@ type ContractTransactor interface {
// There is no guarantee that this is the true gas limit requirement as other
// transactions may be added or removed by miners, but it should provide a basis
// for setting a reasonable default.
EstimateGas(ctx context.Context, call ethereum.CallMsg) (usedGas *big.Int, err error)
EstimateGas(ctx context.Context, call burnout.CallMsg) (usedGas *big.Int, err error)
// SendTransaction injects the transaction into the pending pool for execution.
SendTransaction(ctx context.Context, tx *types.Transaction) error
}

View file

@ -1,18 +1,18 @@
// Copyright 2015 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2015 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
package backends
@ -24,17 +24,17 @@ import (
"sync"
"time"
"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/math"
"github.com/ethereum/go-ethereum/consensus/ethash"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/state"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/core/vm"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/params"
"github.com/burnout/go-burnout"
"github.com/burnout/go-burnout/accounts/abi/bind"
"github.com/burnout/go-burnout/common"
"github.com/burnout/go-burnout/common/math"
"github.com/burnout/go-burnout/consensus/ethash"
"github.com/burnout/go-burnout/core"
"github.com/burnout/go-burnout/core/state"
"github.com/burnout/go-burnout/core/types"
"github.com/burnout/go-burnout/core/vm"
"github.com/burnout/go-burnout/brndb"
"github.com/burnout/go-burnout/params"
)
// This nil assignment ensures compile time that SimulatedBackend implements bind.ContractBackend.
@ -45,8 +45,8 @@ var errBlockNumberUnsupported = errors.New("SimulatedBackend cannot access block
// SimulatedBackend implements bind.ContractBackend, simulating a blockchain in
// the background. Its main purpose is to allow easily testing contract bindings.
type SimulatedBackend struct {
database ethdb.Database // In memory database to store our testing data
blockchain *core.BlockChain // Ethereum blockchain to handle the consensus
database brndb.Database // In memory database to store our testing data
blockchain *core.BlockChain // Burnout blockchain to handle the consensus
mu sync.Mutex
pendingBlock *types.Block // Currently pending block that will be imported on request
@ -58,7 +58,7 @@ type SimulatedBackend struct {
// NewSimulatedBackend creates a new binding backend using a simulated blockchain
// for testing purposes.
func NewSimulatedBackend(alloc core.GenesisAlloc) *SimulatedBackend {
database, _ := ethdb.NewMemDatabase()
database, _ := brndb.NewMemDatabase()
genesis := core.Genesis{Config: params.AllProtocolChanges, Alloc: alloc}
genesis.MustCommit(database)
blockchain, _ := core.NewBlockChain(database, genesis.Config, ethash.NewFaker(), vm.Config{})
@ -157,7 +157,7 @@ func (b *SimulatedBackend) PendingCodeAt(ctx context.Context, contract common.Ad
}
// CallContract executes a contract call.
func (b *SimulatedBackend) CallContract(ctx context.Context, call ethereum.CallMsg, blockNumber *big.Int) ([]byte, error) {
func (b *SimulatedBackend) CallContract(ctx context.Context, call burnout.CallMsg, blockNumber *big.Int) ([]byte, error) {
b.mu.Lock()
defer b.mu.Unlock()
@ -173,7 +173,7 @@ func (b *SimulatedBackend) CallContract(ctx context.Context, call ethereum.CallM
}
// PendingCallContract executes a contract call on the pending state.
func (b *SimulatedBackend) PendingCallContract(ctx context.Context, call ethereum.CallMsg) ([]byte, error) {
func (b *SimulatedBackend) PendingCallContract(ctx context.Context, call burnout.CallMsg) ([]byte, error) {
b.mu.Lock()
defer b.mu.Unlock()
defer b.pendingState.RevertToSnapshot(b.pendingState.Snapshot())
@ -199,7 +199,7 @@ func (b *SimulatedBackend) SuggestGasPrice(ctx context.Context) (*big.Int, error
// EstimateGas executes the requested code against the currently pending block/state and
// returns the used amount of gas.
func (b *SimulatedBackend) EstimateGas(ctx context.Context, call ethereum.CallMsg) (*big.Int, error) {
func (b *SimulatedBackend) EstimateGas(ctx context.Context, call burnout.CallMsg) (*big.Int, error) {
b.mu.Lock()
defer b.mu.Unlock()
@ -235,7 +235,7 @@ func (b *SimulatedBackend) EstimateGas(ctx context.Context, call ethereum.CallMs
// callContract implemens common code between normal and pending contract calls.
// state is modified during execution, make sure to copy it if necessary.
func (b *SimulatedBackend) callContract(ctx context.Context, call ethereum.CallMsg, block *types.Block, statedb *state.StateDB) ([]byte, *big.Int, bool, error) {
func (b *SimulatedBackend) callContract(ctx context.Context, call burnout.CallMsg, block *types.Block, statedb *state.StateDB) ([]byte, *big.Int, bool, error) {
// Ensure message is initialized properly.
if call.GasPrice == nil {
call.GasPrice = big.NewInt(1)
@ -305,7 +305,7 @@ func (b *SimulatedBackend) AdjustTime(adjustment time.Duration) error {
// callmsg implements core.Message to allow passing it as a transaction simulator.
type callmsg struct {
ethereum.CallMsg
burnout.CallMsg
}
func (m callmsg) From() common.Address { return m.CallMsg.From }

View file

@ -1,18 +1,18 @@
// Copyright 2015 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2015 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
package bind
@ -22,11 +22,11 @@ import (
"fmt"
"math/big"
"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/accounts/abi"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/crypto"
"github.com/burnout/go-burnout"
"github.com/burnout/go-burnout/accounts/abi"
"github.com/burnout/go-burnout/common"
"github.com/burnout/go-burnout/core/types"
"github.com/burnout/go-burnout/crypto"
)
// SignerFn is a signer function callback when a contract requires a method to
@ -42,9 +42,9 @@ type CallOpts struct {
}
// TransactOpts is the collection of authorization data required to create a
// valid Ethereum transaction.
// valid Burnout transaction.
type TransactOpts struct {
From common.Address // Ethereum account to send the transaction from
From common.Address // Burnout account to send the transaction from
Nonce *big.Int // Nonce to use for the transaction execution (nil = use pending state)
Signer SignerFn // Method to use for signing the transaction (mandatory)
@ -56,11 +56,11 @@ type TransactOpts struct {
}
// BoundContract is the base wrapper object that reflects a contract on the
// Ethereum network. It contains a collection of methods that are used by the
// Burnout network. It contains a collection of methods that are used by the
// higher level contract bindings to operate.
type BoundContract struct {
address common.Address // Deployment address of the contract on the Ethereum blockchain
abi abi.ABI // Reflect based ABI to access the correct Ethereum methods
address common.Address // Deployment address of the contract on the Burnout blockchain
abi abi.ABI // Reflect based ABI to access the correct Burnout methods
caller ContractCaller // Read interface to interact with the blockchain
transactor ContractTransactor // Write interface to interact with the blockchain
}
@ -76,7 +76,7 @@ func NewBoundContract(address common.Address, abi abi.ABI, caller ContractCaller
}
}
// DeployContract deploys a contract onto the Ethereum blockchain and binds the
// DeployContract deploys a contract onto the Burnout blockchain and binds the
// deployment address with a Go wrapper.
func DeployContract(opts *TransactOpts, abi abi.ABI, bytecode []byte, backend ContractBackend, params ...interface{}) (common.Address, *types.Transaction, *BoundContract, error) {
// Otherwise try to deploy the contract
@ -109,7 +109,7 @@ func (c *BoundContract) Call(opts *CallOpts, result interface{}, method string,
return err
}
var (
msg = ethereum.CallMsg{From: opts.From, To: &c.address, Data: input}
msg = burnout.CallMsg{From: opts.From, To: &c.address, Data: input}
ctx = ensureContext(opts.Context)
code []byte
output []byte
@ -199,7 +199,7 @@ func (c *BoundContract) transact(opts *TransactOpts, contract *common.Address, i
}
}
// If the contract surely has code (or code is not needed), estimate the transaction
msg := ethereum.CallMsg{From: opts.From, To: contract, Value: value, Data: input}
msg := burnout.CallMsg{From: opts.From, To: contract, Value: value, Data: input}
gasLimit, err = c.transactor.EstimateGas(ensureContext(opts.Context), msg)
if err != nil {
return nil, fmt.Errorf("failed to estimate gas needed: %v", err)

View file

@ -1,23 +1,23 @@
// Copyright 2016 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2016 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
// Package bind generates Ethereum contract Go bindings.
// Package bind generates Burnout contract Go bindings.
//
// Detailed usage document and tutorial available on the go-ethereum Wiki page:
// https://github.com/ethereum/go-ethereum/wiki/Native-DApps:-Go-bindings-to-Ethereum-contracts
// Detailed usage document and tutorial available on the go-burnout Wiki page:
// https://github.com/burnout/go-burnout/wiki/Native-DApps:-Go-bindings-to-Burnout-contracts
package bind
import (
@ -28,7 +28,7 @@ import (
"text/template"
"unicode"
"github.com/ethereum/go-ethereum/accounts/abi"
"github.com/burnout/go-burnout/accounts/abi"
"golang.org/x/tools/imports"
)

File diff suppressed because one or more lines are too long

View file

@ -1,22 +1,22 @@
// Copyright 2016 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2016 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
package bind
import "github.com/ethereum/go-ethereum/accounts/abi"
import "github.com/burnout/go-burnout/accounts/abi"
// tmplData is the data structure required to fill the binding template.
type tmplData struct {
@ -65,7 +65,7 @@ package {{.Package}}
// {{.Type}}Bin is the compiled bytecode used for deploying new contracts.
const {{.Type}}Bin = ` + "`" + `{{.InputBin}}` + "`" + `
// Deploy{{.Type}} deploys a new Ethereum contract, binding an instance of {{.Type}} to it.
// Deploy{{.Type}} deploys a new Burnout contract, binding an instance of {{.Type}} to it.
func Deploy{{.Type}}(auth *bind.TransactOpts, backend bind.ContractBackend {{range .Constructor.Inputs}}, {{.Name}} {{bindtype .Type}}{{end}}) (common.Address, *types.Transaction, *{{.Type}}, error) {
parsed, err := abi.JSON(strings.NewReader({{.Type}}ABI))
if err != nil {
@ -79,23 +79,23 @@ package {{.Package}}
}
{{end}}
// {{.Type}} is an auto generated Go binding around an Ethereum contract.
// {{.Type}} is an auto generated Go binding around an Burnout contract.
type {{.Type}} struct {
{{.Type}}Caller // Read-only binding to the contract
{{.Type}}Transactor // Write-only binding to the contract
}
// {{.Type}}Caller is an auto generated read-only Go binding around an Ethereum contract.
// {{.Type}}Caller is an auto generated read-only Go binding around an Burnout contract.
type {{.Type}}Caller struct {
contract *bind.BoundContract // Generic contract wrapper for the low level calls
}
// {{.Type}}Transactor is an auto generated write-only Go binding around an Ethereum contract.
// {{.Type}}Transactor is an auto generated write-only Go binding around an Burnout contract.
type {{.Type}}Transactor struct {
contract *bind.BoundContract // Generic contract wrapper for the low level calls
}
// {{.Type}}Session is an auto generated Go binding around an Ethereum contract,
// {{.Type}}Session is an auto generated Go binding around an Burnout contract,
// with pre-set call and transact options.
type {{.Type}}Session struct {
Contract *{{.Type}} // Generic contract binding to set the session for
@ -103,31 +103,31 @@ package {{.Package}}
TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session
}
// {{.Type}}CallerSession is an auto generated read-only Go binding around an Ethereum contract,
// {{.Type}}CallerSession is an auto generated read-only Go binding around an Burnout contract,
// with pre-set call options.
type {{.Type}}CallerSession struct {
Contract *{{.Type}}Caller // Generic contract caller binding to set the session for
CallOpts bind.CallOpts // Call options to use throughout this session
}
// {{.Type}}TransactorSession is an auto generated write-only Go binding around an Ethereum contract,
// {{.Type}}TransactorSession is an auto generated write-only Go binding around an Burnout contract,
// with pre-set transact options.
type {{.Type}}TransactorSession struct {
Contract *{{.Type}}Transactor // Generic contract transactor binding to set the session for
TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session
}
// {{.Type}}Raw is an auto generated low-level Go binding around an Ethereum contract.
// {{.Type}}Raw is an auto generated low-level Go binding around an Burnout contract.
type {{.Type}}Raw struct {
Contract *{{.Type}} // Generic contract binding to access the raw methods on
}
// {{.Type}}CallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract.
// {{.Type}}CallerRaw is an auto generated low-level read-only Go binding around an Burnout contract.
type {{.Type}}CallerRaw struct {
Contract *{{.Type}}Caller // Generic read-only contract binding to access the raw methods on
}
// {{.Type}}TransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract.
// {{.Type}}TransactorRaw is an auto generated low-level write-only Go binding around an Burnout contract.
type {{.Type}}TransactorRaw struct {
Contract *{{.Type}}Transactor // Generic write-only contract binding to access the raw methods on
}
@ -274,8 +274,8 @@ const tmplSourceJava = `
package {{.Package}};
import org.ethereum.geth.*;
import org.ethereum.geth.internal.*;
import org.burnout.geth.*;
import org.burnout.geth.internal.*;
{{range $contract := .Contracts}}
public class {{.Type}} {
@ -286,8 +286,8 @@ import org.ethereum.geth.internal.*;
// BYTECODE is the compiled bytecode used for deploying new contracts.
public final static byte[] BYTECODE = "{{.InputBin}}".getBytes();
// deploy deploys a new Ethereum contract, binding an instance of {{.Type}} to it.
public static {{.Type}} deploy(TransactOpts auth, EthereumClient client{{range .Constructor.Inputs}}, {{bindtype .Type}} {{.Name}}{{end}}) throws Exception {
// deploy deploys a new Burnout contract, binding an instance of {{.Type}} to it.
public static {{.Type}} deploy(TransactOpts auth, BurnoutClient client{{range .Constructor.Inputs}}, {{bindtype .Type}} {{.Name}}{{end}}) throws Exception {
Interfaces args = Geth.newInterfaces({{(len .Constructor.Inputs)}});
{{range $index, $element := .Constructor.Inputs}}
args.set({{$index}}, Geth.newInterface()); args.get({{$index}}).set{{namedtype (bindtype .Type) .Type}}({{.Name}});
@ -303,17 +303,17 @@ import org.ethereum.geth.internal.*;
}
{{end}}
// Ethereum address where this contract is located at.
// Burnout address where this contract is located at.
public final Address Address;
// Ethereum transaction in which this contract was deployed (if known!).
// Burnout transaction in which this contract was deployed (if known!).
public final Transaction Deployer;
// Contract instance bound to a blockchain address.
private final BoundContract Contract;
// Creates a new instance of {{.Type}}, bound to a specific deployed contract.
public {{.Type}}(Address address, EthereumClient client) throws Exception {
public {{.Type}}(Address address, BurnoutClient client) throws Exception {
this(Geth.bindContract(address, ABI, client));
}

View file

@ -1,18 +1,18 @@
// Copyright 2016 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2016 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
package bind
@ -21,9 +21,9 @@ import (
"fmt"
"time"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/log"
"github.com/burnout/go-burnout/common"
"github.com/burnout/go-burnout/core/types"
"github.com/burnout/go-burnout/log"
)
// WaitMined waits for tx to be mined on the blockchain.

View file

@ -1,18 +1,18 @@
// Copyright 2016 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2016 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
package bind_test
@ -22,12 +22,12 @@ import (
"testing"
"time"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/accounts/abi/bind/backends"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/crypto"
"github.com/burnout/go-burnout/accounts/abi/bind"
"github.com/burnout/go-burnout/accounts/abi/bind/backends"
"github.com/burnout/go-burnout/common"
"github.com/burnout/go-burnout/core"
"github.com/burnout/go-burnout/core/types"
"github.com/burnout/go-burnout/crypto"
)
var testKey, _ = crypto.HexToECDSA("b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291")

View file

@ -1,23 +1,23 @@
// Copyright 2015 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2015 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
// Package abi implements the Ethereum ABI (Application Binary
// Package abi implements the Burnout ABI (Application Binary
// Interface).
//
// The Ethereum ABI is strongly typed, known at compile time
// The Burnout ABI is strongly typed, known at compile time
// and static. This ABI will handle basic type casting; unsigned
// to signed and visa versa. It does not handle slice casting such
// as unsigned slice to signed slice. Bit size type casting is also

View file

@ -1,18 +1,18 @@
// Copyright 2016 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2016 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
package abi

View file

@ -1,18 +1,18 @@
// Copyright 2016 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2016 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
package abi
@ -20,8 +20,8 @@ import (
"fmt"
"strings"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
"github.com/burnout/go-burnout/common"
"github.com/burnout/go-burnout/crypto"
)
// Event is an event potentially triggered by the EVM's LOG mechanism. The Event

View file

@ -1,18 +1,18 @@
// Copyright 2016 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2016 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
package abi
@ -20,8 +20,8 @@ import (
"strings"
"testing"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
"github.com/burnout/go-burnout/common"
"github.com/burnout/go-burnout/crypto"
)
func TestEventId(t *testing.T) {

View file

@ -1,18 +1,18 @@
// Copyright 2015 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2015 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
package abi
@ -21,7 +21,7 @@ import (
"reflect"
"strings"
"github.com/ethereum/go-ethereum/crypto"
"github.com/burnout/go-burnout/crypto"
)
// Callable method given a `Name` and whether the method is a constant.

View file

@ -1,18 +1,18 @@
// Copyright 2015 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2015 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
package abi
@ -20,8 +20,8 @@ import (
"math/big"
"reflect"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/math"
"github.com/burnout/go-burnout/common"
"github.com/burnout/go-burnout/common/math"
)
var (

View file

@ -1,18 +1,18 @@
// Copyright 2015 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2015 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
package abi

View file

@ -1,18 +1,18 @@
// Copyright 2016 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2016 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
package abi
@ -20,8 +20,8 @@ import (
"math/big"
"reflect"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/math"
"github.com/burnout/go-burnout/common"
"github.com/burnout/go-burnout/common/math"
)
// packBytesSlice packs the given bytes as [L, V] as the canonical representation

View file

@ -1,18 +1,18 @@
// Copyright 2015 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2015 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
package abi
@ -24,7 +24,7 @@ import (
"strings"
"testing"
"github.com/ethereum/go-ethereum/common"
"github.com/burnout/go-burnout/common"
)
func TestPack(t *testing.T) {

View file

@ -1,18 +1,18 @@
// Copyright 2016 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2016 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
package abi

View file

@ -1,18 +1,18 @@
// Copyright 2015 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2015 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
package abi

View file

@ -1,18 +1,18 @@
// Copyright 2016 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2016 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
package abi
@ -21,7 +21,7 @@ import (
"reflect"
"testing"
"github.com/ethereum/go-ethereum/common"
"github.com/burnout/go-burnout/common"
)
// typeWithoutStringer is a alias for the Type type which simply doesn't implement

View file

@ -1,18 +1,18 @@
// Copyright 2015 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2015 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
package abi
@ -22,7 +22,7 @@ import (
"math/big"
"reflect"
"github.com/ethereum/go-ethereum/common"
"github.com/burnout/go-burnout/common"
)
// toGoSliceType parses the input and casts it to the proper slice defined by the ABI

View file

@ -1,18 +1,18 @@
// Copyright 2015 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2015 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
package abi
@ -24,7 +24,7 @@ import (
"strings"
"testing"
"github.com/ethereum/go-ethereum/common"
"github.com/burnout/go-burnout/common"
)
func TestSimpleMethodUnpack(t *testing.T) {

View file

@ -1,35 +1,35 @@
// Copyright 2017 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2017 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
// Package accounts implements high level Ethereum account management.
// Package accounts implements high level Burnout account management.
package accounts
import (
"math/big"
ethereum "github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/event"
burnout "github.com/burnout/go-burnout"
"github.com/burnout/go-burnout/common"
"github.com/burnout/go-burnout/core/types"
"github.com/burnout/go-burnout/event"
)
// Account represents an Ethereum account located at a specific location defined
// Account represents an Burnout account located at a specific location defined
// by the optional URL field.
type Account struct {
Address common.Address `json:"address"` // Ethereum account address derived from the key
Address common.Address `json:"address"` // Burnout account address derived from the key
URL URL `json:"url"` // Optional resource locator within a backend
}
@ -85,7 +85,7 @@ type Wallet interface {
//
// You can disable automatic account discovery by calling SelfDerive with a nil
// chain state reader.
SelfDerive(base DerivationPath, chain ethereum.ChainStateReader)
SelfDerive(base DerivationPath, chain burnout.ChainStateReader)
// SignHash requests the wallet to sign the given hash.
//

View file

@ -1,18 +1,18 @@
// Copyright 2017 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2017 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
package accounts

View file

@ -1,18 +1,18 @@
// Copyright 2017 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2017 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
package accounts
@ -50,10 +50,10 @@ var DefaultLedgerBaseDerivationPath = DerivationPath{0x80000000 + 44, 0x80000000
// The BIP-44 spec https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki
// defines that the `purpose` be 44' (or 0x8000002C) for crypto currencies, and
// SLIP-44 https://github.com/satoshilabs/slips/blob/master/slip-0044.md assigns
// the `coin_type` 60' (or 0x8000003C) to Ethereum.
// the `coin_type` 60' (or 0x8000003C) to Burnout.
//
// The root path for Ethereum is m/44'/60'/0'/0 according to the specification
// from https://github.com/ethereum/EIPs/issues/84, albeit it's not set in stone
// The root path for Burnout is m/44'/60'/0'/0 according to the specification
// from https://github.com/burnout/EIPs/issues/84, albeit it's not set in stone
// yet whether accounts should increment the last component or the children of
// that. We will go with the simpler approach of incrementing the last component.
type DerivationPath []uint32

View file

@ -1,18 +1,18 @@
// Copyright 2017 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2017 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
package accounts

View file

@ -1,18 +1,18 @@
// Copyright 2017 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2017 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
package keystore
@ -28,9 +28,9 @@ import (
"sync"
"time"
"github.com/ethereum/go-ethereum/accounts"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/log"
"github.com/burnout/go-burnout/accounts"
"github.com/burnout/go-burnout/common"
"github.com/burnout/go-burnout/log"
)
// Minimum amount of time between cache reloads. This limit applies if the platform does

View file

@ -1,18 +1,18 @@
// Copyright 2017 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2017 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
package keystore
@ -28,8 +28,8 @@ import (
"github.com/cespare/cp"
"github.com/davecgh/go-spew/spew"
"github.com/ethereum/go-ethereum/accounts"
"github.com/ethereum/go-ethereum/common"
"github.com/burnout/go-burnout/accounts"
"github.com/burnout/go-burnout/common"
)
var (
@ -95,7 +95,7 @@ func TestWatchNoDir(t *testing.T) {
// Create ks but not the directory that it watches.
rand.Seed(time.Now().UnixNano())
dir := filepath.Join(os.TempDir(), fmt.Sprintf("eth-keystore-watch-test-%d-%d", os.Getpid(), rand.Int()))
dir := filepath.Join(os.TempDir(), fmt.Sprintf("brn-keystore-watch-test-%d-%d", os.Getpid(), rand.Int()))
ks := NewKeyStore(dir, LightScryptN, LightScryptP)
list := ks.Accounts()

View file

@ -1,18 +1,18 @@
// Copyright 2014 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2014 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
package keystore
@ -29,9 +29,9 @@ import (
"strings"
"time"
"github.com/ethereum/go-ethereum/accounts"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
"github.com/burnout/go-burnout/accounts"
"github.com/burnout/go-burnout/common"
"github.com/burnout/go-burnout/crypto"
"github.com/pborman/uuid"
)

View file

@ -1,23 +1,23 @@
// Copyright 2017 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2017 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
// Package keystore implements encrypted storage of secp256k1 private keys.
//
// Keys are stored as encrypted JSON files according to the Web3 Secret Storage specification.
// See https://github.com/ethereum/wiki/wiki/Web3-Secret-Storage-Definition for more information.
// See https://github.com/burnout/wiki/wiki/Web3-Secret-Storage-Definition for more information.
package keystore
import (
@ -33,11 +33,11 @@ import (
"sync"
"time"
"github.com/ethereum/go-ethereum/accounts"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/event"
"github.com/burnout/go-burnout/accounts"
"github.com/burnout/go-burnout/common"
"github.com/burnout/go-burnout/core/types"
"github.com/burnout/go-burnout/crypto"
"github.com/burnout/go-burnout/event"
)
var (
@ -472,7 +472,7 @@ func (ks *KeyStore) Update(a accounts.Account, passphrase, newPassphrase string)
return ks.storage.StoreKey(a.URL.Path, key, newPassphrase)
}
// ImportPreSaleKey decrypts the given Ethereum presale wallet and stores
// ImportPreSaleKey decrypts the given Burnout presale wallet and stores
// a key file in the key directory. The key file is encrypted with the same passphrase.
func (ks *KeyStore) ImportPreSaleKey(keyJSON []byte, passphrase string) (accounts.Account, error) {
a, _, err := importPreSaleKey(ks.storage, keyJSON, passphrase)

View file

@ -1,25 +1,25 @@
// Copyright 2014 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2014 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
/*
This key store behaves as KeyStorePlain with the difference that
the private key is encrypted and on disk uses another JSON encoding.
The crypto is documented at https://github.com/ethereum/wiki/wiki/Web3-Secret-Storage-Definition
The crypto is documented at https://github.com/burnout/wiki/wiki/Web3-Secret-Storage-Definition
*/
@ -35,10 +35,10 @@ import (
"io/ioutil"
"path/filepath"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/math"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/crypto/randentropy"
"github.com/burnout/go-burnout/common"
"github.com/burnout/go-burnout/common/math"
"github.com/burnout/go-burnout/crypto"
"github.com/burnout/go-burnout/crypto/randentropy"
"github.com/pborman/uuid"
"golang.org/x/crypto/pbkdf2"
"golang.org/x/crypto/scrypt"

View file

@ -1,18 +1,18 @@
// Copyright 2016 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2016 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
package keystore
@ -20,7 +20,7 @@ import (
"io/ioutil"
"testing"
"github.com/ethereum/go-ethereum/common"
"github.com/burnout/go-burnout/common"
)
const (

View file

@ -1,18 +1,18 @@
// Copyright 2015 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2015 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
package keystore
@ -22,7 +22,7 @@ import (
"os"
"path/filepath"
"github.com/ethereum/go-ethereum/common"
"github.com/burnout/go-burnout/common"
)
type keyStorePlain struct {

View file

@ -1,18 +1,18 @@
// Copyright 2014 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2014 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
package keystore
@ -27,8 +27,8 @@ import (
"strings"
"testing"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
"github.com/burnout/go-burnout/common"
"github.com/burnout/go-burnout/crypto"
)
func tmpKeyStoreIface(t *testing.T, encrypted bool) (dir string, ks keyStore) {
@ -121,7 +121,7 @@ func TestImportPreSaleKey(t *testing.T) {
}
}
// Test and utils for the key store tests in the Ethereum JSON tests;
// Test and utils for the key store tests in the Burnout JSON tests;
// testdataKeyStoreTests/basic_tests.json
type KeyStoreTestV3 struct {
Json encryptedKeyJSONV3

View file

@ -1,18 +1,18 @@
// Copyright 2017 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2017 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
package keystore
@ -26,9 +26,9 @@ import (
"testing"
"time"
"github.com/ethereum/go-ethereum/accounts"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/event"
"github.com/burnout/go-burnout/accounts"
"github.com/burnout/go-burnout/common"
"github.com/burnout/go-burnout/event"
)
var testSigData = make([]byte, 32)
@ -353,7 +353,7 @@ func TestWalletNotifications(t *testing.T) {
}
func tmpKeyStore(t *testing.T, encrypted bool) (string, *KeyStore) {
d, err := ioutil.TempDir("", "eth-keystore-test")
d, err := ioutil.TempDir("", "brn-keystore-test")
if err != nil {
t.Fatal(err)
}

View file

@ -1,27 +1,27 @@
// Copyright 2017 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2017 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
package keystore
import (
"math/big"
ethereum "github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/accounts"
"github.com/ethereum/go-ethereum/core/types"
burnout "github.com/burnout/go-burnout"
"github.com/burnout/go-burnout/accounts"
"github.com/burnout/go-burnout/core/types"
)
// keystoreWallet implements the accounts.Wallet interface for the original
@ -76,7 +76,7 @@ func (w *keystoreWallet) Derive(path accounts.DerivationPath, pin bool) (account
// SelfDerive implements accounts.Wallet, but is a noop for plain wallets since
// there is no notion of hierarchical account derivation for plain keystore accounts.
func (w *keystoreWallet) SelfDerive(base accounts.DerivationPath, chain ethereum.ChainStateReader) {}
func (w *keystoreWallet) SelfDerive(base accounts.DerivationPath, chain burnout.ChainStateReader) {}
// SignHash implements accounts.Wallet, attempting to sign the given hash with
// the given account. If the wallet does not wrap this particular account, an

View file

@ -1,18 +1,18 @@
// Copyright 2016 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2016 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
package keystore
@ -25,8 +25,8 @@ import (
"errors"
"fmt"
"github.com/ethereum/go-ethereum/accounts"
"github.com/ethereum/go-ethereum/crypto"
"github.com/burnout/go-burnout/accounts"
"github.com/burnout/go-burnout/crypto"
"github.com/pborman/uuid"
"golang.org/x/crypto/pbkdf2"
)
@ -61,7 +61,7 @@ func decryptPreSaleKey(fileContent []byte, password string) (key *Key, err error
iv := encSeedBytes[:16]
cipherText := encSeedBytes[16:]
/*
See https://github.com/ethereum/pyethsaletool
See https://github.com/burnout/pyethsaletool
pyethsaletool generates the encryption key from password by
2000 rounds of PBKDF2 with HMAC-SHA-256 using password as salt (:().

View file

@ -1,18 +1,18 @@
// Copyright 2016 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2016 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
// +build darwin,!ios freebsd linux,!arm64 netbsd solaris
@ -21,7 +21,7 @@ package keystore
import (
"time"
"github.com/ethereum/go-ethereum/log"
"github.com/burnout/go-burnout/log"
"github.com/rjeczalik/notify"
)

View file

@ -1,18 +1,18 @@
// Copyright 2016 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2016 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
// +build ios linux,arm64 windows !darwin,!freebsd,!linux,!netbsd,!solaris

View file

@ -1,18 +1,18 @@
// Copyright 2017 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2017 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
package accounts
@ -21,7 +21,7 @@ import (
"sort"
"sync"
"github.com/ethereum/go-ethereum/event"
"github.com/burnout/go-burnout/event"
)
// Manager is an overarching account manager that can communicate with various

View file

@ -1,18 +1,18 @@
// Copyright 2017 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2017 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
package accounts
@ -33,7 +33,7 @@ import (
// references to the original version, whereas the latter is important to ensure
// one single canonical form opposed to many allowed ones by the RFC 3986 spec.
//
// As such, these URLs should not be used outside of the scope of an Ethereum
// As such, these URLs should not be used outside of the scope of an Burnout
// wallet or account.
type URL struct {
Scheme string // Protocol scheme to identify a capable account backend

View file

@ -1,18 +1,18 @@
// Copyright 2017 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2017 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
package usbwallet
@ -22,9 +22,9 @@ import (
"sync"
"time"
"github.com/ethereum/go-ethereum/accounts"
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/log"
"github.com/burnout/go-burnout/accounts"
"github.com/burnout/go-burnout/event"
"github.com/burnout/go-burnout/log"
"github.com/karalabe/hid"
)

View file

@ -70,17 +70,17 @@ const (
MessageType_MessageType_SignIdentity MessageType = 53
MessageType_MessageType_SignedIdentity MessageType = 54
MessageType_MessageType_GetFeatures MessageType = 55
MessageType_MessageType_EthereumGetAddress MessageType = 56
MessageType_MessageType_EthereumAddress MessageType = 57
MessageType_MessageType_EthereumSignTx MessageType = 58
MessageType_MessageType_EthereumTxRequest MessageType = 59
MessageType_MessageType_EthereumTxAck MessageType = 60
MessageType_MessageType_BurnoutGetAddress MessageType = 56
MessageType_MessageType_BurnoutAddress MessageType = 57
MessageType_MessageType_BurnoutSignTx MessageType = 58
MessageType_MessageType_BurnoutTxRequest MessageType = 59
MessageType_MessageType_BurnoutTxAck MessageType = 60
MessageType_MessageType_GetECDHSessionKey MessageType = 61
MessageType_MessageType_ECDHSessionKey MessageType = 62
MessageType_MessageType_SetU2FCounter MessageType = 63
MessageType_MessageType_EthereumSignMessage MessageType = 64
MessageType_MessageType_EthereumVerifyMessage MessageType = 65
MessageType_MessageType_EthereumMessageSignature MessageType = 66
MessageType_MessageType_BurnoutSignMessage MessageType = 64
MessageType_MessageType_BurnoutVerifyMessage MessageType = 65
MessageType_MessageType_BurnoutMessageSignature MessageType = 66
MessageType_MessageType_DebugLinkDecision MessageType = 100
MessageType_MessageType_DebugLinkGetState MessageType = 101
MessageType_MessageType_DebugLinkState MessageType = 102
@ -146,17 +146,17 @@ var MessageType_name = map[int32]string{
53: "MessageType_SignIdentity",
54: "MessageType_SignedIdentity",
55: "MessageType_GetFeatures",
56: "MessageType_EthereumGetAddress",
57: "MessageType_EthereumAddress",
58: "MessageType_EthereumSignTx",
59: "MessageType_EthereumTxRequest",
60: "MessageType_EthereumTxAck",
56: "MessageType_BurnoutGetAddress",
57: "MessageType_BurnoutAddress",
58: "MessageType_BurnoutSignTx",
59: "MessageType_BurnoutTxRequest",
60: "MessageType_BurnoutTxAck",
61: "MessageType_GetECDHSessionKey",
62: "MessageType_ECDHSessionKey",
63: "MessageType_SetU2FCounter",
64: "MessageType_EthereumSignMessage",
65: "MessageType_EthereumVerifyMessage",
66: "MessageType_EthereumMessageSignature",
64: "MessageType_BurnoutSignMessage",
65: "MessageType_BurnoutVerifyMessage",
66: "MessageType_BurnoutMessageSignature",
100: "MessageType_DebugLinkDecision",
101: "MessageType_DebugLinkGetState",
102: "MessageType_DebugLinkState",
@ -221,17 +221,17 @@ var MessageType_value = map[string]int32{
"MessageType_SignIdentity": 53,
"MessageType_SignedIdentity": 54,
"MessageType_GetFeatures": 55,
"MessageType_EthereumGetAddress": 56,
"MessageType_EthereumAddress": 57,
"MessageType_EthereumSignTx": 58,
"MessageType_EthereumTxRequest": 59,
"MessageType_EthereumTxAck": 60,
"MessageType_BurnoutGetAddress": 56,
"MessageType_BurnoutAddress": 57,
"MessageType_BurnoutSignTx": 58,
"MessageType_BurnoutTxRequest": 59,
"MessageType_BurnoutTxAck": 60,
"MessageType_GetECDHSessionKey": 61,
"MessageType_ECDHSessionKey": 62,
"MessageType_SetU2FCounter": 63,
"MessageType_EthereumSignMessage": 64,
"MessageType_EthereumVerifyMessage": 65,
"MessageType_EthereumMessageSignature": 66,
"MessageType_BurnoutSignMessage": 64,
"MessageType_BurnoutVerifyMessage": 65,
"MessageType_BurnoutMessageSignature": 66,
"MessageType_DebugLinkDecision": 100,
"MessageType_DebugLinkGetState": 101,
"MessageType_DebugLinkState": 102,
@ -954,29 +954,29 @@ func (m *GetAddress) GetScriptType() InputScriptType {
}
// *
// Request: Ask device for Ethereum address corresponding to address_n path
// Request: Ask device for Burnout address corresponding to address_n path
// @next PassphraseRequest
// @next EthereumAddress
// @next BurnoutAddress
// @next Failure
type EthereumGetAddress struct {
type BurnoutGetAddress struct {
AddressN []uint32 `protobuf:"varint,1,rep,name=address_n,json=addressN" json:"address_n,omitempty"`
ShowDisplay *bool `protobuf:"varint,2,opt,name=show_display,json=showDisplay" json:"show_display,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *EthereumGetAddress) Reset() { *m = EthereumGetAddress{} }
func (m *EthereumGetAddress) String() string { return proto.CompactTextString(m) }
func (*EthereumGetAddress) ProtoMessage() {}
func (*EthereumGetAddress) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{22} }
func (m *BurnoutGetAddress) Reset() { *m = BurnoutGetAddress{} }
func (m *BurnoutGetAddress) String() string { return proto.CompactTextString(m) }
func (*BurnoutGetAddress) ProtoMessage() {}
func (*BurnoutGetAddress) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{22} }
func (m *EthereumGetAddress) GetAddressN() []uint32 {
func (m *BurnoutGetAddress) GetAddressN() []uint32 {
if m != nil {
return m.AddressN
}
return nil
}
func (m *EthereumGetAddress) GetShowDisplay() bool {
func (m *BurnoutGetAddress) GetShowDisplay() bool {
if m != nil && m.ShowDisplay != nil {
return *m.ShowDisplay
}
@ -1004,19 +1004,19 @@ func (m *Address) GetAddress() string {
}
// *
// Response: Contains an Ethereum address derived from device private seed
// @prev EthereumGetAddress
type EthereumAddress struct {
// Response: Contains an Burnout address derived from device private seed
// @prev BurnoutGetAddress
type BurnoutAddress struct {
Address []byte `protobuf:"bytes,1,req,name=address" json:"address,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *EthereumAddress) Reset() { *m = EthereumAddress{} }
func (m *EthereumAddress) String() string { return proto.CompactTextString(m) }
func (*EthereumAddress) ProtoMessage() {}
func (*EthereumAddress) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{24} }
func (m *BurnoutAddress) Reset() { *m = BurnoutAddress{} }
func (m *BurnoutAddress) String() string { return proto.CompactTextString(m) }
func (*BurnoutAddress) ProtoMessage() {}
func (*BurnoutAddress) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{24} }
func (m *EthereumAddress) GetAddress() []byte {
func (m *BurnoutAddress) GetAddress() []byte {
if m != nil {
return m.Address
}
@ -2006,9 +2006,9 @@ func (m *TxAck) GetTx() *TransactionType {
// Note: the first at most 1024 bytes of data MUST be transmitted as part of this message.
// @next PassphraseRequest
// @next PinMatrixRequest
// @next EthereumTxRequest
// @next BurnoutTxRequest
// @next Failure
type EthereumSignTx struct {
type BurnoutSignTx struct {
AddressN []uint32 `protobuf:"varint,1,rep,name=address_n,json=addressN" json:"address_n,omitempty"`
Nonce []byte `protobuf:"bytes,2,opt,name=nonce" json:"nonce,omitempty"`
GasPrice []byte `protobuf:"bytes,3,opt,name=gas_price,json=gasPrice" json:"gas_price,omitempty"`
@ -2021,68 +2021,68 @@ type EthereumSignTx struct {
XXX_unrecognized []byte `json:"-"`
}
func (m *EthereumSignTx) Reset() { *m = EthereumSignTx{} }
func (m *EthereumSignTx) String() string { return proto.CompactTextString(m) }
func (*EthereumSignTx) ProtoMessage() {}
func (*EthereumSignTx) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{49} }
func (m *BurnoutSignTx) Reset() { *m = BurnoutSignTx{} }
func (m *BurnoutSignTx) String() string { return proto.CompactTextString(m) }
func (*BurnoutSignTx) ProtoMessage() {}
func (*BurnoutSignTx) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{49} }
func (m *EthereumSignTx) GetAddressN() []uint32 {
func (m *BurnoutSignTx) GetAddressN() []uint32 {
if m != nil {
return m.AddressN
}
return nil
}
func (m *EthereumSignTx) GetNonce() []byte {
func (m *BurnoutSignTx) GetNonce() []byte {
if m != nil {
return m.Nonce
}
return nil
}
func (m *EthereumSignTx) GetGasPrice() []byte {
func (m *BurnoutSignTx) GetGasPrice() []byte {
if m != nil {
return m.GasPrice
}
return nil
}
func (m *EthereumSignTx) GetGasLimit() []byte {
func (m *BurnoutSignTx) GetGasLimit() []byte {
if m != nil {
return m.GasLimit
}
return nil
}
func (m *EthereumSignTx) GetTo() []byte {
func (m *BurnoutSignTx) GetTo() []byte {
if m != nil {
return m.To
}
return nil
}
func (m *EthereumSignTx) GetValue() []byte {
func (m *BurnoutSignTx) GetValue() []byte {
if m != nil {
return m.Value
}
return nil
}
func (m *EthereumSignTx) GetDataInitialChunk() []byte {
func (m *BurnoutSignTx) GetDataInitialChunk() []byte {
if m != nil {
return m.DataInitialChunk
}
return nil
}
func (m *EthereumSignTx) GetDataLength() uint32 {
func (m *BurnoutSignTx) GetDataLength() uint32 {
if m != nil && m.DataLength != nil {
return *m.DataLength
}
return 0
}
func (m *EthereumSignTx) GetChainId() uint32 {
func (m *BurnoutSignTx) GetChainId() uint32 {
if m != nil && m.ChainId != nil {
return *m.ChainId
}
@ -2093,9 +2093,9 @@ func (m *EthereumSignTx) GetChainId() uint32 {
// Response: Device asks for more data from transaction payload, or returns the signature.
// If data_length is set, device awaits that many more bytes of payload.
// Otherwise, the signature_* fields contain the computed transaction signature. All three fields will be present.
// @prev EthereumSignTx
// @next EthereumTxAck
type EthereumTxRequest struct {
// @prev BurnoutSignTx
// @next BurnoutTxAck
type BurnoutTxRequest struct {
DataLength *uint32 `protobuf:"varint,1,opt,name=data_length,json=dataLength" json:"data_length,omitempty"`
SignatureV *uint32 `protobuf:"varint,2,opt,name=signature_v,json=signatureV" json:"signature_v,omitempty"`
SignatureR []byte `protobuf:"bytes,3,opt,name=signature_r,json=signatureR" json:"signature_r,omitempty"`
@ -2103,33 +2103,33 @@ type EthereumTxRequest struct {
XXX_unrecognized []byte `json:"-"`
}
func (m *EthereumTxRequest) Reset() { *m = EthereumTxRequest{} }
func (m *EthereumTxRequest) String() string { return proto.CompactTextString(m) }
func (*EthereumTxRequest) ProtoMessage() {}
func (*EthereumTxRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{50} }
func (m *BurnoutTxRequest) Reset() { *m = BurnoutTxRequest{} }
func (m *BurnoutTxRequest) String() string { return proto.CompactTextString(m) }
func (*BurnoutTxRequest) ProtoMessage() {}
func (*BurnoutTxRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{50} }
func (m *EthereumTxRequest) GetDataLength() uint32 {
func (m *BurnoutTxRequest) GetDataLength() uint32 {
if m != nil && m.DataLength != nil {
return *m.DataLength
}
return 0
}
func (m *EthereumTxRequest) GetSignatureV() uint32 {
func (m *BurnoutTxRequest) GetSignatureV() uint32 {
if m != nil && m.SignatureV != nil {
return *m.SignatureV
}
return 0
}
func (m *EthereumTxRequest) GetSignatureR() []byte {
func (m *BurnoutTxRequest) GetSignatureR() []byte {
if m != nil {
return m.SignatureR
}
return nil
}
func (m *EthereumTxRequest) GetSignatureS() []byte {
func (m *BurnoutTxRequest) GetSignatureS() []byte {
if m != nil {
return m.SignatureS
}
@ -2138,19 +2138,19 @@ func (m *EthereumTxRequest) GetSignatureS() []byte {
// *
// Request: Transaction payload data.
// @prev EthereumTxRequest
// @next EthereumTxRequest
type EthereumTxAck struct {
// @prev BurnoutTxRequest
// @next BurnoutTxRequest
type BurnoutTxAck struct {
DataChunk []byte `protobuf:"bytes,1,opt,name=data_chunk,json=dataChunk" json:"data_chunk,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *EthereumTxAck) Reset() { *m = EthereumTxAck{} }
func (m *EthereumTxAck) String() string { return proto.CompactTextString(m) }
func (*EthereumTxAck) ProtoMessage() {}
func (*EthereumTxAck) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{51} }
func (m *BurnoutTxAck) Reset() { *m = BurnoutTxAck{} }
func (m *BurnoutTxAck) String() string { return proto.CompactTextString(m) }
func (*BurnoutTxAck) ProtoMessage() {}
func (*BurnoutTxAck) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{51} }
func (m *EthereumTxAck) GetDataChunk() []byte {
func (m *BurnoutTxAck) GetDataChunk() []byte {
if m != nil {
return m.DataChunk
}
@ -2159,27 +2159,27 @@ func (m *EthereumTxAck) GetDataChunk() []byte {
// *
// Request: Ask device to sign message
// @next EthereumMessageSignature
// @next BurnoutMessageSignature
// @next Failure
type EthereumSignMessage struct {
type BurnoutSignMessage struct {
AddressN []uint32 `protobuf:"varint,1,rep,name=address_n,json=addressN" json:"address_n,omitempty"`
Message []byte `protobuf:"bytes,2,req,name=message" json:"message,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *EthereumSignMessage) Reset() { *m = EthereumSignMessage{} }
func (m *EthereumSignMessage) String() string { return proto.CompactTextString(m) }
func (*EthereumSignMessage) ProtoMessage() {}
func (*EthereumSignMessage) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{52} }
func (m *BurnoutSignMessage) Reset() { *m = BurnoutSignMessage{} }
func (m *BurnoutSignMessage) String() string { return proto.CompactTextString(m) }
func (*BurnoutSignMessage) ProtoMessage() {}
func (*BurnoutSignMessage) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{52} }
func (m *EthereumSignMessage) GetAddressN() []uint32 {
func (m *BurnoutSignMessage) GetAddressN() []uint32 {
if m != nil {
return m.AddressN
}
return nil
}
func (m *EthereumSignMessage) GetMessage() []byte {
func (m *BurnoutSignMessage) GetMessage() []byte {
if m != nil {
return m.Message
}
@ -2190,33 +2190,33 @@ func (m *EthereumSignMessage) GetMessage() []byte {
// Request: Ask device to verify message
// @next Success
// @next Failure
type EthereumVerifyMessage struct {
type BurnoutVerifyMessage struct {
Address []byte `protobuf:"bytes,1,opt,name=address" json:"address,omitempty"`
Signature []byte `protobuf:"bytes,2,opt,name=signature" json:"signature,omitempty"`
Message []byte `protobuf:"bytes,3,opt,name=message" json:"message,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *EthereumVerifyMessage) Reset() { *m = EthereumVerifyMessage{} }
func (m *EthereumVerifyMessage) String() string { return proto.CompactTextString(m) }
func (*EthereumVerifyMessage) ProtoMessage() {}
func (*EthereumVerifyMessage) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{53} }
func (m *BurnoutVerifyMessage) Reset() { *m = BurnoutVerifyMessage{} }
func (m *BurnoutVerifyMessage) String() string { return proto.CompactTextString(m) }
func (*BurnoutVerifyMessage) ProtoMessage() {}
func (*BurnoutVerifyMessage) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{53} }
func (m *EthereumVerifyMessage) GetAddress() []byte {
func (m *BurnoutVerifyMessage) GetAddress() []byte {
if m != nil {
return m.Address
}
return nil
}
func (m *EthereumVerifyMessage) GetSignature() []byte {
func (m *BurnoutVerifyMessage) GetSignature() []byte {
if m != nil {
return m.Signature
}
return nil
}
func (m *EthereumVerifyMessage) GetMessage() []byte {
func (m *BurnoutVerifyMessage) GetMessage() []byte {
if m != nil {
return m.Message
}
@ -2225,26 +2225,26 @@ func (m *EthereumVerifyMessage) GetMessage() []byte {
// *
// Response: Signed message
// @prev EthereumSignMessage
type EthereumMessageSignature struct {
// @prev BurnoutSignMessage
type BurnoutMessageSignature struct {
Address []byte `protobuf:"bytes,1,opt,name=address" json:"address,omitempty"`
Signature []byte `protobuf:"bytes,2,opt,name=signature" json:"signature,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *EthereumMessageSignature) Reset() { *m = EthereumMessageSignature{} }
func (m *EthereumMessageSignature) String() string { return proto.CompactTextString(m) }
func (*EthereumMessageSignature) ProtoMessage() {}
func (*EthereumMessageSignature) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{54} }
func (m *BurnoutMessageSignature) Reset() { *m = BurnoutMessageSignature{} }
func (m *BurnoutMessageSignature) String() string { return proto.CompactTextString(m) }
func (*BurnoutMessageSignature) ProtoMessage() {}
func (*BurnoutMessageSignature) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{54} }
func (m *EthereumMessageSignature) GetAddress() []byte {
func (m *BurnoutMessageSignature) GetAddress() []byte {
if m != nil {
return m.Address
}
return nil
}
func (m *EthereumMessageSignature) GetSignature() []byte {
func (m *BurnoutMessageSignature) GetSignature() []byte {
if m != nil {
return m.Signature
}
@ -2806,9 +2806,9 @@ func init() {
proto.RegisterType((*GetPublicKey)(nil), "GetPublicKey")
proto.RegisterType((*PublicKey)(nil), "PublicKey")
proto.RegisterType((*GetAddress)(nil), "GetAddress")
proto.RegisterType((*EthereumGetAddress)(nil), "EthereumGetAddress")
proto.RegisterType((*BurnoutGetAddress)(nil), "BurnoutGetAddress")
proto.RegisterType((*Address)(nil), "Address")
proto.RegisterType((*EthereumAddress)(nil), "EthereumAddress")
proto.RegisterType((*BurnoutAddress)(nil), "BurnoutAddress")
proto.RegisterType((*WipeDevice)(nil), "WipeDevice")
proto.RegisterType((*LoadDevice)(nil), "LoadDevice")
proto.RegisterType((*ResetDevice)(nil), "ResetDevice")
@ -2833,12 +2833,12 @@ func init() {
proto.RegisterType((*SimpleSignTx)(nil), "SimpleSignTx")
proto.RegisterType((*TxRequest)(nil), "TxRequest")
proto.RegisterType((*TxAck)(nil), "TxAck")
proto.RegisterType((*EthereumSignTx)(nil), "EthereumSignTx")
proto.RegisterType((*EthereumTxRequest)(nil), "EthereumTxRequest")
proto.RegisterType((*EthereumTxAck)(nil), "EthereumTxAck")
proto.RegisterType((*EthereumSignMessage)(nil), "EthereumSignMessage")
proto.RegisterType((*EthereumVerifyMessage)(nil), "EthereumVerifyMessage")
proto.RegisterType((*EthereumMessageSignature)(nil), "EthereumMessageSignature")
proto.RegisterType((*BurnoutSignTx)(nil), "BurnoutSignTx")
proto.RegisterType((*BurnoutTxRequest)(nil), "BurnoutTxRequest")
proto.RegisterType((*BurnoutTxAck)(nil), "BurnoutTxAck")
proto.RegisterType((*BurnoutSignMessage)(nil), "BurnoutSignMessage")
proto.RegisterType((*BurnoutVerifyMessage)(nil), "BurnoutVerifyMessage")
proto.RegisterType((*BurnoutMessageSignature)(nil), "BurnoutMessageSignature")
proto.RegisterType((*SignIdentity)(nil), "SignIdentity")
proto.RegisterType((*SignedIdentity)(nil), "SignedIdentity")
proto.RegisterType((*GetECDHSessionKey)(nil), "GetECDHSessionKey")

View file

@ -69,17 +69,17 @@ enum MessageType {
MessageType_SignIdentity = 53 [(wire_in) = true];
MessageType_SignedIdentity = 54 [(wire_out) = true];
MessageType_GetFeatures = 55 [(wire_in) = true];
MessageType_EthereumGetAddress = 56 [(wire_in) = true];
MessageType_EthereumAddress = 57 [(wire_out) = true];
MessageType_EthereumSignTx = 58 [(wire_in) = true];
MessageType_EthereumTxRequest = 59 [(wire_out) = true];
MessageType_EthereumTxAck = 60 [(wire_in) = true];
MessageType_BurnoutGetAddress = 56 [(wire_in) = true];
MessageType_BurnoutAddress = 57 [(wire_out) = true];
MessageType_BurnoutSignTx = 58 [(wire_in) = true];
MessageType_BurnoutTxRequest = 59 [(wire_out) = true];
MessageType_BurnoutTxAck = 60 [(wire_in) = true];
MessageType_GetECDHSessionKey = 61 [(wire_in) = true];
MessageType_ECDHSessionKey = 62 [(wire_out) = true];
MessageType_SetU2FCounter = 63 [(wire_in) = true];
MessageType_EthereumSignMessage = 64 [(wire_in) = true];
MessageType_EthereumVerifyMessage = 65 [(wire_in) = true];
MessageType_EthereumMessageSignature = 66 [(wire_out) = true];
MessageType_BurnoutSignMessage = 64 [(wire_in) = true];
MessageType_BurnoutVerifyMessage = 65 [(wire_in) = true];
MessageType_BurnoutMessageSignature = 66 [(wire_out) = true];
MessageType_DebugLinkDecision = 100 [(wire_debug_in) = true, (wire_tiny) = true];
MessageType_DebugLinkGetState = 101 [(wire_debug_in) = true];
MessageType_DebugLinkState = 102 [(wire_debug_out) = true];
@ -316,12 +316,12 @@ message GetAddress {
}
/**
* Request: Ask device for Ethereum address corresponding to address_n path
* Request: Ask device for Burnout address corresponding to address_n path
* @next PassphraseRequest
* @next EthereumAddress
* @next BurnoutAddress
* @next Failure
*/
message EthereumGetAddress {
message BurnoutGetAddress {
repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node
optional bool show_display = 2; // optionally show on display before sending the result
}
@ -335,11 +335,11 @@ message Address {
}
/**
* Response: Contains an Ethereum address derived from device private seed
* @prev EthereumGetAddress
* Response: Contains an Burnout address derived from device private seed
* @prev BurnoutGetAddress
*/
message EthereumAddress {
required bytes address = 1; // Coin address as an Ethereum 160 bit hash
message BurnoutAddress {
required bytes address = 1; // Coin address as an Burnout 160 bit hash
}
/**
@ -640,10 +640,10 @@ message TxAck {
* Note: the first at most 1024 bytes of data MUST be transmitted as part of this message.
* @next PassphraseRequest
* @next PinMatrixRequest
* @next EthereumTxRequest
* @next BurnoutTxRequest
* @next Failure
*/
message EthereumSignTx {
message BurnoutSignTx {
repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node
optional bytes nonce = 2; // <=256 bit unsigned big endian
optional bytes gas_price = 3; // <=256 bit unsigned big endian (in wei)
@ -659,10 +659,10 @@ message EthereumSignTx {
* Response: Device asks for more data from transaction payload, or returns the signature.
* If data_length is set, device awaits that many more bytes of payload.
* Otherwise, the signature_* fields contain the computed transaction signature. All three fields will be present.
* @prev EthereumSignTx
* @next EthereumTxAck
* @prev BurnoutSignTx
* @next BurnoutTxAck
*/
message EthereumTxRequest {
message BurnoutTxRequest {
optional uint32 data_length = 1; // Number of bytes being requested (<= 1024)
optional uint32 signature_v = 2; // Computed signature (recovery parameter, limited to 27 or 28)
optional bytes signature_r = 3; // Computed signature R component (256 bit)
@ -671,23 +671,23 @@ message EthereumTxRequest {
/**
* Request: Transaction payload data.
* @prev EthereumTxRequest
* @next EthereumTxRequest
* @prev BurnoutTxRequest
* @next BurnoutTxRequest
*/
message EthereumTxAck {
message BurnoutTxAck {
optional bytes data_chunk = 1; // Bytes from transaction payload (<= 1024 bytes)
}
////////////////////////////////////////
// Ethereum: Message signing messages //
// Burnout: Message signing messages //
////////////////////////////////////////
/**
* Request: Ask device to sign message
* @next EthereumMessageSignature
* @next BurnoutMessageSignature
* @next Failure
*/
message EthereumSignMessage {
message BurnoutSignMessage {
repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node
required bytes message = 2; // message to be signed
}
@ -697,7 +697,7 @@ message EthereumSignMessage {
* @next Success
* @next Failure
*/
message EthereumVerifyMessage {
message BurnoutVerifyMessage {
optional bytes address = 1; // address to verify
optional bytes signature = 2; // signature to verify
optional bytes message = 3; // message to verify
@ -705,9 +705,9 @@ message EthereumVerifyMessage {
/**
* Response: Signed message
* @prev EthereumSignMessage
* @prev BurnoutSignMessage
*/
message EthereumMessageSignature {
message BurnoutMessageSignature {
optional bytes address = 1; // address used to sign the message
optional bytes signature = 2; // signature of the message
}

View file

@ -1,18 +1,18 @@
// Copyright 2017 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2017 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
// This file contains the implementation for interacting with the Trezor hardware
// wallets. The wire protocol spec can be found on the SatoshiLabs website:

View file

@ -42,9 +42,9 @@ It has these top-level messages:
GetPublicKey
PublicKey
GetAddress
EthereumGetAddress
BurnoutGetAddress
Address
EthereumAddress
BurnoutAddress
WipeDevice
LoadDevice
ResetDevice
@ -69,12 +69,12 @@ It has these top-level messages:
SimpleSignTx
TxRequest
TxAck
EthereumSignTx
EthereumTxRequest
EthereumTxAck
EthereumSignMessage
EthereumVerifyMessage
EthereumMessageSignature
BurnoutSignTx
BurnoutTxRequest
BurnoutTxAck
BurnoutSignMessage
BurnoutVerifyMessage
BurnoutMessageSignature
SignIdentity
SignedIdentity
GetECDHSessionKey

View file

@ -1,22 +1,22 @@
// Copyright 2017 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2017 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
// This file contains the implementation for interacting with the Ledger hardware
// wallets. The wire protocol spec can be found in the Ledger Blue GitHub repo:
// https://raw.githubusercontent.com/LedgerHQ/blue-app-eth/master/doc/ethapp.asc
// https://raw.githubusercontent.com/LedgerHQ/blue-app-brn/master/doc/ethapp.asc
package usbwallet
@ -28,12 +28,12 @@ import (
"io"
"math/big"
"github.com/ethereum/go-ethereum/accounts"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/rlp"
"github.com/burnout/go-burnout/accounts"
"github.com/burnout/go-burnout/common"
"github.com/burnout/go-burnout/common/hexutil"
"github.com/burnout/go-burnout/core/types"
"github.com/burnout/go-burnout/log"
"github.com/burnout/go-burnout/rlp"
)
// ledgerOpcode is an enumeration encoding the supported Ledger opcodes.
@ -48,8 +48,8 @@ type ledgerParam1 byte
type ledgerParam2 byte
const (
ledgerOpRetrieveAddress ledgerOpcode = 0x02 // Returns the public key and Ethereum address for a given BIP 32 path
ledgerOpSignTransaction ledgerOpcode = 0x04 // Signs an Ethereum transaction after having the user validate the parameters
ledgerOpRetrieveAddress ledgerOpcode = 0x02 // Returns the public key and Burnout address for a given BIP 32 path
ledgerOpSignTransaction ledgerOpcode = 0x04 // Signs an Burnout transaction after having the user validate the parameters
ledgerOpGetConfiguration ledgerOpcode = 0x06 // Returns specific wallet application configuration
ledgerP1DirectlyFetchAddress ledgerParam1 = 0x00 // Return address directly from the wallet
@ -92,15 +92,15 @@ func (w *ledgerDriver) Status() (string, error) {
return fmt.Sprintf("Failed: %v", w.failure), w.failure
}
if w.browser {
return "Ethereum app in browser mode", w.failure
return "Burnout app in browser mode", w.failure
}
if w.offline() {
return "Ethereum app offline", w.failure
return "Burnout app offline", w.failure
}
return fmt.Sprintf("Ethereum app v%d.%d.%d online", w.version[0], w.version[1], w.version[2]), w.failure
return fmt.Sprintf("Burnout app v%d.%d.%d online", w.version[0], w.version[1], w.version[2]), w.failure
}
// offline returns whether the wallet and the Ethereum app is offline or not.
// offline returns whether the wallet and the Burnout app is offline or not.
//
// The method assumes that the state lock is held!
func (w *ledgerDriver) offline() bool {
@ -115,13 +115,13 @@ func (w *ledgerDriver) Open(device io.ReadWriter, passphrase string) error {
_, err := w.ledgerDerive(accounts.DefaultBaseDerivationPath)
if err != nil {
// Ethereum app is not running or in browser mode, nothing more to do, return
// Burnout app is not running or in browser mode, nothing more to do, return
if err == errLedgerReplyInvalidHeader {
w.browser = true
}
return nil
}
// Try to resolve the Ethereum app's version, will fail prior to v1.0.2
// Try to resolve the Burnout app's version, will fail prior to v1.0.2
if w.version, err = w.ledgerVersion(); err != nil {
w.version = [3]byte{1, 0, 0} // Assume worst case, can't verify if v1.0.0 or v1.0.1
}
@ -146,7 +146,7 @@ func (w *ledgerDriver) Heartbeat() error {
}
// Derive implements usbwallet.driver, sending a derivation request to the Ledger
// and returning the Ethereum address located on that derivation path.
// and returning the Burnout address located on that derivation path.
func (w *ledgerDriver) Derive(path accounts.DerivationPath) (common.Address, error) {
return w.ledgerDerive(path)
}
@ -154,11 +154,11 @@ func (w *ledgerDriver) Derive(path accounts.DerivationPath) (common.Address, err
// SignTx implements usbwallet.driver, sending the transaction to the Ledger and
// waiting for the user to confirm or deny the transaction.
//
// Note, if the version of the Ethereum application running on the Ledger wallet is
// Note, if the version of the Burnout application running on the Ledger wallet is
// too old to sign EIP-155 transactions, but such is requested nonetheless, an error
// will be returned opposed to silently signing in Homestead mode.
func (w *ledgerDriver) SignTx(path accounts.DerivationPath, tx *types.Transaction, chainID *big.Int) (common.Address, *types.Transaction, error) {
// If the Ethereum app doesn't run, abort
// If the Burnout app doesn't run, abort
if w.offline() {
return common.Address{}, nil, accounts.ErrWalletClosed
}
@ -170,7 +170,7 @@ func (w *ledgerDriver) SignTx(path accounts.DerivationPath, tx *types.Transactio
return w.ledgerSign(path, tx, chainID)
}
// ledgerVersion retrieves the current version of the Ethereum wallet app running
// ledgerVersion retrieves the current version of the Burnout wallet app running
// on the Ledger wallet.
//
// The version retrieval protocol is defined as follows:
@ -202,7 +202,7 @@ func (w *ledgerDriver) ledgerVersion() ([3]byte, error) {
return version, nil
}
// ledgerDerive retrieves the currently active Ethereum address from a Ledger
// ledgerDerive retrieves the currently active Burnout address from a Ledger
// wallet at the specified derivation path.
//
// The address derivation protocol is defined as follows:
@ -230,8 +230,8 @@ func (w *ledgerDriver) ledgerVersion() ([3]byte, error) {
// ------------------------+-------------------
// Public Key length | 1 byte
// Uncompressed Public Key | arbitrary
// Ethereum address length | 1 byte
// Ethereum address | 40 bytes hex ascii
// Burnout address length | 1 byte
// Burnout address | 40 bytes hex ascii
// Chain code if requested | 32 bytes
func (w *ledgerDriver) ledgerDerive(derivationPath []uint32) (common.Address, error) {
// Flatten the derivation path into the Ledger request
@ -251,13 +251,13 @@ func (w *ledgerDriver) ledgerDerive(derivationPath []uint32) (common.Address, er
}
reply = reply[1+int(reply[0]):]
// Extract the Ethereum hex address string
// Extract the Burnout hex address string
if len(reply) < 1 || len(reply) < 1+int(reply[0]) {
return common.Address{}, errors.New("reply lacks address entry")
}
hexstr := reply[1 : 1+int(reply[0])]
// Decode the hex sting into an Ethereum address and return
// Decode the hex sting into an Burnout address and return
var address common.Address
hex.Decode(address[:], hexstr)
return address, nil
@ -340,7 +340,7 @@ func (w *ledgerDriver) ledgerSign(derivationPath []uint32, tx *types.Transaction
payload = payload[chunk:]
op = ledgerP1ContTransactionData
}
// Extract the Ethereum signature and do a sanity validation
// Extract the Burnout signature and do a sanity validation
if len(reply) != 65 {
return common.Address{}, nil, errors.New("reply lacks signature")
}

View file

@ -1,18 +1,18 @@
// Copyright 2017 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2017 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
// This file contains the implementation for interacting with the Trezor hardware
// wallets. The wire protocol spec can be found on the SatoshiLabs website:
@ -27,12 +27,12 @@ import (
"io"
"math/big"
"github.com/ethereum/go-ethereum/accounts"
"github.com/ethereum/go-ethereum/accounts/usbwallet/internal/trezor"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/log"
"github.com/burnout/go-burnout/accounts"
"github.com/burnout/go-burnout/accounts/usbwallet/internal/trezor"
"github.com/burnout/go-burnout/common"
"github.com/burnout/go-burnout/common/hexutil"
"github.com/burnout/go-burnout/core/types"
"github.com/burnout/go-burnout/log"
"github.com/golang/protobuf/proto"
)
@ -64,7 +64,7 @@ func newTrezorDriver(logger log.Logger) driver {
}
// Status implements accounts.Wallet, always whether the Trezor is opened, closed
// or whether the Ethereum app was not started on it.
// or whether the Burnout app was not started on it.
func (w *trezorDriver) Status() (string, error) {
if w.failure != nil {
return fmt.Sprintf("Failed: %v", w.failure), w.failure
@ -145,7 +145,7 @@ func (w *trezorDriver) Heartbeat() error {
}
// Derive implements usbwallet.driver, sending a derivation request to the Trezor
// and returning the Ethereum address located on that derivation path.
// and returning the Burnout address located on that derivation path.
func (w *trezorDriver) Derive(path accounts.DerivationPath) (common.Address, error) {
return w.trezorDerive(path)
}
@ -160,10 +160,10 @@ func (w *trezorDriver) SignTx(path accounts.DerivationPath, tx *types.Transactio
}
// trezorDerive sends a derivation request to the Trezor device and returns the
// Ethereum address located on that path.
// Burnout address located on that path.
func (w *trezorDriver) trezorDerive(derivationPath []uint32) (common.Address, error) {
address := new(trezor.EthereumAddress)
if _, err := w.trezorExchange(&trezor.EthereumGetAddress{AddressN: derivationPath}, address); err != nil {
address := new(trezor.BurnoutAddress)
if _, err := w.trezorExchange(&trezor.BurnoutGetAddress{AddressN: derivationPath}, address); err != nil {
return common.Address{}, err
}
return common.BytesToAddress(address.GetAddress()), nil
@ -176,7 +176,7 @@ func (w *trezorDriver) trezorSign(derivationPath []uint32, tx *types.Transaction
data := tx.Data()
length := uint32(len(data))
request := &trezor.EthereumSignTx{
request := &trezor.BurnoutSignTx{
AddressN: derivationPath,
Nonce: new(big.Int).SetUint64(tx.Nonce()).Bytes(),
GasPrice: tx.GasPrice().Bytes(),
@ -197,7 +197,7 @@ func (w *trezorDriver) trezorSign(derivationPath []uint32, tx *types.Transaction
request.ChainId = &id
}
// Send the initiation message and stream content until a signature is returned
response := new(trezor.EthereumTxRequest)
response := new(trezor.BurnoutTxRequest)
if _, err := w.trezorExchange(request, response); err != nil {
return common.Address{}, nil, err
}
@ -205,11 +205,11 @@ func (w *trezorDriver) trezorSign(derivationPath []uint32, tx *types.Transaction
chunk := data[:*response.DataLength]
data = data[*response.DataLength:]
if _, err := w.trezorExchange(&trezor.EthereumTxAck{DataChunk: chunk}, response); err != nil {
if _, err := w.trezorExchange(&trezor.BurnoutTxAck{DataChunk: chunk}, response); err != nil {
return common.Address{}, nil, err
}
}
// Extract the Ethereum signature and do a sanity validation
// Extract the Burnout signature and do a sanity validation
if len(response.GetSignatureR()) == 0 || len(response.GetSignatureS()) == 0 || response.GetSignatureV() == 0 {
return common.Address{}, nil, errors.New("reply lacks signature")
}

View file

@ -1,18 +1,18 @@
// Copyright 2017 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2017 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
// Package usbwallet implements support for USB hardware wallets.
package usbwallet
@ -25,11 +25,11 @@ import (
"sync"
"time"
ethereum "github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/accounts"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/log"
burnout "github.com/burnout/go-burnout"
"github.com/burnout/go-burnout/accounts"
"github.com/burnout/go-burnout/common"
"github.com/burnout/go-burnout/core/types"
"github.com/burnout/go-burnout/log"
"github.com/karalabe/hid"
)
@ -59,7 +59,7 @@ type driver interface {
// is still online and healthy.
Heartbeat() error
// Derive sends a derivation request to the USB device and returns the Ethereum
// Derive sends a derivation request to the USB device and returns the Burnout
// address located on that path.
Derive(path accounts.DerivationPath) (common.Address, error)
@ -84,7 +84,7 @@ type wallet struct {
deriveNextPath accounts.DerivationPath // Next derivation path for account auto-discovery
deriveNextAddr common.Address // Next derived account address for auto-discovery
deriveChain ethereum.ChainStateReader // Blockchain state reader to discover used account with
deriveChain burnout.ChainStateReader // Blockchain state reader to discover used account with
deriveReq chan chan struct{} // Channel to request a self-derivation on
deriveQuit chan chan error // Channel to terminate the self-deriver with
@ -346,7 +346,7 @@ func (w *wallet) selfDerive() {
context = context.Background()
)
for empty := false; !empty; {
// Retrieve the next derived Ethereum account
// Retrieve the next derived Burnout account
if nextAddr == (common.Address{}) {
if nextAddr, err = w.driver.Derive(nextPath); err != nil {
w.log.Warn("USB wallet account derivation failed", "err", err)
@ -484,7 +484,7 @@ func (w *wallet) Derive(path accounts.DerivationPath, pin bool) (accounts.Accoun
// user used previously (based on the chain state), but ones that he/she did not
// explicitly pin to the wallet manually. To avoid chain head monitoring, self
// derivation only runs during account listing (and even then throttled).
func (w *wallet) SelfDerive(base accounts.DerivationPath, chain ethereum.ChainStateReader) {
func (w *wallet) SelfDerive(base accounts.DerivationPath, chain burnout.ChainStateReader) {
w.stateLock.Lock()
defer w.stateLock.Unlock()
@ -505,7 +505,7 @@ func (w *wallet) SignHash(account accounts.Account, hash []byte) ([]byte, error)
// wallet to request a confirmation from the user. It returns either the signed
// transaction or a failure if the user denied the transaction.
//
// Note, if the version of the Ethereum application running on the Ledger wallet is
// Note, if the version of the Burnout application running on the Ledger wallet is
// too old to sign EIP-155 transactions, but such is requested nonetheless, an error
// will be returned opposed to silently signing in Homestead mode.
func (w *wallet) SignTx(account accounts.Account, tx *types.Transaction, chainID *big.Int) (*types.Transaction, error) {

View file

@ -1,7 +1,7 @@
os: Visual Studio 2015
# Clone directly into GOPATH.
clone_folder: C:\gopath\src\github.com\ethereum\go-ethereum
clone_folder: C:\gopath\src\github.com\burnout\go-burnout
clone_depth: 5
version: "{branch}.{build}"
environment:

View file

@ -1,18 +1,18 @@
// Copyright 2017 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2017 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
// Package bmt provides a binary merkle tree implementation
package bmt

View file

@ -1,18 +1,18 @@
// Copyright 2017 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2017 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
// simple nonconcurrent reference implementation for hashsize segment based
// Binary Merkle tree hash on arbitrary but fixed maximum chunksize

View file

@ -1,18 +1,18 @@
// Copyright 2017 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2017 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
package bmt
@ -28,7 +28,7 @@ import (
"testing"
"time"
"github.com/ethereum/go-ethereum/crypto/sha3"
"github.com/burnout/go-burnout/crypto/sha3"
)
const (

View file

@ -1,20 +1,20 @@
// Copyright 2015 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2015 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
package eth
package brn
import (
"bytes"
@ -28,58 +28,58 @@ import (
"strings"
"time"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/state"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/core/vm"
"github.com/ethereum/go-ethereum/internal/ethapi"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/miner"
"github.com/ethereum/go-ethereum/params"
"github.com/ethereum/go-ethereum/rlp"
"github.com/ethereum/go-ethereum/rpc"
"github.com/ethereum/go-ethereum/trie"
"github.com/burnout/go-burnout/common"
"github.com/burnout/go-burnout/common/hexutil"
"github.com/burnout/go-burnout/core"
"github.com/burnout/go-burnout/core/state"
"github.com/burnout/go-burnout/core/types"
"github.com/burnout/go-burnout/core/vm"
"github.com/burnout/go-burnout/internal/ethapi"
"github.com/burnout/go-burnout/log"
"github.com/burnout/go-burnout/miner"
"github.com/burnout/go-burnout/params"
"github.com/burnout/go-burnout/rlp"
"github.com/burnout/go-burnout/rpc"
"github.com/burnout/go-burnout/trie"
)
const defaultTraceTimeout = 5 * time.Second
// PublicEthereumAPI provides an API to access Ethereum full node-related
// PublicBurnoutAPI provides an API to access Burnout full node-related
// information.
type PublicEthereumAPI struct {
e *Ethereum
type PublicBurnoutAPI struct {
e *Burnout
}
// NewPublicEthereumAPI creates a new Ethereum protocol API for full nodes.
func NewPublicEthereumAPI(e *Ethereum) *PublicEthereumAPI {
return &PublicEthereumAPI{e}
// NewPublicBurnoutAPI creates a new Burnout protocol API for full nodes.
func NewPublicBurnoutAPI(e *Burnout) *PublicBurnoutAPI {
return &PublicBurnoutAPI{e}
}
// Etherbase is the address that mining rewards will be send to
func (api *PublicEthereumAPI) Etherbase() (common.Address, error) {
func (api *PublicBurnoutAPI) Etherbase() (common.Address, error) {
return api.e.Etherbase()
}
// Coinbase is the address that mining rewards will be send to (alias for Etherbase)
func (api *PublicEthereumAPI) Coinbase() (common.Address, error) {
func (api *PublicBurnoutAPI) Coinbase() (common.Address, error) {
return api.Etherbase()
}
// Hashrate returns the POW hashrate
func (api *PublicEthereumAPI) Hashrate() hexutil.Uint64 {
func (api *PublicBurnoutAPI) Hashrate() hexutil.Uint64 {
return hexutil.Uint64(api.e.Miner().HashRate())
}
// PublicMinerAPI provides an API to control the miner.
// It offers only methods that operate on data that pose no security risk when it is publicly accessible.
type PublicMinerAPI struct {
e *Ethereum
e *Burnout
agent *miner.RemoteAgent
}
// NewPublicMinerAPI create a new PublicMinerAPI instance.
func NewPublicMinerAPI(e *Ethereum) *PublicMinerAPI {
func NewPublicMinerAPI(e *Burnout) *PublicMinerAPI {
agent := miner.NewRemoteAgent(e.BlockChain(), e.Engine())
e.Miner().Register(agent)
@ -125,11 +125,11 @@ func (api *PublicMinerAPI) SubmitHashrate(hashrate hexutil.Uint64, id common.Has
// PrivateMinerAPI provides private RPC methods to control the miner.
// These methods can be abused by external users and must be considered insecure for use by untrusted users.
type PrivateMinerAPI struct {
e *Ethereum
e *Burnout
}
// NewPrivateMinerAPI create a new RPC service which controls the miner of this node.
func NewPrivateMinerAPI(e *Ethereum) *PrivateMinerAPI {
func NewPrivateMinerAPI(e *Burnout) *PrivateMinerAPI {
return &PrivateMinerAPI{e: e}
}
@ -205,16 +205,16 @@ func (api *PrivateMinerAPI) GetHashrate() uint64 {
return uint64(api.e.miner.HashRate())
}
// PrivateAdminAPI is the collection of Ethereum full node-related APIs
// PrivateAdminAPI is the collection of Burnout full node-related APIs
// exposed over the private admin endpoint.
type PrivateAdminAPI struct {
eth *Ethereum
brn *Burnout
}
// NewPrivateAdminAPI creates a new API definition for the full node private
// admin methods of the Ethereum service.
func NewPrivateAdminAPI(eth *Ethereum) *PrivateAdminAPI {
return &PrivateAdminAPI{eth: eth}
// admin methods of the Burnout service.
func NewPrivateAdminAPI(brn *Burnout) *PrivateAdminAPI {
return &PrivateAdminAPI{brn: brn}
}
// ExportChain exports the current blockchain into a local file.
@ -233,7 +233,7 @@ func (api *PrivateAdminAPI) ExportChain(file string) (bool, error) {
}
// Export the blockchain
if err := api.eth.BlockChain().Export(writer); err != nil {
if err := api.brn.BlockChain().Export(writer); err != nil {
return false, err
}
return true, nil
@ -285,12 +285,12 @@ func (api *PrivateAdminAPI) ImportChain(file string) (bool, error) {
break
}
if hasAllBlocks(api.eth.BlockChain(), blocks) {
if hasAllBlocks(api.brn.BlockChain(), blocks) {
blocks = blocks[:0]
continue
}
// Import the batch and reset the buffer
if _, err := api.eth.BlockChain().InsertChain(blocks); err != nil {
if _, err := api.brn.BlockChain().InsertChain(blocks); err != nil {
return false, fmt.Errorf("batch %d: failed to insert: %v", batch, err)
}
blocks = blocks[:0]
@ -298,16 +298,16 @@ func (api *PrivateAdminAPI) ImportChain(file string) (bool, error) {
return true, nil
}
// PublicDebugAPI is the collection of Ethereum full node APIs exposed
// PublicDebugAPI is the collection of Burnout full node APIs exposed
// over the public debugging endpoint.
type PublicDebugAPI struct {
eth *Ethereum
brn *Burnout
}
// NewPublicDebugAPI creates a new API definition for the full node-
// related public debug methods of the Ethereum service.
func NewPublicDebugAPI(eth *Ethereum) *PublicDebugAPI {
return &PublicDebugAPI{eth: eth}
// related public debug methods of the Burnout service.
func NewPublicDebugAPI(brn *Burnout) *PublicDebugAPI {
return &PublicDebugAPI{brn: brn}
}
// DumpBlock retrieves the entire state of the database at a given block.
@ -316,36 +316,36 @@ func (api *PublicDebugAPI) DumpBlock(blockNr rpc.BlockNumber) (state.Dump, error
// If we're dumping the pending state, we need to request
// both the pending block as well as the pending state from
// the miner and operate on those
_, stateDb := api.eth.miner.Pending()
_, stateDb := api.brn.miner.Pending()
return stateDb.RawDump(), nil
}
var block *types.Block
if blockNr == rpc.LatestBlockNumber {
block = api.eth.blockchain.CurrentBlock()
block = api.brn.blockchain.CurrentBlock()
} else {
block = api.eth.blockchain.GetBlockByNumber(uint64(blockNr))
block = api.brn.blockchain.GetBlockByNumber(uint64(blockNr))
}
if block == nil {
return state.Dump{}, fmt.Errorf("block #%d not found", blockNr)
}
stateDb, err := api.eth.BlockChain().StateAt(block.Root())
stateDb, err := api.brn.BlockChain().StateAt(block.Root())
if err != nil {
return state.Dump{}, err
}
return stateDb.RawDump(), nil
}
// PrivateDebugAPI is the collection of Ethereum full node APIs exposed over
// PrivateDebugAPI is the collection of Burnout full node APIs exposed over
// the private debugging endpoint.
type PrivateDebugAPI struct {
config *params.ChainConfig
eth *Ethereum
brn *Burnout
}
// NewPrivateDebugAPI creates a new API definition for the full node-related
// private debug methods of the Ethereum service.
func NewPrivateDebugAPI(config *params.ChainConfig, eth *Ethereum) *PrivateDebugAPI {
return &PrivateDebugAPI{config: config, eth: eth}
// private debug methods of the Burnout service.
func NewPrivateDebugAPI(config *params.ChainConfig, brn *Burnout) *PrivateDebugAPI {
return &PrivateDebugAPI{config: config, brn: brn}
}
// BlockTraceResult is the returned value when replaying a block to check for
@ -397,11 +397,11 @@ func (api *PrivateDebugAPI) TraceBlockByNumber(blockNr rpc.BlockNumber, config *
switch blockNr {
case rpc.PendingBlockNumber:
// Pending block is only known by the miner
block = api.eth.miner.PendingBlock()
block = api.brn.miner.PendingBlock()
case rpc.LatestBlockNumber:
block = api.eth.blockchain.CurrentBlock()
block = api.brn.blockchain.CurrentBlock()
default:
block = api.eth.blockchain.GetBlockByNumber(uint64(blockNr))
block = api.brn.blockchain.GetBlockByNumber(uint64(blockNr))
}
if block == nil {
@ -419,7 +419,7 @@ func (api *PrivateDebugAPI) TraceBlockByNumber(blockNr rpc.BlockNumber, config *
// TraceBlockByHash processes the block by hash.
func (api *PrivateDebugAPI) TraceBlockByHash(hash common.Hash, config *vm.LogConfig) BlockTraceResult {
// Fetch the block that we aim to reprocess
block := api.eth.BlockChain().GetBlockByHash(hash)
block := api.brn.BlockChain().GetBlockByHash(hash)
if block == nil {
return BlockTraceResult{Error: fmt.Sprintf("block #%x not found", hash)}
}
@ -436,7 +436,7 @@ func (api *PrivateDebugAPI) TraceBlockByHash(hash common.Hash, config *vm.LogCon
func (api *PrivateDebugAPI) traceBlock(block *types.Block, logConfig *vm.LogConfig) (bool, []vm.StructLog, error) {
// Validate and reprocess the block
var (
blockchain = api.eth.BlockChain()
blockchain = api.brn.BlockChain()
validator = blockchain.Validator()
processor = blockchain.Processor()
)
@ -447,7 +447,7 @@ func (api *PrivateDebugAPI) traceBlock(block *types.Block, logConfig *vm.LogConf
Debug: true,
Tracer: structLogger,
}
if err := api.eth.engine.VerifyHeader(blockchain, block.Header(), true); err != nil {
if err := api.brn.engine.VerifyHeader(blockchain, block.Header(), true); err != nil {
return false, structLogger.StructLogs(), err
}
statedb, err := blockchain.StateAt(blockchain.GetBlock(block.ParentHash(), block.NumberU64()-1).Root())
@ -512,7 +512,7 @@ func (api *PrivateDebugAPI) TraceTransaction(ctx context.Context, txHash common.
}
// Retrieve the tx from the chain and the containing block
tx, blockHash, _, txIndex := core.GetTransaction(api.eth.ChainDb(), txHash)
tx, blockHash, _, txIndex := core.GetTransaction(api.brn.ChainDb(), txHash)
if tx == nil {
return nil, fmt.Errorf("transaction %x not found", txHash)
}
@ -545,15 +545,15 @@ func (api *PrivateDebugAPI) TraceTransaction(ctx context.Context, txHash common.
// computeTxEnv returns the execution environment of a certain transaction.
func (api *PrivateDebugAPI) computeTxEnv(blockHash common.Hash, txIndex int) (core.Message, vm.Context, *state.StateDB, error) {
// Create the parent state.
block := api.eth.BlockChain().GetBlockByHash(blockHash)
block := api.brn.BlockChain().GetBlockByHash(blockHash)
if block == nil {
return nil, vm.Context{}, nil, fmt.Errorf("block %x not found", blockHash)
}
parent := api.eth.BlockChain().GetBlock(block.ParentHash(), block.NumberU64()-1)
parent := api.brn.BlockChain().GetBlock(block.ParentHash(), block.NumberU64()-1)
if parent == nil {
return nil, vm.Context{}, nil, fmt.Errorf("block parent %x not found", block.ParentHash())
}
statedb, err := api.eth.BlockChain().StateAt(parent.Root())
statedb, err := api.brn.BlockChain().StateAt(parent.Root())
if err != nil {
return nil, vm.Context{}, nil, err
}
@ -564,7 +564,7 @@ func (api *PrivateDebugAPI) computeTxEnv(blockHash common.Hash, txIndex int) (co
for idx, tx := range txs {
// Assemble the transaction call message
msg, _ := tx.AsMessage(signer)
context := core.NewEVMContext(msg, block.Header(), api.eth.BlockChain(), nil)
context := core.NewEVMContext(msg, block.Header(), api.brn.BlockChain(), nil)
if idx == txIndex {
return msg, context, statedb, nil
}
@ -582,14 +582,14 @@ func (api *PrivateDebugAPI) computeTxEnv(blockHash common.Hash, txIndex int) (co
// Preimage is a debug API function that returns the preimage for a sha3 hash, if known.
func (api *PrivateDebugAPI) Preimage(ctx context.Context, hash common.Hash) (hexutil.Bytes, error) {
db := core.PreimageTable(api.eth.ChainDb())
db := core.PreimageTable(api.brn.ChainDb())
return db.Get(hash.Bytes())
}
// GetBadBLocks returns a list of the last 'bad blocks' that the client has seen on the network
// and returns them as a JSON list of block-hashes
func (api *PrivateDebugAPI) GetBadBlocks(ctx context.Context) ([]core.BadBlockArgs, error) {
return api.eth.BlockChain().BadBlocks()
return api.brn.BlockChain().BadBlocks()
}
// StorageRangeResult is the result of a debug_storageRangeAt API call.

View file

@ -1,90 +1,90 @@
// Copyright 2015 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2015 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
package eth
package brn
import (
"context"
"math/big"
"github.com/ethereum/go-ethereum/accounts"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/math"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/bloombits"
"github.com/ethereum/go-ethereum/core/state"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/core/vm"
"github.com/ethereum/go-ethereum/eth/downloader"
"github.com/ethereum/go-ethereum/eth/gasprice"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/params"
"github.com/ethereum/go-ethereum/rpc"
"github.com/burnout/go-burnout/accounts"
"github.com/burnout/go-burnout/common"
"github.com/burnout/go-burnout/common/math"
"github.com/burnout/go-burnout/core"
"github.com/burnout/go-burnout/core/bloombits"
"github.com/burnout/go-burnout/core/state"
"github.com/burnout/go-burnout/core/types"
"github.com/burnout/go-burnout/core/vm"
"github.com/burnout/go-burnout/brn/downloader"
"github.com/burnout/go-burnout/brn/gasprice"
"github.com/burnout/go-burnout/brndb"
"github.com/burnout/go-burnout/event"
"github.com/burnout/go-burnout/params"
"github.com/burnout/go-burnout/rpc"
)
// EthApiBackend implements ethapi.Backend for full nodes
type EthApiBackend struct {
eth *Ethereum
brn *Burnout
gpo *gasprice.Oracle
}
func (b *EthApiBackend) ChainConfig() *params.ChainConfig {
return b.eth.chainConfig
return b.brn.chainConfig
}
func (b *EthApiBackend) CurrentBlock() *types.Block {
return b.eth.blockchain.CurrentBlock()
return b.brn.blockchain.CurrentBlock()
}
func (b *EthApiBackend) SetHead(number uint64) {
b.eth.protocolManager.downloader.Cancel()
b.eth.blockchain.SetHead(number)
b.brn.protocolManager.downloader.Cancel()
b.brn.blockchain.SetHead(number)
}
func (b *EthApiBackend) HeaderByNumber(ctx context.Context, blockNr rpc.BlockNumber) (*types.Header, error) {
// Pending block is only known by the miner
if blockNr == rpc.PendingBlockNumber {
block := b.eth.miner.PendingBlock()
block := b.brn.miner.PendingBlock()
return block.Header(), nil
}
// Otherwise resolve and return the block
if blockNr == rpc.LatestBlockNumber {
return b.eth.blockchain.CurrentBlock().Header(), nil
return b.brn.blockchain.CurrentBlock().Header(), nil
}
return b.eth.blockchain.GetHeaderByNumber(uint64(blockNr)), nil
return b.brn.blockchain.GetHeaderByNumber(uint64(blockNr)), nil
}
func (b *EthApiBackend) BlockByNumber(ctx context.Context, blockNr rpc.BlockNumber) (*types.Block, error) {
// Pending block is only known by the miner
if blockNr == rpc.PendingBlockNumber {
block := b.eth.miner.PendingBlock()
block := b.brn.miner.PendingBlock()
return block, nil
}
// Otherwise resolve and return the block
if blockNr == rpc.LatestBlockNumber {
return b.eth.blockchain.CurrentBlock(), nil
return b.brn.blockchain.CurrentBlock(), nil
}
return b.eth.blockchain.GetBlockByNumber(uint64(blockNr)), nil
return b.brn.blockchain.GetBlockByNumber(uint64(blockNr)), nil
}
func (b *EthApiBackend) StateAndHeaderByNumber(ctx context.Context, blockNr rpc.BlockNumber) (*state.StateDB, *types.Header, error) {
// Pending state is only known by the miner
if blockNr == rpc.PendingBlockNumber {
block, state := b.eth.miner.Pending()
block, state := b.brn.miner.Pending()
return state, block.Header(), nil
}
// Otherwise resolve the block number and return its state
@ -92,56 +92,56 @@ func (b *EthApiBackend) StateAndHeaderByNumber(ctx context.Context, blockNr rpc.
if header == nil || err != nil {
return nil, nil, err
}
stateDb, err := b.eth.BlockChain().StateAt(header.Root)
stateDb, err := b.brn.BlockChain().StateAt(header.Root)
return stateDb, header, err
}
func (b *EthApiBackend) GetBlock(ctx context.Context, blockHash common.Hash) (*types.Block, error) {
return b.eth.blockchain.GetBlockByHash(blockHash), nil
return b.brn.blockchain.GetBlockByHash(blockHash), nil
}
func (b *EthApiBackend) GetReceipts(ctx context.Context, blockHash common.Hash) (types.Receipts, error) {
return core.GetBlockReceipts(b.eth.chainDb, blockHash, core.GetBlockNumber(b.eth.chainDb, blockHash)), nil
return core.GetBlockReceipts(b.brn.chainDb, blockHash, core.GetBlockNumber(b.brn.chainDb, blockHash)), nil
}
func (b *EthApiBackend) GetTd(blockHash common.Hash) *big.Int {
return b.eth.blockchain.GetTdByHash(blockHash)
return b.brn.blockchain.GetTdByHash(blockHash)
}
func (b *EthApiBackend) GetEVM(ctx context.Context, msg core.Message, state *state.StateDB, header *types.Header, vmCfg vm.Config) (*vm.EVM, func() error, error) {
state.SetBalance(msg.From(), math.MaxBig256)
vmError := func() error { return nil }
context := core.NewEVMContext(msg, header, b.eth.BlockChain(), nil)
return vm.NewEVM(context, state, b.eth.chainConfig, vmCfg), vmError, nil
context := core.NewEVMContext(msg, header, b.brn.BlockChain(), nil)
return vm.NewEVM(context, state, b.brn.chainConfig, vmCfg), vmError, nil
}
func (b *EthApiBackend) SubscribeRemovedLogsEvent(ch chan<- core.RemovedLogsEvent) event.Subscription {
return b.eth.BlockChain().SubscribeRemovedLogsEvent(ch)
return b.brn.BlockChain().SubscribeRemovedLogsEvent(ch)
}
func (b *EthApiBackend) SubscribeChainEvent(ch chan<- core.ChainEvent) event.Subscription {
return b.eth.BlockChain().SubscribeChainEvent(ch)
return b.brn.BlockChain().SubscribeChainEvent(ch)
}
func (b *EthApiBackend) SubscribeChainHeadEvent(ch chan<- core.ChainHeadEvent) event.Subscription {
return b.eth.BlockChain().SubscribeChainHeadEvent(ch)
return b.brn.BlockChain().SubscribeChainHeadEvent(ch)
}
func (b *EthApiBackend) SubscribeChainSideEvent(ch chan<- core.ChainSideEvent) event.Subscription {
return b.eth.BlockChain().SubscribeChainSideEvent(ch)
return b.brn.BlockChain().SubscribeChainSideEvent(ch)
}
func (b *EthApiBackend) SubscribeLogsEvent(ch chan<- []*types.Log) event.Subscription {
return b.eth.BlockChain().SubscribeLogsEvent(ch)
return b.brn.BlockChain().SubscribeLogsEvent(ch)
}
func (b *EthApiBackend) SendTx(ctx context.Context, signedTx *types.Transaction) error {
return b.eth.txPool.AddLocal(signedTx)
return b.brn.txPool.AddLocal(signedTx)
}
func (b *EthApiBackend) GetPoolTransactions() (types.Transactions, error) {
pending, err := b.eth.txPool.Pending()
pending, err := b.brn.txPool.Pending()
if err != nil {
return nil, err
}
@ -153,56 +153,56 @@ func (b *EthApiBackend) GetPoolTransactions() (types.Transactions, error) {
}
func (b *EthApiBackend) GetPoolTransaction(hash common.Hash) *types.Transaction {
return b.eth.txPool.Get(hash)
return b.brn.txPool.Get(hash)
}
func (b *EthApiBackend) GetPoolNonce(ctx context.Context, addr common.Address) (uint64, error) {
return b.eth.txPool.State().GetNonce(addr), nil
return b.brn.txPool.State().GetNonce(addr), nil
}
func (b *EthApiBackend) Stats() (pending int, queued int) {
return b.eth.txPool.Stats()
return b.brn.txPool.Stats()
}
func (b *EthApiBackend) TxPoolContent() (map[common.Address]types.Transactions, map[common.Address]types.Transactions) {
return b.eth.TxPool().Content()
return b.brn.TxPool().Content()
}
func (b *EthApiBackend) SubscribeTxPreEvent(ch chan<- core.TxPreEvent) event.Subscription {
return b.eth.TxPool().SubscribeTxPreEvent(ch)
return b.brn.TxPool().SubscribeTxPreEvent(ch)
}
func (b *EthApiBackend) Downloader() *downloader.Downloader {
return b.eth.Downloader()
return b.brn.Downloader()
}
func (b *EthApiBackend) ProtocolVersion() int {
return b.eth.EthVersion()
return b.brn.EthVersion()
}
func (b *EthApiBackend) SuggestPrice(ctx context.Context) (*big.Int, error) {
return b.gpo.SuggestPrice(ctx)
}
func (b *EthApiBackend) ChainDb() ethdb.Database {
return b.eth.ChainDb()
func (b *EthApiBackend) ChainDb() brndb.Database {
return b.brn.ChainDb()
}
func (b *EthApiBackend) EventMux() *event.TypeMux {
return b.eth.EventMux()
return b.brn.EventMux()
}
func (b *EthApiBackend) AccountManager() *accounts.Manager {
return b.eth.AccountManager()
return b.brn.AccountManager()
}
func (b *EthApiBackend) BloomStatus() (uint64, uint64) {
sections, _, _ := b.eth.bloomIndexer.Sections()
sections, _, _ := b.brn.bloomIndexer.Sections()
return params.BloomBitsBlocks, sections
}
func (b *EthApiBackend) ServiceFilter(ctx context.Context, session *bloombits.MatcherSession) {
for i := 0; i < bloomFilterThreads; i++ {
go session.Multiplex(bloomRetrievalBatch, bloomRetrievalWait, b.eth.bloomRequests)
go session.Multiplex(bloomRetrievalBatch, bloomRetrievalWait, b.brn.bloomRequests)
}
}

View file

@ -1,29 +1,29 @@
// Copyright 2016 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2016 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
package eth
package brn
import (
"reflect"
"testing"
"github.com/davecgh/go-spew/spew"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/state"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/burnout/go-burnout/common"
"github.com/burnout/go-burnout/core/state"
"github.com/burnout/go-burnout/brndb"
)
var dumper = spew.ConfigState{Indent: " "}
@ -31,7 +31,7 @@ var dumper = spew.ConfigState{Indent: " "}
func TestStorageRangeAt(t *testing.T) {
// Create a state where account 0x010000... has a few storage entries.
var (
db, _ = ethdb.NewMemDatabase()
db, _ = brndb.NewMemDatabase()
state, _ = state.New(common.Hash{}, state.NewDatabase(db))
addr = common.Address{0x01}
keys = []common.Hash{ // hashes of Keys of storage

View file

@ -1,21 +1,21 @@
// Copyright 2014 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2014 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
// Package eth implements the Ethereum protocol.
package eth
// Package brn implements the Burnout protocol.
package brn
import (
"errors"
@ -25,29 +25,29 @@ import (
"sync"
"sync/atomic"
"github.com/ethereum/go-ethereum/accounts"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/consensus"
"github.com/ethereum/go-ethereum/consensus/clique"
"github.com/ethereum/go-ethereum/consensus/ethash"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/bloombits"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/core/vm"
"github.com/ethereum/go-ethereum/eth/downloader"
"github.com/ethereum/go-ethereum/eth/filters"
"github.com/ethereum/go-ethereum/eth/gasprice"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/internal/ethapi"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/miner"
"github.com/ethereum/go-ethereum/node"
"github.com/ethereum/go-ethereum/p2p"
"github.com/ethereum/go-ethereum/params"
"github.com/ethereum/go-ethereum/rlp"
"github.com/ethereum/go-ethereum/rpc"
"github.com/burnout/go-burnout/accounts"
"github.com/burnout/go-burnout/common"
"github.com/burnout/go-burnout/common/hexutil"
"github.com/burnout/go-burnout/consensus"
"github.com/burnout/go-burnout/consensus/clique"
"github.com/burnout/go-burnout/consensus/ethash"
"github.com/burnout/go-burnout/core"
"github.com/burnout/go-burnout/core/bloombits"
"github.com/burnout/go-burnout/core/types"
"github.com/burnout/go-burnout/core/vm"
"github.com/burnout/go-burnout/brn/downloader"
"github.com/burnout/go-burnout/brn/filters"
"github.com/burnout/go-burnout/brn/gasprice"
"github.com/burnout/go-burnout/brndb"
"github.com/burnout/go-burnout/event"
"github.com/burnout/go-burnout/internal/ethapi"
"github.com/burnout/go-burnout/log"
"github.com/burnout/go-burnout/miner"
"github.com/burnout/go-burnout/node"
"github.com/burnout/go-burnout/p2p"
"github.com/burnout/go-burnout/params"
"github.com/burnout/go-burnout/rlp"
"github.com/burnout/go-burnout/rpc"
)
type LesServer interface {
@ -56,13 +56,13 @@ type LesServer interface {
Protocols() []p2p.Protocol
}
// Ethereum implements the Ethereum full node service.
type Ethereum struct {
// Burnout implements the Burnout full node service.
type Burnout struct {
config *Config
chainConfig *params.ChainConfig
// Channel for shutting down the service
shutdownChan chan bool // Channel for shutting down the ethereum
shutdownChan chan bool // Channel for shutting down the burnout
stopDbUpgrade func() error // stop chain db sequential key upgrade
// Handlers
@ -72,7 +72,7 @@ type Ethereum struct {
lesServer LesServer
// DB interfaces
chainDb ethdb.Database // Block chain database
chainDb brndb.Database // Block chain database
eventMux *event.TypeMux
engine consensus.Engine
@ -93,15 +93,15 @@ type Ethereum struct {
lock sync.RWMutex // Protects the variadic fields (e.g. gas price and etherbase)
}
func (s *Ethereum) AddLesServer(ls LesServer) {
func (s *Burnout) AddLesServer(ls LesServer) {
s.lesServer = ls
}
// New creates a new Ethereum object (including the
// initialisation of the common Ethereum object)
func New(ctx *node.ServiceContext, config *Config) (*Ethereum, error) {
// New creates a new Burnout object (including the
// initialisation of the common Burnout object)
func New(ctx *node.ServiceContext, config *Config) (*Burnout, error) {
if config.SyncMode == downloader.LightSync {
return nil, errors.New("can't run eth.Ethereum in light sync mode, use les.LightEthereum")
return nil, errors.New("can't run brn.Burnout in light sync mode, use les.LightBurnout")
}
if !config.SyncMode.IsValid() {
return nil, fmt.Errorf("invalid sync mode %d", config.SyncMode)
@ -117,7 +117,7 @@ func New(ctx *node.ServiceContext, config *Config) (*Ethereum, error) {
}
log.Info("Initialised chain configuration", "config", chainConfig)
eth := &Ethereum{
brn := &Burnout{
config: config,
chainDb: chainDb,
chainConfig: chainConfig,
@ -133,7 +133,7 @@ func New(ctx *node.ServiceContext, config *Config) (*Ethereum, error) {
bloomIndexer: NewBloomIndexer(chainDb, params.BloomBitsBlocks),
}
log.Info("Initialising Ethereum protocol", "versions", ProtocolVersions, "network", config.NetworkId)
log.Info("Initialising Burnout protocol", "versions", ProtocolVersions, "network", config.NetworkId)
if !config.SkipBcVersionCheck {
bcVersion := core.GetBlockChainVersion(chainDb)
@ -144,37 +144,37 @@ func New(ctx *node.ServiceContext, config *Config) (*Ethereum, error) {
}
vmConfig := vm.Config{EnablePreimageRecording: config.EnablePreimageRecording}
eth.blockchain, err = core.NewBlockChain(chainDb, eth.chainConfig, eth.engine, vmConfig)
brn.blockchain, err = core.NewBlockChain(chainDb, brn.chainConfig, brn.engine, vmConfig)
if err != nil {
return nil, err
}
// Rewind the chain in case of an incompatible config upgrade.
if compat, ok := genesisErr.(*params.ConfigCompatError); ok {
log.Warn("Rewinding chain to upgrade configuration", "err", compat)
eth.blockchain.SetHead(compat.RewindTo)
brn.blockchain.SetHead(compat.RewindTo)
core.WriteChainConfig(chainDb, genesisHash, chainConfig)
}
eth.bloomIndexer.Start(eth.blockchain.CurrentHeader(), eth.blockchain.SubscribeChainEvent)
brn.bloomIndexer.Start(brn.blockchain.CurrentHeader(), brn.blockchain.SubscribeChainEvent)
if config.TxPool.Journal != "" {
config.TxPool.Journal = ctx.ResolvePath(config.TxPool.Journal)
}
eth.txPool = core.NewTxPool(config.TxPool, eth.chainConfig, eth.blockchain)
brn.txPool = core.NewTxPool(config.TxPool, brn.chainConfig, brn.blockchain)
if eth.protocolManager, err = NewProtocolManager(eth.chainConfig, config.SyncMode, config.NetworkId, eth.eventMux, eth.txPool, eth.engine, eth.blockchain, chainDb); err != nil {
if brn.protocolManager, err = NewProtocolManager(brn.chainConfig, config.SyncMode, config.NetworkId, brn.eventMux, brn.txPool, brn.engine, brn.blockchain, chainDb); err != nil {
return nil, err
}
eth.miner = miner.New(eth, eth.chainConfig, eth.EventMux(), eth.engine)
eth.miner.SetExtra(makeExtraData(config.ExtraData))
brn.miner = miner.New(brn, brn.chainConfig, brn.EventMux(), brn.engine)
brn.miner.SetExtra(makeExtraData(config.ExtraData))
eth.ApiBackend = &EthApiBackend{eth, nil}
brn.ApiBackend = &EthApiBackend{brn, nil}
gpoParams := config.GPO
if gpoParams.Default == nil {
gpoParams.Default = config.GasPrice
}
eth.ApiBackend.gpo = gasprice.NewOracle(eth.ApiBackend, gpoParams)
brn.ApiBackend.gpo = gasprice.NewOracle(brn.ApiBackend, gpoParams)
return eth, nil
return brn, nil
}
func makeExtraData(extra []byte) []byte {
@ -195,19 +195,19 @@ func makeExtraData(extra []byte) []byte {
}
// CreateDB creates the chain database.
func CreateDB(ctx *node.ServiceContext, config *Config, name string) (ethdb.Database, error) {
func CreateDB(ctx *node.ServiceContext, config *Config, name string) (brndb.Database, error) {
db, err := ctx.OpenDatabase(name, config.DatabaseCache, config.DatabaseHandles)
if err != nil {
return nil, err
}
if db, ok := db.(*ethdb.LDBDatabase); ok {
db.Meter("eth/db/chaindata/")
if db, ok := db.(*brndb.LDBDatabase); ok {
db.Meter("brn/db/chaindata/")
}
return db, nil
}
// CreateConsensusEngine creates the required type of consensus engine instance for an Ethereum service
func CreateConsensusEngine(ctx *node.ServiceContext, config *Config, chainConfig *params.ChainConfig, db ethdb.Database) consensus.Engine {
// CreateConsensusEngine creates the required type of consensus engine instance for an Burnout service
func CreateConsensusEngine(ctx *node.ServiceContext, config *Config, chainConfig *params.ChainConfig, db brndb.Database) consensus.Engine {
// If proof-of-authority is requested, set it up
if chainConfig.Clique != nil {
return clique.New(chainConfig.Clique, db)
@ -231,9 +231,9 @@ func CreateConsensusEngine(ctx *node.ServiceContext, config *Config, chainConfig
}
}
// APIs returns the collection of RPC services the ethereum package offers.
// APIs returns the collection of RPC services the burnout package offers.
// NOTE, some of these services probably need to be moved to somewhere else.
func (s *Ethereum) APIs() []rpc.API {
func (s *Burnout) APIs() []rpc.API {
apis := ethapi.GetAPIs(s.ApiBackend)
// Append any APIs exposed explicitly by the consensus engine
@ -242,17 +242,17 @@ func (s *Ethereum) APIs() []rpc.API {
// Append all the local APIs and return
return append(apis, []rpc.API{
{
Namespace: "eth",
Namespace: "brn",
Version: "1.0",
Service: NewPublicEthereumAPI(s),
Service: NewPublicBurnoutAPI(s),
Public: true,
}, {
Namespace: "eth",
Namespace: "brn",
Version: "1.0",
Service: NewPublicMinerAPI(s),
Public: true,
}, {
Namespace: "eth",
Namespace: "brn",
Version: "1.0",
Service: downloader.NewPublicDownloaderAPI(s.protocolManager.downloader, s.eventMux),
Public: true,
@ -262,7 +262,7 @@ func (s *Ethereum) APIs() []rpc.API {
Service: NewPrivateMinerAPI(s),
Public: false,
}, {
Namespace: "eth",
Namespace: "brn",
Version: "1.0",
Service: filters.NewPublicFilterAPI(s.ApiBackend, false),
Public: true,
@ -288,11 +288,11 @@ func (s *Ethereum) APIs() []rpc.API {
}...)
}
func (s *Ethereum) ResetWithGenesisBlock(gb *types.Block) {
func (s *Burnout) ResetWithGenesisBlock(gb *types.Block) {
s.blockchain.ResetWithGenesisBlock(gb)
}
func (s *Ethereum) Etherbase() (eb common.Address, err error) {
func (s *Burnout) Etherbase() (eb common.Address, err error) {
s.lock.RLock()
etherbase := s.etherbase
s.lock.RUnlock()
@ -309,7 +309,7 @@ func (s *Ethereum) Etherbase() (eb common.Address, err error) {
}
// set in js console via admin interface or wrapper from cli flags
func (self *Ethereum) SetEtherbase(etherbase common.Address) {
func (self *Burnout) SetEtherbase(etherbase common.Address) {
self.lock.Lock()
self.etherbase = etherbase
self.lock.Unlock()
@ -317,7 +317,7 @@ func (self *Ethereum) SetEtherbase(etherbase common.Address) {
self.miner.SetEtherbase(etherbase)
}
func (s *Ethereum) StartMining(local bool) error {
func (s *Burnout) StartMining(local bool) error {
eb, err := s.Etherbase()
if err != nil {
log.Error("Cannot start mining without etherbase", "err", err)
@ -342,24 +342,24 @@ func (s *Ethereum) StartMining(local bool) error {
return nil
}
func (s *Ethereum) StopMining() { s.miner.Stop() }
func (s *Ethereum) IsMining() bool { return s.miner.Mining() }
func (s *Ethereum) Miner() *miner.Miner { return s.miner }
func (s *Burnout) StopMining() { s.miner.Stop() }
func (s *Burnout) IsMining() bool { return s.miner.Mining() }
func (s *Burnout) Miner() *miner.Miner { return s.miner }
func (s *Ethereum) AccountManager() *accounts.Manager { return s.accountManager }
func (s *Ethereum) BlockChain() *core.BlockChain { return s.blockchain }
func (s *Ethereum) TxPool() *core.TxPool { return s.txPool }
func (s *Ethereum) EventMux() *event.TypeMux { return s.eventMux }
func (s *Ethereum) Engine() consensus.Engine { return s.engine }
func (s *Ethereum) ChainDb() ethdb.Database { return s.chainDb }
func (s *Ethereum) IsListening() bool { return true } // Always listening
func (s *Ethereum) EthVersion() int { return int(s.protocolManager.SubProtocols[0].Version) }
func (s *Ethereum) NetVersion() uint64 { return s.networkId }
func (s *Ethereum) Downloader() *downloader.Downloader { return s.protocolManager.downloader }
func (s *Burnout) AccountManager() *accounts.Manager { return s.accountManager }
func (s *Burnout) BlockChain() *core.BlockChain { return s.blockchain }
func (s *Burnout) TxPool() *core.TxPool { return s.txPool }
func (s *Burnout) EventMux() *event.TypeMux { return s.eventMux }
func (s *Burnout) Engine() consensus.Engine { return s.engine }
func (s *Burnout) ChainDb() brndb.Database { return s.chainDb }
func (s *Burnout) IsListening() bool { return true } // Always listening
func (s *Burnout) EthVersion() int { return int(s.protocolManager.SubProtocols[0].Version) }
func (s *Burnout) NetVersion() uint64 { return s.networkId }
func (s *Burnout) Downloader() *downloader.Downloader { return s.protocolManager.downloader }
// Protocols implements node.Service, returning all the currently configured
// network protocols to start.
func (s *Ethereum) Protocols() []p2p.Protocol {
func (s *Burnout) Protocols() []p2p.Protocol {
if s.lesServer == nil {
return s.protocolManager.SubProtocols
}
@ -367,8 +367,8 @@ func (s *Ethereum) Protocols() []p2p.Protocol {
}
// Start implements node.Service, starting all internal goroutines needed by the
// Ethereum protocol implementation.
func (s *Ethereum) Start(srvr *p2p.Server) error {
// Burnout protocol implementation.
func (s *Burnout) Start(srvr *p2p.Server) error {
// Start the bloom bits servicing goroutines
s.startBloomHandlers()
@ -392,8 +392,8 @@ func (s *Ethereum) Start(srvr *p2p.Server) error {
}
// Stop implements node.Service, terminating all internal goroutines used by the
// Ethereum protocol.
func (s *Ethereum) Stop() error {
// Burnout protocol.
func (s *Burnout) Stop() error {
if s.stopDbUpgrade != nil {
s.stopDbUpgrade()
}

View file

@ -1,52 +1,52 @@
// Copyright 2015 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2015 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
package eth
package brn
import (
"context"
"math/big"
"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/internal/ethapi"
"github.com/ethereum/go-ethereum/rlp"
"github.com/ethereum/go-ethereum/rpc"
"github.com/burnout/go-burnout"
"github.com/burnout/go-burnout/common"
"github.com/burnout/go-burnout/common/hexutil"
"github.com/burnout/go-burnout/core/types"
"github.com/burnout/go-burnout/internal/ethapi"
"github.com/burnout/go-burnout/rlp"
"github.com/burnout/go-burnout/rpc"
)
// ContractBackend implements bind.ContractBackend with direct calls to Ethereum
// internals to support operating on contracts within subprotocols like eth and
// ContractBackend implements bind.ContractBackend with direct calls to Burnout
// internals to support operating on contracts within subprotocols like brn and
// swarm.
//
// Internally this backend uses the already exposed API endpoints of the Ethereum
// Internally this backend uses the already exposed API endpoints of the Burnout
// object. These should be rewritten to internal Go method calls when the Go API
// is refactored to support a clean library use.
type ContractBackend struct {
eapi *ethapi.PublicEthereumAPI // Wrapper around the Ethereum object to access metadata
eapi *ethapi.PublicBurnoutAPI // Wrapper around the Burnout object to access metadata
bcapi *ethapi.PublicBlockChainAPI // Wrapper around the blockchain to access chain data
txapi *ethapi.PublicTransactionPoolAPI // Wrapper around the transaction pool to access transaction data
}
// NewContractBackend creates a new native contract backend using an existing
// Ethereum object.
// Burnout object.
func NewContractBackend(apiBackend ethapi.Backend) *ContractBackend {
return &ContractBackend{
eapi: ethapi.NewPublicEthereumAPI(apiBackend),
eapi: ethapi.NewPublicBurnoutAPI(apiBackend),
bcapi: ethapi.NewPublicBlockChainAPI(apiBackend),
txapi: ethapi.NewPublicTransactionPoolAPI(apiBackend, new(ethapi.AddrLocker)),
}
@ -62,23 +62,23 @@ func (b *ContractBackend) PendingCodeAt(ctx context.Context, contract common.Add
return b.bcapi.GetCode(ctx, contract, rpc.PendingBlockNumber)
}
// ContractCall implements bind.ContractCaller executing an Ethereum contract
// ContractCall implements bind.ContractCaller executing an Burnout contract
// call with the specified data as the input. The pending flag requests execution
// against the pending block, not the stable head of the chain.
func (b *ContractBackend) CallContract(ctx context.Context, msg ethereum.CallMsg, blockNum *big.Int) ([]byte, error) {
func (b *ContractBackend) CallContract(ctx context.Context, msg burnout.CallMsg, blockNum *big.Int) ([]byte, error) {
out, err := b.bcapi.Call(ctx, toCallArgs(msg), toBlockNumber(blockNum))
return out, err
}
// ContractCall implements bind.ContractCaller executing an Ethereum contract
// ContractCall implements bind.ContractCaller executing an Burnout contract
// call with the specified data as the input. The pending flag requests execution
// against the pending block, not the stable head of the chain.
func (b *ContractBackend) PendingCallContract(ctx context.Context, msg ethereum.CallMsg) ([]byte, error) {
func (b *ContractBackend) PendingCallContract(ctx context.Context, msg burnout.CallMsg) ([]byte, error) {
out, err := b.bcapi.Call(ctx, toCallArgs(msg), rpc.PendingBlockNumber)
return out, err
}
func toCallArgs(msg ethereum.CallMsg) ethapi.CallArgs {
func toCallArgs(msg burnout.CallMsg) ethapi.CallArgs {
args := ethapi.CallArgs{
To: msg.To,
From: msg.From,
@ -124,7 +124,7 @@ func (b *ContractBackend) SuggestGasPrice(ctx context.Context) (*big.Int, error)
// the backend blockchain. There is no guarantee that this is the true gas limit
// requirement as other transactions may be added or removed by miners, but it
// should provide a basis for setting a reasonable default.
func (b *ContractBackend) EstimateGas(ctx context.Context, msg ethereum.CallMsg) (*big.Int, error) {
func (b *ContractBackend) EstimateGas(ctx context.Context, msg burnout.CallMsg) (*big.Int, error) {
out, err := b.bcapi.EstimateGas(ctx, toCallArgs(msg))
return out.ToInt(), err
}

View file

@ -1,35 +1,35 @@
// Copyright 2017 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2017 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
package eth
package brn
import (
"time"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/bitutil"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/bloombits"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/params"
"github.com/burnout/go-burnout/common"
"github.com/burnout/go-burnout/common/bitutil"
"github.com/burnout/go-burnout/core"
"github.com/burnout/go-burnout/core/bloombits"
"github.com/burnout/go-burnout/core/types"
"github.com/burnout/go-burnout/brndb"
"github.com/burnout/go-burnout/params"
)
const (
// bloomServiceThreads is the number of goroutines used globally by an Ethereum
// bloomServiceThreads is the number of goroutines used globally by an Burnout
// instance to service bloombits lookups for all running filters.
bloomServiceThreads = 16
@ -48,21 +48,21 @@ const (
// startBloomHandlers starts a batch of goroutines to accept bloom bit database
// retrievals from possibly a range of filters and serving the data to satisfy.
func (eth *Ethereum) startBloomHandlers() {
func (brn *Burnout) startBloomHandlers() {
for i := 0; i < bloomServiceThreads; i++ {
go func() {
for {
select {
case <-eth.shutdownChan:
case <-brn.shutdownChan:
return
case request := <-eth.bloomRequests:
case request := <-brn.bloomRequests:
task := <-request
task.Bitsets = make([][]byte, len(task.Sections))
for i, section := range task.Sections {
head := core.GetCanonicalHash(eth.chainDb, (section+1)*params.BloomBitsBlocks-1)
blob, err := bitutil.DecompressBytes(core.GetBloomBits(eth.chainDb, task.Bit, section, head), int(params.BloomBitsBlocks)/8)
head := core.GetCanonicalHash(brn.chainDb, (section+1)*params.BloomBitsBlocks-1)
blob, err := bitutil.DecompressBytes(core.GetBloomBits(brn.chainDb, task.Bit, section, head), int(params.BloomBitsBlocks)/8)
if err != nil {
panic(err)
}
@ -86,11 +86,11 @@ const (
)
// BloomIndexer implements a core.ChainIndexer, building up a rotated bloom bits index
// for the Ethereum header bloom filters, permitting blazing fast filtering.
// for the Burnout header bloom filters, permitting blazing fast filtering.
type BloomIndexer struct {
size uint64 // section size to generate bloombits for
db ethdb.Database // database instance to write index data and metadata into
db brndb.Database // database instance to write index data and metadata into
gen *bloombits.Generator // generator to rotate the bloom bits crating the bloom index
section uint64 // Section is the section number being processed currently
@ -99,12 +99,12 @@ type BloomIndexer struct {
// NewBloomIndexer returns a chain indexer that generates bloom bits data for the
// canonical chain for fast logs filtering.
func NewBloomIndexer(db ethdb.Database, size uint64) *core.ChainIndexer {
func NewBloomIndexer(db brndb.Database, size uint64) *core.ChainIndexer {
backend := &BloomIndexer{
db: db,
size: size,
}
table := ethdb.NewTable(db, string(core.BloomBitsIndexPrefix))
table := brndb.NewTable(db, string(core.BloomBitsIndexPrefix))
return core.NewChainIndexer(db, table, backend, size, bloomConfirms, bloomThrottling, "bloombits")
}

View file

@ -1,20 +1,20 @@
// Copyright 2017 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2017 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
package eth
package brn
import (
"math/big"
@ -23,15 +23,15 @@ import (
"path/filepath"
"runtime"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/eth/downloader"
"github.com/ethereum/go-ethereum/eth/gasprice"
"github.com/ethereum/go-ethereum/params"
"github.com/burnout/go-burnout/common"
"github.com/burnout/go-burnout/common/hexutil"
"github.com/burnout/go-burnout/core"
"github.com/burnout/go-burnout/brn/downloader"
"github.com/burnout/go-burnout/brn/gasprice"
"github.com/burnout/go-burnout/params"
)
// DefaultConfig contains default settings for use on the Ethereum main net.
// DefaultConfig contains default settings for use on the Burnout main net.
var DefaultConfig = Config{
SyncMode: downloader.FastSync,
EthashCacheDir: "ethash",
@ -69,7 +69,7 @@ func init() {
type Config struct {
// The genesis block, which is inserted if the database is empty.
// If nil, the Ethereum main net block is used.
// If nil, the Burnout main net block is used.
Genesis *core.Genesis `toml:",omitempty"`
// Protocol options

View file

@ -1,31 +1,31 @@
// Copyright 2016 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2016 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
// Package eth implements the Ethereum protocol.
package eth
// Package brn implements the Burnout protocol.
package brn
import (
"bytes"
"time"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/rlp"
"github.com/burnout/go-burnout/common"
"github.com/burnout/go-burnout/core"
"github.com/burnout/go-burnout/brndb"
"github.com/burnout/go-burnout/log"
"github.com/burnout/go-burnout/rlp"
)
var deduplicateData = []byte("dbUpgrade_20170714deduplicateData")
@ -34,7 +34,7 @@ var deduplicateData = []byte("dbUpgrade_20170714deduplicateData")
// starts a background process to make upgrades if necessary.
// Returns a stop function that blocks until the process has
// been safely stopped.
func upgradeDeduplicateData(db ethdb.Database) func() error {
func upgradeDeduplicateData(db brndb.Database) func() error {
// If the database is already converted or empty, bail out
data, _ := db.Get(deduplicateData)
if len(data) > 0 && data[0] == 42 {
@ -50,7 +50,7 @@ func upgradeDeduplicateData(db ethdb.Database) func() error {
go func() {
// Create an iterator to read the entire database and covert old lookup entires
it := db.(*ethdb.LDBDatabase).NewIterator()
it := db.(*brndb.LDBDatabase).NewIterator()
defer func() {
if it != nil {
it.Release()
@ -100,7 +100,7 @@ func upgradeDeduplicateData(db ethdb.Database) func() error {
converted++
if converted%100000 == 0 {
it.Release()
it = db.(*ethdb.LDBDatabase).NewIterator()
it = db.(*brndb.LDBDatabase).NewIterator()
it.Seek(key)
log.Info("Deduplicating database entries", "deduped", converted)

View file

@ -1,18 +1,18 @@
// Copyright 2015 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2015 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
package downloader
@ -20,9 +20,9 @@ import (
"context"
"sync"
ethereum "github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/rpc"
burnout "github.com/burnout/go-burnout"
"github.com/burnout/go-burnout/event"
"github.com/burnout/go-burnout/rpc"
)
// PublicDownloaderAPI provides an API which gives information about the current synchronisation status.
@ -89,7 +89,7 @@ func (api *PublicDownloaderAPI) eventLoop() {
}
}
// Syncing provides information when this nodes starts synchronising with the Ethereum network and when it's finished.
// Syncing provides information when this nodes starts synchronising with the Burnout network and when it's finished.
func (api *PublicDownloaderAPI) Syncing(ctx context.Context) (*rpc.Subscription, error) {
notifier, supported := rpc.NotifierFromContext(ctx)
if !supported {
@ -122,7 +122,7 @@ func (api *PublicDownloaderAPI) Syncing(ctx context.Context) (*rpc.Subscription,
// SyncingResult provides information about the current synchronisation status for this node.
type SyncingResult struct {
Syncing bool `json:"syncing"`
Status ethereum.SyncProgress `json:"status"`
Status burnout.SyncProgress `json:"status"`
}
// uninstallSyncSubscriptionRequest uninstalles a syncing subscription in the API event loop.

View file

@ -1,18 +1,18 @@
// Copyright 2015 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2015 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
// Package downloader contains the manual full chain synchronisation.
package downloader
@ -27,13 +27,13 @@ import (
"sync/atomic"
"time"
ethereum "github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/params"
burnout "github.com/burnout/go-burnout"
"github.com/burnout/go-burnout/common"
"github.com/burnout/go-burnout/core/types"
"github.com/burnout/go-burnout/brndb"
"github.com/burnout/go-burnout/event"
"github.com/burnout/go-burnout/log"
"github.com/burnout/go-burnout/params"
"github.com/rcrowley/go-metrics"
)
@ -57,7 +57,7 @@ var (
qosConfidenceCap = 10 // Number of peers above which not to modify RTT confidence
qosTuningImpact = 0.25 // Impact that a new tuning target has on the previous value
maxQueuedHeaders = 32 * 1024 // [eth/62] Maximum number of headers to queue for import (DOS protection)
maxQueuedHeaders = 32 * 1024 // [brn/62] Maximum number of headers to queue for import (DOS protection)
maxHeadersProcess = 2048 // Number of header download results to import at once into the chain
maxResultsProcess = 2048 // Number of content download results to import at once into the chain
@ -100,7 +100,7 @@ type Downloader struct {
queue *queue // Scheduler for selecting the hashes to download
peers *peerSet // Set of active peers from which download can proceed
stateDB ethdb.Database
stateDB brndb.Database
fsPivotLock *types.Header // Pivot header on critical section entry (cannot change between retries)
fsPivotFails uint32 // Number of subsequent fast sync failures in the critical section
@ -126,17 +126,17 @@ type Downloader struct {
notified int32
// Channels
headerCh chan dataPack // [eth/62] Channel receiving inbound block headers
bodyCh chan dataPack // [eth/62] Channel receiving inbound block bodies
receiptCh chan dataPack // [eth/63] Channel receiving inbound receipts
bodyWakeCh chan bool // [eth/62] Channel to signal the block body fetcher of new tasks
receiptWakeCh chan bool // [eth/63] Channel to signal the receipt fetcher of new tasks
headerProcCh chan []*types.Header // [eth/62] Channel to feed the header processor new tasks
headerCh chan dataPack // [brn/62] Channel receiving inbound block headers
bodyCh chan dataPack // [brn/62] Channel receiving inbound block bodies
receiptCh chan dataPack // [brn/63] Channel receiving inbound receipts
bodyWakeCh chan bool // [brn/62] Channel to signal the block body fetcher of new tasks
receiptWakeCh chan bool // [brn/63] Channel to signal the receipt fetcher of new tasks
headerProcCh chan []*types.Header // [brn/62] Channel to feed the header processor new tasks
// for stateFetcher
stateSyncStart chan *stateSync
trackStateReq chan *stateReq
stateCh chan dataPack // [eth/63] Channel receiving inbound node state data
stateCh chan dataPack // [brn/63] Channel receiving inbound node state data
// Cancellation and termination
cancelPeer string // Identifier of the peer currently being used as the master (cancel on drop)
@ -201,7 +201,7 @@ type BlockChain interface {
}
// New creates a new downloader to fetch hashes and blocks from remote peers.
func New(mode SyncMode, stateDb ethdb.Database, mux *event.TypeMux, chain BlockChain, lightchain LightChain, dropPeer peerDropFn) *Downloader {
func New(mode SyncMode, stateDb brndb.Database, mux *event.TypeMux, chain BlockChain, lightchain LightChain, dropPeer peerDropFn) *Downloader {
if lightchain == nil {
lightchain = chain
}
@ -240,7 +240,7 @@ func New(mode SyncMode, stateDb ethdb.Database, mux *event.TypeMux, chain BlockC
// In addition, during the state download phase of fast synchronisation the number
// of processed and the total number of known states are also returned. Otherwise
// these are zero.
func (d *Downloader) Progress() ethereum.SyncProgress {
func (d *Downloader) Progress() burnout.SyncProgress {
// Lock the current stats and return the progress
d.syncStatsLock.RLock()
defer d.syncStatsLock.RUnlock()
@ -254,7 +254,7 @@ func (d *Downloader) Progress() ethereum.SyncProgress {
case LightSync:
current = d.lightchain.CurrentHeader().Number.Uint64()
}
return ethereum.SyncProgress{
return burnout.SyncProgress{
StartingBlock: d.syncStatsChainOrigin,
CurrentBlock: current,
HighestBlock: d.syncStatsChainHeight,
@ -413,7 +413,7 @@ func (d *Downloader) syncWithPeer(p *peerConnection, hash common.Hash, td *big.I
return errTooOld
}
log.Debug("Synchronising with the network", "peer", p.id, "eth", p.version, "head", hash, "td", td, "mode", d.mode)
log.Debug("Synchronising with the network", "peer", p.id, "brn", p.version, "head", hash, "td", td, "mode", d.mode)
defer func(start time.Time) {
log.Debug("Synchronisation terminated", "elapsed", time.Since(start))
}(time.Now())

View file

@ -1,18 +1,18 @@
// Copyright 2015 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2015 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
package downloader
@ -25,15 +25,15 @@ import (
"testing"
"time"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/state"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/params"
"github.com/ethereum/go-ethereum/trie"
"github.com/burnout/go-burnout/common"
"github.com/burnout/go-burnout/core"
"github.com/burnout/go-burnout/core/state"
"github.com/burnout/go-burnout/core/types"
"github.com/burnout/go-burnout/crypto"
"github.com/burnout/go-burnout/brndb"
"github.com/burnout/go-burnout/event"
"github.com/burnout/go-burnout/params"
"github.com/burnout/go-burnout/trie"
)
var (
@ -53,8 +53,8 @@ type downloadTester struct {
downloader *Downloader
genesis *types.Block // Genesis blocks used by the tester and peers
stateDb ethdb.Database // Database used by the tester for syncing from peers
peerDb ethdb.Database // Database of the peers containing all data
stateDb brndb.Database // Database used by the tester for syncing from peers
peerDb brndb.Database // Database of the peers containing all data
ownHashes []common.Hash // Hash chain belonging to the tester
ownHeaders map[common.Hash]*types.Header // Headers belonging to the tester
@ -75,7 +75,7 @@ type downloadTester struct {
// newTester creates a new downloader test mocker.
func newTester() *downloadTester {
testdb, _ := ethdb.NewMemDatabase()
testdb, _ := brndb.NewMemDatabase()
genesis := core.GenesisBlockForTesting(testdb, testAddress, big.NewInt(1000000000))
tester := &downloadTester{
@ -93,7 +93,7 @@ func newTester() *downloadTester {
peerChainTds: make(map[string]map[common.Hash]*big.Int),
peerMissingStates: make(map[string]map[common.Hash]bool),
}
tester.stateDb, _ = ethdb.NewMemDatabase()
tester.stateDb, _ = brndb.NewMemDatabase()
tester.stateDb.Put(genesis.Root().Bytes(), []byte{0x00})
tester.downloader = New(FullSync, tester.stateDb, new(event.TypeMux), tester, nil, tester.dropPeer)

View file

@ -1,18 +1,18 @@
// Copyright 2015 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2015 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
package downloader

43
brn/downloader/metrics.go Normal file
View file

@ -0,0 +1,43 @@
// Copyright 2015 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
// Contains the metrics collected by the downloader.
package downloader
import (
"github.com/burnout/go-burnout/metrics"
)
var (
headerInMeter = metrics.NewMeter("brn/downloader/headers/in")
headerReqTimer = metrics.NewTimer("brn/downloader/headers/req")
headerDropMeter = metrics.NewMeter("brn/downloader/headers/drop")
headerTimeoutMeter = metrics.NewMeter("brn/downloader/headers/timeout")
bodyInMeter = metrics.NewMeter("brn/downloader/bodies/in")
bodyReqTimer = metrics.NewTimer("brn/downloader/bodies/req")
bodyDropMeter = metrics.NewMeter("brn/downloader/bodies/drop")
bodyTimeoutMeter = metrics.NewMeter("brn/downloader/bodies/timeout")
receiptInMeter = metrics.NewMeter("brn/downloader/receipts/in")
receiptReqTimer = metrics.NewTimer("brn/downloader/receipts/req")
receiptDropMeter = metrics.NewMeter("brn/downloader/receipts/drop")
receiptTimeoutMeter = metrics.NewMeter("brn/downloader/receipts/timeout")
stateInMeter = metrics.NewMeter("brn/downloader/states/in")
stateDropMeter = metrics.NewMeter("brn/downloader/states/drop")
)

View file

@ -1,18 +1,18 @@
// Copyright 2015 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2015 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
package downloader

View file

@ -1,18 +1,18 @@
// Copyright 2015 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2015 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
// Contains the active peer-set of the downloader, maintaining both failures
// as well as reputation metrics to prioritize the block retrievals.
@ -29,9 +29,9 @@ import (
"sync/atomic"
"time"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/log"
"github.com/burnout/go-burnout/common"
"github.com/burnout/go-burnout/event"
"github.com/burnout/go-burnout/log"
)
const (
@ -147,7 +147,7 @@ func (p *peerConnection) Reset() {
func (p *peerConnection) FetchHeaders(from uint64, count int) error {
// Sanity check the protocol version
if p.version < 62 {
panic(fmt.Sprintf("header fetch [eth/62+] requested on eth/%d", p.version))
panic(fmt.Sprintf("header fetch [brn/62+] requested on brn/%d", p.version))
}
// Short circuit if the peer is already fetching
if !atomic.CompareAndSwapInt32(&p.headerIdle, 0, 1) {
@ -165,7 +165,7 @@ func (p *peerConnection) FetchHeaders(from uint64, count int) error {
func (p *peerConnection) FetchBodies(request *fetchRequest) error {
// Sanity check the protocol version
if p.version < 62 {
panic(fmt.Sprintf("body fetch [eth/62+] requested on eth/%d", p.version))
panic(fmt.Sprintf("body fetch [brn/62+] requested on brn/%d", p.version))
}
// Short circuit if the peer is already fetching
if !atomic.CompareAndSwapInt32(&p.blockIdle, 0, 1) {
@ -187,7 +187,7 @@ func (p *peerConnection) FetchBodies(request *fetchRequest) error {
func (p *peerConnection) FetchReceipts(request *fetchRequest) error {
// Sanity check the protocol version
if p.version < 63 {
panic(fmt.Sprintf("body fetch [eth/63+] requested on eth/%d", p.version))
panic(fmt.Sprintf("body fetch [brn/63+] requested on brn/%d", p.version))
}
// Short circuit if the peer is already fetching
if !atomic.CompareAndSwapInt32(&p.receiptIdle, 0, 1) {
@ -209,7 +209,7 @@ func (p *peerConnection) FetchReceipts(request *fetchRequest) error {
func (p *peerConnection) FetchNodeData(hashes []common.Hash) error {
// Sanity check the protocol version
if p.version < 63 {
panic(fmt.Sprintf("node data fetch [eth/63+] requested on eth/%d", p.version))
panic(fmt.Sprintf("node data fetch [brn/63+] requested on brn/%d", p.version))
}
// Short circuit if the peer is already fetching
if !atomic.CompareAndSwapInt32(&p.stateIdle, 0, 1) {

View file

@ -1,18 +1,18 @@
// Copyright 2015 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2015 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
// Contains the block download scheduler to collect download tasks and schedule
// them in an ordered, and throttled way.
@ -25,9 +25,9 @@ import (
"sync"
"time"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/log"
"github.com/burnout/go-burnout/common"
"github.com/burnout/go-burnout/core/types"
"github.com/burnout/go-burnout/log"
"github.com/rcrowley/go-metrics"
"gopkg.in/karalabe/cookiejar.v2/collections/prque"
)
@ -42,9 +42,9 @@ var (
// fetchRequest is a currently running data retrieval operation.
type fetchRequest struct {
Peer *peerConnection // Peer to which the request was sent
From uint64 // [eth/62] Requested chain element index (used for skeleton fills only)
Hashes map[common.Hash]int // [eth/61] Requested hashes with their insertion index (priority)
Headers []*types.Header // [eth/62] Requested headers, sorted by request order
From uint64 // [brn/62] Requested chain element index (used for skeleton fills only)
Hashes map[common.Hash]int // [brn/61] Requested hashes with their insertion index (priority)
Headers []*types.Header // [brn/62] Requested headers, sorted by request order
Time time.Time // Time when the request was made
}
@ -64,28 +64,28 @@ type queue struct {
mode SyncMode // Synchronisation mode to decide on the block parts to schedule for fetching
fastSyncPivot uint64 // Block number where the fast sync pivots into archive synchronisation mode
headerHead common.Hash // [eth/62] Hash of the last queued header to verify order
headerHead common.Hash // [brn/62] Hash of the last queued header to verify order
// Headers are "special", they download in batches, supported by a skeleton chain
headerTaskPool map[uint64]*types.Header // [eth/62] Pending header retrieval tasks, mapping starting indexes to skeleton headers
headerTaskQueue *prque.Prque // [eth/62] Priority queue of the skeleton indexes to fetch the filling headers for
headerPeerMiss map[string]map[uint64]struct{} // [eth/62] Set of per-peer header batches known to be unavailable
headerPendPool map[string]*fetchRequest // [eth/62] Currently pending header retrieval operations
headerResults []*types.Header // [eth/62] Result cache accumulating the completed headers
headerProced int // [eth/62] Number of headers already processed from the results
headerOffset uint64 // [eth/62] Number of the first header in the result cache
headerContCh chan bool // [eth/62] Channel to notify when header download finishes
headerTaskPool map[uint64]*types.Header // [brn/62] Pending header retrieval tasks, mapping starting indexes to skeleton headers
headerTaskQueue *prque.Prque // [brn/62] Priority queue of the skeleton indexes to fetch the filling headers for
headerPeerMiss map[string]map[uint64]struct{} // [brn/62] Set of per-peer header batches known to be unavailable
headerPendPool map[string]*fetchRequest // [brn/62] Currently pending header retrieval operations
headerResults []*types.Header // [brn/62] Result cache accumulating the completed headers
headerProced int // [brn/62] Number of headers already processed from the results
headerOffset uint64 // [brn/62] Number of the first header in the result cache
headerContCh chan bool // [brn/62] Channel to notify when header download finishes
// All data retrievals below are based on an already assembles header chain
blockTaskPool map[common.Hash]*types.Header // [eth/62] Pending block (body) retrieval tasks, mapping hashes to headers
blockTaskQueue *prque.Prque // [eth/62] Priority queue of the headers to fetch the blocks (bodies) for
blockPendPool map[string]*fetchRequest // [eth/62] Currently pending block (body) retrieval operations
blockDonePool map[common.Hash]struct{} // [eth/62] Set of the completed block (body) fetches
blockTaskPool map[common.Hash]*types.Header // [brn/62] Pending block (body) retrieval tasks, mapping hashes to headers
blockTaskQueue *prque.Prque // [brn/62] Priority queue of the headers to fetch the blocks (bodies) for
blockPendPool map[string]*fetchRequest // [brn/62] Currently pending block (body) retrieval operations
blockDonePool map[common.Hash]struct{} // [brn/62] Set of the completed block (body) fetches
receiptTaskPool map[common.Hash]*types.Header // [eth/63] Pending receipt retrieval tasks, mapping hashes to headers
receiptTaskQueue *prque.Prque // [eth/63] Priority queue of the headers to fetch the receipts for
receiptPendPool map[string]*fetchRequest // [eth/63] Currently pending receipt retrieval operations
receiptDonePool map[common.Hash]struct{} // [eth/63] Set of the completed receipt fetches
receiptTaskPool map[common.Hash]*types.Header // [brn/63] Pending receipt retrieval tasks, mapping hashes to headers
receiptTaskQueue *prque.Prque // [brn/63] Priority queue of the headers to fetch the receipts for
receiptPendPool map[string]*fetchRequest // [brn/63] Currently pending receipt retrieval operations
receiptDonePool map[common.Hash]struct{} // [brn/63] Set of the completed receipt fetches
resultCache []*fetchResult // Downloaded but not yet delivered fetch results
resultOffset uint64 // Offset of the first cached fetch result in the block chain

View file

@ -1,18 +1,18 @@
// Copyright 2017 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2017 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
package downloader
@ -23,12 +23,12 @@ import (
"sync/atomic"
"time"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/state"
"github.com/ethereum/go-ethereum/crypto/sha3"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/trie"
"github.com/burnout/go-burnout/common"
"github.com/burnout/go-burnout/core/state"
"github.com/burnout/go-burnout/crypto/sha3"
"github.com/burnout/go-burnout/brndb"
"github.com/burnout/go-burnout/log"
"github.com/burnout/go-burnout/trie"
)
// stateReq represents a batch of state fetch requests groupped together into
@ -316,7 +316,7 @@ func (s *stateSync) loop() error {
}
func (s *stateSync) commit(force bool) error {
if !force && s.bytesUncommitted < ethdb.IdealBatchSize {
if !force && s.bytesUncommitted < brndb.IdealBatchSize {
return nil
}
start := time.Now()

View file

@ -1,25 +1,25 @@
// Copyright 2015 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2015 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
package downloader
import (
"fmt"
"github.com/ethereum/go-ethereum/core/types"
"github.com/burnout/go-burnout/core/types"
)
// peerDropFn is a callback type for dropping a peer detected as malicious.

View file

@ -1,18 +1,18 @@
// Copyright 2015 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2015 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
// Package fetcher contains the block announcement based synchronisation.
package fetcher
@ -22,10 +22,10 @@ import (
"math/rand"
"time"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/consensus"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/log"
"github.com/burnout/go-burnout/common"
"github.com/burnout/go-burnout/consensus"
"github.com/burnout/go-burnout/core/types"
"github.com/burnout/go-burnout/log"
"gopkg.in/karalabe/cookiejar.v2/collections/prque"
)
@ -138,9 +138,9 @@ type Fetcher struct {
// Testing hooks
announceChangeHook func(common.Hash, bool) // Method to call upon adding or deleting a hash from the announce list
queueChangeHook func(common.Hash, bool) // Method to call upon adding or deleting a block from the import queue
fetchingHook func([]common.Hash) // Method to call upon starting a block (eth/61) or header (eth/62) fetch
completingHook func([]common.Hash) // Method to call upon starting a block body fetch (eth/62)
importedHook func(*types.Block) // Method to call upon successful block import (both eth/61 and eth/62)
fetchingHook func([]common.Hash) // Method to call upon starting a block (brn/61) or header (brn/62) fetch
completingHook func([]common.Hash) // Method to call upon starting a block body fetch (brn/62)
importedHook func(*types.Block) // Method to call upon successful block import (both brn/61 and brn/62)
}
// New creates a block fetcher to retrieve blocks based on hash announcements.

View file

@ -1,18 +1,18 @@
// Copyright 2015 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2015 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
package fetcher
@ -24,16 +24,16 @@ import (
"testing"
"time"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/params"
"github.com/burnout/go-burnout/common"
"github.com/burnout/go-burnout/core"
"github.com/burnout/go-burnout/core/types"
"github.com/burnout/go-burnout/crypto"
"github.com/burnout/go-burnout/brndb"
"github.com/burnout/go-burnout/params"
)
var (
testdb, _ = ethdb.NewMemDatabase()
testdb, _ = brndb.NewMemDatabase()
testKey, _ = crypto.HexToECDSA("b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291")
testAddress = crypto.PubkeyToAddress(testKey.PublicKey)
genesis = core.GenesisBlockForTesting(testdb, testAddress, big.NewInt(1000000000))

43
brn/fetcher/metrics.go Normal file
View file

@ -0,0 +1,43 @@
// Copyright 2015 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
// Contains the metrics collected by the fetcher.
package fetcher
import (
"github.com/burnout/go-burnout/metrics"
)
var (
propAnnounceInMeter = metrics.NewMeter("brn/fetcher/prop/announces/in")
propAnnounceOutTimer = metrics.NewTimer("brn/fetcher/prop/announces/out")
propAnnounceDropMeter = metrics.NewMeter("brn/fetcher/prop/announces/drop")
propAnnounceDOSMeter = metrics.NewMeter("brn/fetcher/prop/announces/dos")
propBroadcastInMeter = metrics.NewMeter("brn/fetcher/prop/broadcasts/in")
propBroadcastOutTimer = metrics.NewTimer("brn/fetcher/prop/broadcasts/out")
propBroadcastDropMeter = metrics.NewMeter("brn/fetcher/prop/broadcasts/drop")
propBroadcastDOSMeter = metrics.NewMeter("brn/fetcher/prop/broadcasts/dos")
headerFetchMeter = metrics.NewMeter("brn/fetcher/fetch/headers")
bodyFetchMeter = metrics.NewMeter("brn/fetcher/fetch/bodies")
headerFilterInMeter = metrics.NewMeter("brn/fetcher/filter/headers/in")
headerFilterOutMeter = metrics.NewMeter("brn/fetcher/filter/headers/out")
bodyFilterInMeter = metrics.NewMeter("brn/fetcher/filter/bodies/in")
bodyFilterOutMeter = metrics.NewMeter("brn/fetcher/filter/bodies/out")
)

View file

@ -1,18 +1,18 @@
// Copyright 2015 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2015 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
package filters
@ -25,12 +25,12 @@ import (
"sync"
"time"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/rpc"
"github.com/burnout/go-burnout/common"
"github.com/burnout/go-burnout/common/hexutil"
"github.com/burnout/go-burnout/core/types"
"github.com/burnout/go-burnout/brndb"
"github.com/burnout/go-burnout/event"
"github.com/burnout/go-burnout/rpc"
)
var (
@ -49,12 +49,12 @@ type filter struct {
}
// PublicFilterAPI offers support to create and manage filters. This will allow external clients to retrieve various
// information related to the Ethereum protocol such als blocks, transactions and logs.
// information related to the Burnout protocol such als blocks, transactions and logs.
type PublicFilterAPI struct {
backend Backend
mux *event.TypeMux
quit chan struct{}
chainDb ethdb.Database
chainDb brndb.Database
events *EventSystem
filtersMu sync.Mutex
filters map[rpc.ID]*filter
@ -100,7 +100,7 @@ func (api *PublicFilterAPI) timeoutLoop() {
// It is part of the filter package because this filter can be used throug the
// `eth_getFilterChanges` polling method that is also used for log filters.
//
// https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_newpendingtransactionfilter
// https://github.com/burnout/wiki/wiki/JSON-RPC#eth_newpendingtransactionfilter
func (api *PublicFilterAPI) NewPendingTransactionFilter() rpc.ID {
var (
pendingTxs = make(chan common.Hash)
@ -166,7 +166,7 @@ func (api *PublicFilterAPI) NewPendingTransactions(ctx context.Context) (*rpc.Su
// NewBlockFilter creates a filter that fetches blocks that are imported into the chain.
// It is part of the filter package since polling goes with eth_getFilterChanges.
//
// https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_newblockfilter
// https://github.com/burnout/wiki/wiki/JSON-RPC#eth_newblockfilter
func (api *PublicFilterAPI) NewBlockFilter() rpc.ID {
var (
headers = make(chan *types.Header)
@ -286,7 +286,7 @@ type FilterCriteria struct {
//
// In case "fromBlock" > "toBlock" an error is returned.
//
// https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_newfilter
// https://github.com/burnout/wiki/wiki/JSON-RPC#eth_newfilter
func (api *PublicFilterAPI) NewFilter(crit FilterCriteria) (rpc.ID, error) {
logs := make(chan []*types.Log)
logsSub, err := api.events.SubscribeLogs(crit, logs)
@ -321,7 +321,7 @@ func (api *PublicFilterAPI) NewFilter(crit FilterCriteria) (rpc.ID, error) {
// GetLogs returns logs matching the given argument that are stored within the state.
//
// https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_getlogs
// https://github.com/burnout/wiki/wiki/JSON-RPC#eth_getlogs
func (api *PublicFilterAPI) GetLogs(ctx context.Context, crit FilterCriteria) ([]*types.Log, error) {
// Convert the RPC block numbers into internal representations
if crit.FromBlock == nil {
@ -342,7 +342,7 @@ func (api *PublicFilterAPI) GetLogs(ctx context.Context, crit FilterCriteria) ([
// UninstallFilter removes the filter with the given filter id.
//
// https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_uninstallfilter
// https://github.com/burnout/wiki/wiki/JSON-RPC#eth_uninstallfilter
func (api *PublicFilterAPI) UninstallFilter(id rpc.ID) bool {
api.filtersMu.Lock()
f, found := api.filters[id]
@ -360,7 +360,7 @@ func (api *PublicFilterAPI) UninstallFilter(id rpc.ID) bool {
// GetFilterLogs returns the logs for the filter with the given id.
// If the filter could not be found an empty array of logs is returned.
//
// https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_getfilterlogs
// https://github.com/burnout/wiki/wiki/JSON-RPC#eth_getfilterlogs
func (api *PublicFilterAPI) GetFilterLogs(ctx context.Context, id rpc.ID) ([]*types.Log, error) {
api.filtersMu.Lock()
f, found := api.filters[id]
@ -394,7 +394,7 @@ func (api *PublicFilterAPI) GetFilterLogs(ctx context.Context, id rpc.ID) ([]*ty
// For pending transaction and block filters the result is []common.Hash.
// (pending)Log filters return []Log.
//
// https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_getfilterchanges
// https://github.com/burnout/wiki/wiki/JSON-RPC#eth_getfilterchanges
func (api *PublicFilterAPI) GetFilterChanges(id rpc.ID) (interface{}, error) {
api.filtersMu.Lock()
defer api.filtersMu.Unlock()

View file

@ -1,18 +1,18 @@
// Copyright 2016 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2016 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
package filters
@ -21,8 +21,8 @@ import (
"fmt"
"testing"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/rpc"
"github.com/burnout/go-burnout/common"
"github.com/burnout/go-burnout/rpc"
)
func TestUnmarshalJSONNewFilterArgs(t *testing.T) {

View file

@ -1,18 +1,18 @@
// Copyright 2017 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2017 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
package filters
@ -23,14 +23,14 @@ import (
"testing"
"time"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/bitutil"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/bloombits"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/node"
"github.com/burnout/go-burnout/common"
"github.com/burnout/go-burnout/common/bitutil"
"github.com/burnout/go-burnout/core"
"github.com/burnout/go-burnout/core/bloombits"
"github.com/burnout/go-burnout/core/types"
"github.com/burnout/go-burnout/brndb"
"github.com/burnout/go-burnout/event"
"github.com/burnout/go-burnout/node"
)
func BenchmarkBloomBits512(b *testing.B) {
@ -67,7 +67,7 @@ func benchmarkBloomBits(b *testing.B, sectionSize uint64) {
benchDataDir := node.DefaultDataDir() + "/geth/chaindata"
fmt.Println("Running bloombits benchmark section size:", sectionSize)
db, err := ethdb.NewLDBDatabase(benchDataDir, 128, 1024)
db, err := brndb.NewLDBDatabase(benchDataDir, 128, 1024)
if err != nil {
b.Fatalf("error opening database at %v: %v", benchDataDir, err)
}
@ -129,7 +129,7 @@ func benchmarkBloomBits(b *testing.B, sectionSize uint64) {
for i := 0; i < benchFilterCnt; i++ {
if i%20 == 0 {
db.Close()
db, _ = ethdb.NewLDBDatabase(benchDataDir, 128, 1024)
db, _ = brndb.NewLDBDatabase(benchDataDir, 128, 1024)
backend = &testBackend{mux, db, cnt, new(event.Feed), new(event.Feed), new(event.Feed), new(event.Feed)}
}
var addr common.Address
@ -146,8 +146,8 @@ func benchmarkBloomBits(b *testing.B, sectionSize uint64) {
db.Close()
}
func forEachKey(db ethdb.Database, startPrefix, endPrefix []byte, fn func(key []byte)) {
it := db.(*ethdb.LDBDatabase).NewIterator()
func forEachKey(db brndb.Database, startPrefix, endPrefix []byte, fn func(key []byte)) {
it := db.(*brndb.LDBDatabase).NewIterator()
it.Seek(startPrefix)
for it.Valid() {
key := it.Key()
@ -166,7 +166,7 @@ func forEachKey(db ethdb.Database, startPrefix, endPrefix []byte, fn func(key []
var bloomBitsPrefix = []byte("bloomBits-")
func clearBloomBits(db ethdb.Database) {
func clearBloomBits(db brndb.Database) {
fmt.Println("Clearing bloombits data...")
forEachKey(db, bloomBitsPrefix, bloomBitsPrefix, func(key []byte) {
db.Delete(key)
@ -176,7 +176,7 @@ func clearBloomBits(db ethdb.Database) {
func BenchmarkNoBloomBits(b *testing.B) {
benchDataDir := node.DefaultDataDir() + "/geth/chaindata"
fmt.Println("Running benchmark without bloombits")
db, err := ethdb.NewLDBDatabase(benchDataDir, 128, 1024)
db, err := brndb.NewLDBDatabase(benchDataDir, 128, 1024)
if err != nil {
b.Fatalf("error opening database at %v: %v", benchDataDir, err)
}

View file

@ -1,18 +1,18 @@
// Copyright 2014 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2014 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
package filters
@ -21,17 +21,17 @@ import (
"math/big"
"time"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/bloombits"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/rpc"
"github.com/burnout/go-burnout/common"
"github.com/burnout/go-burnout/core"
"github.com/burnout/go-burnout/core/bloombits"
"github.com/burnout/go-burnout/core/types"
"github.com/burnout/go-burnout/brndb"
"github.com/burnout/go-burnout/event"
"github.com/burnout/go-burnout/rpc"
)
type Backend interface {
ChainDb() ethdb.Database
ChainDb() brndb.Database
EventMux() *event.TypeMux
HeaderByNumber(ctx context.Context, blockNr rpc.BlockNumber) (*types.Header, error)
GetReceipts(ctx context.Context, blockHash common.Hash) (types.Receipts, error)
@ -49,7 +49,7 @@ type Backend interface {
type Filter struct {
backend Backend
db ethdb.Database
db brndb.Database
begin, end int64
addresses []common.Address
topics [][]common.Hash

View file

@ -1,20 +1,20 @@
// Copyright 2015 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2015 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
// Package filters implements an ethereum filtering system for block,
// Package filters implements an burnout filtering system for block,
// transactions and log events.
package filters
@ -25,11 +25,11 @@ import (
"sync"
"time"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/rpc"
"github.com/burnout/go-burnout/common"
"github.com/burnout/go-burnout/core"
"github.com/burnout/go-burnout/core/types"
"github.com/burnout/go-burnout/event"
"github.com/burnout/go-burnout/rpc"
)
// Type determines the kind of filter and is used to put the filter in to

View file

@ -1,18 +1,18 @@
// Copyright 2016 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2016 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
package filters
@ -25,19 +25,19 @@ import (
"testing"
"time"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/bloombits"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/params"
"github.com/ethereum/go-ethereum/rpc"
"github.com/burnout/go-burnout/common"
"github.com/burnout/go-burnout/core"
"github.com/burnout/go-burnout/core/bloombits"
"github.com/burnout/go-burnout/core/types"
"github.com/burnout/go-burnout/brndb"
"github.com/burnout/go-burnout/event"
"github.com/burnout/go-burnout/params"
"github.com/burnout/go-burnout/rpc"
)
type testBackend struct {
mux *event.TypeMux
db ethdb.Database
db brndb.Database
sections uint64
txFeed *event.Feed
rmLogsFeed *event.Feed
@ -45,7 +45,7 @@ type testBackend struct {
chainFeed *event.Feed
}
func (b *testBackend) ChainDb() ethdb.Database {
func (b *testBackend) ChainDb() brndb.Database {
return b.db
}
@ -128,7 +128,7 @@ func TestBlockSubscription(t *testing.T) {
var (
mux = new(event.TypeMux)
db, _ = ethdb.NewMemDatabase()
db, _ = brndb.NewMemDatabase()
txFeed = new(event.Feed)
rmLogsFeed = new(event.Feed)
logsFeed = new(event.Feed)
@ -185,7 +185,7 @@ func TestPendingTxFilter(t *testing.T) {
var (
mux = new(event.TypeMux)
db, _ = ethdb.NewMemDatabase()
db, _ = brndb.NewMemDatabase()
txFeed = new(event.Feed)
rmLogsFeed = new(event.Feed)
logsFeed = new(event.Feed)
@ -248,7 +248,7 @@ func TestPendingTxFilter(t *testing.T) {
func TestLogFilterCreation(t *testing.T) {
var (
mux = new(event.TypeMux)
db, _ = ethdb.NewMemDatabase()
db, _ = brndb.NewMemDatabase()
txFeed = new(event.Feed)
rmLogsFeed = new(event.Feed)
logsFeed = new(event.Feed)
@ -297,7 +297,7 @@ func TestInvalidLogFilterCreation(t *testing.T) {
var (
mux = new(event.TypeMux)
db, _ = ethdb.NewMemDatabase()
db, _ = brndb.NewMemDatabase()
txFeed = new(event.Feed)
rmLogsFeed = new(event.Feed)
logsFeed = new(event.Feed)
@ -327,7 +327,7 @@ func TestLogFilter(t *testing.T) {
var (
mux = new(event.TypeMux)
db, _ = ethdb.NewMemDatabase()
db, _ = brndb.NewMemDatabase()
txFeed = new(event.Feed)
rmLogsFeed = new(event.Feed)
logsFeed = new(event.Feed)
@ -446,7 +446,7 @@ func TestPendingLogsSubscription(t *testing.T) {
var (
mux = new(event.TypeMux)
db, _ = ethdb.NewMemDatabase()
db, _ = brndb.NewMemDatabase()
txFeed = new(event.Feed)
rmLogsFeed = new(event.Feed)
logsFeed = new(event.Feed)

View file

@ -1,18 +1,18 @@
// Copyright 2015 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2015 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
package filters
@ -23,13 +23,13 @@ import (
"os"
"testing"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/params"
"github.com/burnout/go-burnout/common"
"github.com/burnout/go-burnout/core"
"github.com/burnout/go-burnout/core/types"
"github.com/burnout/go-burnout/crypto"
"github.com/burnout/go-burnout/brndb"
"github.com/burnout/go-burnout/event"
"github.com/burnout/go-burnout/params"
)
func makeReceipt(addr common.Address) *types.Receipt {
@ -49,7 +49,7 @@ func BenchmarkFilters(b *testing.B) {
defer os.RemoveAll(dir)
var (
db, _ = ethdb.NewLDBDatabase(dir, 0, 0)
db, _ = brndb.NewLDBDatabase(dir, 0, 0)
mux = new(event.TypeMux)
txFeed = new(event.Feed)
rmLogsFeed = new(event.Feed)
@ -59,7 +59,7 @@ func BenchmarkFilters(b *testing.B) {
key1, _ = crypto.HexToECDSA("b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291")
addr1 = crypto.PubkeyToAddress(key1.PublicKey)
addr2 = common.BytesToAddress([]byte("jeff"))
addr3 = common.BytesToAddress([]byte("ethereum"))
addr3 = common.BytesToAddress([]byte("burnout"))
addr4 = common.BytesToAddress([]byte("random addresses please"))
)
defer db.Close()
@ -114,7 +114,7 @@ func TestFilters(t *testing.T) {
defer os.RemoveAll(dir)
var (
db, _ = ethdb.NewLDBDatabase(dir, 0, 0)
db, _ = brndb.NewLDBDatabase(dir, 0, 0)
mux = new(event.TypeMux)
txFeed = new(event.Feed)
rmLogsFeed = new(event.Feed)

View file

@ -1,18 +1,18 @@
// Copyright 2015 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2015 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
package gasprice
@ -22,10 +22,10 @@ import (
"sort"
"sync"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/internal/ethapi"
"github.com/ethereum/go-ethereum/params"
"github.com/ethereum/go-ethereum/rpc"
"github.com/burnout/go-burnout/common"
"github.com/burnout/go-burnout/internal/ethapi"
"github.com/burnout/go-burnout/params"
"github.com/burnout/go-burnout/rpc"
)
var maxPrice = big.NewInt(500 * params.Shannon)

View file

@ -1,15 +1,15 @@
// Code generated by github.com/fjl/gencodec. DO NOT EDIT.
package eth
package brn
import (
"math/big"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/eth/downloader"
"github.com/ethereum/go-ethereum/eth/gasprice"
"github.com/burnout/go-burnout/common"
"github.com/burnout/go-burnout/common/hexutil"
"github.com/burnout/go-burnout/core"
"github.com/burnout/go-burnout/brn/downloader"
"github.com/burnout/go-burnout/brn/gasprice"
)
func (c Config) MarshalTOML() (interface{}, error) {

View file

@ -1,20 +1,20 @@
// Copyright 2015 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2015 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
package eth
package brn
import (
"encoding/json"
@ -26,20 +26,20 @@ import (
"sync/atomic"
"time"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/consensus"
"github.com/ethereum/go-ethereum/consensus/misc"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/eth/downloader"
"github.com/ethereum/go-ethereum/eth/fetcher"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/p2p"
"github.com/ethereum/go-ethereum/p2p/discover"
"github.com/ethereum/go-ethereum/params"
"github.com/ethereum/go-ethereum/rlp"
"github.com/burnout/go-burnout/common"
"github.com/burnout/go-burnout/consensus"
"github.com/burnout/go-burnout/consensus/misc"
"github.com/burnout/go-burnout/core"
"github.com/burnout/go-burnout/core/types"
"github.com/burnout/go-burnout/brn/downloader"
"github.com/burnout/go-burnout/brn/fetcher"
"github.com/burnout/go-burnout/brndb"
"github.com/burnout/go-burnout/event"
"github.com/burnout/go-burnout/log"
"github.com/burnout/go-burnout/p2p"
"github.com/burnout/go-burnout/p2p/discover"
"github.com/burnout/go-burnout/params"
"github.com/burnout/go-burnout/rlp"
)
const (
@ -71,7 +71,7 @@ type ProtocolManager struct {
txpool txPool
blockchain *core.BlockChain
chaindb ethdb.Database
chaindb brndb.Database
chainconfig *params.ChainConfig
maxPeers int
@ -97,9 +97,9 @@ type ProtocolManager struct {
wg sync.WaitGroup
}
// NewProtocolManager returns a new ethereum sub protocol manager. The Ethereum sub protocol manages peers capable
// with the ethereum network.
func NewProtocolManager(config *params.ChainConfig, mode downloader.SyncMode, networkId uint64, mux *event.TypeMux, txpool txPool, engine consensus.Engine, blockchain *core.BlockChain, chaindb ethdb.Database) (*ProtocolManager, error) {
// NewProtocolManager returns a new burnout sub protocol manager. The Burnout sub protocol manages peers capable
// with the burnout network.
func NewProtocolManager(config *params.ChainConfig, mode downloader.SyncMode, networkId uint64, mux *event.TypeMux, txpool txPool, engine consensus.Engine, blockchain *core.BlockChain, chaindb brndb.Database) (*ProtocolManager, error) {
// Create the protocol manager with the base fields
manager := &ProtocolManager{
networkId: networkId,
@ -189,9 +189,9 @@ func (pm *ProtocolManager) removePeer(id string) {
if peer == nil {
return
}
log.Debug("Removing Ethereum peer", "peer", id)
log.Debug("Removing Burnout peer", "peer", id)
// Unregister the peer from the downloader and Ethereum peer set
// Unregister the peer from the downloader and Burnout peer set
pm.downloader.UnregisterPeer(id)
if err := pm.peers.Unregister(id); err != nil {
log.Error("Peer removal failed", "peer", id, "err", err)
@ -220,7 +220,7 @@ func (pm *ProtocolManager) Start(maxPeers int) {
}
func (pm *ProtocolManager) Stop() {
log.Info("Stopping Ethereum protocol")
log.Info("Stopping Burnout protocol")
pm.txSub.Unsubscribe() // quits txBroadcastLoop
pm.minedBlockSub.Unsubscribe() // quits blockBroadcastLoop
@ -241,25 +241,25 @@ func (pm *ProtocolManager) Stop() {
// Wait for all peer handler goroutines and the loops to come down.
pm.wg.Wait()
log.Info("Ethereum protocol stopped")
log.Info("Burnout protocol stopped")
}
func (pm *ProtocolManager) newPeer(pv int, p *p2p.Peer, rw p2p.MsgReadWriter) *peer {
return newPeer(pv, p, newMeteredMsgWriter(rw))
}
// handle is the callback invoked to manage the life cycle of an eth peer. When
// handle is the callback invoked to manage the life cycle of an brn peer. When
// this function terminates, the peer is disconnected.
func (pm *ProtocolManager) handle(p *peer) error {
if pm.peers.Len() >= pm.maxPeers {
return p2p.DiscTooManyPeers
}
p.Log().Debug("Ethereum peer connected", "name", p.Name())
p.Log().Debug("Burnout peer connected", "name", p.Name())
// Execute the Ethereum handshake
// Execute the Burnout handshake
td, head, genesis := pm.blockchain.Status()
if err := p.Handshake(pm.networkId, td, head, genesis); err != nil {
p.Log().Debug("Ethereum handshake failed", "err", err)
p.Log().Debug("Burnout handshake failed", "err", err)
return err
}
if rw, ok := p.rw.(*meteredMsgReadWriter); ok {
@ -267,7 +267,7 @@ func (pm *ProtocolManager) handle(p *peer) error {
}
// Register the peer locally
if err := pm.peers.Register(p); err != nil {
p.Log().Error("Ethereum peer registration failed", "err", err)
p.Log().Error("Burnout peer registration failed", "err", err)
return err
}
defer pm.removePeer(p.id)
@ -302,7 +302,7 @@ func (pm *ProtocolManager) handle(p *peer) error {
// main loop. handle incoming messages.
for {
if err := pm.handleMsg(p); err != nil {
p.Log().Debug("Ethereum message handling failed", "err", err)
p.Log().Debug("Burnout message handling failed", "err", err)
return err
}
}
@ -744,10 +744,10 @@ func (self *ProtocolManager) txBroadcastLoop() {
}
}
// EthNodeInfo represents a short summary of the Ethereum sub-protocol metadata known
// EthNodeInfo represents a short summary of the Burnout sub-protocol metadata known
// about the host peer.
type EthNodeInfo struct {
Network uint64 `json:"network"` // Ethereum network ID (1=Frontier, 2=Morden, Ropsten=3)
Network uint64 `json:"network"` // Burnout network ID (1=Frontier, 2=Morden, Ropsten=3)
Difficulty *big.Int `json:"difficulty"` // Total difficulty of the host's blockchain
Genesis common.Hash `json:"genesis"` // SHA3 hash of the host's genesis block
Head common.Hash `json:"head"` // SHA3 hash of the host's best owned block

View file

@ -1,20 +1,20 @@
// Copyright 2015 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2015 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
package eth
package brn
import (
"math"
@ -23,18 +23,18 @@ import (
"testing"
"time"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/consensus/ethash"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/state"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/core/vm"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/eth/downloader"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/p2p"
"github.com/ethereum/go-ethereum/params"
"github.com/burnout/go-burnout/common"
"github.com/burnout/go-burnout/consensus/ethash"
"github.com/burnout/go-burnout/core"
"github.com/burnout/go-burnout/core/state"
"github.com/burnout/go-burnout/core/types"
"github.com/burnout/go-burnout/core/vm"
"github.com/burnout/go-burnout/crypto"
"github.com/burnout/go-burnout/brn/downloader"
"github.com/burnout/go-burnout/brndb"
"github.com/burnout/go-burnout/event"
"github.com/burnout/go-burnout/p2p"
"github.com/burnout/go-burnout/params"
)
var bigTxGas = new(big.Int).SetUint64(params.TxGas)
@ -345,7 +345,7 @@ func testGetNodeData(t *testing.T, protocol int) {
// Fetch for now the entire chain db
hashes := []common.Hash{}
for _, key := range pm.chaindb.(*ethdb.MemDatabase).Keys() {
for _, key := range pm.chaindb.(*brndb.MemDatabase).Keys() {
if len(key) == len(common.Hash{}) {
hashes = append(hashes, common.BytesToHash(key))
}
@ -368,7 +368,7 @@ func testGetNodeData(t *testing.T, protocol int) {
t.Errorf("data hash mismatch: have %x, want %x", hash, want)
}
}
statedb, _ := ethdb.NewMemDatabase()
statedb, _ := brndb.NewMemDatabase()
for i := 0; i < len(data); i++ {
statedb.Put(hashes[i].Bytes(), data[i])
}
@ -450,7 +450,7 @@ func testGetReceipt(t *testing.T, protocol int) {
}
}
// Tests that post eth protocol handshake, DAO fork-enabled clients also execute
// Tests that post brn protocol handshake, DAO fork-enabled clients also execute
// a DAO "challenge" verifying each others' DAO fork headers to ensure they're on
// compatible chains.
func TestDAOChallengeNoVsNo(t *testing.T) { testDAOChallenge(t, false, false, false) }
@ -470,7 +470,7 @@ func testDAOChallenge(t *testing.T, localForked, remoteForked bool, timeout bool
var (
evmux = new(event.TypeMux)
pow = ethash.NewFaker()
db, _ = ethdb.NewMemDatabase()
db, _ = brndb.NewMemDatabase()
config = &params.ChainConfig{DAOForkBlock: big.NewInt(1), DAOForkSupport: localForked}
gspec = &core.Genesis{Config: config}
genesis = gspec.MustCommit(db)

View file

@ -1,23 +1,23 @@
// Copyright 2015 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2015 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
// This file contains some shares testing functionality, common to multiple
// different files and modules being tested.
package eth
package brn
import (
"crypto/ecdsa"
@ -27,18 +27,18 @@ import (
"sync"
"testing"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/consensus/ethash"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/core/vm"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/eth/downloader"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/p2p"
"github.com/ethereum/go-ethereum/p2p/discover"
"github.com/ethereum/go-ethereum/params"
"github.com/burnout/go-burnout/common"
"github.com/burnout/go-burnout/consensus/ethash"
"github.com/burnout/go-burnout/core"
"github.com/burnout/go-burnout/core/types"
"github.com/burnout/go-burnout/core/vm"
"github.com/burnout/go-burnout/crypto"
"github.com/burnout/go-burnout/brn/downloader"
"github.com/burnout/go-burnout/brndb"
"github.com/burnout/go-burnout/event"
"github.com/burnout/go-burnout/p2p"
"github.com/burnout/go-burnout/p2p/discover"
"github.com/burnout/go-burnout/params"
)
var (
@ -53,7 +53,7 @@ func newTestProtocolManager(mode downloader.SyncMode, blocks int, generator func
var (
evmux = new(event.TypeMux)
engine = ethash.NewFaker()
db, _ = ethdb.NewMemDatabase()
db, _ = brndb.NewMemDatabase()
gspec = &core.Genesis{
Config: params.TestChainConfig,
Alloc: core.GenesisAlloc{testBank: {Balance: big.NewInt(1000000)}},

View file

@ -1,59 +1,59 @@
// Copyright 2015 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2015 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
package eth
package brn
import (
"github.com/ethereum/go-ethereum/metrics"
"github.com/ethereum/go-ethereum/p2p"
"github.com/burnout/go-burnout/metrics"
"github.com/burnout/go-burnout/p2p"
)
var (
propTxnInPacketsMeter = metrics.NewMeter("eth/prop/txns/in/packets")
propTxnInTrafficMeter = metrics.NewMeter("eth/prop/txns/in/traffic")
propTxnOutPacketsMeter = metrics.NewMeter("eth/prop/txns/out/packets")
propTxnOutTrafficMeter = metrics.NewMeter("eth/prop/txns/out/traffic")
propHashInPacketsMeter = metrics.NewMeter("eth/prop/hashes/in/packets")
propHashInTrafficMeter = metrics.NewMeter("eth/prop/hashes/in/traffic")
propHashOutPacketsMeter = metrics.NewMeter("eth/prop/hashes/out/packets")
propHashOutTrafficMeter = metrics.NewMeter("eth/prop/hashes/out/traffic")
propBlockInPacketsMeter = metrics.NewMeter("eth/prop/blocks/in/packets")
propBlockInTrafficMeter = metrics.NewMeter("eth/prop/blocks/in/traffic")
propBlockOutPacketsMeter = metrics.NewMeter("eth/prop/blocks/out/packets")
propBlockOutTrafficMeter = metrics.NewMeter("eth/prop/blocks/out/traffic")
reqHeaderInPacketsMeter = metrics.NewMeter("eth/req/headers/in/packets")
reqHeaderInTrafficMeter = metrics.NewMeter("eth/req/headers/in/traffic")
reqHeaderOutPacketsMeter = metrics.NewMeter("eth/req/headers/out/packets")
reqHeaderOutTrafficMeter = metrics.NewMeter("eth/req/headers/out/traffic")
reqBodyInPacketsMeter = metrics.NewMeter("eth/req/bodies/in/packets")
reqBodyInTrafficMeter = metrics.NewMeter("eth/req/bodies/in/traffic")
reqBodyOutPacketsMeter = metrics.NewMeter("eth/req/bodies/out/packets")
reqBodyOutTrafficMeter = metrics.NewMeter("eth/req/bodies/out/traffic")
reqStateInPacketsMeter = metrics.NewMeter("eth/req/states/in/packets")
reqStateInTrafficMeter = metrics.NewMeter("eth/req/states/in/traffic")
reqStateOutPacketsMeter = metrics.NewMeter("eth/req/states/out/packets")
reqStateOutTrafficMeter = metrics.NewMeter("eth/req/states/out/traffic")
reqReceiptInPacketsMeter = metrics.NewMeter("eth/req/receipts/in/packets")
reqReceiptInTrafficMeter = metrics.NewMeter("eth/req/receipts/in/traffic")
reqReceiptOutPacketsMeter = metrics.NewMeter("eth/req/receipts/out/packets")
reqReceiptOutTrafficMeter = metrics.NewMeter("eth/req/receipts/out/traffic")
miscInPacketsMeter = metrics.NewMeter("eth/misc/in/packets")
miscInTrafficMeter = metrics.NewMeter("eth/misc/in/traffic")
miscOutPacketsMeter = metrics.NewMeter("eth/misc/out/packets")
miscOutTrafficMeter = metrics.NewMeter("eth/misc/out/traffic")
propTxnInPacketsMeter = metrics.NewMeter("brn/prop/txns/in/packets")
propTxnInTrafficMeter = metrics.NewMeter("brn/prop/txns/in/traffic")
propTxnOutPacketsMeter = metrics.NewMeter("brn/prop/txns/out/packets")
propTxnOutTrafficMeter = metrics.NewMeter("brn/prop/txns/out/traffic")
propHashInPacketsMeter = metrics.NewMeter("brn/prop/hashes/in/packets")
propHashInTrafficMeter = metrics.NewMeter("brn/prop/hashes/in/traffic")
propHashOutPacketsMeter = metrics.NewMeter("brn/prop/hashes/out/packets")
propHashOutTrafficMeter = metrics.NewMeter("brn/prop/hashes/out/traffic")
propBlockInPacketsMeter = metrics.NewMeter("brn/prop/blocks/in/packets")
propBlockInTrafficMeter = metrics.NewMeter("brn/prop/blocks/in/traffic")
propBlockOutPacketsMeter = metrics.NewMeter("brn/prop/blocks/out/packets")
propBlockOutTrafficMeter = metrics.NewMeter("brn/prop/blocks/out/traffic")
reqHeaderInPacketsMeter = metrics.NewMeter("brn/req/headers/in/packets")
reqHeaderInTrafficMeter = metrics.NewMeter("brn/req/headers/in/traffic")
reqHeaderOutPacketsMeter = metrics.NewMeter("brn/req/headers/out/packets")
reqHeaderOutTrafficMeter = metrics.NewMeter("brn/req/headers/out/traffic")
reqBodyInPacketsMeter = metrics.NewMeter("brn/req/bodies/in/packets")
reqBodyInTrafficMeter = metrics.NewMeter("brn/req/bodies/in/traffic")
reqBodyOutPacketsMeter = metrics.NewMeter("brn/req/bodies/out/packets")
reqBodyOutTrafficMeter = metrics.NewMeter("brn/req/bodies/out/traffic")
reqStateInPacketsMeter = metrics.NewMeter("brn/req/states/in/packets")
reqStateInTrafficMeter = metrics.NewMeter("brn/req/states/in/traffic")
reqStateOutPacketsMeter = metrics.NewMeter("brn/req/states/out/packets")
reqStateOutTrafficMeter = metrics.NewMeter("brn/req/states/out/traffic")
reqReceiptInPacketsMeter = metrics.NewMeter("brn/req/receipts/in/packets")
reqReceiptInTrafficMeter = metrics.NewMeter("brn/req/receipts/in/traffic")
reqReceiptOutPacketsMeter = metrics.NewMeter("brn/req/receipts/out/packets")
reqReceiptOutTrafficMeter = metrics.NewMeter("brn/req/receipts/out/traffic")
miscInPacketsMeter = metrics.NewMeter("brn/misc/in/packets")
miscInTrafficMeter = metrics.NewMeter("brn/misc/in/traffic")
miscOutPacketsMeter = metrics.NewMeter("brn/misc/out/packets")
miscOutTrafficMeter = metrics.NewMeter("brn/misc/out/traffic")
)
// meteredMsgReadWriter is a wrapper around a p2p.MsgReadWriter, capable of

View file

@ -1,20 +1,20 @@
// Copyright 2015 The go-ethereum Authors
// This file is part of the go-ethereum library.
// Copyright 2015 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// The go-burnout library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// along with the go-burnout library. If not, see <http://www.gnu.org/licenses/>.
package eth
package brn
import (
"errors"
@ -23,10 +23,10 @@ import (
"sync"
"time"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/p2p"
"github.com/ethereum/go-ethereum/rlp"
"github.com/burnout/go-burnout/common"
"github.com/burnout/go-burnout/core/types"
"github.com/burnout/go-burnout/p2p"
"github.com/burnout/go-burnout/rlp"
"gopkg.in/fatih/set.v0"
)
@ -42,10 +42,10 @@ const (
handshakeTimeout = 5 * time.Second
)
// PeerInfo represents a short summary of the Ethereum sub-protocol metadata known
// PeerInfo represents a short summary of the Burnout sub-protocol metadata known
// about a connected peer.
type PeerInfo struct {
Version int `json:"version"` // Ethereum protocol version negotiated
Version int `json:"version"` // Burnout protocol version negotiated
Difficulty *big.Int `json:"difficulty"` // Total difficulty of the peer's blockchain
Head string `json:"head"` // SHA3 hash of the peer's best owned block
}
@ -228,7 +228,7 @@ func (p *peer) RequestReceipts(hashes []common.Hash) error {
return p2p.Send(p.rw, GetReceiptsMsg, hashes)
}
// Handshake executes the eth protocol handshake, negotiating version number,
// Handshake executes the brn protocol handshake, negotiating version number,
// network IDs, difficulties, head and genesis blocks.
func (p *peer) Handshake(network uint64, td *big.Int, head common.Hash, genesis common.Hash) error {
// Send out own handshake in a new thread
@ -293,12 +293,12 @@ func (p *peer) readStatus(network uint64, status *statusData, genesis common.Has
// String implements fmt.Stringer.
func (p *peer) String() string {
return fmt.Sprintf("Peer %s [%s]", p.id,
fmt.Sprintf("eth/%2d", p.version),
fmt.Sprintf("brn/%2d", p.version),
)
}
// peerSet represents the collection of active peers currently participating in
// the Ethereum sub-protocol.
// the Burnout sub-protocol.
type peerSet struct {
peers map[string]*peer
lock sync.RWMutex

Some files were not shown because too many files have changed in this diff Show more