mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 02:12:23 +00:00
Change api name
This commit is contained in:
parent
02c4c86295
commit
4c286651c8
189 changed files with 1047 additions and 1047 deletions
2
.github/CODEOWNERS
vendored
2
.github/CODEOWNERS
vendored
|
|
@ -4,7 +4,7 @@
|
||||||
accounts/usbwallet @karalabe
|
accounts/usbwallet @karalabe
|
||||||
consensus @karalabe
|
consensus @karalabe
|
||||||
core/ @karalabe @holiman
|
core/ @karalabe @holiman
|
||||||
eth/ @karalabe
|
ess/ @karalabe
|
||||||
les/ @zsfelfoldi
|
les/ @zsfelfoldi
|
||||||
light/ @zsfelfoldi
|
light/ @zsfelfoldi
|
||||||
mobile/ @karalabe
|
mobile/ @karalabe
|
||||||
|
|
|
||||||
2
.github/ISSUE_TEMPLATE.md
vendored
2
.github/ISSUE_TEMPLATE.md
vendored
|
|
@ -2,7 +2,7 @@ Hi there,
|
||||||
|
|
||||||
please note that this is an issue tracker reserved for bug reports and feature requests.
|
please note that this is an issue tracker reserved for bug reports and feature requests.
|
||||||
|
|
||||||
For general questions please use the gitter channel or the Ethereum stack exchange at https://ethereum.stackexchange.com.
|
For general questions please use the gitter channel or the Essentia stack exchange at https://ethereum.stackexchange.com.
|
||||||
|
|
||||||
#### System information
|
#### System information
|
||||||
|
|
||||||
|
|
|
||||||
50
README.md
50
README.md
|
|
@ -1,6 +1,6 @@
|
||||||
## Go Ethereum
|
## Go Essentia
|
||||||
|
|
||||||
Official golang implementation of the Ethereum protocol.
|
Official golang implementation of the Essentia protocol.
|
||||||
|
|
||||||
[
|
[Installation Instructions](https://github.com/orangeAndSuns/go-ethereum/wiki/Building-Essentia)
|
||||||
on the wiki.
|
on the wiki.
|
||||||
|
|
||||||
Building geth requires both a Go (version 1.7 or later) and a C compiler.
|
Building geth requires both a Go (version 1.7 or later) and a C compiler.
|
||||||
|
|
@ -34,14 +34,14 @@ The go-ethereum project comes with several wrappers/executables found in the `cm
|
||||||
|
|
||||||
| Command | Description |
|
| 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/orangeAndSuns/go-ethereum/wiki/Command-Line-Options) for command line options. |
|
| **`geth`** | Our main Essentia CLI client. It is the entry point into the Essentia 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 Essentia 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/orangeAndSuns/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/orangeAndSuns/go-ethereum/wiki/Native-DApps:-Go-bindings-to-Ethereum-contracts) wiki page for details. |
|
| `abigen` | Source code generator to convert Essentia contract definitions into easy to use, compile-time type-safe Go packages. It operates on plain [Essentia contract ABIs](https://github.com/ethereum/wiki/wiki/Essentia-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/orangeAndSuns/go-ethereum/wiki/Native-DApps:-Go-bindings-to-Essentia-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. |
|
| `bootnode` | Stripped down version of our Essentia 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 isolated, fine-grained debugging of EVM opcodes (e.g. `evm --code 60ff60ff --debug`). |
|
| `evm` | Developer utility version of the EVM (Essentia Virtual Machine) that is capable of running bytecode snippets within a configurable environment and execution mode. Its purpose is to allow isolated, 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. |
|
| `gethrpctest` | Developer utility tool to support our [ethereum/rpc-test](https://github.com/ethereum/rpc-tests) test suite which validates baseline conformity to the [Essentia 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`). |
|
| `rlpdump` | Developer utility tool to convert binary RLP ([Recursive Length Prefix](https://github.com/ethereum/wiki/wiki/RLP)) dumps (data encoding used by the Essentia 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 [Swarm README](https://github.com/orangeAndSuns/go-ethereum/tree/master/swarm) for more information. |
|
| `swarm` | Swarm daemon and tools. This is the entrypoint for the Swarm network. `swarm --help` for command line options and subcommands. See [Swarm README](https://github.com/orangeAndSuns/go-ethereum/tree/master/swarm) for more information. |
|
||||||
| `puppeth` | a CLI wizard that aids in creating a new Ethereum network. |
|
| `puppeth` | a CLI wizard that aids in creating a new Essentia network. |
|
||||||
|
|
||||||
## Running geth
|
## Running geth
|
||||||
|
|
||||||
|
|
@ -50,9 +50,9 @@ Going through all the possible command line flags is out of scope here (please c
|
||||||
enumerated a few common parameter combos to get you up to speed quickly on how you can run your
|
enumerated a few common parameter combos to get you up to speed quickly on how you can run your
|
||||||
own Geth instance.
|
own Geth instance.
|
||||||
|
|
||||||
### Full node on the main Ethereum network
|
### Full node on the main Essentia 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 Essentia network:
|
||||||
create accounts; transfer funds; deploy and interact with contracts. For this particular use-case
|
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
|
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:
|
state of the network. To do so:
|
||||||
|
|
@ -64,7 +64,7 @@ $ geth console
|
||||||
This command will:
|
This command will:
|
||||||
|
|
||||||
* Start geth in fast sync mode (default, can be changed with the `--syncmode` flag), causing it to
|
* Start geth in fast sync mode (default, can be changed with the `--syncmode` flag), causing it to
|
||||||
download more data in exchange for avoiding processing the entire history of the Ethereum network,
|
download more data in exchange for avoiding processing the entire history of the Essentia network,
|
||||||
which is very CPU intensive.
|
which is very CPU intensive.
|
||||||
* Start up Geth's built-in interactive [JavaScript console](https://github.com/orangeAndSuns/go-ethereum/wiki/JavaScript-Console),
|
* Start up Geth's built-in interactive [JavaScript console](https://github.com/orangeAndSuns/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)
|
(via the trailing `console` subcommand) through which you can invoke all official [`web3` methods](https://github.com/ethereum/wiki/wiki/JavaScript-API)
|
||||||
|
|
@ -72,9 +72,9 @@ This command will:
|
||||||
This too is optional and if you leave it out you can always attach to an already running Geth instance
|
This too is optional and if you leave it out you can always attach to an already running Geth instance
|
||||||
with `geth attach`.
|
with `geth attach`.
|
||||||
|
|
||||||
### Full node on the Ethereum test network
|
### Full node on the Essentia 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 Essentia contracts, you
|
||||||
almost certainly would like to do that without any real money involved until you get the hang of the
|
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**
|
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.
|
network with your node, which is fully equivalent to the main network, but with play-Ether only.
|
||||||
|
|
@ -93,7 +93,7 @@ Specifying the `--testnet` flag however will reconfigure your Geth instance a bi
|
||||||
and Linux this also means that attaching to a running testnet node requires the use of a custom
|
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.
|
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.
|
`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 Essentia network, the client will connect to the test network,
|
||||||
which uses different P2P bootnodes, different network IDs and genesis states.
|
which uses different P2P bootnodes, different network IDs and genesis states.
|
||||||
|
|
||||||
*Note: Although there are some internal protective measures to prevent transactions from crossing
|
*Note: Although there are some internal protective measures to prevent transactions from crossing
|
||||||
|
|
@ -103,7 +103,7 @@ separate the two networks and will not make any accounts available between them.
|
||||||
|
|
||||||
### Full node on the Rinkeby test network
|
### Full node on the Rinkeby test network
|
||||||
|
|
||||||
The above test network is a cross client one based on the ethash proof-of-work consensus algorithm. As such, it has certain extra overhead and is more susceptible to reorganization attacks due to the network's low difficulty / security. Go Ethereum also supports connecting to a proof-of-authority based test network called [*Rinkeby*](https://www.rinkeby.io) (operated by members of the community). This network is lighter, more secure, but is only supported by go-ethereum.
|
The above test network is a cross client one based on the ethash proof-of-work consensus algorithm. As such, it has certain extra overhead and is more susceptible to reorganization attacks due to the network's low difficulty / security. Go Essentia also supports connecting to a proof-of-authority based test network called [*Rinkeby*](https://www.rinkeby.io) (operated by members of the community). This network is lighter, more secure, but is only supported by go-ethereum.
|
||||||
|
|
||||||
```
|
```
|
||||||
$ geth --rinkeby console
|
$ geth --rinkeby console
|
||||||
|
|
@ -127,7 +127,7 @@ $ geth --your-favourite-flags dumpconfig
|
||||||
|
|
||||||
#### Docker quick start
|
#### 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 Essentia 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 ethereum-node -v /Users/alice/ethereum:/root \
|
||||||
|
|
@ -141,7 +141,7 @@ Do not forget `--rpcaddr 0.0.0.0`, if you want to access RPC from other containe
|
||||||
|
|
||||||
### Programatically interfacing Geth nodes
|
### 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 Essentia
|
||||||
network via your own programs and not manually through the console. To aid this, Geth has built-in
|
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
|
support for a JSON-RPC based APIs ([standard APIs](https://github.com/ethereum/wiki/wiki/JSON-RPC) and
|
||||||
[Geth specific APIs](https://github.com/orangeAndSuns/go-ethereum/wiki/Management-APIs)). These can be
|
[Geth specific APIs](https://github.com/orangeAndSuns/go-ethereum/wiki/Management-APIs)). These can be
|
||||||
|
|
@ -156,15 +156,15 @@ HTTP based JSON-RPC API options:
|
||||||
* `--rpc` Enable the HTTP-RPC server
|
* `--rpc` Enable the HTTP-RPC server
|
||||||
* `--rpcaddr` HTTP-RPC server listening interface (default: "localhost")
|
* `--rpcaddr` HTTP-RPC server listening interface (default: "localhost")
|
||||||
* `--rpcport` HTTP-RPC server listening port (default: 8545)
|
* `--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: "ess,net,web3")
|
||||||
* `--rpccorsdomain` Comma separated list of domains from which to accept cross origin requests (browser enforced)
|
* `--rpccorsdomain` Comma separated list of domains from which to accept cross origin requests (browser enforced)
|
||||||
* `--ws` Enable the WS-RPC server
|
* `--ws` Enable the WS-RPC server
|
||||||
* `--wsaddr` WS-RPC server listening interface (default: "localhost")
|
* `--wsaddr` WS-RPC server listening interface (default: "localhost")
|
||||||
* `--wsport` WS-RPC server listening port (default: 8546)
|
* `--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: "ess,net,web3")
|
||||||
* `--wsorigins` Origins from which to accept websockets requests
|
* `--wsorigins` Origins from which to accept websockets requests
|
||||||
* `--ipcdisable` Disable the IPC-RPC server
|
* `--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,ess,miner,net,personal,shh,txpool,web3")
|
||||||
* `--ipcpath` Filename for IPC socket/pipe within the datadir (explicit paths escape it)
|
* `--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
|
You'll need to use your own programming environments' capabilities (libraries, tools, etc) to connect
|
||||||
|
|
@ -172,7 +172,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!
|
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
|
**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 Essentia nodes with exposed APIs!
|
||||||
Further, all browser tabs can access locally running webservers, so malicious webpages could try to
|
Further, all browser tabs can access locally running webservers, so malicious webpages could try to
|
||||||
subvert locally available APIs!**
|
subvert locally available APIs!**
|
||||||
|
|
||||||
|
|
@ -259,7 +259,7 @@ need to configure a miner to process transactions and create new blocks for you.
|
||||||
|
|
||||||
#### Running a private miner
|
#### 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 Essentia 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
|
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-ethereum)
|
||||||
repository.
|
repository.
|
||||||
|
|
@ -295,7 +295,7 @@ 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.
|
* 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.
|
* Pull requests need to be based on and opened against the `master` branch.
|
||||||
* Commit messages should be prefixed with the package(s) they modify.
|
* Commit messages should be prefixed with the package(s) they modify.
|
||||||
* E.g. "eth, rpc: make trace configs optional"
|
* E.g. "ess, rpc: make trace configs optional"
|
||||||
|
|
||||||
Please see the [Developers' Guide](https://github.com/orangeAndSuns/go-ethereum/wiki/Developers'-Guide)
|
Please see the [Developers' Guide](https://github.com/orangeAndSuns/go-ethereum/wiki/Developers'-Guide)
|
||||||
for more details on configuring your environment, managing project dependencies and testing procedures.
|
for more details on configuring your environment, managing project dependencies and testing procedures.
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ type ContractCaller interface {
|
||||||
// CodeAt returns the code of the given account. This is needed to differentiate
|
// 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.
|
// between contract internal errors and the local chain being out of sync.
|
||||||
CodeAt(ctx context.Context, contract common.Address, blockNumber *big.Int) ([]byte, error)
|
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 Essentia contract call with the specified data as the
|
||||||
// input.
|
// input.
|
||||||
CallContract(ctx context.Context, call ethereum.CallMsg, blockNumber *big.Int) ([]byte, error)
|
CallContract(ctx context.Context, call ethereum.CallMsg, blockNumber *big.Int) ([]byte, error)
|
||||||
}
|
}
|
||||||
|
|
@ -58,7 +58,7 @@ type ContractCaller interface {
|
||||||
type PendingContractCaller interface {
|
type PendingContractCaller interface {
|
||||||
// PendingCodeAt returns the code of the given account in the pending state.
|
// PendingCodeAt returns the code of the given account in the pending state.
|
||||||
PendingCodeAt(ctx context.Context, contract common.Address) ([]byte, error)
|
PendingCodeAt(ctx context.Context, contract common.Address) ([]byte, error)
|
||||||
// PendingCallContract executes an Ethereum contract call against the pending state.
|
// PendingCallContract executes an Essentia contract call against the pending state.
|
||||||
PendingCallContract(ctx context.Context, call ethereum.CallMsg) ([]byte, error)
|
PendingCallContract(ctx context.Context, call ethereum.CallMsg) ([]byte, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ var errGasEstimationFailed = errors.New("gas required exceeds allowance or alway
|
||||||
// the background. Its main purpose is to allow easily testing contract bindings.
|
// the background. Its main purpose is to allow easily testing contract bindings.
|
||||||
type SimulatedBackend struct {
|
type SimulatedBackend struct {
|
||||||
database ethdb.Database // In memory database to store our testing data
|
database ethdb.Database // In memory database to store our testing data
|
||||||
blockchain *core.BlockChain // Ethereum blockchain to handle the consensus
|
blockchain *core.BlockChain // Essentia blockchain to handle the consensus
|
||||||
|
|
||||||
mu sync.Mutex
|
mu sync.Mutex
|
||||||
pendingBlock *types.Block // Currently pending block that will be imported on request
|
pendingBlock *types.Block // Currently pending block that will be imported on request
|
||||||
|
|
|
||||||
|
|
@ -43,9 +43,9 @@ type CallOpts struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
// TransactOpts is the collection of authorization data required to create a
|
// TransactOpts is the collection of authorization data required to create a
|
||||||
// valid Ethereum transaction.
|
// valid Essentia transaction.
|
||||||
type TransactOpts struct {
|
type TransactOpts struct {
|
||||||
From common.Address // Ethereum account to send the transaction from
|
From common.Address // Essentia account to send the transaction from
|
||||||
Nonce *big.Int // Nonce to use for the transaction execution (nil = use pending state)
|
Nonce *big.Int // Nonce to use for the transaction execution (nil = use pending state)
|
||||||
Signer SignerFn // Method to use for signing the transaction (mandatory)
|
Signer SignerFn // Method to use for signing the transaction (mandatory)
|
||||||
|
|
||||||
|
|
@ -73,11 +73,11 @@ type WatchOpts struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
// BoundContract is the base wrapper object that reflects a contract on the
|
// 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
|
// Essentia network. It contains a collection of methods that are used by the
|
||||||
// higher level contract bindings to operate.
|
// higher level contract bindings to operate.
|
||||||
type BoundContract struct {
|
type BoundContract struct {
|
||||||
address common.Address // Deployment address of the contract on the Ethereum blockchain
|
address common.Address // Deployment address of the contract on the Essentia blockchain
|
||||||
abi abi.ABI // Reflect based ABI to access the correct Ethereum methods
|
abi abi.ABI // Reflect based ABI to access the correct Essentia methods
|
||||||
caller ContractCaller // Read interface to interact with the blockchain
|
caller ContractCaller // Read interface to interact with the blockchain
|
||||||
transactor ContractTransactor // Write interface to interact with the blockchain
|
transactor ContractTransactor // Write interface to interact with the blockchain
|
||||||
filterer ContractFilterer // Event filtering to interact with the blockchain
|
filterer ContractFilterer // Event filtering to interact with the blockchain
|
||||||
|
|
@ -95,7 +95,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 Essentia blockchain and binds the
|
||||||
// deployment address with a Go wrapper.
|
// 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) {
|
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
|
// Otherwise try to deploy the contract
|
||||||
|
|
|
||||||
|
|
@ -14,10 +14,10 @@
|
||||||
// You should have received a copy of the GNU Lesser General Public License
|
// 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-ethereum library. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
// Package bind generates Ethereum contract Go bindings.
|
// Package bind generates Essentia contract Go bindings.
|
||||||
//
|
//
|
||||||
// Detailed usage document and tutorial available on the go-ethereum Wiki page:
|
// Detailed usage document and tutorial available on the go-ethereum Wiki page:
|
||||||
// https://github.com/orangeAndSuns/go-ethereum/wiki/Native-DApps:-Go-bindings-to-Ethereum-contracts
|
// https://github.com/orangeAndSuns/go-ethereum/wiki/Native-DApps:-Go-bindings-to-Essentia-contracts
|
||||||
package bind
|
package bind
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,7 @@ package {{.Package}}
|
||||||
// {{.Type}}Bin is the compiled bytecode used for deploying new contracts.
|
// {{.Type}}Bin is the compiled bytecode used for deploying new contracts.
|
||||||
const {{.Type}}Bin = ` + "`" + `{{.InputBin}}` + "`" + `
|
const {{.Type}}Bin = ` + "`" + `{{.InputBin}}` + "`" + `
|
||||||
|
|
||||||
// Deploy{{.Type}} deploys a new Ethereum contract, binding an instance of {{.Type}} to it.
|
// Deploy{{.Type}} deploys a new Essentia 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) {
|
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))
|
parsed, err := abi.JSON(strings.NewReader({{.Type}}ABI))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
@ -86,29 +86,29 @@ package {{.Package}}
|
||||||
}
|
}
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
||||||
// {{.Type}} is an auto generated Go binding around an Ethereum contract.
|
// {{.Type}} is an auto generated Go binding around an Essentia contract.
|
||||||
type {{.Type}} struct {
|
type {{.Type}} struct {
|
||||||
{{.Type}}Caller // Read-only binding to the contract
|
{{.Type}}Caller // Read-only binding to the contract
|
||||||
{{.Type}}Transactor // Write-only binding to the contract
|
{{.Type}}Transactor // Write-only binding to the contract
|
||||||
{{.Type}}Filterer // Log filterer for contract events
|
{{.Type}}Filterer // Log filterer for contract events
|
||||||
}
|
}
|
||||||
|
|
||||||
// {{.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 Essentia contract.
|
||||||
type {{.Type}}Caller struct {
|
type {{.Type}}Caller struct {
|
||||||
contract *bind.BoundContract // Generic contract wrapper for the low level calls
|
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 Essentia contract.
|
||||||
type {{.Type}}Transactor struct {
|
type {{.Type}}Transactor struct {
|
||||||
contract *bind.BoundContract // Generic contract wrapper for the low level calls
|
contract *bind.BoundContract // Generic contract wrapper for the low level calls
|
||||||
}
|
}
|
||||||
|
|
||||||
// {{.Type}}Filterer is an auto generated log filtering Go binding around an Ethereum contract events.
|
// {{.Type}}Filterer is an auto generated log filtering Go binding around an Essentia contract events.
|
||||||
type {{.Type}}Filterer struct {
|
type {{.Type}}Filterer struct {
|
||||||
contract *bind.BoundContract // Generic contract wrapper for the low level calls
|
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 Essentia contract,
|
||||||
// with pre-set call and transact options.
|
// with pre-set call and transact options.
|
||||||
type {{.Type}}Session struct {
|
type {{.Type}}Session struct {
|
||||||
Contract *{{.Type}} // Generic contract binding to set the session for
|
Contract *{{.Type}} // Generic contract binding to set the session for
|
||||||
|
|
@ -116,31 +116,31 @@ package {{.Package}}
|
||||||
TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session
|
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 Essentia contract,
|
||||||
// with pre-set call options.
|
// with pre-set call options.
|
||||||
type {{.Type}}CallerSession struct {
|
type {{.Type}}CallerSession struct {
|
||||||
Contract *{{.Type}}Caller // Generic contract caller binding to set the session for
|
Contract *{{.Type}}Caller // Generic contract caller binding to set the session for
|
||||||
CallOpts bind.CallOpts // Call options to use throughout this session
|
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 Essentia contract,
|
||||||
// with pre-set transact options.
|
// with pre-set transact options.
|
||||||
type {{.Type}}TransactorSession struct {
|
type {{.Type}}TransactorSession struct {
|
||||||
Contract *{{.Type}}Transactor // Generic contract transactor binding to set the session for
|
Contract *{{.Type}}Transactor // Generic contract transactor binding to set the session for
|
||||||
TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session
|
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 Essentia contract.
|
||||||
type {{.Type}}Raw struct {
|
type {{.Type}}Raw struct {
|
||||||
Contract *{{.Type}} // Generic contract binding to access the raw methods on
|
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 Essentia contract.
|
||||||
type {{.Type}}CallerRaw struct {
|
type {{.Type}}CallerRaw struct {
|
||||||
Contract *{{.Type}}Caller // Generic read-only contract binding to access the raw methods on
|
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 Essentia contract.
|
||||||
type {{.Type}}TransactorRaw struct {
|
type {{.Type}}TransactorRaw struct {
|
||||||
Contract *{{.Type}}Transactor // Generic write-only contract binding to access the raw methods on
|
Contract *{{.Type}}Transactor // Generic write-only contract binding to access the raw methods on
|
||||||
}
|
}
|
||||||
|
|
@ -439,7 +439,7 @@ import org.ethereum.geth.internal.*;
|
||||||
// BYTECODE is the compiled bytecode used for deploying new contracts.
|
// BYTECODE is the compiled bytecode used for deploying new contracts.
|
||||||
public final static byte[] BYTECODE = "{{.InputBin}}".getBytes();
|
public final static byte[] BYTECODE = "{{.InputBin}}".getBytes();
|
||||||
|
|
||||||
// deploy deploys a new Ethereum contract, binding an instance of {{.Type}} to it.
|
// deploy deploys a new Essentia 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 {
|
public static {{.Type}} deploy(TransactOpts auth, EthereumClient client{{range .Constructor.Inputs}}, {{bindtype .Type}} {{.Name}}{{end}}) throws Exception {
|
||||||
Interfaces args = Geth.newInterfaces({{(len .Constructor.Inputs)}});
|
Interfaces args = Geth.newInterfaces({{(len .Constructor.Inputs)}});
|
||||||
{{range $index, $element := .Constructor.Inputs}}
|
{{range $index, $element := .Constructor.Inputs}}
|
||||||
|
|
@ -456,10 +456,10 @@ import org.ethereum.geth.internal.*;
|
||||||
}
|
}
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
||||||
// Ethereum address where this contract is located at.
|
// Essentia address where this contract is located at.
|
||||||
public final Address Address;
|
public final Address Address;
|
||||||
|
|
||||||
// Ethereum transaction in which this contract was deployed (if known!).
|
// Essentia transaction in which this contract was deployed (if known!).
|
||||||
public final Transaction Deployer;
|
public final Transaction Deployer;
|
||||||
|
|
||||||
// Contract instance bound to a blockchain address.
|
// Contract instance bound to a blockchain address.
|
||||||
|
|
|
||||||
|
|
@ -14,10 +14,10 @@
|
||||||
// You should have received a copy of the GNU Lesser General Public License
|
// 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-ethereum library. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
// Package abi implements the Ethereum ABI (Application Binary
|
// Package abi implements the Essentia ABI (Application Binary
|
||||||
// Interface).
|
// Interface).
|
||||||
//
|
//
|
||||||
// The Ethereum ABI is strongly typed, known at compile time
|
// The Essentia ABI is strongly typed, known at compile time
|
||||||
// and static. This ABI will handle basic type casting; unsigned
|
// and static. This ABI will handle basic type casting; unsigned
|
||||||
// to signed and visa versa. It does not handle slice casting such
|
// to signed and visa versa. It does not handle slice casting such
|
||||||
// as unsigned slice to signed slice. Bit size type casting is also
|
// as unsigned slice to signed slice. Bit size type casting is also
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@
|
||||||
// You should have received a copy of the GNU Lesser General Public License
|
// 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-ethereum library. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
// Package accounts implements high level Ethereum account management.
|
// Package accounts implements high level Essentia account management.
|
||||||
package accounts
|
package accounts
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|
@ -26,10 +26,10 @@ import (
|
||||||
"github.com/orangeAndSuns/go-ethereum/event"
|
"github.com/orangeAndSuns/go-ethereum/event"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Account represents an Ethereum account located at a specific location defined
|
// Account represents an Essentia account located at a specific location defined
|
||||||
// by the optional URL field.
|
// by the optional URL field.
|
||||||
type Account struct {
|
type Account struct {
|
||||||
Address common.Address `json:"address"` // Ethereum account address derived from the key
|
Address common.Address `json:"address"` // Essentia account address derived from the key
|
||||||
URL URL `json:"url"` // Optional resource locator within a backend
|
URL URL `json:"url"` // Optional resource locator within a backend
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -50,9 +50,9 @@ var DefaultLedgerBaseDerivationPath = DerivationPath{0x80000000 + 44, 0x80000000
|
||||||
// The BIP-44 spec https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki
|
// 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
|
// 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
|
// 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 Essentia.
|
||||||
//
|
//
|
||||||
// The root path for Ethereum is m/44'/60'/0'/0 according to the specification
|
// The root path for Essentia 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
|
// from https://github.com/ethereum/EIPs/issues/84, albeit it's not set in stone
|
||||||
// yet whether accounts should increment the last component or the children of
|
// 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.
|
// that. We will go with the simpler approach of incrementing the last component.
|
||||||
|
|
|
||||||
|
|
@ -96,7 +96,7 @@ func TestWatchNoDir(t *testing.T) {
|
||||||
|
|
||||||
// Create ks but not the directory that it watches.
|
// Create ks but not the directory that it watches.
|
||||||
rand.Seed(time.Now().UnixNano())
|
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("ess-keystore-watch-test-%d-%d", os.Getpid(), rand.Int()))
|
||||||
ks := NewKeyStore(dir, LightScryptN, LightScryptP)
|
ks := NewKeyStore(dir, LightScryptN, LightScryptP)
|
||||||
|
|
||||||
list := ks.Accounts()
|
list := ks.Accounts()
|
||||||
|
|
@ -322,7 +322,7 @@ func TestUpdatedKeyfileContents(t *testing.T) {
|
||||||
|
|
||||||
// Create a temporary kesytore to test with
|
// Create a temporary kesytore to test with
|
||||||
rand.Seed(time.Now().UnixNano())
|
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("ess-keystore-watch-test-%d-%d", os.Getpid(), rand.Int()))
|
||||||
ks := NewKeyStore(dir, LightScryptN, LightScryptP)
|
ks := NewKeyStore(dir, LightScryptN, LightScryptP)
|
||||||
|
|
||||||
list := ks.Accounts()
|
list := ks.Accounts()
|
||||||
|
|
|
||||||
|
|
@ -472,7 +472,7 @@ func (ks *KeyStore) Update(a accounts.Account, passphrase, newPassphrase string)
|
||||||
return ks.storage.StoreKey(a.URL.Path, key, newPassphrase)
|
return ks.storage.StoreKey(a.URL.Path, key, newPassphrase)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ImportPreSaleKey decrypts the given Ethereum presale wallet and stores
|
// ImportPreSaleKey decrypts the given Essentia presale wallet and stores
|
||||||
// a key file in the key directory. The key file is encrypted with the same passphrase.
|
// 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) {
|
func (ks *KeyStore) ImportPreSaleKey(keyJSON []byte, passphrase string) (accounts.Account, error) {
|
||||||
a, _, err := importPreSaleKey(ks.storage, keyJSON, passphrase)
|
a, _, err := importPreSaleKey(ks.storage, keyJSON, passphrase)
|
||||||
|
|
|
||||||
|
|
@ -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 Essentia JSON tests;
|
||||||
// testdataKeyStoreTests/basic_tests.json
|
// testdataKeyStoreTests/basic_tests.json
|
||||||
type KeyStoreTestV3 struct {
|
type KeyStoreTestV3 struct {
|
||||||
Json encryptedKeyJSONV3
|
Json encryptedKeyJSONV3
|
||||||
|
|
|
||||||
|
|
@ -375,7 +375,7 @@ func checkEvents(t *testing.T, want []walletEvent, have []walletEvent) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func tmpKeyStore(t *testing.T, encrypted bool) (string, *KeyStore) {
|
func tmpKeyStore(t *testing.T, encrypted bool) (string, *KeyStore) {
|
||||||
d, err := ioutil.TempDir("", "eth-keystore-test")
|
d, err := ioutil.TempDir("", "ess-keystore-test")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ import (
|
||||||
// references to the original version, whereas the latter is important to ensure
|
// 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.
|
// 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 Essentia
|
||||||
// wallet or account.
|
// wallet or account.
|
||||||
type URL struct {
|
type URL struct {
|
||||||
Scheme string // Protocol scheme to identify a capable account backend
|
Scheme string // Protocol scheme to identify a capable account backend
|
||||||
|
|
|
||||||
|
|
@ -954,7 +954,7 @@ func (m *GetAddress) GetScriptType() InputScriptType {
|
||||||
}
|
}
|
||||||
|
|
||||||
// *
|
// *
|
||||||
// Request: Ask device for Ethereum address corresponding to address_n path
|
// Request: Ask device for Essentia address corresponding to address_n path
|
||||||
// @next PassphraseRequest
|
// @next PassphraseRequest
|
||||||
// @next EthereumAddress
|
// @next EthereumAddress
|
||||||
// @next Failure
|
// @next Failure
|
||||||
|
|
@ -1004,7 +1004,7 @@ func (m *Address) GetAddress() string {
|
||||||
}
|
}
|
||||||
|
|
||||||
// *
|
// *
|
||||||
// Response: Contains an Ethereum address derived from device private seed
|
// Response: Contains an Essentia address derived from device private seed
|
||||||
// @prev EthereumGetAddress
|
// @prev EthereumGetAddress
|
||||||
type EthereumAddress struct {
|
type EthereumAddress struct {
|
||||||
Address []byte `protobuf:"bytes,1,req,name=address" json:"address,omitempty"`
|
Address []byte `protobuf:"bytes,1,req,name=address" json:"address,omitempty"`
|
||||||
|
|
|
||||||
|
|
@ -318,7 +318,7 @@ message GetAddress {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Request: Ask device for Ethereum address corresponding to address_n path
|
* Request: Ask device for Essentia address corresponding to address_n path
|
||||||
* @next PassphraseRequest
|
* @next PassphraseRequest
|
||||||
* @next EthereumAddress
|
* @next EthereumAddress
|
||||||
* @next Failure
|
* @next Failure
|
||||||
|
|
@ -337,11 +337,11 @@ message Address {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Response: Contains an Ethereum address derived from device private seed
|
* Response: Contains an Essentia address derived from device private seed
|
||||||
* @prev EthereumGetAddress
|
* @prev EthereumGetAddress
|
||||||
*/
|
*/
|
||||||
message EthereumAddress {
|
message EthereumAddress {
|
||||||
required bytes address = 1; // Coin address as an Ethereum 160 bit hash
|
required bytes address = 1; // Coin address as an Essentia 160 bit hash
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -681,7 +681,7 @@ message EthereumTxAck {
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////
|
////////////////////////////////////////
|
||||||
// Ethereum: Message signing messages //
|
// Essentia: Message signing messages //
|
||||||
////////////////////////////////////////
|
////////////////////////////////////////
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
// This file contains the implementation for interacting with the Ledger hardware
|
// 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:
|
// 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-ess/master/doc/ethapp.asc
|
||||||
|
|
||||||
package usbwallet
|
package usbwallet
|
||||||
|
|
||||||
|
|
@ -48,8 +48,8 @@ type ledgerParam1 byte
|
||||||
type ledgerParam2 byte
|
type ledgerParam2 byte
|
||||||
|
|
||||||
const (
|
const (
|
||||||
ledgerOpRetrieveAddress ledgerOpcode = 0x02 // Returns the public key and Ethereum address for a given BIP 32 path
|
ledgerOpRetrieveAddress ledgerOpcode = 0x02 // Returns the public key and Essentia address for a given BIP 32 path
|
||||||
ledgerOpSignTransaction ledgerOpcode = 0x04 // Signs an Ethereum transaction after having the user validate the parameters
|
ledgerOpSignTransaction ledgerOpcode = 0x04 // Signs an Essentia transaction after having the user validate the parameters
|
||||||
ledgerOpGetConfiguration ledgerOpcode = 0x06 // Returns specific wallet application configuration
|
ledgerOpGetConfiguration ledgerOpcode = 0x06 // Returns specific wallet application configuration
|
||||||
|
|
||||||
ledgerP1DirectlyFetchAddress ledgerParam1 = 0x00 // Return address directly from the wallet
|
ledgerP1DirectlyFetchAddress ledgerParam1 = 0x00 // Return address directly from the wallet
|
||||||
|
|
@ -90,15 +90,15 @@ func (w *ledgerDriver) Status() (string, error) {
|
||||||
return fmt.Sprintf("Failed: %v", w.failure), w.failure
|
return fmt.Sprintf("Failed: %v", w.failure), w.failure
|
||||||
}
|
}
|
||||||
if w.browser {
|
if w.browser {
|
||||||
return "Ethereum app in browser mode", w.failure
|
return "Essentia app in browser mode", w.failure
|
||||||
}
|
}
|
||||||
if w.offline() {
|
if w.offline() {
|
||||||
return "Ethereum app offline", w.failure
|
return "Essentia 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("Essentia 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 Essentia app is offline or not.
|
||||||
//
|
//
|
||||||
// The method assumes that the state lock is held!
|
// The method assumes that the state lock is held!
|
||||||
func (w *ledgerDriver) offline() bool {
|
func (w *ledgerDriver) offline() bool {
|
||||||
|
|
@ -113,13 +113,13 @@ func (w *ledgerDriver) Open(device io.ReadWriter, passphrase string) error {
|
||||||
|
|
||||||
_, err := w.ledgerDerive(accounts.DefaultBaseDerivationPath)
|
_, err := w.ledgerDerive(accounts.DefaultBaseDerivationPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// Ethereum app is not running or in browser mode, nothing more to do, return
|
// Essentia app is not running or in browser mode, nothing more to do, return
|
||||||
if err == errLedgerReplyInvalidHeader {
|
if err == errLedgerReplyInvalidHeader {
|
||||||
w.browser = true
|
w.browser = true
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
// Try to resolve the Ethereum app's version, will fail prior to v1.0.2
|
// Try to resolve the Essentia app's version, will fail prior to v1.0.2
|
||||||
if w.version, err = w.ledgerVersion(); err != nil {
|
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
|
w.version = [3]byte{1, 0, 0} // Assume worst case, can't verify if v1.0.0 or v1.0.1
|
||||||
}
|
}
|
||||||
|
|
@ -144,7 +144,7 @@ func (w *ledgerDriver) Heartbeat() error {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Derive implements usbwallet.driver, sending a derivation request to the Ledger
|
// Derive implements usbwallet.driver, sending a derivation request to the Ledger
|
||||||
// and returning the Ethereum address located on that derivation path.
|
// and returning the Essentia address located on that derivation path.
|
||||||
func (w *ledgerDriver) Derive(path accounts.DerivationPath) (common.Address, error) {
|
func (w *ledgerDriver) Derive(path accounts.DerivationPath) (common.Address, error) {
|
||||||
return w.ledgerDerive(path)
|
return w.ledgerDerive(path)
|
||||||
}
|
}
|
||||||
|
|
@ -152,11 +152,11 @@ func (w *ledgerDriver) Derive(path accounts.DerivationPath) (common.Address, err
|
||||||
// SignTx implements usbwallet.driver, sending the transaction to the Ledger and
|
// SignTx implements usbwallet.driver, sending the transaction to the Ledger and
|
||||||
// waiting for the user to confirm or deny the transaction.
|
// 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 Essentia application running on the Ledger wallet is
|
||||||
// too old to sign EIP-155 transactions, but such is requested nonetheless, an error
|
// too old to sign EIP-155 transactions, but such is requested nonetheless, an error
|
||||||
// will be returned opposed to silently signing in Homestead mode.
|
// 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) {
|
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 Essentia app doesn't run, abort
|
||||||
if w.offline() {
|
if w.offline() {
|
||||||
return common.Address{}, nil, accounts.ErrWalletClosed
|
return common.Address{}, nil, accounts.ErrWalletClosed
|
||||||
}
|
}
|
||||||
|
|
@ -168,7 +168,7 @@ func (w *ledgerDriver) SignTx(path accounts.DerivationPath, tx *types.Transactio
|
||||||
return w.ledgerSign(path, tx, chainID)
|
return w.ledgerSign(path, tx, chainID)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ledgerVersion retrieves the current version of the Ethereum wallet app running
|
// ledgerVersion retrieves the current version of the Essentia wallet app running
|
||||||
// on the Ledger wallet.
|
// on the Ledger wallet.
|
||||||
//
|
//
|
||||||
// The version retrieval protocol is defined as follows:
|
// The version retrieval protocol is defined as follows:
|
||||||
|
|
@ -200,7 +200,7 @@ func (w *ledgerDriver) ledgerVersion() ([3]byte, error) {
|
||||||
return version, nil
|
return version, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// ledgerDerive retrieves the currently active Ethereum address from a Ledger
|
// ledgerDerive retrieves the currently active Essentia address from a Ledger
|
||||||
// wallet at the specified derivation path.
|
// wallet at the specified derivation path.
|
||||||
//
|
//
|
||||||
// The address derivation protocol is defined as follows:
|
// The address derivation protocol is defined as follows:
|
||||||
|
|
@ -228,8 +228,8 @@ func (w *ledgerDriver) ledgerVersion() ([3]byte, error) {
|
||||||
// ------------------------+-------------------
|
// ------------------------+-------------------
|
||||||
// Public Key length | 1 byte
|
// Public Key length | 1 byte
|
||||||
// Uncompressed Public Key | arbitrary
|
// Uncompressed Public Key | arbitrary
|
||||||
// Ethereum address length | 1 byte
|
// Essentia address length | 1 byte
|
||||||
// Ethereum address | 40 bytes hex ascii
|
// Essentia address | 40 bytes hex ascii
|
||||||
// Chain code if requested | 32 bytes
|
// Chain code if requested | 32 bytes
|
||||||
func (w *ledgerDriver) ledgerDerive(derivationPath []uint32) (common.Address, error) {
|
func (w *ledgerDriver) ledgerDerive(derivationPath []uint32) (common.Address, error) {
|
||||||
// Flatten the derivation path into the Ledger request
|
// Flatten the derivation path into the Ledger request
|
||||||
|
|
@ -249,13 +249,13 @@ func (w *ledgerDriver) ledgerDerive(derivationPath []uint32) (common.Address, er
|
||||||
}
|
}
|
||||||
reply = reply[1+int(reply[0]):]
|
reply = reply[1+int(reply[0]):]
|
||||||
|
|
||||||
// Extract the Ethereum hex address string
|
// Extract the Essentia hex address string
|
||||||
if len(reply) < 1 || len(reply) < 1+int(reply[0]) {
|
if len(reply) < 1 || len(reply) < 1+int(reply[0]) {
|
||||||
return common.Address{}, errors.New("reply lacks address entry")
|
return common.Address{}, errors.New("reply lacks address entry")
|
||||||
}
|
}
|
||||||
hexstr := reply[1 : 1+int(reply[0])]
|
hexstr := reply[1 : 1+int(reply[0])]
|
||||||
|
|
||||||
// Decode the hex sting into an Ethereum address and return
|
// Decode the hex sting into an Essentia address and return
|
||||||
var address common.Address
|
var address common.Address
|
||||||
hex.Decode(address[:], hexstr)
|
hex.Decode(address[:], hexstr)
|
||||||
return address, nil
|
return address, nil
|
||||||
|
|
@ -338,7 +338,7 @@ func (w *ledgerDriver) ledgerSign(derivationPath []uint32, tx *types.Transaction
|
||||||
payload = payload[chunk:]
|
payload = payload[chunk:]
|
||||||
op = ledgerP1ContTransactionData
|
op = ledgerP1ContTransactionData
|
||||||
}
|
}
|
||||||
// Extract the Ethereum signature and do a sanity validation
|
// Extract the Essentia signature and do a sanity validation
|
||||||
if len(reply) != 65 {
|
if len(reply) != 65 {
|
||||||
return common.Address{}, nil, errors.New("reply lacks signature")
|
return common.Address{}, nil, errors.New("reply lacks signature")
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@ func newTrezorDriver(logger log.Logger) driver {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Status implements accounts.Wallet, always whether the Trezor is opened, closed
|
// Status implements accounts.Wallet, always whether the Trezor is opened, closed
|
||||||
// or whether the Ethereum app was not started on it.
|
// or whether the Essentia app was not started on it.
|
||||||
func (w *trezorDriver) Status() (string, error) {
|
func (w *trezorDriver) Status() (string, error) {
|
||||||
if w.failure != nil {
|
if w.failure != nil {
|
||||||
return fmt.Sprintf("Failed: %v", w.failure), w.failure
|
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
|
// Derive implements usbwallet.driver, sending a derivation request to the Trezor
|
||||||
// and returning the Ethereum address located on that derivation path.
|
// and returning the Essentia address located on that derivation path.
|
||||||
func (w *trezorDriver) Derive(path accounts.DerivationPath) (common.Address, error) {
|
func (w *trezorDriver) Derive(path accounts.DerivationPath) (common.Address, error) {
|
||||||
return w.trezorDerive(path)
|
return w.trezorDerive(path)
|
||||||
}
|
}
|
||||||
|
|
@ -160,7 +160,7 @@ func (w *trezorDriver) SignTx(path accounts.DerivationPath, tx *types.Transactio
|
||||||
}
|
}
|
||||||
|
|
||||||
// trezorDerive sends a derivation request to the Trezor device and returns the
|
// trezorDerive sends a derivation request to the Trezor device and returns the
|
||||||
// Ethereum address located on that path.
|
// Essentia address located on that path.
|
||||||
func (w *trezorDriver) trezorDerive(derivationPath []uint32) (common.Address, error) {
|
func (w *trezorDriver) trezorDerive(derivationPath []uint32) (common.Address, error) {
|
||||||
address := new(trezor.EthereumAddress)
|
address := new(trezor.EthereumAddress)
|
||||||
if _, err := w.trezorExchange(&trezor.EthereumGetAddress{AddressN: derivationPath}, address); err != nil {
|
if _, err := w.trezorExchange(&trezor.EthereumGetAddress{AddressN: derivationPath}, address); err != nil {
|
||||||
|
|
@ -209,7 +209,7 @@ func (w *trezorDriver) trezorSign(derivationPath []uint32, tx *types.Transaction
|
||||||
return common.Address{}, nil, err
|
return common.Address{}, nil, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Extract the Ethereum signature and do a sanity validation
|
// Extract the Essentia signature and do a sanity validation
|
||||||
if len(response.GetSignatureR()) == 0 || len(response.GetSignatureS()) == 0 || response.GetSignatureV() == 0 {
|
if len(response.GetSignatureR()) == 0 || len(response.GetSignatureS()) == 0 || response.GetSignatureV() == 0 {
|
||||||
return common.Address{}, nil, errors.New("reply lacks signature")
|
return common.Address{}, nil, errors.New("reply lacks signature")
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@ type driver interface {
|
||||||
// is still online and healthy.
|
// is still online and healthy.
|
||||||
Heartbeat() error
|
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 Essentia
|
||||||
// address located on that path.
|
// address located on that path.
|
||||||
Derive(path accounts.DerivationPath) (common.Address, error)
|
Derive(path accounts.DerivationPath) (common.Address, error)
|
||||||
|
|
||||||
|
|
@ -346,7 +346,7 @@ func (w *wallet) selfDerive() {
|
||||||
context = context.Background()
|
context = context.Background()
|
||||||
)
|
)
|
||||||
for empty := false; !empty; {
|
for empty := false; !empty; {
|
||||||
// Retrieve the next derived Ethereum account
|
// Retrieve the next derived Essentia account
|
||||||
if nextAddr == (common.Address{}) {
|
if nextAddr == (common.Address{}) {
|
||||||
if nextAddr, err = w.driver.Derive(nextPath); err != nil {
|
if nextAddr, err = w.driver.Derive(nextPath); err != nil {
|
||||||
w.log.Warn("USB wallet account derivation failed", "err", err)
|
w.log.Warn("USB wallet account derivation failed", "err", err)
|
||||||
|
|
@ -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
|
// wallet to request a confirmation from the user. It returns either the signed
|
||||||
// transaction or a failure if the user denied the transaction.
|
// 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 Essentia application running on the Ledger wallet is
|
||||||
// too old to sign EIP-155 transactions, but such is requested nonetheless, an error
|
// too old to sign EIP-155 transactions, but such is requested nonetheless, an error
|
||||||
// will be returned opposed to silently signing in Homestead mode.
|
// 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) {
|
func (w *wallet) SignTx(account accounts.Account, tx *types.Transaction, chainID *big.Int) (*types.Transaction, error) {
|
||||||
|
|
|
||||||
16
build/ci.go
16
build/ci.go
|
|
@ -85,23 +85,23 @@ var (
|
||||||
debExecutables = []debExecutable{
|
debExecutables = []debExecutable{
|
||||||
{
|
{
|
||||||
Name: "abigen",
|
Name: "abigen",
|
||||||
Description: "Source code generator to convert Ethereum contract definitions into easy to use, compile-time type-safe Go packages.",
|
Description: "Source code generator to convert Essentia contract definitions into easy to use, compile-time type-safe Go packages.",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Name: "bootnode",
|
Name: "bootnode",
|
||||||
Description: "Ethereum bootnode.",
|
Description: "Essentia bootnode.",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Name: "evm",
|
Name: "evm",
|
||||||
Description: "Developer utility version of the EVM (Ethereum Virtual Machine) that is capable of running bytecode snippets within a configurable environment and execution mode.",
|
Description: "Developer utility version of the EVM (Essentia Virtual Machine) that is capable of running bytecode snippets within a configurable environment and execution mode.",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Name: "geth",
|
Name: "geth",
|
||||||
Description: "Ethereum CLI client.",
|
Description: "Essentia CLI client.",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Name: "puppeth",
|
Name: "puppeth",
|
||||||
Description: "Ethereum private network manager.",
|
Description: "Essentia private network manager.",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Name: "rlpdump",
|
Name: "rlpdump",
|
||||||
|
|
@ -109,11 +109,11 @@ var (
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Name: "swarm",
|
Name: "swarm",
|
||||||
Description: "Ethereum Swarm daemon and tools",
|
Description: "Essentia Swarm daemon and tools",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Name: "wnode",
|
Name: "wnode",
|
||||||
Description: "Ethereum Whisper diagnostic tool",
|
Description: "Essentia Whisper diagnostic tool",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -544,7 +544,7 @@ type debExecutable struct {
|
||||||
func newDebMetadata(distro, author string, env build.Environment, t time.Time) debMetadata {
|
func newDebMetadata(distro, author string, env build.Environment, t time.Time) debMetadata {
|
||||||
if author == "" {
|
if author == "" {
|
||||||
// No signing key, use default author.
|
// No signing key, use default author.
|
||||||
author = "Ethereum Builds <fjl@ethereum.org>"
|
author = "Essentia Builds <fjl@ethereum.org>"
|
||||||
}
|
}
|
||||||
return debMetadata{
|
return debMetadata{
|
||||||
Env: env,
|
Env: env,
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
<version>{{.Version}}</version>
|
<version>{{.Version}}</version>
|
||||||
<packaging>aar</packaging>
|
<packaging>aar</packaging>
|
||||||
|
|
||||||
<name>Android Ethereum Client</name>
|
<name>Android Essentia Client</name>
|
||||||
<description>Android port of the go-ethereum libraries and node</description>
|
<description>Android port of the go-ethereum libraries and node</description>
|
||||||
<url>https://github.com/orangeAndSuns/go-ethereum</url>
|
<url>https://github.com/orangeAndSuns/go-ethereum</url>
|
||||||
<inceptionYear>2015</inceptionYear>
|
<inceptionYear>2015</inceptionYear>
|
||||||
|
|
@ -23,7 +23,7 @@
|
||||||
</licenses>
|
</licenses>
|
||||||
|
|
||||||
<organization>
|
<organization>
|
||||||
<name>Ethereum</name>
|
<name>Essentia</name>
|
||||||
<url>https://ethereum.org</url>
|
<url>https://ethereum.org</url>
|
||||||
</organization>
|
</organization>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,9 +29,9 @@
|
||||||
# - sign installer
|
# - sign installer
|
||||||
CRCCheck on
|
CRCCheck on
|
||||||
|
|
||||||
!define GROUPNAME "Ethereum"
|
!define GROUPNAME "Essentia"
|
||||||
!define APPNAME "Geth"
|
!define APPNAME "Geth"
|
||||||
!define DESCRIPTION "Official Go implementation of the Ethereum protocol"
|
!define DESCRIPTION "Official Go implementation of the Essentia protocol"
|
||||||
!addplugindir .\
|
!addplugindir .\
|
||||||
|
|
||||||
# Require admin rights on NT6+ (When UAC is turned on)
|
# Require admin rights on NT6+ (When UAC is turned on)
|
||||||
|
|
|
||||||
|
|
@ -29,9 +29,9 @@ Section "Geth" GETH_IDX
|
||||||
SimpleFC::AdvRemoveRule "Geth UDP discovery (UDP:30303)"
|
SimpleFC::AdvRemoveRule "Geth UDP discovery (UDP:30303)"
|
||||||
|
|
||||||
# Firewall - add rules
|
# Firewall - add rules
|
||||||
SimpleFC::AdvAddRule "Geth incoming peers (TCP:30303)" "" 6 1 1 2147483647 1 "$INSTDIR\geth.exe" "" "" "Ethereum" 30303 "" "" ""
|
SimpleFC::AdvAddRule "Geth incoming peers (TCP:30303)" "" 6 1 1 2147483647 1 "$INSTDIR\geth.exe" "" "" "Essentia" 30303 "" "" ""
|
||||||
SimpleFC::AdvAddRule "Geth outgoing peers (TCP:30303)" "" 6 2 1 2147483647 1 "$INSTDIR\geth.exe" "" "" "Ethereum" "" 30303 "" ""
|
SimpleFC::AdvAddRule "Geth outgoing peers (TCP:30303)" "" 6 2 1 2147483647 1 "$INSTDIR\geth.exe" "" "" "Essentia" "" 30303 "" ""
|
||||||
SimpleFC::AdvAddRule "Geth UDP discovery (UDP:30303)" "" 17 2 1 2147483647 1 "$INSTDIR\geth.exe" "" "" "Ethereum" "" 30303 "" ""
|
SimpleFC::AdvAddRule "Geth UDP discovery (UDP:30303)" "" 17 2 1 2147483647 1 "$INSTDIR\geth.exe" "" "" "Essentia" "" 30303 "" ""
|
||||||
|
|
||||||
# Set default IPC endpoint (https://github.com/ethereum/EIPs/issues/147)
|
# Set default IPC endpoint (https://github.com/ethereum/EIPs/issues/147)
|
||||||
${EnvVarUpdate} $0 "ETHEREUM_SOCKET" "R" "HKLM" "\\.\pipe\geth.ipc"
|
${EnvVarUpdate} $0 "ETHEREUM_SOCKET" "R" "HKLM" "\\.\pipe\geth.ipc"
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ Pod::Spec.new do |spec|
|
||||||
spec.authors = { {{range .Contributors}}
|
spec.authors = { {{range .Contributors}}
|
||||||
'{{.Name}}' => '{{.Email}}',{{end}}
|
'{{.Name}}' => '{{.Email}}',{{end}}
|
||||||
}
|
}
|
||||||
spec.summary = 'iOS Ethereum Client'
|
spec.summary = 'iOS Essentia Client'
|
||||||
spec.source = { :git => 'https://github.com/orangeAndSuns/go-ethereum.git', :commit => '{{.Commit}}' }
|
spec.source = { :git => 'https://github.com/orangeAndSuns/go-ethereum.git', :commit => '{{.Commit}}' }
|
||||||
|
|
||||||
spec.platform = :ios
|
spec.platform = :ios
|
||||||
|
|
|
||||||
|
|
@ -29,11 +29,11 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
abiFlag = flag.String("abi", "", "Path to the Ethereum contract ABI json to bind, - for STDIN")
|
abiFlag = flag.String("abi", "", "Path to the Essentia contract ABI json to bind, - for STDIN")
|
||||||
binFlag = flag.String("bin", "", "Path to the Ethereum contract bytecode (generate deploy method)")
|
binFlag = flag.String("bin", "", "Path to the Essentia contract bytecode (generate deploy method)")
|
||||||
typFlag = flag.String("type", "", "Struct name for the binding (default = package name)")
|
typFlag = flag.String("type", "", "Struct name for the binding (default = package name)")
|
||||||
|
|
||||||
solFlag = flag.String("sol", "", "Path to the Ethereum contract Solidity source to build and bind")
|
solFlag = flag.String("sol", "", "Path to the Essentia contract Solidity source to build and bind")
|
||||||
solcFlag = flag.String("solc", "solc", "Solidity compiler to use if source builds are requested")
|
solcFlag = flag.String("solc", "solc", "Solidity compiler to use if source builds are requested")
|
||||||
excFlag = flag.String("exc", "", "Comma separated types to exclude from binding")
|
excFlag = flag.String("exc", "", "Comma separated types to exclude from binding")
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
|
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
// bootnode runs a bootstrap node for the Ethereum Discovery Protocol.
|
// bootnode runs a bootstrap node for the Essentia Discovery Protocol.
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|
|
||||||
|
|
@ -5,9 +5,9 @@ This allows DApps not to depend on geth's account management. When a DApp wants
|
||||||
the signer, the signer will then provide the user with context and asks the user for permission to sign the data. If
|
the signer, the signer will then provide the user with context and asks the user for permission to sign the data. If
|
||||||
the users grants the signing request the signer will send the signature back to the DApp.
|
the users grants the signing request the signer will send the signature back to the DApp.
|
||||||
|
|
||||||
This setup allows a DApp to connect to a remote Ethereum node and send transactions that are locally signed. This can
|
This setup allows a DApp to connect to a remote Essentia node and send transactions that are locally signed. This can
|
||||||
help in situations when a DApp is connected to a remote node because a local Ethereum node is not available, not
|
help in situations when a DApp is connected to a remote node because a local Essentia node is not available, not
|
||||||
synchronised with the chain or a particular Ethereum node that has no built-in (or limited) account management.
|
synchronised with the chain or a particular Essentia node that has no built-in (or limited) account management.
|
||||||
|
|
||||||
Clef can run as a daemon on the same machine, or off a usb-stick like [usb armory](https://inversepath.com/usbarmory),
|
Clef can run as a daemon on the same machine, or off a usb-stick like [usb armory](https://inversepath.com/usbarmory),
|
||||||
or a separate VM in a [QubesOS](https://www.qubes-os.org/) type os setup.
|
or a separate VM in a [QubesOS](https://www.qubes-os.org/) type os setup.
|
||||||
|
|
@ -68,7 +68,7 @@ The security model of the signer is as follows:
|
||||||
The general flow for signing a transaction using e.g. geth is as follows:
|
The general flow for signing a transaction using e.g. geth is as follows:
|
||||||

|

|
||||||
|
|
||||||
In this case, `geth` would be started with `--externalsigner=http://localhost:8550` and would relay requests to `eth.sendTransaction`.
|
In this case, `geth` would be started with `--externalsigner=http://localhost:8550` and would relay requests to `ess.sendTransaction`.
|
||||||
|
|
||||||
## TODOs
|
## TODOs
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -170,7 +170,7 @@ remove any stored credential for that address (keyfile)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
app.Name = "Clef"
|
app.Name = "Clef"
|
||||||
app.Usage = "Manage Ethereum account operations"
|
app.Usage = "Manage Essentia account operations"
|
||||||
app.Flags = []cli.Flag{
|
app.Flags = []cli.Flag{
|
||||||
logLevelFlag,
|
logLevelFlag,
|
||||||
keystoreFlag,
|
keystoreFlag,
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
ethkey
|
ethkey
|
||||||
======
|
======
|
||||||
|
|
||||||
ethkey is a simple command-line tool for working with Ethereum keyfiles.
|
ethkey is a simple command-line tool for working with Essentia keyfiles.
|
||||||
|
|
||||||
|
|
||||||
# Usage
|
# Usage
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ var gitCommit = ""
|
||||||
var app *cli.App
|
var app *cli.App
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
app = utils.NewApp(gitCommit, "an Ethereum key manager")
|
app = utils.NewApp(gitCommit, "an Essentia key manager")
|
||||||
app.Commands = []cli.Command{
|
app.Commands = []cli.Command{
|
||||||
commandGenerate,
|
commandGenerate,
|
||||||
commandInspect,
|
commandInspect,
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,7 @@ var (
|
||||||
apiPortFlag = flag.Int("apiport", 8080, "Listener port for the HTTP API connection")
|
apiPortFlag = flag.Int("apiport", 8080, "Listener port for the HTTP API connection")
|
||||||
ethPortFlag = flag.Int("ethport", 30303, "Listener port for the devp2p connection")
|
ethPortFlag = flag.Int("ethport", 30303, "Listener port for the devp2p connection")
|
||||||
bootFlag = flag.String("bootnodes", "", "Comma separated bootnode essnode URLs to seed with")
|
bootFlag = flag.String("bootnodes", "", "Comma separated bootnode essnode URLs to seed with")
|
||||||
netFlag = flag.Uint64("network", 0, "Network ID to use for the Ethereum protocol")
|
netFlag = flag.Uint64("network", 0, "Network ID to use for the Essentia protocol")
|
||||||
statsFlag = flag.String("ethstats", "", "Ethstats network monitoring auth string")
|
statsFlag = flag.String("ethstats", "", "Ethstats network monitoring auth string")
|
||||||
|
|
||||||
netnameFlag = flag.String("faucet.name", "", "Network name to assign to the faucet")
|
netnameFlag = flag.String("faucet.name", "", "Network name to assign to the faucet")
|
||||||
|
|
@ -81,7 +81,7 @@ var (
|
||||||
captchaSecret = flag.String("captcha.secret", "", "Recaptcha secret key to authenticate server side")
|
captchaSecret = flag.String("captcha.secret", "", "Recaptcha secret key to authenticate server side")
|
||||||
|
|
||||||
noauthFlag = flag.Bool("noauth", false, "Enables funding requests without authentication")
|
noauthFlag = flag.Bool("noauth", false, "Enables funding requests without authentication")
|
||||||
logFlag = flag.Int("loglevel", 3, "Log level to use for Ethereum and the faucet")
|
logFlag = flag.Int("loglevel", 3, "Log level to use for Essentia and the faucet")
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
@ -184,16 +184,16 @@ func main() {
|
||||||
// request represents an accepted funding request.
|
// request represents an accepted funding request.
|
||||||
type request struct {
|
type request struct {
|
||||||
Avatar string `json:"avatar"` // Avatar URL to make the UI nicer
|
Avatar string `json:"avatar"` // Avatar URL to make the UI nicer
|
||||||
Account common.Address `json:"account"` // Ethereum address being funded
|
Account common.Address `json:"account"` // Essentia address being funded
|
||||||
Time time.Time `json:"time"` // Timestamp when the request was accepted
|
Time time.Time `json:"time"` // Timestamp when the request was accepted
|
||||||
Tx *types.Transaction `json:"tx"` // Transaction funding the account
|
Tx *types.Transaction `json:"tx"` // Transaction funding the account
|
||||||
}
|
}
|
||||||
|
|
||||||
// faucet represents a crypto faucet backed by an Ethereum light client.
|
// faucet represents a crypto faucet backed by an Essentia light client.
|
||||||
type faucet struct {
|
type faucet struct {
|
||||||
config *params.ChainConfig // Chain configurations for signing
|
config *params.ChainConfig // Chain configurations for signing
|
||||||
stack *node.Node // Ethereum protocol stack
|
stack *node.Node // Essentia protocol stack
|
||||||
client *ethclient.Client // Client connection to the Ethereum chain
|
client *ethclient.Client // Client connection to the Essentia chain
|
||||||
index []byte // Index page to serve up on the web
|
index []byte // Index page to serve up on the web
|
||||||
|
|
||||||
keystore *keystore.KeyStore // Keystore containing the single signer
|
keystore *keystore.KeyStore // Keystore containing the single signer
|
||||||
|
|
@ -227,9 +227,9 @@ func newFaucet(genesis *core.Genesis, port int, essnodes []*discv5.Node, network
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
// Assemble the Ethereum light client protocol
|
// Assemble the Essentia light client protocol
|
||||||
if err := stack.Register(func(ctx *node.ServiceContext) (node.Service, error) {
|
if err := stack.Register(func(ctx *node.ServiceContext) (node.Service, error) {
|
||||||
cfg := eth.DefaultConfig
|
cfg := ess.DefaultConfig
|
||||||
cfg.SyncMode = downloader.LightSync
|
cfg.SyncMode = downloader.LightSync
|
||||||
cfg.NetworkId = network
|
cfg.NetworkId = network
|
||||||
cfg.Genesis = genesis
|
cfg.Genesis = genesis
|
||||||
|
|
@ -275,7 +275,7 @@ func newFaucet(genesis *core.Genesis, port int, essnodes []*discv5.Node, network
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// close terminates the Ethereum connection and tears down the faucet.
|
// close terminates the Essentia connection and tears down the faucet.
|
||||||
func (f *faucet) close() error {
|
func (f *faucet) close() error {
|
||||||
return f.stack.Stop()
|
return f.stack.Stop()
|
||||||
}
|
}
|
||||||
|
|
@ -425,7 +425,7 @@ func (f *faucet) apiHandler(conn *websocket.Conn) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Retrieve the Ethereum address to fund, the requesting user and a profile picture
|
// Retrieve the Essentia address to fund, the requesting user and a profile picture
|
||||||
var (
|
var (
|
||||||
username string
|
username string
|
||||||
avatar string
|
avatar string
|
||||||
|
|
@ -636,7 +636,7 @@ func sendSuccess(conn *websocket.Conn, msg string) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
// authTwitter tries to authenticate a faucet request using Twitter posts, returning
|
// authTwitter tries to authenticate a faucet request using Twitter posts, returning
|
||||||
// the username, avatar URL and Ethereum address to fund on success.
|
// the username, avatar URL and Essentia address to fund on success.
|
||||||
func authTwitter(url string) (string, string, common.Address, error) {
|
func authTwitter(url string) (string, string, common.Address, error) {
|
||||||
// Ensure the user specified a meaningful URL, no fancy nonsense
|
// Ensure the user specified a meaningful URL, no fancy nonsense
|
||||||
parts := strings.Split(url, "/")
|
parts := strings.Split(url, "/")
|
||||||
|
|
@ -645,7 +645,7 @@ func authTwitter(url string) (string, string, common.Address, error) {
|
||||||
}
|
}
|
||||||
// Twitter's API isn't really friendly with direct links. Still, we don't
|
// Twitter's API isn't really friendly with direct links. Still, we don't
|
||||||
// want to do ask read permissions from users, so just load the public posts and
|
// want to do ask read permissions from users, so just load the public posts and
|
||||||
// scrape it for the Ethereum address and profile URL.
|
// scrape it for the Essentia address and profile URL.
|
||||||
res, err := http.Get(url)
|
res, err := http.Get(url)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", "", common.Address{}, err
|
return "", "", common.Address{}, err
|
||||||
|
|
@ -665,7 +665,7 @@ func authTwitter(url string) (string, string, common.Address, error) {
|
||||||
}
|
}
|
||||||
address := common.HexToAddress(string(regexp.MustCompile("0x[0-9a-fA-F]{40}").Find(body)))
|
address := common.HexToAddress(string(regexp.MustCompile("0x[0-9a-fA-F]{40}").Find(body)))
|
||||||
if address == (common.Address{}) {
|
if address == (common.Address{}) {
|
||||||
return "", "", common.Address{}, errors.New("No Ethereum address found to fund")
|
return "", "", common.Address{}, errors.New("No Essentia address found to fund")
|
||||||
}
|
}
|
||||||
var avatar string
|
var avatar string
|
||||||
if parts = regexp.MustCompile("src=\"([^\"]+twimg.com/profile_images[^\"]+)\"").FindStringSubmatch(string(body)); len(parts) == 2 {
|
if parts = regexp.MustCompile("src=\"([^\"]+twimg.com/profile_images[^\"]+)\"").FindStringSubmatch(string(body)); len(parts) == 2 {
|
||||||
|
|
@ -675,7 +675,7 @@ func authTwitter(url string) (string, string, common.Address, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// authGooglePlus tries to authenticate a faucet request using GooglePlus posts,
|
// authGooglePlus tries to authenticate a faucet request using GooglePlus posts,
|
||||||
// returning the username, avatar URL and Ethereum address to fund on success.
|
// returning the username, avatar URL and Essentia address to fund on success.
|
||||||
func authGooglePlus(url string) (string, string, common.Address, error) {
|
func authGooglePlus(url string) (string, string, common.Address, error) {
|
||||||
// Ensure the user specified a meaningful URL, no fancy nonsense
|
// Ensure the user specified a meaningful URL, no fancy nonsense
|
||||||
parts := strings.Split(url, "/")
|
parts := strings.Split(url, "/")
|
||||||
|
|
@ -686,7 +686,7 @@ func authGooglePlus(url string) (string, string, common.Address, error) {
|
||||||
|
|
||||||
// Google's API isn't really friendly with direct links. Still, we don't
|
// Google's API isn't really friendly with direct links. Still, we don't
|
||||||
// want to do ask read permissions from users, so just load the public posts and
|
// want to do ask read permissions from users, so just load the public posts and
|
||||||
// scrape it for the Ethereum address and profile URL.
|
// scrape it for the Essentia address and profile URL.
|
||||||
res, err := http.Get(url)
|
res, err := http.Get(url)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", "", common.Address{}, err
|
return "", "", common.Address{}, err
|
||||||
|
|
@ -699,7 +699,7 @@ func authGooglePlus(url string) (string, string, common.Address, error) {
|
||||||
}
|
}
|
||||||
address := common.HexToAddress(string(regexp.MustCompile("0x[0-9a-fA-F]{40}").Find(body)))
|
address := common.HexToAddress(string(regexp.MustCompile("0x[0-9a-fA-F]{40}").Find(body)))
|
||||||
if address == (common.Address{}) {
|
if address == (common.Address{}) {
|
||||||
return "", "", common.Address{}, errors.New("No Ethereum address found to fund")
|
return "", "", common.Address{}, errors.New("No Essentia address found to fund")
|
||||||
}
|
}
|
||||||
var avatar string
|
var avatar string
|
||||||
if parts = regexp.MustCompile("src=\"([^\"]+googleusercontent.com[^\"]+photo.jpg)\"").FindStringSubmatch(string(body)); len(parts) == 2 {
|
if parts = regexp.MustCompile("src=\"([^\"]+googleusercontent.com[^\"]+photo.jpg)\"").FindStringSubmatch(string(body)); len(parts) == 2 {
|
||||||
|
|
@ -709,7 +709,7 @@ func authGooglePlus(url string) (string, string, common.Address, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// authFacebook tries to authenticate a faucet request using Facebook posts,
|
// authFacebook tries to authenticate a faucet request using Facebook posts,
|
||||||
// returning the username, avatar URL and Ethereum address to fund on success.
|
// returning the username, avatar URL and Essentia address to fund on success.
|
||||||
func authFacebook(url string) (string, string, common.Address, error) {
|
func authFacebook(url string) (string, string, common.Address, error) {
|
||||||
// Ensure the user specified a meaningful URL, no fancy nonsense
|
// Ensure the user specified a meaningful URL, no fancy nonsense
|
||||||
parts := strings.Split(url, "/")
|
parts := strings.Split(url, "/")
|
||||||
|
|
@ -720,7 +720,7 @@ func authFacebook(url string) (string, string, common.Address, error) {
|
||||||
|
|
||||||
// Facebook's Graph API isn't really friendly with direct links. Still, we don't
|
// Facebook's Graph API isn't really friendly with direct links. Still, we don't
|
||||||
// want to do ask read permissions from users, so just load the public posts and
|
// want to do ask read permissions from users, so just load the public posts and
|
||||||
// scrape it for the Ethereum address and profile URL.
|
// scrape it for the Essentia address and profile URL.
|
||||||
res, err := http.Get(url)
|
res, err := http.Get(url)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", "", common.Address{}, err
|
return "", "", common.Address{}, err
|
||||||
|
|
@ -733,7 +733,7 @@ func authFacebook(url string) (string, string, common.Address, error) {
|
||||||
}
|
}
|
||||||
address := common.HexToAddress(string(regexp.MustCompile("0x[0-9a-fA-F]{40}").Find(body)))
|
address := common.HexToAddress(string(regexp.MustCompile("0x[0-9a-fA-F]{40}").Find(body)))
|
||||||
if address == (common.Address{}) {
|
if address == (common.Address{}) {
|
||||||
return "", "", common.Address{}, errors.New("No Ethereum address found to fund")
|
return "", "", common.Address{}, errors.New("No Essentia address found to fund")
|
||||||
}
|
}
|
||||||
var avatar string
|
var avatar string
|
||||||
if parts = regexp.MustCompile("src=\"([^\"]+fbcdn.net[^\"]+)\"").FindStringSubmatch(string(body)); len(parts) == 2 {
|
if parts = regexp.MustCompile("src=\"([^\"]+fbcdn.net[^\"]+)\"").FindStringSubmatch(string(body)); len(parts) == 2 {
|
||||||
|
|
@ -742,13 +742,13 @@ func authFacebook(url string) (string, string, common.Address, error) {
|
||||||
return username + "@facebook", avatar, address, nil
|
return username + "@facebook", avatar, address, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// authNoAuth tries to interpret a faucet request as a plain Ethereum address,
|
// authNoAuth tries to interpret a faucet request as a plain Essentia address,
|
||||||
// without actually performing any remote authentication. This mode is prone to
|
// without actually performing any remote authentication. This mode is prone to
|
||||||
// Byzantine attack, so only ever use for truly private networks.
|
// Byzantine attack, so only ever use for truly private networks.
|
||||||
func authNoAuth(url string) (string, string, common.Address, error) {
|
func authNoAuth(url string) (string, string, common.Address, error) {
|
||||||
address := common.HexToAddress(regexp.MustCompile("0x[0-9a-fA-F]{40}").FindString(url))
|
address := common.HexToAddress(regexp.MustCompile("0x[0-9a-fA-F]{40}").FindString(url))
|
||||||
if address == (common.Address{}) {
|
if address == (common.Address{}) {
|
||||||
return "", "", common.Address{}, errors.New("No Ethereum address found to fund")
|
return "", "", common.Address{}, errors.New("No Essentia address found to fund")
|
||||||
}
|
}
|
||||||
return address.Hex() + "@noauth", "", address, nil
|
return address.Hex() + "@noauth", "", address, nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-8 col-lg-offset-2">
|
<div class="col-lg-8 col-lg-offset-2">
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<input id="url" name="url" type="text" class="form-control" placeholder="Social network URL containing your Ethereum address...">
|
<input id="url" name="url" type="text" class="form-control" placeholder="Social network URL containing your Essentia address...">
|
||||||
<span class="input-group-btn">
|
<span class="input-group-btn">
|
||||||
<button class="btn btn-default dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Give me Ether <i class="fa fa-caret-down" aria-hidden="true"></i></button>
|
<button class="btn btn-default dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Give me Ether <i class="fa fa-caret-down" aria-hidden="true"></i></button>
|
||||||
<ul class="dropdown-menu dropdown-menu-right">{{range $idx, $amount := .Amounts}}
|
<ul class="dropdown-menu dropdown-menu-right">{{range $idx, $amount := .Amounts}}
|
||||||
|
|
@ -83,17 +83,17 @@
|
||||||
<p>This Ether faucet is running on the {{.Network}} network. To prevent malicious actors from exhausting all available funds or accumulating enough Ether to mount long running spam attacks, requests are tied to common 3rd party social network accounts. Anyone having a Twitter, Google+ or Facebook account may request funds within the permitted limits.</p>
|
<p>This Ether faucet is running on the {{.Network}} network. To prevent malicious actors from exhausting all available funds or accumulating enough Ether to mount long running spam attacks, requests are tied to common 3rd party social network accounts. Anyone having a Twitter, Google+ or Facebook account may request funds within the permitted limits.</p>
|
||||||
<dl class="dl-horizontal">
|
<dl class="dl-horizontal">
|
||||||
<dt style="width: auto; margin-left: 40px;"><i class="fa fa-twitter" aria-hidden="true" style="font-size: 36px;"></i></dt>
|
<dt style="width: auto; margin-left: 40px;"><i class="fa fa-twitter" aria-hidden="true" style="font-size: 36px;"></i></dt>
|
||||||
<dd style="margin-left: 88px; margin-bottom: 10px;"></i> To request funds via Twitter, make a <a href="https://twitter.com/intent/tweet?text=Requesting%20faucet%20funds%20into%200x0000000000000000000000000000000000000000%20on%20the%20%23{{.Network}}%20%23Ethereum%20test%20network." target="_about:blank">tweet</a> with your Ethereum address pasted into the contents (surrounding text doesn't matter).<br/>Copy-paste the <a href="https://support.twitter.com/articles/80586" target="_about:blank">tweets URL</a> into the above input box and fire away!</dd>
|
<dd style="margin-left: 88px; margin-bottom: 10px;"></i> To request funds via Twitter, make a <a href="https://twitter.com/intent/tweet?text=Requesting%20faucet%20funds%20into%200x0000000000000000000000000000000000000000%20on%20the%20%23{{.Network}}%20%23Ethereum%20test%20network." target="_about:blank">tweet</a> with your Essentia address pasted into the contents (surrounding text doesn't matter).<br/>Copy-paste the <a href="https://support.twitter.com/articles/80586" target="_about:blank">tweets URL</a> into the above input box and fire away!</dd>
|
||||||
|
|
||||||
<dt style="width: auto; margin-left: 40px;"><i class="fa fa-google-plus-official" aria-hidden="true" style="font-size: 36px;"></i></dt>
|
<dt style="width: auto; margin-left: 40px;"><i class="fa fa-google-plus-official" aria-hidden="true" style="font-size: 36px;"></i></dt>
|
||||||
<dd style="margin-left: 88px; margin-bottom: 10px;"></i> To request funds via Google Plus, publish a new <strong>public</strong> post with your Ethereum address embedded into the content (surrounding text doesn't matter).<br/>Copy-paste the posts URL into the above input box and fire away!</dd>
|
<dd style="margin-left: 88px; margin-bottom: 10px;"></i> To request funds via Google Plus, publish a new <strong>public</strong> post with your Essentia address embedded into the content (surrounding text doesn't matter).<br/>Copy-paste the posts URL into the above input box and fire away!</dd>
|
||||||
|
|
||||||
<dt style="width: auto; margin-left: 40px;"><i class="fa fa-facebook" aria-hidden="true" style="font-size: 36px;"></i></dt>
|
<dt style="width: auto; margin-left: 40px;"><i class="fa fa-facebook" aria-hidden="true" style="font-size: 36px;"></i></dt>
|
||||||
<dd style="margin-left: 88px; margin-bottom: 10px;"></i> To request funds via Facebook, publish a new <strong>public</strong> post with your Ethereum address embedded into the content (surrounding text doesn't matter).<br/>Copy-paste the <a href="https://www.facebook.com/help/community/question/?id=282662498552845" target="_about:blank">posts URL</a> into the above input box and fire away!</dd>
|
<dd style="margin-left: 88px; margin-bottom: 10px;"></i> To request funds via Facebook, publish a new <strong>public</strong> post with your Essentia address embedded into the content (surrounding text doesn't matter).<br/>Copy-paste the <a href="https://www.facebook.com/help/community/question/?id=282662498552845" target="_about:blank">posts URL</a> into the above input box and fire away!</dd>
|
||||||
|
|
||||||
{{if .NoAuth}}
|
{{if .NoAuth}}
|
||||||
<dt class="text-danger" style="width: auto; margin-left: 40px;"><i class="fa fa-unlock-alt" aria-hidden="true" style="font-size: 36px;"></i></dt>
|
<dt class="text-danger" style="width: auto; margin-left: 40px;"><i class="fa fa-unlock-alt" aria-hidden="true" style="font-size: 36px;"></i></dt>
|
||||||
<dd class="text-danger" style="margin-left: 88px; margin-bottom: 10px;"></i> To request funds <strong>without authentication</strong>, simply copy-paste your Ethereum address into the above input box (surrounding text doesn't matter) and fire away.<br/>This mode is susceptible to Byzantine attacks. Only use for debugging or private networks!</dd>
|
<dd class="text-danger" style="margin-left: 88px; margin-bottom: 10px;"></i> To request funds <strong>without authentication</strong>, simply copy-paste your Essentia address into the above input box (surrounding text doesn't matter) and fire away.<br/>This mode is susceptible to Byzantine attacks. Only use for debugging or private networks!</dd>
|
||||||
{{end}}
|
{{end}}
|
||||||
</dl>
|
</dl>
|
||||||
<p>You can track the current pending requests below the input field to see how much you have to wait until your turn comes.</p>
|
<p>You can track the current pending requests below the input field to see how much you have to wait until your turn comes.</p>
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ import (
|
||||||
var (
|
var (
|
||||||
walletCommand = cli.Command{
|
walletCommand = cli.Command{
|
||||||
Name: "wallet",
|
Name: "wallet",
|
||||||
Usage: "Manage Ethereum presale wallets",
|
Usage: "Manage Essentia presale wallets",
|
||||||
ArgsUsage: "",
|
ArgsUsage: "",
|
||||||
Category: "ACCOUNT COMMANDS",
|
Category: "ACCOUNT COMMANDS",
|
||||||
Description: `
|
Description: `
|
||||||
|
|
@ -45,7 +45,7 @@ passwordfile as argument containing the wallet password in plaintext.`,
|
||||||
{
|
{
|
||||||
|
|
||||||
Name: "import",
|
Name: "import",
|
||||||
Usage: "Import Ethereum presale wallet",
|
Usage: "Import Essentia presale wallet",
|
||||||
ArgsUsage: "<keyFile>",
|
ArgsUsage: "<keyFile>",
|
||||||
Action: utils.MigrateFlags(importWallet),
|
Action: utils.MigrateFlags(importWallet),
|
||||||
Category: "ACCOUNT COMMANDS",
|
Category: "ACCOUNT COMMANDS",
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,7 @@ type ethstatsConfig struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
type gethConfig struct {
|
type gethConfig struct {
|
||||||
Eth eth.Config
|
Ess ess.Config
|
||||||
Shh whisper.Config
|
Shh whisper.Config
|
||||||
Node node.Config
|
Node node.Config
|
||||||
Ethstats ethstatsConfig
|
Ethstats ethstatsConfig
|
||||||
|
|
@ -101,8 +101,8 @@ func defaultNodeConfig() node.Config {
|
||||||
cfg := node.DefaultConfig
|
cfg := node.DefaultConfig
|
||||||
cfg.Name = clientIdentifier
|
cfg.Name = clientIdentifier
|
||||||
cfg.Version = params.VersionWithCommit(gitCommit)
|
cfg.Version = params.VersionWithCommit(gitCommit)
|
||||||
cfg.HTTPModules = append(cfg.HTTPModules, "eth", "shh")
|
cfg.HTTPModules = append(cfg.HTTPModules, "ess", "shh")
|
||||||
cfg.WSModules = append(cfg.WSModules, "eth", "shh")
|
cfg.WSModules = append(cfg.WSModules, "ess", "shh")
|
||||||
cfg.IPCPath = "geth.ipc"
|
cfg.IPCPath = "geth.ipc"
|
||||||
return cfg
|
return cfg
|
||||||
}
|
}
|
||||||
|
|
@ -110,7 +110,7 @@ func defaultNodeConfig() node.Config {
|
||||||
func makeConfigNode(ctx *cli.Context) (*node.Node, gethConfig) {
|
func makeConfigNode(ctx *cli.Context) (*node.Node, gethConfig) {
|
||||||
// Load defaults.
|
// Load defaults.
|
||||||
cfg := gethConfig{
|
cfg := gethConfig{
|
||||||
Eth: eth.DefaultConfig,
|
Ess: ess.DefaultConfig,
|
||||||
Shh: whisper.DefaultConfig,
|
Shh: whisper.DefaultConfig,
|
||||||
Node: defaultNodeConfig(),
|
Node: defaultNodeConfig(),
|
||||||
Dashboard: dashboard.DefaultConfig,
|
Dashboard: dashboard.DefaultConfig,
|
||||||
|
|
@ -129,7 +129,7 @@ func makeConfigNode(ctx *cli.Context) (*node.Node, gethConfig) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
utils.Fatalf("Failed to create the protocol stack: %v", err)
|
utils.Fatalf("Failed to create the protocol stack: %v", err)
|
||||||
}
|
}
|
||||||
utils.SetEthConfig(ctx, stack, &cfg.Eth)
|
utils.SetEthConfig(ctx, stack, &cfg.Ess)
|
||||||
if ctx.GlobalIsSet(utils.EthStatsURLFlag.Name) {
|
if ctx.GlobalIsSet(utils.EthStatsURLFlag.Name) {
|
||||||
cfg.Ethstats.URL = ctx.GlobalString(utils.EthStatsURLFlag.Name)
|
cfg.Ethstats.URL = ctx.GlobalString(utils.EthStatsURLFlag.Name)
|
||||||
}
|
}
|
||||||
|
|
@ -153,7 +153,7 @@ func enableWhisper(ctx *cli.Context) bool {
|
||||||
func makeFullNode(ctx *cli.Context) *node.Node {
|
func makeFullNode(ctx *cli.Context) *node.Node {
|
||||||
stack, cfg := makeConfigNode(ctx)
|
stack, cfg := makeConfigNode(ctx)
|
||||||
|
|
||||||
utils.RegisterEthService(stack, &cfg.Eth)
|
utils.RegisterEthService(stack, &cfg.Ess)
|
||||||
|
|
||||||
if ctx.GlobalBool(utils.DashboardEnabledFlag.Name) {
|
if ctx.GlobalBool(utils.DashboardEnabledFlag.Name) {
|
||||||
utils.RegisterDashboardService(stack, &cfg.Dashboard, gitCommit)
|
utils.RegisterDashboardService(stack, &cfg.Dashboard, gitCommit)
|
||||||
|
|
@ -171,7 +171,7 @@ func makeFullNode(ctx *cli.Context) *node.Node {
|
||||||
utils.RegisterShhService(stack, &cfg.Shh)
|
utils.RegisterShhService(stack, &cfg.Shh)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add the Ethereum Stats daemon if requested.
|
// Add the Essentia Stats daemon if requested.
|
||||||
if cfg.Ethstats.URL != "" {
|
if cfg.Ethstats.URL != "" {
|
||||||
utils.RegisterEthStatsService(stack, cfg.Ethstats.URL)
|
utils.RegisterEthStatsService(stack, cfg.Ethstats.URL)
|
||||||
}
|
}
|
||||||
|
|
@ -183,8 +183,8 @@ func dumpConfig(ctx *cli.Context) error {
|
||||||
_, cfg := makeConfigNode(ctx)
|
_, cfg := makeConfigNode(ctx)
|
||||||
comment := ""
|
comment := ""
|
||||||
|
|
||||||
if cfg.Eth.Genesis != nil {
|
if cfg.Ess.Genesis != nil {
|
||||||
cfg.Eth.Genesis = nil
|
cfg.Ess.Genesis = nil
|
||||||
comment += "# Note: this config doesn't contain the genesis block.\n\n"
|
comment += "# Note: this config doesn't contain the genesis block.\n\n"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,8 +31,8 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
ipcAPIs = "admin:1.0 debug:1.0 eth:1.0 miner:1.0 net:1.0 personal:1.0 rpc:1.0 shh:1.0 txpool:1.0 web3:1.0"
|
ipcAPIs = "admin:1.0 debug:1.0 ess:1.0 miner:1.0 net:1.0 personal:1.0 rpc:1.0 shh:1.0 txpool:1.0 web3:1.0"
|
||||||
httpAPIs = "eth:1.0 net:1.0 rpc:1.0 web3:1.0"
|
httpAPIs = "ess:1.0 net:1.0 rpc:1.0 web3:1.0"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Tests that a node embedded within a console can be started up properly and
|
// Tests that a node embedded within a console can be started up properly and
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ var customGenesisTests = []struct {
|
||||||
"parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
|
"parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
|
||||||
"timestamp" : "0x00"
|
"timestamp" : "0x00"
|
||||||
}`,
|
}`,
|
||||||
query: "eth.getBlock(0).nonce",
|
query: "ess.getBlock(0).nonce",
|
||||||
result: "0x0000000000000042",
|
result: "0x0000000000000042",
|
||||||
},
|
},
|
||||||
// Genesis file with an empty chain configuration (ensure missing fields work)
|
// Genesis file with an empty chain configuration (ensure missing fields work)
|
||||||
|
|
@ -58,7 +58,7 @@ var customGenesisTests = []struct {
|
||||||
"timestamp" : "0x00",
|
"timestamp" : "0x00",
|
||||||
"config" : {}
|
"config" : {}
|
||||||
}`,
|
}`,
|
||||||
query: "eth.getBlock(0).nonce",
|
query: "ess.getBlock(0).nonce",
|
||||||
result: "0x0000000000000042",
|
result: "0x0000000000000042",
|
||||||
},
|
},
|
||||||
// Genesis file with specific chain configurations
|
// Genesis file with specific chain configurations
|
||||||
|
|
@ -79,7 +79,7 @@ var customGenesisTests = []struct {
|
||||||
"daoForkSupport" : true
|
"daoForkSupport" : true
|
||||||
}
|
}
|
||||||
}`,
|
}`,
|
||||||
query: "eth.getBlock(0).nonce",
|
query: "ess.getBlock(0).nonce",
|
||||||
result: "0x0000000000000042",
|
result: "0x0000000000000042",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
|
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
// geth is the official command-line client for Ethereum.
|
// geth is the official command-line client for Essentia.
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|
@ -319,13 +319,13 @@ func startNode(ctx *cli.Context, stack *node.Node) {
|
||||||
}()
|
}()
|
||||||
// Start auxiliary services if enabled
|
// Start auxiliary services if enabled
|
||||||
if ctx.GlobalBool(utils.MiningEnabledFlag.Name) || ctx.GlobalBool(utils.DeveloperFlag.Name) {
|
if ctx.GlobalBool(utils.MiningEnabledFlag.Name) || ctx.GlobalBool(utils.DeveloperFlag.Name) {
|
||||||
// Mining only makes sense if a full Ethereum node is running
|
// Mining only makes sense if a full Essentia node is running
|
||||||
if ctx.GlobalBool(utils.LightModeFlag.Name) || ctx.GlobalString(utils.SyncModeFlag.Name) == "light" {
|
if ctx.GlobalBool(utils.LightModeFlag.Name) || ctx.GlobalString(utils.SyncModeFlag.Name) == "light" {
|
||||||
utils.Fatalf("Light clients do not support mining")
|
utils.Fatalf("Light clients do not support mining")
|
||||||
}
|
}
|
||||||
var ethereum *eth.Ethereum
|
var ethereum *ess.Essentia
|
||||||
if err := stack.Service(ðereum); err != nil {
|
if err := stack.Service(ðereum); err != nil {
|
||||||
utils.Fatalf("Ethereum service not running: %v", err)
|
utils.Fatalf("Essentia service not running: %v", err)
|
||||||
}
|
}
|
||||||
// Use a reduced number of threads if requested
|
// Use a reduced number of threads if requested
|
||||||
if threads := ctx.GlobalInt(utils.MinerThreadsFlag.Name); threads > 0 {
|
if threads := ctx.GlobalInt(utils.MinerThreadsFlag.Name); threads > 0 {
|
||||||
|
|
|
||||||
|
|
@ -113,8 +113,8 @@ func version(ctx *cli.Context) error {
|
||||||
fmt.Println("Git Commit:", gitCommit)
|
fmt.Println("Git Commit:", gitCommit)
|
||||||
}
|
}
|
||||||
fmt.Println("Architecture:", runtime.GOARCH)
|
fmt.Println("Architecture:", runtime.GOARCH)
|
||||||
fmt.Println("Protocol Versions:", eth.ProtocolVersions)
|
fmt.Println("Protocol Versions:", ess.ProtocolVersions)
|
||||||
fmt.Println("Network Id:", eth.DefaultConfig.NetworkId)
|
fmt.Println("Network Id:", ess.DefaultConfig.NetworkId)
|
||||||
fmt.Println("Go Version:", runtime.Version())
|
fmt.Println("Go Version:", runtime.Version())
|
||||||
fmt.Println("Operating System:", runtime.GOOS)
|
fmt.Println("Operating System:", runtime.GOOS)
|
||||||
fmt.Printf("GOPATH=%s\n", os.Getenv("GOPATH"))
|
fmt.Printf("GOPATH=%s\n", os.Getenv("GOPATH"))
|
||||||
|
|
|
||||||
|
|
@ -73,7 +73,7 @@ func monitor(ctx *cli.Context) error {
|
||||||
client *rpc.Client
|
client *rpc.Client
|
||||||
err error
|
err error
|
||||||
)
|
)
|
||||||
// Attach to an Ethereum node over IPC or RPC
|
// Attach to an Essentia node over IPC or RPC
|
||||||
endpoint := ctx.String(monitorCommandAttachFlag.Name)
|
endpoint := ctx.String(monitorCommandAttachFlag.Name)
|
||||||
if client, err = dialRPC(endpoint); err != nil {
|
if client, err = dialRPC(endpoint); err != nil {
|
||||||
utils.Fatalf("Unable to attach to geth node: %v", err)
|
utils.Fatalf("Unable to attach to geth node: %v", err)
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// cppEthereumGenesisSpec represents the genesis specification format used by the
|
// cppEthereumGenesisSpec represents the genesis specification format used by the
|
||||||
// C++ Ethereum implementation.
|
// C++ Essentia implementation.
|
||||||
type cppEthereumGenesisSpec struct {
|
type cppEthereumGenesisSpec struct {
|
||||||
SealEngine string `json:"sealEngine"`
|
SealEngine string `json:"sealEngine"`
|
||||||
Params struct {
|
Params struct {
|
||||||
|
|
@ -201,7 +201,7 @@ type parityChainSpec struct {
|
||||||
|
|
||||||
Genesis struct {
|
Genesis struct {
|
||||||
Seal struct {
|
Seal struct {
|
||||||
Ethereum struct {
|
Essentia struct {
|
||||||
Nonce hexutil.Bytes `json:"nonce"`
|
Nonce hexutil.Bytes `json:"nonce"`
|
||||||
MixHash hexutil.Bytes `json:"mixHash"`
|
MixHash hexutil.Bytes `json:"mixHash"`
|
||||||
} `json:"ethereum"`
|
} `json:"ethereum"`
|
||||||
|
|
@ -294,10 +294,10 @@ func newParityChainSpec(network string, genesis *core.Genesis, bootnodes []strin
|
||||||
spec.Params.EIP214Transition = genesis.Config.ByzantiumBlock.Uint64()
|
spec.Params.EIP214Transition = genesis.Config.ByzantiumBlock.Uint64()
|
||||||
spec.Params.EIP658Transition = genesis.Config.ByzantiumBlock.Uint64()
|
spec.Params.EIP658Transition = genesis.Config.ByzantiumBlock.Uint64()
|
||||||
|
|
||||||
spec.Genesis.Seal.Ethereum.Nonce = (hexutil.Bytes)(make([]byte, 8))
|
spec.Genesis.Seal.Essentia.Nonce = (hexutil.Bytes)(make([]byte, 8))
|
||||||
binary.LittleEndian.PutUint64(spec.Genesis.Seal.Ethereum.Nonce[:], genesis.Nonce)
|
binary.LittleEndian.PutUint64(spec.Genesis.Seal.Essentia.Nonce[:], genesis.Nonce)
|
||||||
|
|
||||||
spec.Genesis.Seal.Ethereum.MixHash = (hexutil.Bytes)(genesis.Mixhash[:])
|
spec.Genesis.Seal.Essentia.MixHash = (hexutil.Bytes)(genesis.Mixhash[:])
|
||||||
spec.Genesis.Difficulty = (*hexutil.Big)(genesis.Difficulty)
|
spec.Genesis.Difficulty = (*hexutil.Big)(genesis.Difficulty)
|
||||||
spec.Genesis.Author = genesis.Coinbase
|
spec.Genesis.Author = genesis.Coinbase
|
||||||
spec.Genesis.Timestamp = (hexutil.Uint64)(genesis.Timestamp)
|
spec.Genesis.Timestamp = (hexutil.Uint64)(genesis.Timestamp)
|
||||||
|
|
@ -342,7 +342,7 @@ func newParityChainSpec(network string, genesis *core.Genesis, bootnodes []strin
|
||||||
}
|
}
|
||||||
|
|
||||||
// pyEthereumGenesisSpec represents the genesis specification format used by the
|
// pyEthereumGenesisSpec represents the genesis specification format used by the
|
||||||
// Python Ethereum implementation.
|
// Python Essentia implementation.
|
||||||
type pyEthereumGenesisSpec struct {
|
type pyEthereumGenesisSpec struct {
|
||||||
Nonce hexutil.Bytes `json:"nonce"`
|
Nonce hexutil.Bytes `json:"nonce"`
|
||||||
Timestamp hexutil.Uint64 `json:"timestamp"`
|
Timestamp hexutil.Uint64 `json:"timestamp"`
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ var dashboardContent = `
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
|
||||||
<title>{{.NetworkTitle}}: Ethereum Testnet</title>
|
<title>{{.NetworkTitle}}: Essentia Testnet</title>
|
||||||
|
|
||||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
|
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
|
||||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
|
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
|
||||||
|
|
@ -84,10 +84,10 @@ var dashboardContent = `
|
||||||
{{if .FaucetPage}}<li id="faucet_menu"><a onclick="load('#faucet')"><i class="fa fa-bath"></i> Crypto Faucet</a></li>{{end}}
|
{{if .FaucetPage}}<li id="faucet_menu"><a onclick="load('#faucet')"><i class="fa fa-bath"></i> Crypto Faucet</a></li>{{end}}
|
||||||
<li id="connect_menu"><a><i class="fa fa-plug"></i> Connect Yourself</a>
|
<li id="connect_menu"><a><i class="fa fa-plug"></i> Connect Yourself</a>
|
||||||
<ul id="connect_list" class="nav child_menu">
|
<ul id="connect_list" class="nav child_menu">
|
||||||
<li><a onclick="$('#connect_menu').removeClass('active'); $('#connect_list').toggle(); load('#geth')">Go Ethereum: Geth</a></li>
|
<li><a onclick="$('#connect_menu').removeClass('active'); $('#connect_list').toggle(); load('#geth')">Go Essentia: Geth</a></li>
|
||||||
<li><a onclick="$('#connect_menu').removeClass('active'); $('#connect_list').toggle(); load('#mist')">Go Ethereum: Wallet & Mist</a></li>
|
<li><a onclick="$('#connect_menu').removeClass('active'); $('#connect_list').toggle(); load('#mist')">Go Essentia: Wallet & Mist</a></li>
|
||||||
<li><a onclick="$('#connect_menu').removeClass('active'); $('#connect_list').toggle(); load('#mobile')">Go Ethereum: Android & iOS</a></li>{{if .Ethash}}
|
<li><a onclick="$('#connect_menu').removeClass('active'); $('#connect_list').toggle(); load('#mobile')">Go Essentia: Android & iOS</a></li>{{if .Ethash}}
|
||||||
<li><a onclick="$('#connect_menu').removeClass('active'); $('#connect_list').toggle(); load('#other')">Other Ethereum Clients</a></li>{{end}}
|
<li><a onclick="$('#connect_menu').removeClass('active'); $('#connect_list').toggle(); load('#other')">Other Essentia Clients</a></li>{{end}}
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li id="about_menu"><a onclick="load('#about')"><i class="fa fa-heartbeat"></i> About Puppeth</a></li>
|
<li id="about_menu"><a onclick="load('#about')"><i class="fa fa-heartbeat"></i> About Puppeth</a></li>
|
||||||
|
|
@ -100,7 +100,7 @@ var dashboardContent = `
|
||||||
<div id="geth" hidden style="padding: 16px;">
|
<div id="geth" hidden style="padding: 16px;">
|
||||||
<div class="page-title">
|
<div class="page-title">
|
||||||
<div class="title_left">
|
<div class="title_left">
|
||||||
<h3>Connect Yourself – Go Ethereum: Geth</h3>
|
<h3>Connect Yourself – Go Essentia: Geth</h3>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="clearfix"></div>
|
<div class="clearfix"></div>
|
||||||
|
|
@ -189,7 +189,7 @@ var dashboardContent = `
|
||||||
<div id="mist" hidden style="padding: 16px;">
|
<div id="mist" hidden style="padding: 16px;">
|
||||||
<div class="page-title">
|
<div class="page-title">
|
||||||
<div class="title_left">
|
<div class="title_left">
|
||||||
<h3>Connect Yourself – Go Ethereum: Wallet & Mist</h3>
|
<h3>Connect Yourself – Go Essentia: Wallet & Mist</h3>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="clearfix"></div>
|
<div class="clearfix"></div>
|
||||||
|
|
@ -201,17 +201,17 @@ var dashboardContent = `
|
||||||
<div class="clearfix"></div>
|
<div class="clearfix"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="x_content">
|
<div class="x_content">
|
||||||
<p>The Ethereum Wallet is an <a href="https://electron.atom.io/" target="about:blank">Electron</a> based desktop application to manage your Ethereum accounts and funds. Beside the usual account life-cycle operations you would expect to perform, the wallet also provides a means to send transactions from your accounts and to interact with smart contracts deployed on the network.</p>
|
<p>The Essentia Wallet is an <a href="https://electron.atom.io/" target="about:blank">Electron</a> based desktop application to manage your Essentia accounts and funds. Beside the usual account life-cycle operations you would expect to perform, the wallet also provides a means to send transactions from your accounts and to interact with smart contracts deployed on the network.</p>
|
||||||
<p>Under the hood the wallet is backed by a go-ethereum full node, meaning that a mid range machine is assumed. Similarly, synchronization is based on <strong>fast-sync</strong>, which will download all blockchain data from the network and make it available to the wallet. Light nodes cannot currently fully back the wallet, but it's a target actively pursued.</p>
|
<p>Under the hood the wallet is backed by a go-ethereum full node, meaning that a mid range machine is assumed. Similarly, synchronization is based on <strong>fast-sync</strong>, which will download all blockchain data from the network and make it available to the wallet. Light nodes cannot currently fully back the wallet, but it's a target actively pursued.</p>
|
||||||
<br/>
|
<br/>
|
||||||
<p>To connect with the Ethereum Wallet, you'll need to initialize your private network first via Geth as the wallet does not currently support calling Geth directly. To initialize your local chain, download <a href="/{{.GethGenesis}}"><code>{{.GethGenesis}}</code></a> and run:
|
<p>To connect with the Essentia Wallet, you'll need to initialize your private network first via Geth as the wallet does not currently support calling Geth directly. To initialize your local chain, download <a href="/{{.GethGenesis}}"><code>{{.GethGenesis}}</code></a> and run:
|
||||||
<pre>geth --datadir=$HOME/.{{.Network}} init {{.GethGenesis}}</pre>
|
<pre>geth --datadir=$HOME/.{{.Network}} init {{.GethGenesis}}</pre>
|
||||||
</p>
|
</p>
|
||||||
<p>With your local chain initialized, you can start the Ethereum Wallet:
|
<p>With your local chain initialized, you can start the Essentia Wallet:
|
||||||
<pre>ethereumwallet --rpc $HOME/.{{.Network}}/geth.ipc --node-networkid={{.NetworkID}} --node-datadir=$HOME/.{{.Network}}{{if .Ethstats}} --node-ethstats='{{.Ethstats}}'{{end}} --node-bootnodes={{.BootnodesFlat}}</pre>
|
<pre>ethereumwallet --rpc $HOME/.{{.Network}}/geth.ipc --node-networkid={{.NetworkID}} --node-datadir=$HOME/.{{.Network}}{{if .Ethstats}} --node-ethstats='{{.Ethstats}}'{{end}} --node-bootnodes={{.BootnodesFlat}}</pre>
|
||||||
<p>
|
<p>
|
||||||
<br/>
|
<br/>
|
||||||
<p>You can download the Ethereum Wallet from <a href="https://github.com/ethereum/mist/releases" target="about:blank">https://github.com/ethereum/mist/releases</a>.</p>
|
<p>You can download the Essentia Wallet from <a href="https://github.com/ethereum/mist/releases" target="about:blank">https://github.com/ethereum/mist/releases</a>.</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -222,7 +222,7 @@ var dashboardContent = `
|
||||||
<div class="clearfix"></div>
|
<div class="clearfix"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="x_content">
|
<div class="x_content">
|
||||||
<p>The Mist browser is an <a href="https://electron.atom.io/" target="about:blank">Electron</a> based desktop application to load and interact with Ethereum enabled third party web DApps. Beside all the functionality provided by the Ethereum Wallet, Mist is an extended web-browser where loaded pages have access to the Ethereum network via a web3.js provider, and may also interact with users' own accounts (given proper authorization and confirmation of course).</p>
|
<p>The Mist browser is an <a href="https://electron.atom.io/" target="about:blank">Electron</a> based desktop application to load and interact with Essentia enabled third party web DApps. Beside all the functionality provided by the Essentia Wallet, Mist is an extended web-browser where loaded pages have access to the Essentia network via a web3.js provider, and may also interact with users' own accounts (given proper authorization and confirmation of course).</p>
|
||||||
<p>Under the hood the browser is backed by a go-ethereum full node, meaning that a mid range machine is assumed. Similarly, synchronization is based on <strong>fast-sync</strong>, which will download all blockchain data from the network and make it available to the wallet. Light nodes cannot currently fully back the wallet, but it's a target actively pursued.</p>
|
<p>Under the hood the browser is backed by a go-ethereum full node, meaning that a mid range machine is assumed. Similarly, synchronization is based on <strong>fast-sync</strong>, which will download all blockchain data from the network and make it available to the wallet. Light nodes cannot currently fully back the wallet, but it's a target actively pursued.</p>
|
||||||
<br/>
|
<br/>
|
||||||
<p>To connect with the Mist browser, you'll need to initialize your private network first via Geth as Mist does not currently support calling Geth directly. To initialize your local chain, download <a href="/{{.GethGenesis}}"><code>{{.GethGenesis}}</code></a> and run:
|
<p>To connect with the Mist browser, you'll need to initialize your private network first via Geth as Mist does not currently support calling Geth directly. To initialize your local chain, download <a href="/{{.GethGenesis}}"><code>{{.GethGenesis}}</code></a> and run:
|
||||||
|
|
@ -241,7 +241,7 @@ var dashboardContent = `
|
||||||
<div id="mobile" hidden style="padding: 16px;">
|
<div id="mobile" hidden style="padding: 16px;">
|
||||||
<div class="page-title">
|
<div class="page-title">
|
||||||
<div class="title_left">
|
<div class="title_left">
|
||||||
<h3>Connect Yourself – Go Ethereum: Android & iOS</h3>
|
<h3>Connect Yourself – Go Essentia: Android & iOS</h3>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="clearfix"></div>
|
<div class="clearfix"></div>
|
||||||
|
|
@ -249,16 +249,16 @@ var dashboardContent = `
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<div class="x_panel">
|
<div class="x_panel">
|
||||||
<div class="x_title">
|
<div class="x_title">
|
||||||
<h2><i class="fa fa-android" aria-hidden="true"></i> Android devices <small>Accesses Ethereum via Java</small></h2>
|
<h2><i class="fa fa-android" aria-hidden="true"></i> Android devices <small>Accesses Essentia via Java</small></h2>
|
||||||
<div class="clearfix"></div>
|
<div class="clearfix"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="x_content">
|
<div class="x_content">
|
||||||
<p>Starting with the 1.5 release of go-ethereum, we've transitioned away from shipping only full blown Ethereum clients and started focusing on releasing the code as reusable packages initially for Go projects, then later for Java based Android projects too. Mobile support is still evolving, hence is bound to change often and hard, but the Ethereum network can nonetheless be accessed from Android too.</p>
|
<p>Starting with the 1.5 release of go-ethereum, we've transitioned away from shipping only full blown Essentia clients and started focusing on releasing the code as reusable packages initially for Go projects, then later for Java based Android projects too. Mobile support is still evolving, hence is bound to change often and hard, but the Essentia network can nonetheless be accessed from Android too.</p>
|
||||||
<p>Under the hood the Android library is backed by a go-ethereum light node, meaning that given a not-too-old Android device, you should be able to join the network without significant issues. Certain functionality is not yet available and rough edges are bound to appear here and there, please report issues if you find any.</p>
|
<p>Under the hood the Android library is backed by a go-ethereum light node, meaning that given a not-too-old Android device, you should be able to join the network without significant issues. Certain functionality is not yet available and rough edges are bound to appear here and there, please report issues if you find any.</p>
|
||||||
<br/>
|
<br/>
|
||||||
<p>The stable Android archives are distributed via Maven Central, and the develop snapshots via the Sonatype repositories. Before proceeding, please ensure you have a recent version configured in your Android project. You can find details in <a href="https://github.com/orangeAndSuns/go-ethereum/wiki/Mobile:-Introduction#android-archive" target="about:blank">Mobile: Introduction – Android archive</a>.
|
<p>The stable Android archives are distributed via Maven Central, and the develop snapshots via the Sonatype repositories. Before proceeding, please ensure you have a recent version configured in your Android project. You can find details in <a href="https://github.com/orangeAndSuns/go-ethereum/wiki/Mobile:-Introduction#android-archive" target="about:blank">Mobile: Introduction – Android archive</a>.
|
||||||
<p>Before connecting to the Ethereum network, download the <a href="/{{.GethGenesis}}"><code>{{.GethGenesis}}</code></a> genesis json file and either store it in your Android project as a resource file you can access, or save it as a string in a variable. You're going to need to to initialize your client.</p>
|
<p>Before connecting to the Essentia network, download the <a href="/{{.GethGenesis}}"><code>{{.GethGenesis}}</code></a> genesis json file and either store it in your Android project as a resource file you can access, or save it as a string in a variable. You're going to need to to initialize your client.</p>
|
||||||
<p>Inside your Java code you can now import the geth archive and connect to Ethereum:
|
<p>Inside your Java code you can now import the geth archive and connect to Essentia:
|
||||||
<pre>import org.ethereum.geth.*;</pre>
|
<pre>import org.ethereum.geth.*;</pre>
|
||||||
<pre>
|
<pre>
|
||||||
Enodes bootnodes = new Enodes();{{range .Bootnodes}}
|
Enodes bootnodes = new Enodes();{{range .Bootnodes}}
|
||||||
|
|
@ -280,16 +280,16 @@ node.start();
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<div class="x_panel">
|
<div class="x_panel">
|
||||||
<div class="x_title">
|
<div class="x_title">
|
||||||
<h2><i class="fa fa-apple" aria-hidden="true"></i> iOS devices <small>Accesses Ethereum via ObjC/Swift</small></h2>
|
<h2><i class="fa fa-apple" aria-hidden="true"></i> iOS devices <small>Accesses Essentia via ObjC/Swift</small></h2>
|
||||||
<div class="clearfix"></div>
|
<div class="clearfix"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="x_content">
|
<div class="x_content">
|
||||||
<p>Starting with the 1.5 release of go-ethereum, we've transitioned away from shipping only full blown Ethereum clients and started focusing on releasing the code as reusable packages initially for Go projects, then later for ObjC/Swift based iOS projects too. Mobile support is still evolving, hence is bound to change often and hard, but the Ethereum network can nonetheless be accessed from iOS too.</p>
|
<p>Starting with the 1.5 release of go-ethereum, we've transitioned away from shipping only full blown Essentia clients and started focusing on releasing the code as reusable packages initially for Go projects, then later for ObjC/Swift based iOS projects too. Mobile support is still evolving, hence is bound to change often and hard, but the Essentia network can nonetheless be accessed from iOS too.</p>
|
||||||
<p>Under the hood the iOS library is backed by a go-ethereum light node, meaning that given a not-too-old Apple device, you should be able to join the network without significant issues. Certain functionality is not yet available and rough edges are bound to appear here and there, please report issues if you find any.</p>
|
<p>Under the hood the iOS library is backed by a go-ethereum light node, meaning that given a not-too-old Apple device, you should be able to join the network without significant issues. Certain functionality is not yet available and rough edges are bound to appear here and there, please report issues if you find any.</p>
|
||||||
<br/>
|
<br/>
|
||||||
<p>Both stable and develop builds of the iOS framework are available via CocoaPods. Before proceeding, please ensure you have a recent version configured in your iOS project. You can find details in <a href="https://github.com/orangeAndSuns/go-ethereum/wiki/Mobile:-Introduction#ios-framework" target="about:blank">Mobile: Introduction – iOS framework</a>.
|
<p>Both stable and develop builds of the iOS framework are available via CocoaPods. Before proceeding, please ensure you have a recent version configured in your iOS project. You can find details in <a href="https://github.com/orangeAndSuns/go-ethereum/wiki/Mobile:-Introduction#ios-framework" target="about:blank">Mobile: Introduction – iOS framework</a>.
|
||||||
<p>Before connecting to the Ethereum network, download the <a href="/{{.GethGenesis}}"><code>{{.GethGenesis}}</code></a> genesis json file and either store it in your iOS project as a resource file you can access, or save it as a string in a variable. You're going to need to to initialize your client.</p>
|
<p>Before connecting to the Essentia network, download the <a href="/{{.GethGenesis}}"><code>{{.GethGenesis}}</code></a> genesis json file and either store it in your iOS project as a resource file you can access, or save it as a string in a variable. You're going to need to to initialize your client.</p>
|
||||||
<p>Inside your Swift code you can now import the geth framework and connect to Ethereum (ObjC should be analogous):
|
<p>Inside your Swift code you can now import the geth framework and connect to Essentia (ObjC should be analogous):
|
||||||
<pre>import Geth</pre>
|
<pre>import Geth</pre>
|
||||||
<pre>
|
<pre>
|
||||||
var error: NSError?
|
var error: NSError?
|
||||||
|
|
@ -316,7 +316,7 @@ try! node?.start();
|
||||||
<div id="other" hidden style="padding: 16px;">
|
<div id="other" hidden style="padding: 16px;">
|
||||||
<div class="page-title">
|
<div class="page-title">
|
||||||
<div class="title_left">
|
<div class="title_left">
|
||||||
<h3>Connect Yourself – Other Ethereum Clients</h3>
|
<h3>Connect Yourself – Other Essentia Clients</h3>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="clearfix"></div>
|
<div class="clearfix"></div>
|
||||||
|
|
@ -326,15 +326,15 @@ try! node?.start();
|
||||||
<div class="x_title">
|
<div class="x_title">
|
||||||
<h2>
|
<h2>
|
||||||
<svg height="14px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 115 115"><path fill="#5C8DBC" d="M9.7 83.3V35.5s0-3.4 3.3-5.2c3.3-1.8 39.6-23.5 39.6-23.5s4.6-3.1 9.4 0c0 0 43.1 23.9 42.4 25.3L85.3 43.3s-3.6-8.4-13.1-13c-11.3-5.5-29.7-6.2-42.9 13.3 0 0-8.6 13.5.3 31.6l-19 10.7s-.9-.6-.9-2.6z"/><path fill="#5C8DBC" d="M71 51.3c-2.8-4.7-7.9-7.9-13.8-7.9-8.8 0-16 7.2-16 16 0 2.8.7 5.4 2 7.7L71 51.3z"/><path fill="#194674" d="M43.1 67c2.8 4.7 7.9 7.9 13.8 7.9 8.8 0 16-7.2 16-16 0-2.8-.7-5.4-2-7.7L43.1 67z"/><path fill="#1B598E" d="M104.4 32.1s1.3 52.6-.3 53.6L58 58.6l46.4-26.5z"/><path fill="#FFF" d="M90 57h-3.9v-4.1h-4.2V57h-4v4.1h4V65h4.2v-3.9H90zm13.6 0h-3.9v-4.1h-4.2V57h-4v4.1h4V65h4.2v-3.9h3.9z"/><path fill="#194674" d="M29.5 75.1s9.2 17 28.5 16.1 27.3-16.6 27.3-16.6L104 85.4s4.1.8-41.6 25.7c0 0-4.9 3.3-10.2 0 0 0-41.3-23.1-41.6-25.3l18.9-10.7z"/></svg>
|
<svg height="14px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 115 115"><path fill="#5C8DBC" d="M9.7 83.3V35.5s0-3.4 3.3-5.2c3.3-1.8 39.6-23.5 39.6-23.5s4.6-3.1 9.4 0c0 0 43.1 23.9 42.4 25.3L85.3 43.3s-3.6-8.4-13.1-13c-11.3-5.5-29.7-6.2-42.9 13.3 0 0-8.6 13.5.3 31.6l-19 10.7s-.9-.6-.9-2.6z"/><path fill="#5C8DBC" d="M71 51.3c-2.8-4.7-7.9-7.9-13.8-7.9-8.8 0-16 7.2-16 16 0 2.8.7 5.4 2 7.7L71 51.3z"/><path fill="#194674" d="M43.1 67c2.8 4.7 7.9 7.9 13.8 7.9 8.8 0 16-7.2 16-16 0-2.8-.7-5.4-2-7.7L43.1 67z"/><path fill="#1B598E" d="M104.4 32.1s1.3 52.6-.3 53.6L58 58.6l46.4-26.5z"/><path fill="#FFF" d="M90 57h-3.9v-4.1h-4.2V57h-4v4.1h4V65h4.2v-3.9H90zm13.6 0h-3.9v-4.1h-4.2V57h-4v4.1h4V65h4.2v-3.9h3.9z"/><path fill="#194674" d="M29.5 75.1s9.2 17 28.5 16.1 27.3-16.6 27.3-16.6L104 85.4s4.1.8-41.6 25.7c0 0-4.9 3.3-10.2 0 0 0-41.3-23.1-41.6-25.3l18.9-10.7z"/></svg>
|
||||||
C++ Ethereum <small>Official C++ client from the Ethereum Foundation</small>
|
C++ Essentia <small>Official C++ client from the Essentia Foundation</small>
|
||||||
</h2>
|
</h2>
|
||||||
<div class="clearfix"></div>
|
<div class="clearfix"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="x_content">
|
<div class="x_content">
|
||||||
<p>C++ Ethereum is the third most popular of the Ethereum clients, focusing on code portability to a broad range of operating systems and hardware. The client is currently a full node with transaction processing based synchronization.</p>
|
<p>C++ Essentia is the third most popular of the Essentia clients, focusing on code portability to a broad range of operating systems and hardware. The client is currently a full node with transaction processing based synchronization.</p>
|
||||||
<br/>
|
<br/>
|
||||||
<p>To run a cpp-ethereum node, download <a href="/{{.CppGenesis}}"><code>{{.CppGenesis}}</code></a> and start the node with:
|
<p>To run a cpp-ethereum node, download <a href="/{{.CppGenesis}}"><code>{{.CppGenesis}}</code></a> and start the node with:
|
||||||
<pre>eth --config {{.CppGenesis}} --datadir $HOME/.{{.Network}} --peerset "{{.CppBootnodes}}"</pre>
|
<pre>ess --config {{.CppGenesis}} --datadir $HOME/.{{.Network}} --peerset "{{.CppBootnodes}}"</pre>
|
||||||
</p>
|
</p>
|
||||||
<br/>
|
<br/>
|
||||||
<p>You can find cpp-ethereum at <a href="https://github.com/ethereum/cpp-ethereum/" target="about:blank">https://github.com/ethereum/cpp-ethereum/</a>.</p>
|
<p>You can find cpp-ethereum at <a href="https://github.com/ethereum/cpp-ethereum/" target="about:blank">https://github.com/ethereum/cpp-ethereum/</a>.</p>
|
||||||
|
|
@ -346,18 +346,18 @@ try! node?.start();
|
||||||
<div class="x_title">
|
<div class="x_title">
|
||||||
<h2>
|
<h2>
|
||||||
<svg height="14px" version="1.1" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M46.42,13.07S24.51,18.54,35,30.6c3.09,3.55-.81,6.75-0.81,6.75s7.84-4,4.24-9.11C35,23.51,32.46,21.17,46.42,13.07ZM32.1,16.88C45.05,6.65,38.4,0,38.4,0c2.68,10.57-9.46,13.76-13.84,20.34-3,4.48,1.46,9.3,7.53,14.77C29.73,29.77,21.71,25.09,32.1,16.88Z" transform="translate(-8.4)" fill="#e57125"/><path d="M23.6,49.49c-9.84,2.75,6,8.43,18.51,3.06a23.06,23.06,0,0,1-3.52-1.72,36.62,36.62,0,0,1-13.25.56C21.16,50.92,23.6,49.49,23.6,49.49Zm17-5.36a51.7,51.7,0,0,1-17.1.82c-4.19-.43-1.45-2.46-1.45-2.46-10.84,3.6,6,7.68,21.18,3.25A7.59,7.59,0,0,1,40.62,44.13ZM51.55,54.68s1.81,1.49-2,2.64c-7.23,2.19-30.1,2.85-36.45.09-2.28-1,2-2.37,3.35-2.66a8.69,8.69,0,0,1,2.21-.25c-2.54-1.79-16.41,3.51-7,5C37.15,63.67,58.17,57.67,51.55,54.68ZM42.77,39.12a20.42,20.42,0,0,1,2.93-1.57s-4.83.86-9.65,1.27A87.37,87.37,0,0,1,20.66,39c-7.51-1,4.12-3.77,4.12-3.77A22,22,0,0,0,14.7,37.61C8.14,40.79,31,42.23,42.77,39.12Zm2.88,7.77a1,1,0,0,1-.24.31C61.44,43,55.54,32.35,47.88,35a2.19,2.19,0,0,0-1,.79,9,9,0,0,1,1.37-.37C52.1,34.66,57.65,40.65,45.64,46.89Zm0.43,14.75a94.76,94.76,0,0,1-29.17.45s1.47,1.22,9,1.7c11.53,0.74,29.22-.41,29.64-5.86C55.6,57.94,54.79,60,46.08,61.65Z" transform="translate(-8.4)" fill="#5482a2"/></svg>
|
<svg height="14px" version="1.1" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M46.42,13.07S24.51,18.54,35,30.6c3.09,3.55-.81,6.75-0.81,6.75s7.84-4,4.24-9.11C35,23.51,32.46,21.17,46.42,13.07ZM32.1,16.88C45.05,6.65,38.4,0,38.4,0c2.68,10.57-9.46,13.76-13.84,20.34-3,4.48,1.46,9.3,7.53,14.77C29.73,29.77,21.71,25.09,32.1,16.88Z" transform="translate(-8.4)" fill="#e57125"/><path d="M23.6,49.49c-9.84,2.75,6,8.43,18.51,3.06a23.06,23.06,0,0,1-3.52-1.72,36.62,36.62,0,0,1-13.25.56C21.16,50.92,23.6,49.49,23.6,49.49Zm17-5.36a51.7,51.7,0,0,1-17.1.82c-4.19-.43-1.45-2.46-1.45-2.46-10.84,3.6,6,7.68,21.18,3.25A7.59,7.59,0,0,1,40.62,44.13ZM51.55,54.68s1.81,1.49-2,2.64c-7.23,2.19-30.1,2.85-36.45.09-2.28-1,2-2.37,3.35-2.66a8.69,8.69,0,0,1,2.21-.25c-2.54-1.79-16.41,3.51-7,5C37.15,63.67,58.17,57.67,51.55,54.68ZM42.77,39.12a20.42,20.42,0,0,1,2.93-1.57s-4.83.86-9.65,1.27A87.37,87.37,0,0,1,20.66,39c-7.51-1,4.12-3.77,4.12-3.77A22,22,0,0,0,14.7,37.61C8.14,40.79,31,42.23,42.77,39.12Zm2.88,7.77a1,1,0,0,1-.24.31C61.44,43,55.54,32.35,47.88,35a2.19,2.19,0,0,0-1,.79,9,9,0,0,1,1.37-.37C52.1,34.66,57.65,40.65,45.64,46.89Zm0.43,14.75a94.76,94.76,0,0,1-29.17.45s1.47,1.22,9,1.7c11.53,0.74,29.22-.41,29.64-5.86C55.6,57.94,54.79,60,46.08,61.65Z" transform="translate(-8.4)" fill="#5482a2"/></svg>
|
||||||
Ethereum Harmony<small>Third party Java client from EtherCamp</small>
|
Essentia Harmony<small>Third party Java client from EtherCamp</small>
|
||||||
</h2>
|
</h2>
|
||||||
<div class="clearfix"></div>
|
<div class="clearfix"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="x_content">
|
<div class="x_content">
|
||||||
<p>Ethereum Harmony is a web user-interface based graphical Ethereum client built on top of the EthereumJ Java implementation of the Ethereum protocol. The client currently is a full node with state download based synchronization.</p>
|
<p>Essentia Harmony is a web user-interface based graphical Essentia client built on top of the EthereumJ Java implementation of the Essentia protocol. The client currently is a full node with state download based synchronization.</p>
|
||||||
<br/>
|
<br/>
|
||||||
<p>To run an Ethereum Harmony node, download <a href="/{{.HarmonyGenesis}}"><code>{{.HarmonyGenesis}}</code></a> and start the node with:
|
<p>To run an Essentia Harmony node, download <a href="/{{.HarmonyGenesis}}"><code>{{.HarmonyGenesis}}</code></a> and start the node with:
|
||||||
<pre>./gradlew runCustom -DgenesisFile={{.HarmonyGenesis}} -Dpeer.networkId={{.NetworkID}} -Ddatabase.dir=$HOME/.harmony/{{.Network}} {{.HarmonyBootnodes}} </pre>
|
<pre>./gradlew runCustom -DgenesisFile={{.HarmonyGenesis}} -Dpeer.networkId={{.NetworkID}} -Ddatabase.dir=$HOME/.harmony/{{.Network}} {{.HarmonyBootnodes}} </pre>
|
||||||
</p>
|
</p>
|
||||||
<br/>
|
<br/>
|
||||||
<p>You can find Ethereum Harmony at <a href="https://github.com/ether-camp/ethereum-harmony/" target="about:blank">https://github.com/ether-camp/ethereum-harmony/</a>.</p>
|
<p>You can find Essentia Harmony at <a href="https://github.com/ether-camp/ethereum-harmony/" target="about:blank">https://github.com/ether-camp/ethereum-harmony/</a>.</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -374,7 +374,7 @@ try! node?.start();
|
||||||
<div class="clearfix"></div>
|
<div class="clearfix"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="x_content">
|
<div class="x_content">
|
||||||
<p>Parity is a fast, light and secure Ethereum client, supporting both headless mode of operation as well as a web user interface for direct manual interaction. The client is currently a full node with transaction processing based synchronization and state pruning enabled.</p>
|
<p>Parity is a fast, light and secure Essentia client, supporting both headless mode of operation as well as a web user interface for direct manual interaction. The client is currently a full node with transaction processing based synchronization and state pruning enabled.</p>
|
||||||
<br/>
|
<br/>
|
||||||
<p>To run a Parity node, download <a href="/{{.ParityGenesis}}"><code>{{.ParityGenesis}}</code></a> and start the node with:
|
<p>To run a Parity node, download <a href="/{{.ParityGenesis}}"><code>{{.ParityGenesis}}</code></a> and start the node with:
|
||||||
<pre>parity --chain={{.ParityGenesis}}</pre>
|
<pre>parity --chain={{.ParityGenesis}}</pre>
|
||||||
|
|
@ -389,16 +389,16 @@ try! node?.start();
|
||||||
<div class="x_title">
|
<div class="x_title">
|
||||||
<h2>
|
<h2>
|
||||||
<svg height="14px" version="1.1" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><defs><linearGradient id="a" x1="13.79" y1="38.21" x2="75.87" y2="-15.2" gradientTransform="matrix(0.56, 0, 0, -0.57, -8.96, 23.53)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#5c9fd3"/><stop offset="1" stop-color="#316a99"/></linearGradient><linearGradient id="b" x1="99.87" y1="-47.53" x2="77.7" y2="-16.16" gradientTransform="matrix(0.56, 0, 0, -0.57, -8.96, 23.53)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#ffd43d"/><stop offset="1" stop-color="#fee875"/></linearGradient></defs><g><path d="M31.62,0a43.6,43.6,0,0,0-7.3.62c-6.46,1.14-7.63,3.53-7.63,7.94v5.82H32v1.94H11a9.53,9.53,0,0,0-9.54,7.74,28.54,28.54,0,0,0,0,15.52c1.09,4.52,3.68,7.74,8.11,7.74h5.25v-7a9.7,9.7,0,0,1,9.54-9.48H39.58a7.69,7.69,0,0,0,7.63-7.76V8.56c0-4.14-3.49-7.25-7.63-7.94A47.62,47.62,0,0,0,31.62,0ZM23.37,4.68A2.91,2.91,0,1,1,20.5,7.6,2.9,2.9,0,0,1,23.37,4.68Z" transform="translate(-0.35)" fill="url(#a)"/><path d="M49.12,16.32V23.1a9.79,9.79,0,0,1-9.54,9.68H24.33a7.79,7.79,0,0,0-7.63,7.76V55.08c0,4.14,3.6,6.57,7.63,7.76a25.55,25.55,0,0,0,15.25,0c3.84-1.11,7.63-3.35,7.63-7.76V49.26H32V47.32H54.85c4.44,0,6.09-3.1,7.63-7.74s1.53-9.38,0-15.52c-1.1-4.42-3.19-7.74-7.63-7.74H49.12ZM40.54,53.14A2.91,2.91,0,1,1,37.67,56,2.88,2.88,0,0,1,40.54,53.14Z" transform="translate(-0.35)" fill="url(#b)"/></g></svg>
|
<svg height="14px" version="1.1" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><defs><linearGradient id="a" x1="13.79" y1="38.21" x2="75.87" y2="-15.2" gradientTransform="matrix(0.56, 0, 0, -0.57, -8.96, 23.53)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#5c9fd3"/><stop offset="1" stop-color="#316a99"/></linearGradient><linearGradient id="b" x1="99.87" y1="-47.53" x2="77.7" y2="-16.16" gradientTransform="matrix(0.56, 0, 0, -0.57, -8.96, 23.53)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#ffd43d"/><stop offset="1" stop-color="#fee875"/></linearGradient></defs><g><path d="M31.62,0a43.6,43.6,0,0,0-7.3.62c-6.46,1.14-7.63,3.53-7.63,7.94v5.82H32v1.94H11a9.53,9.53,0,0,0-9.54,7.74,28.54,28.54,0,0,0,0,15.52c1.09,4.52,3.68,7.74,8.11,7.74h5.25v-7a9.7,9.7,0,0,1,9.54-9.48H39.58a7.69,7.69,0,0,0,7.63-7.76V8.56c0-4.14-3.49-7.25-7.63-7.94A47.62,47.62,0,0,0,31.62,0ZM23.37,4.68A2.91,2.91,0,1,1,20.5,7.6,2.9,2.9,0,0,1,23.37,4.68Z" transform="translate(-0.35)" fill="url(#a)"/><path d="M49.12,16.32V23.1a9.79,9.79,0,0,1-9.54,9.68H24.33a7.79,7.79,0,0,0-7.63,7.76V55.08c0,4.14,3.6,6.57,7.63,7.76a25.55,25.55,0,0,0,15.25,0c3.84-1.11,7.63-3.35,7.63-7.76V49.26H32V47.32H54.85c4.44,0,6.09-3.1,7.63-7.74s1.53-9.38,0-15.52c-1.1-4.42-3.19-7.74-7.63-7.74H49.12ZM40.54,53.14A2.91,2.91,0,1,1,37.67,56,2.88,2.88,0,0,1,40.54,53.14Z" transform="translate(-0.35)" fill="url(#b)"/></g></svg>
|
||||||
PyEthApp<small>Official Python client from the Ethereum Foundation</small>
|
PyEthApp<small>Official Python client from the Essentia Foundation</small>
|
||||||
</h2>
|
</h2>
|
||||||
<div class="clearfix"></div>
|
<div class="clearfix"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="x_content">
|
<div class="x_content">
|
||||||
<p>Pyethapp is the Ethereum Foundation's research client, aiming to provide an easily hackable and extendable codebase. The client is currently a full node with transaction processing based synchronization and state pruning enabled.</p>
|
<p>Pyethapp is the Essentia Foundation's research client, aiming to provide an easily hackable and extendable codebase. The client is currently a full node with transaction processing based synchronization and state pruning enabled.</p>
|
||||||
<br/>
|
<br/>
|
||||||
<p>To run a pyethapp node, download <a href="/{{.PythonGenesis}}"><code>{{.PythonGenesis}}</code></a> and start the node with:
|
<p>To run a pyethapp node, download <a href="/{{.PythonGenesis}}"><code>{{.PythonGenesis}}</code></a> and start the node with:
|
||||||
<pre>mkdir -p $HOME/.config/pyethapp/{{.Network}}</pre>
|
<pre>mkdir -p $HOME/.config/pyethapp/{{.Network}}</pre>
|
||||||
<pre>pyethapp -c eth.genesis="$(cat {{.PythonGenesis}})" -c eth.network_id={{.NetworkID}} -c data_dir=$HOME/.config/pyethapp/{{.Network}} -c discovery.bootstrap_nodes="[{{.PythonBootnodes}}]" -c eth.block.HOMESTEAD_FORK_BLKNUM={{.Homestead}} -c eth.block.ANTI_DOS_FORK_BLKNUM={{.Tangerine}} -c eth.block.SPURIOUS_DRAGON_FORK_BLKNUM={{.Spurious}} -c eth.block.METROPOLIS_FORK_BLKNUM={{.Byzantium}} -c eth.block.DAO_FORK_BLKNUM=18446744073709551615 run --console</pre>
|
<pre>pyethapp -c ess.genesis="$(cat {{.PythonGenesis}})" -c ess.network_id={{.NetworkID}} -c data_dir=$HOME/.config/pyethapp/{{.Network}} -c discovery.bootstrap_nodes="[{{.PythonBootnodes}}]" -c ess.block.HOMESTEAD_FORK_BLKNUM={{.Homestead}} -c ess.block.ANTI_DOS_FORK_BLKNUM={{.Tangerine}} -c ess.block.SPURIOUS_DRAGON_FORK_BLKNUM={{.Spurious}} -c ess.block.METROPOLIS_FORK_BLKNUM={{.Byzantium}} -c ess.block.DAO_FORK_BLKNUM=18446744073709551615 run --console</pre>
|
||||||
</p>
|
</p>
|
||||||
<br/>
|
<br/>
|
||||||
<p>You can find pyethapp at <a href="https://github.com/ethereum/pyethapp/" target="about:blank">https://github.com/ethereum/pyethapp/</a>.</p>
|
<p>You can find pyethapp at <a href="https://github.com/ethereum/pyethapp/" target="about:blank">https://github.com/ethereum/pyethapp/</a>.</p>
|
||||||
|
|
@ -412,11 +412,11 @@ try! node?.start();
|
||||||
<div style="margin: 0 auto;">
|
<div style="margin: 0 auto;">
|
||||||
<div class="x_panel">
|
<div class="x_panel">
|
||||||
<div class="x_title">
|
<div class="x_title">
|
||||||
<h3>Puppeth – Your Ethereum private network manager</h3>
|
<h3>Puppeth – Your Essentia private network manager</h3>
|
||||||
<div class="clearfix"></div>
|
<div class="clearfix"></div>
|
||||||
</div>
|
</div>
|
||||||
<div style="display: inline-block; vertical-align: bottom; width: 623px; margin-top: 16px;">
|
<div style="display: inline-block; vertical-align: bottom; width: 623px; margin-top: 16px;">
|
||||||
<p>Puppeth is a tool to aid you in creating a new Ethereum network down to the genesis block, bootnodes, signers, ethstats server, crypto faucet, wallet browsers, block explorer, dashboard and more; without the hassle that it would normally entail to manually configure all these services one by one.</p>
|
<p>Puppeth is a tool to aid you in creating a new Essentia network down to the genesis block, bootnodes, signers, ethstats server, crypto faucet, wallet browsers, block explorer, dashboard and more; without the hassle that it would normally entail to manually configure all these services one by one.</p>
|
||||||
<p>Puppeth uses ssh to dial in to remote servers, and builds its network components out of docker containers using docker-compose. The user is guided through the process via a command line wizard that does the heavy lifting and topology configuration automatically behind the scenes.</p>
|
<p>Puppeth uses ssh to dial in to remote servers, and builds its network components out of docker containers using docker-compose. The user is guided through the process via a command line wizard that does the heavy lifting and topology configuration automatically behind the scenes.</p>
|
||||||
<br/>
|
<br/>
|
||||||
<p>Puppeth is distributed as part of the <a href="https://geth.ethereum.org/downloads/" target="about:blank">Geth & Tools</a> bundles, but can also be installed separately via:<pre>go get github.com/orangeAndSuns/go-ethereum/cmd/puppeth</pre></p>
|
<p>Puppeth is distributed as part of the <a href="https://geth.ethereum.org/downloads/" target="about:blank">Geth & Tools</a> bundles, but can also be installed separately via:<pre>go get github.com/orangeAndSuns/go-ethereum/cmd/puppeth</pre></p>
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ ADD ethstats.json /ethstats.json
|
||||||
ADD chain.json /chain.json
|
ADD chain.json /chain.json
|
||||||
|
|
||||||
RUN \
|
RUN \
|
||||||
echo '(cd ../eth-net-intelligence-api && pm2 start /ethstats.json)' > explorer.sh && \
|
echo '(cd ../ess-net-intelligence-api && pm2 start /ethstats.json)' > explorer.sh && \
|
||||||
echo '(cd ../etherchain-light && npm start &)' >> explorer.sh && \
|
echo '(cd ../etherchain-light && npm start &)' >> explorer.sh && \
|
||||||
echo '/parity/parity --chain=/chain.json --port={{.NodePort}} --tracing=on --fat-db=on --pruning=archive' >> explorer.sh
|
echo '/parity/parity --chain=/chain.json --port={{.NodePort}} --tracing=on --fat-db=on --pruning=archive' >> explorer.sh
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -158,7 +158,7 @@ func (info *faucetInfos) Report() map[string]string {
|
||||||
report := map[string]string{
|
report := map[string]string{
|
||||||
"Website address": info.host,
|
"Website address": info.host,
|
||||||
"Website listener port": strconv.Itoa(info.port),
|
"Website listener port": strconv.Itoa(info.port),
|
||||||
"Ethereum listener port": strconv.Itoa(info.node.port),
|
"Essentia listener port": strconv.Itoa(info.node.port),
|
||||||
"Funding amount (base tier)": fmt.Sprintf("%d Ethers", info.amount),
|
"Funding amount (base tier)": fmt.Sprintf("%d Ethers", info.amount),
|
||||||
"Funding cooldown (base tier)": fmt.Sprintf("%d mins", info.minutes),
|
"Funding cooldown (base tier)": fmt.Sprintf("%d mins", info.minutes),
|
||||||
"Funding tiers": strconv.Itoa(info.tiers),
|
"Funding tiers": strconv.Itoa(info.tiers),
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ import (
|
||||||
"github.com/orangeAndSuns/go-ethereum/log"
|
"github.com/orangeAndSuns/go-ethereum/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
// nodeDockerfile is the Dockerfile required to run an Ethereum node.
|
// nodeDockerfile is the Dockerfile required to run an Essentia node.
|
||||||
var nodeDockerfile = `
|
var nodeDockerfile = `
|
||||||
FROM ethereum/client-go:latest
|
FROM ethereum/client-go:latest
|
||||||
|
|
||||||
|
|
@ -48,7 +48,7 @@ ENTRYPOINT ["/bin/sh", "geth.sh"]
|
||||||
`
|
`
|
||||||
|
|
||||||
// nodeComposefile is the docker-compose.yml file required to deploy and maintain
|
// nodeComposefile is the docker-compose.yml file required to deploy and maintain
|
||||||
// an Ethereum node (bootnode or miner for now).
|
// an Essentia node (bootnode or miner for now).
|
||||||
var nodeComposefile = `
|
var nodeComposefile = `
|
||||||
version: '2'
|
version: '2'
|
||||||
services:
|
services:
|
||||||
|
|
@ -77,7 +77,7 @@ services:
|
||||||
restart: always
|
restart: always
|
||||||
`
|
`
|
||||||
|
|
||||||
// deployNode deploys a new Ethereum node container to a remote machine via SSH,
|
// deployNode deploys a new Essentia node container to a remote machine via SSH,
|
||||||
// docker and docker-compose. If an instance with the specified network name
|
// docker and docker-compose. If an instance with the specified network name
|
||||||
// already exists there, it will be overwritten!
|
// already exists there, it will be overwritten!
|
||||||
func deployNode(client *sshClient, network string, bootnodes []string, config *nodeInfos, nocache bool) ([]byte, error) {
|
func deployNode(client *sshClient, network string, bootnodes []string, config *nodeInfos, nocache bool) ([]byte, error) {
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ import (
|
||||||
func main() {
|
func main() {
|
||||||
app := cli.NewApp()
|
app := cli.NewApp()
|
||||||
app.Name = "puppeth"
|
app.Name = "puppeth"
|
||||||
app.Usage = "assemble and maintain private Ethereum networks"
|
app.Usage = "assemble and maintain private Essentia networks"
|
||||||
app.Flags = []cli.Flag{
|
app.Flags = []cli.Flag{
|
||||||
cli.StringFlag{
|
cli.StringFlag{
|
||||||
Name: "network",
|
Name: "network",
|
||||||
|
|
|
||||||
|
|
@ -73,7 +73,7 @@ type wizard struct {
|
||||||
conf config // Configurations from previous runs
|
conf config // Configurations from previous runs
|
||||||
|
|
||||||
servers map[string]*sshClient // SSH connections to servers to administer
|
servers map[string]*sshClient // SSH connections to servers to administer
|
||||||
services map[string][]string // Ethereum services known to be running on servers
|
services map[string][]string // Essentia services known to be running on servers
|
||||||
|
|
||||||
in *bufio.Reader // Wrapper around stdin to allow reading user input
|
in *bufio.Reader // Wrapper around stdin to allow reading user input
|
||||||
lock sync.Mutex // Lock to protect configs during concurrent service discovery
|
lock sync.Mutex // Lock to protect configs during concurrent service discovery
|
||||||
|
|
@ -240,7 +240,7 @@ func (w *wizard) readPassword() string {
|
||||||
}
|
}
|
||||||
|
|
||||||
// readAddress reads a single line from stdin, trimming if from spaces and converts
|
// readAddress reads a single line from stdin, trimming if from spaces and converts
|
||||||
// it to an Ethereum address.
|
// it to an Essentia address.
|
||||||
func (w *wizard) readAddress() *common.Address {
|
func (w *wizard) readAddress() *common.Address {
|
||||||
for {
|
for {
|
||||||
// Read the address from the user
|
// Read the address from the user
|
||||||
|
|
@ -264,7 +264,7 @@ func (w *wizard) readAddress() *common.Address {
|
||||||
}
|
}
|
||||||
|
|
||||||
// readDefaultAddress reads a single line from stdin, trimming if from spaces and
|
// readDefaultAddress reads a single line from stdin, trimming if from spaces and
|
||||||
// converts it to an Ethereum address. If an empty line is entered, the default
|
// converts it to an Essentia address. If an empty line is entered, the default
|
||||||
// value is returned.
|
// value is returned.
|
||||||
func (w *wizard) readDefaultAddress(def common.Address) common.Address {
|
func (w *wizard) readDefaultAddress(def common.Address) common.Address {
|
||||||
for {
|
for {
|
||||||
|
|
|
||||||
|
|
@ -43,12 +43,12 @@ func makeWizard(network string) *wizard {
|
||||||
}
|
}
|
||||||
|
|
||||||
// run displays some useful infos to the user, starting on the journey of
|
// run displays some useful infos to the user, starting on the journey of
|
||||||
// setting up a new or managing an existing Ethereum private network.
|
// setting up a new or managing an existing Essentia private network.
|
||||||
func (w *wizard) run() {
|
func (w *wizard) run() {
|
||||||
fmt.Println("+-----------------------------------------------------------+")
|
fmt.Println("+-----------------------------------------------------------+")
|
||||||
fmt.Println("| Welcome to puppeth, your Ethereum private network manager |")
|
fmt.Println("| Welcome to puppeth, your Essentia private network manager |")
|
||||||
fmt.Println("| |")
|
fmt.Println("| |")
|
||||||
fmt.Println("| This tool lets you create a new Ethereum network down to |")
|
fmt.Println("| This tool lets you create a new Essentia network down to |")
|
||||||
fmt.Println("| the genesis block, bootnodes, miners and ethstats servers |")
|
fmt.Println("| the genesis block, bootnodes, miners and ethstats servers |")
|
||||||
fmt.Println("| without the hassle that it would normally entail. |")
|
fmt.Println("| without the hassle that it would normally entail. |")
|
||||||
fmt.Println("| |")
|
fmt.Println("| |")
|
||||||
|
|
@ -71,7 +71,7 @@ func (w *wizard) run() {
|
||||||
log.Error("I also like to live dangerously, still no spaces or hyphens")
|
log.Error("I also like to live dangerously, still no spaces or hyphens")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
log.Info("Administering Ethereum network", "name", w.network)
|
log.Info("Administering Essentia network", "name", w.network)
|
||||||
|
|
||||||
// Load initial configurations and connect to all live servers
|
// Load initial configurations and connect to all live servers
|
||||||
w.conf.path = filepath.Join(os.Getenv("HOME"), ".puppeth", w.network)
|
w.conf.path = filepath.Join(os.Getenv("HOME"), ".puppeth", w.network)
|
||||||
|
|
|
||||||
|
|
@ -164,7 +164,7 @@ func (w *wizard) deployNode(boot bool) {
|
||||||
nocache = w.readDefaultString("n") != "n"
|
nocache = w.readDefaultString("n") != "n"
|
||||||
}
|
}
|
||||||
if out, err := deployNode(client, w.network, w.conf.bootnodes, infos, nocache); err != nil {
|
if out, err := deployNode(client, w.network, w.conf.bootnodes, infos, nocache); err != nil {
|
||||||
log.Error("Failed to deploy Ethereum node container", "err", err)
|
log.Error("Failed to deploy Essentia node container", "err", err)
|
||||||
if len(out) > 0 {
|
if len(out) > 0 {
|
||||||
fmt.Printf("%s\n", out)
|
fmt.Printf("%s\n", out)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -517,19 +517,19 @@ func TestValidateConfig(t *testing.T) {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
cfg: &api.Config{EnsAPIs: []string{
|
cfg: &api.Config{EnsAPIs: []string{
|
||||||
"eth:314159265dD8dbb310642f98f50C066173C1259b@http://127.0.0.1:1234",
|
"ess:314159265dD8dbb310642f98f50C066173C1259b@http://127.0.0.1:1234",
|
||||||
}},
|
}},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
cfg: &api.Config{EnsAPIs: []string{
|
cfg: &api.Config{EnsAPIs: []string{
|
||||||
"eth:314159265dD8dbb310642f98f50C066173C1259b@ws://127.0.0.1:12344",
|
"ess:314159265dD8dbb310642f98f50C066173C1259b@ws://127.0.0.1:12344",
|
||||||
}},
|
}},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
cfg: &api.Config{EnsAPIs: []string{
|
cfg: &api.Config{EnsAPIs: []string{
|
||||||
"eth:",
|
"ess:",
|
||||||
}},
|
}},
|
||||||
err: "invalid format [tld:][contract-addr@]url for ENS API endpoint configuration \"eth:\": missing url",
|
err: "invalid format [tld:][contract-addr@]url for ENS API endpoint configuration \"ess:\": missing url",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
cfg: &api.Config{EnsAPIs: []string{
|
cfg: &api.Config{EnsAPIs: []string{
|
||||||
|
|
|
||||||
|
|
@ -110,7 +110,7 @@ var (
|
||||||
}
|
}
|
||||||
SwarmSwapAPIFlag = cli.StringFlag{
|
SwarmSwapAPIFlag = cli.StringFlag{
|
||||||
Name: "swap-api",
|
Name: "swap-api",
|
||||||
Usage: "URL of the Ethereum API provider to use to settle SWAP payments",
|
Usage: "URL of the Essentia API provider to use to settle SWAP payments",
|
||||||
EnvVar: SWARM_ENV_SWAP_API,
|
EnvVar: SWARM_ENV_SWAP_API,
|
||||||
}
|
}
|
||||||
SwarmSyncDisabledFlag = cli.BoolTFlag{
|
SwarmSyncDisabledFlag = cli.BoolTFlag{
|
||||||
|
|
@ -223,7 +223,7 @@ func init() {
|
||||||
utils.ListenPortFlag.Value = 30399
|
utils.ListenPortFlag.Value = 30399
|
||||||
}
|
}
|
||||||
|
|
||||||
var app = utils.NewApp(gitCommit, "Ethereum Swarm")
|
var app = utils.NewApp(gitCommit, "Essentia Swarm")
|
||||||
|
|
||||||
// This init function creates the cli.App.
|
// This init function creates the cli.App.
|
||||||
func init() {
|
func init() {
|
||||||
|
|
|
||||||
|
|
@ -131,7 +131,7 @@ var (
|
||||||
NetworkIdFlag = cli.Uint64Flag{
|
NetworkIdFlag = cli.Uint64Flag{
|
||||||
Name: "networkid",
|
Name: "networkid",
|
||||||
Usage: "Network identifier (integer, 1=Frontier, 2=Morden (disused), 3=Ropsten, 4=Rinkeby)",
|
Usage: "Network identifier (integer, 1=Frontier, 2=Morden (disused), 3=Ropsten, 4=Rinkeby)",
|
||||||
Value: eth.DefaultConfig.NetworkId,
|
Value: ess.DefaultConfig.NetworkId,
|
||||||
}
|
}
|
||||||
TestnetFlag = cli.BoolFlag{
|
TestnetFlag = cli.BoolFlag{
|
||||||
Name: "testnet",
|
Name: "testnet",
|
||||||
|
|
@ -166,7 +166,7 @@ var (
|
||||||
Name: "light",
|
Name: "light",
|
||||||
Usage: "Enable light client mode (replaced by --syncmode)",
|
Usage: "Enable light client mode (replaced by --syncmode)",
|
||||||
}
|
}
|
||||||
defaultSyncMode = eth.DefaultConfig.SyncMode
|
defaultSyncMode = ess.DefaultConfig.SyncMode
|
||||||
SyncModeFlag = TextMarshalerFlag{
|
SyncModeFlag = TextMarshalerFlag{
|
||||||
Name: "syncmode",
|
Name: "syncmode",
|
||||||
Usage: `Blockchain sync mode ("fast", "full", or "light")`,
|
Usage: `Blockchain sync mode ("fast", "full", or "light")`,
|
||||||
|
|
@ -185,7 +185,7 @@ var (
|
||||||
LightPeersFlag = cli.IntFlag{
|
LightPeersFlag = cli.IntFlag{
|
||||||
Name: "lightpeers",
|
Name: "lightpeers",
|
||||||
Usage: "Maximum number of LES client peers",
|
Usage: "Maximum number of LES client peers",
|
||||||
Value: eth.DefaultConfig.LightPeers,
|
Value: ess.DefaultConfig.LightPeers,
|
||||||
}
|
}
|
||||||
LightKDFFlag = cli.BoolFlag{
|
LightKDFFlag = cli.BoolFlag{
|
||||||
Name: "lightkdf",
|
Name: "lightkdf",
|
||||||
|
|
@ -219,27 +219,27 @@ var (
|
||||||
EthashCachesInMemoryFlag = cli.IntFlag{
|
EthashCachesInMemoryFlag = cli.IntFlag{
|
||||||
Name: "ethash.cachesinmem",
|
Name: "ethash.cachesinmem",
|
||||||
Usage: "Number of recent ethash caches to keep in memory (16MB each)",
|
Usage: "Number of recent ethash caches to keep in memory (16MB each)",
|
||||||
Value: eth.DefaultConfig.Ethash.CachesInMem,
|
Value: ess.DefaultConfig.Ethash.CachesInMem,
|
||||||
}
|
}
|
||||||
EthashCachesOnDiskFlag = cli.IntFlag{
|
EthashCachesOnDiskFlag = cli.IntFlag{
|
||||||
Name: "ethash.cachesondisk",
|
Name: "ethash.cachesondisk",
|
||||||
Usage: "Number of recent ethash caches to keep on disk (16MB each)",
|
Usage: "Number of recent ethash caches to keep on disk (16MB each)",
|
||||||
Value: eth.DefaultConfig.Ethash.CachesOnDisk,
|
Value: ess.DefaultConfig.Ethash.CachesOnDisk,
|
||||||
}
|
}
|
||||||
EthashDatasetDirFlag = DirectoryFlag{
|
EthashDatasetDirFlag = DirectoryFlag{
|
||||||
Name: "ethash.dagdir",
|
Name: "ethash.dagdir",
|
||||||
Usage: "Directory to store the ethash mining DAGs (default = inside home folder)",
|
Usage: "Directory to store the ethash mining DAGs (default = inside home folder)",
|
||||||
Value: DirectoryString{eth.DefaultConfig.Ethash.DatasetDir},
|
Value: DirectoryString{ess.DefaultConfig.Ethash.DatasetDir},
|
||||||
}
|
}
|
||||||
EthashDatasetsInMemoryFlag = cli.IntFlag{
|
EthashDatasetsInMemoryFlag = cli.IntFlag{
|
||||||
Name: "ethash.dagsinmem",
|
Name: "ethash.dagsinmem",
|
||||||
Usage: "Number of recent ethash mining DAGs to keep in memory (1+GB each)",
|
Usage: "Number of recent ethash mining DAGs to keep in memory (1+GB each)",
|
||||||
Value: eth.DefaultConfig.Ethash.DatasetsInMem,
|
Value: ess.DefaultConfig.Ethash.DatasetsInMem,
|
||||||
}
|
}
|
||||||
EthashDatasetsOnDiskFlag = cli.IntFlag{
|
EthashDatasetsOnDiskFlag = cli.IntFlag{
|
||||||
Name: "ethash.dagsondisk",
|
Name: "ethash.dagsondisk",
|
||||||
Usage: "Number of recent ethash mining DAGs to keep on disk (1+GB each)",
|
Usage: "Number of recent ethash mining DAGs to keep on disk (1+GB each)",
|
||||||
Value: eth.DefaultConfig.Ethash.DatasetsOnDisk,
|
Value: ess.DefaultConfig.Ethash.DatasetsOnDisk,
|
||||||
}
|
}
|
||||||
// Transaction pool settings
|
// Transaction pool settings
|
||||||
TxPoolNoLocalsFlag = cli.BoolFlag{
|
TxPoolNoLocalsFlag = cli.BoolFlag{
|
||||||
|
|
@ -259,37 +259,37 @@ var (
|
||||||
TxPoolPriceLimitFlag = cli.Uint64Flag{
|
TxPoolPriceLimitFlag = cli.Uint64Flag{
|
||||||
Name: "txpool.pricelimit",
|
Name: "txpool.pricelimit",
|
||||||
Usage: "Minimum gas price limit to enforce for acceptance into the pool",
|
Usage: "Minimum gas price limit to enforce for acceptance into the pool",
|
||||||
Value: eth.DefaultConfig.TxPool.PriceLimit,
|
Value: ess.DefaultConfig.TxPool.PriceLimit,
|
||||||
}
|
}
|
||||||
TxPoolPriceBumpFlag = cli.Uint64Flag{
|
TxPoolPriceBumpFlag = cli.Uint64Flag{
|
||||||
Name: "txpool.pricebump",
|
Name: "txpool.pricebump",
|
||||||
Usage: "Price bump percentage to replace an already existing transaction",
|
Usage: "Price bump percentage to replace an already existing transaction",
|
||||||
Value: eth.DefaultConfig.TxPool.PriceBump,
|
Value: ess.DefaultConfig.TxPool.PriceBump,
|
||||||
}
|
}
|
||||||
TxPoolAccountSlotsFlag = cli.Uint64Flag{
|
TxPoolAccountSlotsFlag = cli.Uint64Flag{
|
||||||
Name: "txpool.accountslots",
|
Name: "txpool.accountslots",
|
||||||
Usage: "Minimum number of executable transaction slots guaranteed per account",
|
Usage: "Minimum number of executable transaction slots guaranteed per account",
|
||||||
Value: eth.DefaultConfig.TxPool.AccountSlots,
|
Value: ess.DefaultConfig.TxPool.AccountSlots,
|
||||||
}
|
}
|
||||||
TxPoolGlobalSlotsFlag = cli.Uint64Flag{
|
TxPoolGlobalSlotsFlag = cli.Uint64Flag{
|
||||||
Name: "txpool.globalslots",
|
Name: "txpool.globalslots",
|
||||||
Usage: "Maximum number of executable transaction slots for all accounts",
|
Usage: "Maximum number of executable transaction slots for all accounts",
|
||||||
Value: eth.DefaultConfig.TxPool.GlobalSlots,
|
Value: ess.DefaultConfig.TxPool.GlobalSlots,
|
||||||
}
|
}
|
||||||
TxPoolAccountQueueFlag = cli.Uint64Flag{
|
TxPoolAccountQueueFlag = cli.Uint64Flag{
|
||||||
Name: "txpool.accountqueue",
|
Name: "txpool.accountqueue",
|
||||||
Usage: "Maximum number of non-executable transaction slots permitted per account",
|
Usage: "Maximum number of non-executable transaction slots permitted per account",
|
||||||
Value: eth.DefaultConfig.TxPool.AccountQueue,
|
Value: ess.DefaultConfig.TxPool.AccountQueue,
|
||||||
}
|
}
|
||||||
TxPoolGlobalQueueFlag = cli.Uint64Flag{
|
TxPoolGlobalQueueFlag = cli.Uint64Flag{
|
||||||
Name: "txpool.globalqueue",
|
Name: "txpool.globalqueue",
|
||||||
Usage: "Maximum number of non-executable transaction slots for all accounts",
|
Usage: "Maximum number of non-executable transaction slots for all accounts",
|
||||||
Value: eth.DefaultConfig.TxPool.GlobalQueue,
|
Value: ess.DefaultConfig.TxPool.GlobalQueue,
|
||||||
}
|
}
|
||||||
TxPoolLifetimeFlag = cli.DurationFlag{
|
TxPoolLifetimeFlag = cli.DurationFlag{
|
||||||
Name: "txpool.lifetime",
|
Name: "txpool.lifetime",
|
||||||
Usage: "Maximum amount of time non-executable transaction are queued",
|
Usage: "Maximum amount of time non-executable transaction are queued",
|
||||||
Value: eth.DefaultConfig.TxPool.Lifetime,
|
Value: ess.DefaultConfig.TxPool.Lifetime,
|
||||||
}
|
}
|
||||||
// Performance tuning settings
|
// Performance tuning settings
|
||||||
CacheFlag = cli.IntFlag{
|
CacheFlag = cli.IntFlag{
|
||||||
|
|
@ -335,7 +335,7 @@ var (
|
||||||
GasPriceFlag = BigFlag{
|
GasPriceFlag = BigFlag{
|
||||||
Name: "gasprice",
|
Name: "gasprice",
|
||||||
Usage: "Minimal gas price to accept for mining a transactions",
|
Usage: "Minimal gas price to accept for mining a transactions",
|
||||||
Value: eth.DefaultConfig.GasPrice,
|
Value: ess.DefaultConfig.GasPrice,
|
||||||
}
|
}
|
||||||
ExtraDataFlag = cli.StringFlag{
|
ExtraDataFlag = cli.StringFlag{
|
||||||
Name: "extradata",
|
Name: "extradata",
|
||||||
|
|
@ -509,12 +509,12 @@ var (
|
||||||
GpoBlocksFlag = cli.IntFlag{
|
GpoBlocksFlag = cli.IntFlag{
|
||||||
Name: "gpoblocks",
|
Name: "gpoblocks",
|
||||||
Usage: "Number of recent blocks to check for gas prices",
|
Usage: "Number of recent blocks to check for gas prices",
|
||||||
Value: eth.DefaultConfig.GPO.Blocks,
|
Value: ess.DefaultConfig.GPO.Blocks,
|
||||||
}
|
}
|
||||||
GpoPercentileFlag = cli.IntFlag{
|
GpoPercentileFlag = cli.IntFlag{
|
||||||
Name: "gpopercentile",
|
Name: "gpopercentile",
|
||||||
Usage: "Suggested gas price is the given percentile of a set of recent transaction gas prices",
|
Usage: "Suggested gas price is the given percentile of a set of recent transaction gas prices",
|
||||||
Value: eth.DefaultConfig.GPO.Percentile,
|
Value: ess.DefaultConfig.GPO.Percentile,
|
||||||
}
|
}
|
||||||
WhisperEnabledFlag = cli.BoolFlag{
|
WhisperEnabledFlag = cli.BoolFlag{
|
||||||
Name: "shh",
|
Name: "shh",
|
||||||
|
|
@ -810,7 +810,7 @@ func MakeAddress(ks *keystore.KeyStore, account string) (accounts.Account, error
|
||||||
|
|
||||||
// setEtherbase retrieves the etherbase either from the directly specified
|
// setEtherbase retrieves the etherbase either from the directly specified
|
||||||
// command line flags or from the keystore if CLI indexed.
|
// command line flags or from the keystore if CLI indexed.
|
||||||
func setEtherbase(ctx *cli.Context, ks *keystore.KeyStore, cfg *eth.Config) {
|
func setEtherbase(ctx *cli.Context, ks *keystore.KeyStore, cfg *ess.Config) {
|
||||||
if ctx.GlobalIsSet(EtherbaseFlag.Name) {
|
if ctx.GlobalIsSet(EtherbaseFlag.Name) {
|
||||||
account, err := MakeAddress(ks, ctx.GlobalString(EtherbaseFlag.Name))
|
account, err := MakeAddress(ks, ctx.GlobalString(EtherbaseFlag.Name))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
@ -869,7 +869,7 @@ func SetP2PConfig(ctx *cli.Context, cfg *p2p.Config) {
|
||||||
if lightClient {
|
if lightClient {
|
||||||
ethPeers = 0
|
ethPeers = 0
|
||||||
}
|
}
|
||||||
log.Info("Maximum peer count", "ETH", ethPeers, "LES", lightPeers, "total", cfg.MaxPeers)
|
log.Info("Maximum peer count", "ESS", ethPeers, "LES", lightPeers, "total", cfg.MaxPeers)
|
||||||
|
|
||||||
if ctx.GlobalIsSet(MaxPendingPeersFlag.Name) {
|
if ctx.GlobalIsSet(MaxPendingPeersFlag.Name) {
|
||||||
cfg.MaxPendingPeers = ctx.GlobalInt(MaxPendingPeersFlag.Name)
|
cfg.MaxPendingPeers = ctx.GlobalInt(MaxPendingPeersFlag.Name)
|
||||||
|
|
@ -977,7 +977,7 @@ func setTxPool(ctx *cli.Context, cfg *core.TxPoolConfig) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func setEthash(ctx *cli.Context, cfg *eth.Config) {
|
func setEthash(ctx *cli.Context, cfg *ess.Config) {
|
||||||
if ctx.GlobalIsSet(EthashCacheDirFlag.Name) {
|
if ctx.GlobalIsSet(EthashCacheDirFlag.Name) {
|
||||||
cfg.Ethash.CacheDir = ctx.GlobalString(EthashCacheDirFlag.Name)
|
cfg.Ethash.CacheDir = ctx.GlobalString(EthashCacheDirFlag.Name)
|
||||||
}
|
}
|
||||||
|
|
@ -1046,8 +1046,8 @@ func SetShhConfig(ctx *cli.Context, stack *node.Node, cfg *whisper.Config) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetEthConfig applies eth-related command line flags to the config.
|
// SetEthConfig applies ess-related command line flags to the config.
|
||||||
func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *eth.Config) {
|
func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ess.Config) {
|
||||||
// Avoid conflicting network flags
|
// Avoid conflicting network flags
|
||||||
checkExclusive(ctx, DeveloperFlag, TestnetFlag, RinkebyFlag)
|
checkExclusive(ctx, DeveloperFlag, TestnetFlag, RinkebyFlag)
|
||||||
checkExclusive(ctx, FastSyncFlag, LightModeFlag, SyncModeFlag)
|
checkExclusive(ctx, FastSyncFlag, LightModeFlag, SyncModeFlag)
|
||||||
|
|
@ -1160,8 +1160,8 @@ func SetDashboardConfig(ctx *cli.Context, cfg *dashboard.Config) {
|
||||||
cfg.Refresh = ctx.GlobalDuration(DashboardRefreshFlag.Name)
|
cfg.Refresh = ctx.GlobalDuration(DashboardRefreshFlag.Name)
|
||||||
}
|
}
|
||||||
|
|
||||||
// RegisterEthService adds an Ethereum client to the stack.
|
// RegisterEthService adds an Essentia client to the stack.
|
||||||
func RegisterEthService(stack *node.Node, cfg *eth.Config) {
|
func RegisterEthService(stack *node.Node, cfg *ess.Config) {
|
||||||
var err error
|
var err error
|
||||||
if cfg.SyncMode == downloader.LightSync {
|
if cfg.SyncMode == downloader.LightSync {
|
||||||
err = stack.Register(func(ctx *node.ServiceContext) (node.Service, error) {
|
err = stack.Register(func(ctx *node.ServiceContext) (node.Service, error) {
|
||||||
|
|
@ -1169,7 +1169,7 @@ func RegisterEthService(stack *node.Node, cfg *eth.Config) {
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
err = stack.Register(func(ctx *node.ServiceContext) (node.Service, error) {
|
err = stack.Register(func(ctx *node.ServiceContext) (node.Service, error) {
|
||||||
fullNode, err := eth.New(ctx, cfg)
|
fullNode, err := ess.New(ctx, cfg)
|
||||||
if fullNode != nil && cfg.LightServ > 0 {
|
if fullNode != nil && cfg.LightServ > 0 {
|
||||||
ls, _ := les.NewLesServer(fullNode, cfg)
|
ls, _ := les.NewLesServer(fullNode, cfg)
|
||||||
fullNode.AddLesServer(ls)
|
fullNode.AddLesServer(ls)
|
||||||
|
|
@ -1178,7 +1178,7 @@ func RegisterEthService(stack *node.Node, cfg *eth.Config) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
Fatalf("Failed to register the Ethereum service: %v", err)
|
Fatalf("Failed to register the Essentia service: %v", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1198,12 +1198,12 @@ func RegisterShhService(stack *node.Node, cfg *whisper.Config) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// RegisterEthStatsService configures the Ethereum Stats daemon and adds it to
|
// RegisterEthStatsService configures the Essentia Stats daemon and adds it to
|
||||||
// th egiven node.
|
// th egiven node.
|
||||||
func RegisterEthStatsService(stack *node.Node, url string) {
|
func RegisterEthStatsService(stack *node.Node, url string) {
|
||||||
if err := stack.Register(func(ctx *node.ServiceContext) (node.Service, error) {
|
if err := stack.Register(func(ctx *node.ServiceContext) (node.Service, error) {
|
||||||
// Retrieve both eth and les services
|
// Retrieve both ess and les services
|
||||||
var ethServ *eth.Ethereum
|
var ethServ *ess.Essentia
|
||||||
ctx.Service(ðServ)
|
ctx.Service(ðServ)
|
||||||
|
|
||||||
var lesServ *les.LightEthereum
|
var lesServ *les.LightEthereum
|
||||||
|
|
@ -1211,7 +1211,7 @@ func RegisterEthStatsService(stack *node.Node, url string) {
|
||||||
|
|
||||||
return ethstats.New(url, ethServ, lesServ)
|
return ethstats.New(url, ethServ, lesServ)
|
||||||
}); err != nil {
|
}); err != nil {
|
||||||
Fatalf("Failed to register the Ethereum Stats service: %v", err)
|
Fatalf("Failed to register the Essentia Stats service: %v", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1288,12 +1288,12 @@ func MakeChain(ctx *cli.Context, stack *node.Node) (chain *core.BlockChain, chai
|
||||||
engine = ethash.NewFaker()
|
engine = ethash.NewFaker()
|
||||||
if !ctx.GlobalBool(FakePoWFlag.Name) {
|
if !ctx.GlobalBool(FakePoWFlag.Name) {
|
||||||
engine = ethash.New(ethash.Config{
|
engine = ethash.New(ethash.Config{
|
||||||
CacheDir: stack.ResolvePath(eth.DefaultConfig.Ethash.CacheDir),
|
CacheDir: stack.ResolvePath(ess.DefaultConfig.Ethash.CacheDir),
|
||||||
CachesInMem: eth.DefaultConfig.Ethash.CachesInMem,
|
CachesInMem: ess.DefaultConfig.Ethash.CachesInMem,
|
||||||
CachesOnDisk: eth.DefaultConfig.Ethash.CachesOnDisk,
|
CachesOnDisk: ess.DefaultConfig.Ethash.CachesOnDisk,
|
||||||
DatasetDir: stack.ResolvePath(eth.DefaultConfig.Ethash.DatasetDir),
|
DatasetDir: stack.ResolvePath(ess.DefaultConfig.Ethash.DatasetDir),
|
||||||
DatasetsInMem: eth.DefaultConfig.Ethash.DatasetsInMem,
|
DatasetsInMem: ess.DefaultConfig.Ethash.DatasetsInMem,
|
||||||
DatasetsOnDisk: eth.DefaultConfig.Ethash.DatasetsOnDisk,
|
DatasetsOnDisk: ess.DefaultConfig.Ethash.DatasetsOnDisk,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1302,8 +1302,8 @@ func MakeChain(ctx *cli.Context, stack *node.Node) (chain *core.BlockChain, chai
|
||||||
}
|
}
|
||||||
cache := &core.CacheConfig{
|
cache := &core.CacheConfig{
|
||||||
Disabled: ctx.GlobalString(GCModeFlag.Name) == "archive",
|
Disabled: ctx.GlobalString(GCModeFlag.Name) == "archive",
|
||||||
TrieNodeLimit: eth.DefaultConfig.TrieCache,
|
TrieNodeLimit: ess.DefaultConfig.TrieCache,
|
||||||
TrieTimeLimit: eth.DefaultConfig.TrieTimeout,
|
TrieTimeLimit: ess.DefaultConfig.TrieTimeout,
|
||||||
}
|
}
|
||||||
if ctx.GlobalIsSet(CacheFlag.Name) || ctx.GlobalIsSet(CacheGCFlag.Name) {
|
if ctx.GlobalIsSet(CacheFlag.Name) || ctx.GlobalIsSet(CacheGCFlag.Name) {
|
||||||
cache.TrieNodeLimit = ctx.GlobalInt(CacheFlag.Name) * ctx.GlobalInt(CacheGCFlag.Name) / 100
|
cache.TrieNodeLimit = ctx.GlobalInt(CacheFlag.Name) * ctx.GlobalInt(CacheGCFlag.Name) / 100
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Package hexutil implements hex encoding with 0x prefix.
|
Package hexutil implements hex encoding with 0x prefix.
|
||||||
This encoding is used by the Ethereum RPC API to transport binary data in JSON payloads.
|
This encoding is used by the Essentia RPC API to transport binary data in JSON payloads.
|
||||||
|
|
||||||
Encoding Rules
|
Encoding Rules
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -156,7 +156,7 @@ func (h UnprefixedHash) MarshalText() ([]byte, error) {
|
||||||
|
|
||||||
/////////// Address
|
/////////// Address
|
||||||
|
|
||||||
// Address represents the 20 byte address of an Ethereum account.
|
// Address represents the 20 byte address of an Essentia account.
|
||||||
type Address [AddressLength]byte
|
type Address [AddressLength]byte
|
||||||
|
|
||||||
// BytesToAddress returns Address with value b.
|
// BytesToAddress returns Address with value b.
|
||||||
|
|
@ -176,7 +176,7 @@ func BigToAddress(b *big.Int) Address { return BytesToAddress(b.Bytes()) }
|
||||||
func HexToAddress(s string) Address { return BytesToAddress(FromHex(s)) }
|
func HexToAddress(s string) Address { return BytesToAddress(FromHex(s)) }
|
||||||
|
|
||||||
// IsHexAddress verifies whether a string can represent a valid hex-encoded
|
// IsHexAddress verifies whether a string can represent a valid hex-encoded
|
||||||
// Ethereum address or not.
|
// Essentia address or not.
|
||||||
func IsHexAddress(s string) bool {
|
func IsHexAddress(s string) bool {
|
||||||
if hasHexPrefix(s) {
|
if hasHexPrefix(s) {
|
||||||
s = s[2:]
|
s = s[2:]
|
||||||
|
|
|
||||||
|
|
@ -166,7 +166,7 @@ func sigHash(header *types.Header) (hash common.Hash) {
|
||||||
return hash
|
return hash
|
||||||
}
|
}
|
||||||
|
|
||||||
// ecrecover extracts the Ethereum account address from a signed header.
|
// ecrecover extracts the Essentia account address from a signed header.
|
||||||
func ecrecover(header *types.Header, sigcache *lru.ARCCache) (common.Address, error) {
|
func ecrecover(header *types.Header, sigcache *lru.ARCCache) (common.Address, error) {
|
||||||
// If the signature's already cached, return that
|
// If the signature's already cached, return that
|
||||||
hash := header.Hash()
|
hash := header.Hash()
|
||||||
|
|
@ -179,7 +179,7 @@ func ecrecover(header *types.Header, sigcache *lru.ARCCache) (common.Address, er
|
||||||
}
|
}
|
||||||
signature := header.Extra[len(header.Extra)-extraSeal:]
|
signature := header.Extra[len(header.Extra)-extraSeal:]
|
||||||
|
|
||||||
// Recover the public key and the Ethereum address
|
// Recover the public key and the Essentia address
|
||||||
pubkey, err := crypto.Ecrecover(sigHash(header).Bytes(), signature)
|
pubkey, err := crypto.Ecrecover(sigHash(header).Bytes(), signature)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return common.Address{}, err
|
return common.Address{}, err
|
||||||
|
|
@ -192,7 +192,7 @@ func ecrecover(header *types.Header, sigcache *lru.ARCCache) (common.Address, er
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clique is the proof-of-authority consensus engine proposed to support the
|
// Clique is the proof-of-authority consensus engine proposed to support the
|
||||||
// Ethereum testnet following the Ropsten attacks.
|
// Essentia testnet following the Ropsten attacks.
|
||||||
type Clique struct {
|
type Clique struct {
|
||||||
config *params.CliqueConfig // Consensus engine configuration parameters
|
config *params.CliqueConfig // Consensus engine configuration parameters
|
||||||
db ethdb.Database // Database to store and retrieve snapshot checkpoints
|
db ethdb.Database // Database to store and retrieve snapshot checkpoints
|
||||||
|
|
@ -202,7 +202,7 @@ type Clique struct {
|
||||||
|
|
||||||
proposals map[common.Address]bool // Current list of proposals we are pushing
|
proposals map[common.Address]bool // Current list of proposals we are pushing
|
||||||
|
|
||||||
signer common.Address // Ethereum address of the signing key
|
signer common.Address // Essentia address of the signing key
|
||||||
signFn SignerFn // Signer function to authorize hashes with
|
signFn SignerFn // Signer function to authorize hashes with
|
||||||
lock sync.RWMutex // Protects the signer fields
|
lock sync.RWMutex // Protects the signer fields
|
||||||
}
|
}
|
||||||
|
|
@ -228,7 +228,7 @@ func New(config *params.CliqueConfig, db ethdb.Database) *Clique {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Author implements consensus.Engine, returning the Ethereum address recovered
|
// Author implements consensus.Engine, returning the Essentia address recovered
|
||||||
// from the signature in the header's extra-data section.
|
// from the signature in the header's extra-data section.
|
||||||
func (c *Clique) Author(header *types.Header) (common.Address, error) {
|
func (c *Clique) Author(header *types.Header) (common.Address, error) {
|
||||||
return ecrecover(header, c.signatures)
|
return ecrecover(header, c.signatures)
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ type testerVote struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
// testerAccountPool is a pool to maintain currently active tester accounts,
|
// testerAccountPool is a pool to maintain currently active tester accounts,
|
||||||
// mapped from textual names used in the tests below to actual Ethereum private
|
// mapped from textual names used in the tests below to actual Essentia private
|
||||||
// keys capable of signing transactions.
|
// keys capable of signing transactions.
|
||||||
type testerAccountPool struct {
|
type testerAccountPool struct {
|
||||||
accounts map[string]*ecdsa.PrivateKey
|
accounts map[string]*ecdsa.PrivateKey
|
||||||
|
|
@ -65,7 +65,7 @@ func (ap *testerAccountPool) address(account string) common.Address {
|
||||||
if ap.accounts[account] == nil {
|
if ap.accounts[account] == nil {
|
||||||
ap.accounts[account], _ = crypto.GenerateKey()
|
ap.accounts[account], _ = crypto.GenerateKey()
|
||||||
}
|
}
|
||||||
// Resolve and return the Ethereum address
|
// Resolve and return the Essentia address
|
||||||
return crypto.PubkeyToAddress(ap.accounts[account].PublicKey)
|
return crypto.PubkeyToAddress(ap.accounts[account].PublicKey)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@
|
||||||
// You should have received a copy of the GNU Lesser General Public License
|
// 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-ethereum library. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
// Package consensus implements different Ethereum consensus engines.
|
// Package consensus implements different Essentia consensus engines.
|
||||||
package consensus
|
package consensus
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|
@ -51,7 +51,7 @@ type ChainReader interface {
|
||||||
|
|
||||||
// Engine is an algorithm agnostic consensus engine.
|
// Engine is an algorithm agnostic consensus engine.
|
||||||
type Engine interface {
|
type Engine interface {
|
||||||
// Author retrieves the Ethereum address of the account that minted the given
|
// Author retrieves the Essentia address of the account that minted the given
|
||||||
// block, which may be different from the header's coinbase if a consensus
|
// block, which may be different from the header's coinbase if a consensus
|
||||||
// engine is based on signatures.
|
// engine is based on signatures.
|
||||||
Author(header *types.Header) (common.Address, error)
|
Author(header *types.Header) (common.Address, error)
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,7 @@ func (ethash *Ethash) Author(header *types.Header) (common.Address, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// VerifyHeader checks whether a header conforms to the consensus rules of the
|
// VerifyHeader checks whether a header conforms to the consensus rules of the
|
||||||
// stock Ethereum ethash engine.
|
// stock Essentia ethash engine.
|
||||||
func (ethash *Ethash) VerifyHeader(chain consensus.ChainReader, header *types.Header, seal bool) error {
|
func (ethash *Ethash) VerifyHeader(chain consensus.ChainReader, header *types.Header, seal bool) error {
|
||||||
// If we're running a full engine faking, accept any input as valid
|
// If we're running a full engine faking, accept any input as valid
|
||||||
if ethash.config.PowMode == ModeFullFake {
|
if ethash.config.PowMode == ModeFullFake {
|
||||||
|
|
@ -166,7 +166,7 @@ func (ethash *Ethash) verifyHeaderWorker(chain consensus.ChainReader, headers []
|
||||||
}
|
}
|
||||||
|
|
||||||
// VerifyUncles verifies that the given block's uncles conform to the consensus
|
// VerifyUncles verifies that the given block's uncles conform to the consensus
|
||||||
// rules of the stock Ethereum ethash engine.
|
// rules of the stock Essentia ethash engine.
|
||||||
func (ethash *Ethash) VerifyUncles(chain consensus.ChainReader, block *types.Block) error {
|
func (ethash *Ethash) VerifyUncles(chain consensus.ChainReader, block *types.Block) error {
|
||||||
// If we're running a full engine faking, accept any input as valid
|
// If we're running a full engine faking, accept any input as valid
|
||||||
if ethash.config.PowMode == ModeFullFake {
|
if ethash.config.PowMode == ModeFullFake {
|
||||||
|
|
@ -218,7 +218,7 @@ func (ethash *Ethash) VerifyUncles(chain consensus.ChainReader, block *types.Blo
|
||||||
}
|
}
|
||||||
|
|
||||||
// verifyHeader checks whether a header conforms to the consensus rules of the
|
// verifyHeader checks whether a header conforms to the consensus rules of the
|
||||||
// stock Ethereum ethash engine.
|
// stock Essentia ethash engine.
|
||||||
// See YP section 4.3.4. "Block Header Validity"
|
// See YP section 4.3.4. "Block Header Validity"
|
||||||
func (ethash *Ethash) verifyHeader(chain consensus.ChainReader, header, parent *types.Header, uncle bool, seal bool) error {
|
func (ethash *Ethash) verifyHeader(chain consensus.ChainReader, header, parent *types.Header, uncle bool, seal bool) error {
|
||||||
// Ensure that the header's extra-data section is of a reasonable size
|
// Ensure that the header's extra-data section is of a reasonable size
|
||||||
|
|
|
||||||
|
|
@ -439,7 +439,7 @@ func NewTester() *Ethash {
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewFaker creates a ethash consensus engine with a fake PoW scheme that accepts
|
// NewFaker creates a ethash consensus engine with a fake PoW scheme that accepts
|
||||||
// all blocks' seal as valid, though they still have to conform to the Ethereum
|
// all blocks' seal as valid, though they still have to conform to the Essentia
|
||||||
// consensus rules.
|
// consensus rules.
|
||||||
func NewFaker() *Ethash {
|
func NewFaker() *Ethash {
|
||||||
return &Ethash{
|
return &Ethash{
|
||||||
|
|
@ -451,7 +451,7 @@ func NewFaker() *Ethash {
|
||||||
|
|
||||||
// NewFakeFailer creates a ethash consensus engine with a fake PoW scheme that
|
// NewFakeFailer creates a ethash consensus engine with a fake PoW scheme that
|
||||||
// accepts all blocks as valid apart from the single one specified, though they
|
// accepts all blocks as valid apart from the single one specified, though they
|
||||||
// still have to conform to the Ethereum consensus rules.
|
// still have to conform to the Essentia consensus rules.
|
||||||
func NewFakeFailer(fail uint64) *Ethash {
|
func NewFakeFailer(fail uint64) *Ethash {
|
||||||
return &Ethash{
|
return &Ethash{
|
||||||
config: Config{
|
config: Config{
|
||||||
|
|
@ -463,7 +463,7 @@ func NewFakeFailer(fail uint64) *Ethash {
|
||||||
|
|
||||||
// NewFakeDelayer creates a ethash consensus engine with a fake PoW scheme that
|
// NewFakeDelayer creates a ethash consensus engine with a fake PoW scheme that
|
||||||
// accepts all blocks as valid, but delays verifications by some time, though
|
// accepts all blocks as valid, but delays verifications by some time, though
|
||||||
// they still have to conform to the Ethereum consensus rules.
|
// they still have to conform to the Essentia consensus rules.
|
||||||
func NewFakeDelayer(delay time.Duration) *Ethash {
|
func NewFakeDelayer(delay time.Duration) *Ethash {
|
||||||
return &Ethash{
|
return &Ethash{
|
||||||
config: Config{
|
config: Config{
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ import (
|
||||||
// bridge is a collection of JavaScript utility methods to bride the .js runtime
|
// bridge is a collection of JavaScript utility methods to bride the .js runtime
|
||||||
// environment and the Go RPC connection backing the remote method calls.
|
// environment and the Go RPC connection backing the remote method calls.
|
||||||
type bridge struct {
|
type bridge struct {
|
||||||
client *rpc.Client // RPC client to execute Ethereum requests through
|
client *rpc.Client // RPC client to execute Essentia requests through
|
||||||
prompter UserPrompter // Input prompter to allow interactive user feedback
|
prompter UserPrompter // Input prompter to allow interactive user feedback
|
||||||
printer io.Writer // Output writer to serialize any display strings to
|
printer io.Writer // Output writer to serialize any display strings to
|
||||||
}
|
}
|
||||||
|
|
@ -247,7 +247,7 @@ func (b *bridge) SleepBlocks(call otto.FunctionCall) (response otto.Value) {
|
||||||
// go through the console, this will allow web3 to call the appropriate
|
// go through the console, this will allow web3 to call the appropriate
|
||||||
// callbacks if a delayed response or notification is received.
|
// callbacks if a delayed response or notification is received.
|
||||||
blockNumber := func() int64 {
|
blockNumber := func() int64 {
|
||||||
result, err := call.Otto.Run("eth.blockNumber")
|
result, err := call.Otto.Run("ess.blockNumber")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
throwJSException(err.Error())
|
throwJSException(err.Error())
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@ const DefaultPrompt = "> "
|
||||||
type Config struct {
|
type Config struct {
|
||||||
DataDir string // Data directory to store the console history at
|
DataDir string // Data directory to store the console history at
|
||||||
DocRoot string // Filesystem path from where to load JavaScript files from
|
DocRoot string // Filesystem path from where to load JavaScript files from
|
||||||
Client *rpc.Client // RPC client to execute Ethereum requests through
|
Client *rpc.Client // RPC client to execute Essentia requests through
|
||||||
Prompt string // Input prompt prefix string (defaults to DefaultPrompt)
|
Prompt string // Input prompt prefix string (defaults to DefaultPrompt)
|
||||||
Prompter UserPrompter // Input prompter to allow interactive user feedback (defaults to TerminalPrompter)
|
Prompter UserPrompter // Input prompter to allow interactive user feedback (defaults to TerminalPrompter)
|
||||||
Printer io.Writer // Output writer to serialize any display strings to (defaults to os.Stdout)
|
Printer io.Writer // Output writer to serialize any display strings to (defaults to os.Stdout)
|
||||||
|
|
@ -64,7 +64,7 @@ type Config struct {
|
||||||
// JavaScript console attached to a running node via an external or in-process RPC
|
// JavaScript console attached to a running node via an external or in-process RPC
|
||||||
// client.
|
// client.
|
||||||
type Console struct {
|
type Console struct {
|
||||||
client *rpc.Client // RPC client to execute Ethereum requests through
|
client *rpc.Client // RPC client to execute Essentia requests through
|
||||||
jsre *jsre.JSRE // JavaScript runtime environment running the interpreter
|
jsre *jsre.JSRE // JavaScript runtime environment running the interpreter
|
||||||
prompt string // Input prompt prefix string
|
prompt string // Input prompt prefix string
|
||||||
prompter UserPrompter // Input prompter to allow interactive user feedback
|
prompter UserPrompter // Input prompter to allow interactive user feedback
|
||||||
|
|
@ -137,7 +137,7 @@ func (c *Console) init(preload []string) error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("api modules: %v", err)
|
return fmt.Errorf("api modules: %v", err)
|
||||||
}
|
}
|
||||||
flatten := "var eth = web3.eth; var personal = web3.personal; "
|
flatten := "var ess = web3.ess; var personal = web3.personal; "
|
||||||
for api := range apis {
|
for api := range apis {
|
||||||
if api == "web3" {
|
if api == "web3" {
|
||||||
continue // manually mapped or ignore
|
continue // manually mapped or ignore
|
||||||
|
|
@ -157,7 +157,7 @@ func (c *Console) init(preload []string) error {
|
||||||
return fmt.Errorf("namespace flattening: %v", err)
|
return fmt.Errorf("namespace flattening: %v", err)
|
||||||
}
|
}
|
||||||
// Initialize the global name register (disabled for now)
|
// Initialize the global name register (disabled for now)
|
||||||
//c.jsre.Run(`var GlobalRegistrar = eth.contract(` + registrar.GlobalRegistrarAbi + `); registrar = GlobalRegistrar.at("` + registrar.GlobalRegistrarAddr + `");`)
|
//c.jsre.Run(`var GlobalRegistrar = ess.contract(` + registrar.GlobalRegistrarAbi + `); registrar = GlobalRegistrar.at("` + registrar.GlobalRegistrarAddr + `");`)
|
||||||
|
|
||||||
// If the console is in interactive mode, instrument password related methods to query the user
|
// If the console is in interactive mode, instrument password related methods to query the user
|
||||||
if c.prompter != nil {
|
if c.prompter != nil {
|
||||||
|
|
@ -252,7 +252,7 @@ func (c *Console) AutoCompleteInput(line string, pos int) (string, []string, str
|
||||||
return "", nil, ""
|
return "", nil, ""
|
||||||
}
|
}
|
||||||
// Chunck data to relevant part for autocompletion
|
// Chunck data to relevant part for autocompletion
|
||||||
// E.g. in case of nested lines eth.getBalance(eth.coinb<tab><tab>
|
// E.g. in case of nested lines ess.getBalance(ess.coinb<tab><tab>
|
||||||
start := pos - 1
|
start := pos - 1
|
||||||
for ; start > 0; start-- {
|
for ; start > 0; start-- {
|
||||||
// Skip all methods and namespaces (i.e. including the dot)
|
// Skip all methods and namespaces (i.e. including the dot)
|
||||||
|
|
@ -278,8 +278,8 @@ func (c *Console) Welcome() {
|
||||||
fmt.Fprintf(c.printer, "Welcome to the Geth JavaScript console!\n\n")
|
fmt.Fprintf(c.printer, "Welcome to the Geth JavaScript console!\n\n")
|
||||||
c.jsre.Run(`
|
c.jsre.Run(`
|
||||||
console.log("instance: " + web3.version.node);
|
console.log("instance: " + web3.version.node);
|
||||||
console.log("coinbase: " + eth.coinbase);
|
console.log("coinbase: " + ess.coinbase);
|
||||||
console.log("at block: " + eth.blockNumber + " (" + new Date(1000 * eth.getBlock(eth.blockNumber).timestamp) + ")");
|
console.log("at block: " + ess.blockNumber + " (" + new Date(1000 * ess.getBlock(ess.blockNumber).timestamp) + ")");
|
||||||
console.log(" datadir: " + admin.datadir);
|
console.log(" datadir: " + admin.datadir);
|
||||||
`)
|
`)
|
||||||
// List all the supported modules for the user to call
|
// List all the supported modules for the user to call
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,7 @@ func (p *hookedPrompter) SetWordCompleter(completer WordCompleter) {}
|
||||||
type tester struct {
|
type tester struct {
|
||||||
workspace string
|
workspace string
|
||||||
stack *node.Node
|
stack *node.Node
|
||||||
ethereum *eth.Ethereum
|
ethereum *ess.Essentia
|
||||||
console *Console
|
console *Console
|
||||||
input *hookedPrompter
|
input *hookedPrompter
|
||||||
output *bytes.Buffer
|
output *bytes.Buffer
|
||||||
|
|
@ -83,19 +83,19 @@ type tester struct {
|
||||||
|
|
||||||
// newTester creates a test environment based on which the console can operate.
|
// newTester creates a test environment based on which the console can operate.
|
||||||
// Please ensure you call Close() on the returned tester to avoid leaks.
|
// Please ensure you call Close() on the returned tester to avoid leaks.
|
||||||
func newTester(t *testing.T, confOverride func(*eth.Config)) *tester {
|
func newTester(t *testing.T, confOverride func(*ess.Config)) *tester {
|
||||||
// Create a temporary storage for the node keys and initialize it
|
// Create a temporary storage for the node keys and initialize it
|
||||||
workspace, err := ioutil.TempDir("", "console-tester-")
|
workspace, err := ioutil.TempDir("", "console-tester-")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("failed to create temporary keystore: %v", err)
|
t.Fatalf("failed to create temporary keystore: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create a networkless protocol stack and start an Ethereum service within
|
// Create a networkless protocol stack and start an Essentia service within
|
||||||
stack, err := node.New(&node.Config{DataDir: workspace, UseLightweightKDF: true, Name: testInstance})
|
stack, err := node.New(&node.Config{DataDir: workspace, UseLightweightKDF: true, Name: testInstance})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("failed to create node: %v", err)
|
t.Fatalf("failed to create node: %v", err)
|
||||||
}
|
}
|
||||||
ethConf := ð.Config{
|
ethConf := &ess.Config{
|
||||||
Genesis: core.DeveloperGenesisBlock(15, common.Address{}),
|
Genesis: core.DeveloperGenesisBlock(15, common.Address{}),
|
||||||
Etherbase: common.HexToAddress(testAddress),
|
Etherbase: common.HexToAddress(testAddress),
|
||||||
Ethash: ethash.Config{
|
Ethash: ethash.Config{
|
||||||
|
|
@ -105,8 +105,8 @@ func newTester(t *testing.T, confOverride func(*eth.Config)) *tester {
|
||||||
if confOverride != nil {
|
if confOverride != nil {
|
||||||
confOverride(ethConf)
|
confOverride(ethConf)
|
||||||
}
|
}
|
||||||
if err = stack.Register(func(ctx *node.ServiceContext) (node.Service, error) { return eth.New(ctx, ethConf) }); err != nil {
|
if err = stack.Register(func(ctx *node.ServiceContext) (node.Service, error) { return ess.New(ctx, ethConf) }); err != nil {
|
||||||
t.Fatalf("failed to register Ethereum protocol: %v", err)
|
t.Fatalf("failed to register Essentia protocol: %v", err)
|
||||||
}
|
}
|
||||||
// Start the node and assemble the JavaScript console around it
|
// Start the node and assemble the JavaScript console around it
|
||||||
if err = stack.Start(); err != nil {
|
if err = stack.Start(); err != nil {
|
||||||
|
|
@ -131,7 +131,7 @@ func newTester(t *testing.T, confOverride func(*eth.Config)) *tester {
|
||||||
t.Fatalf("failed to create JavaScript console: %v", err)
|
t.Fatalf("failed to create JavaScript console: %v", err)
|
||||||
}
|
}
|
||||||
// Create the final tester and return
|
// Create the final tester and return
|
||||||
var ethereum *eth.Ethereum
|
var ethereum *ess.Essentia
|
||||||
stack.Service(ðereum)
|
stack.Service(ðereum)
|
||||||
|
|
||||||
return &tester{
|
return &tester{
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@
|
||||||
// You should have received a copy of the GNU Lesser General Public License
|
// 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-ethereum library. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
// Package chequebook package wraps the 'chequebook' Ethereum smart contract.
|
// Package chequebook package wraps the 'chequebook' Essentia smart contract.
|
||||||
//
|
//
|
||||||
// The functions in this package allow using chequebook for
|
// The functions in this package allow using chequebook for
|
||||||
// issuing, receiving, verifying cheques in ether; (auto)cashing cheques in ether
|
// issuing, receiving, verifying cheques in ether; (auto)cashing cheques in ether
|
||||||
|
|
@ -620,7 +620,7 @@ func sig2vrs(sig []byte) (v byte, r, s [32]byte) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// Cash cashes the cheque by sending an Ethereum transaction.
|
// Cash cashes the cheque by sending an Essentia transaction.
|
||||||
func (self *Cheque) Cash(session *contract.ChequebookSession) (string, error) {
|
func (self *Cheque) Cash(session *contract.ChequebookSession) (string, error) {
|
||||||
v, r, s := sig2vrs(self.Sig)
|
v, r, s := sig2vrs(self.Sig)
|
||||||
tx, err := session.Cash(self.Beneficiary, self.Amount, v, r, s)
|
tx, err := session.Cash(self.Beneficiary, self.Amount, v, r, s)
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ const ChequebookABI = "[{\"constant\":false,\"inputs\":[],\"name\":\"kill\",\"ou
|
||||||
// ChequebookBin is the compiled bytecode used for deploying new contracts.
|
// ChequebookBin is the compiled bytecode used for deploying new contracts.
|
||||||
const ChequebookBin = `0x606060405260008054600160a060020a033316600160a060020a03199091161790556102ec806100306000396000f3006060604052600436106100565763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166341c0e1b581146100585780637bf786f81461006b578063fbf788d61461009c575b005b341561006357600080fd5b6100566100ca565b341561007657600080fd5b61008a600160a060020a03600435166100f1565b60405190815260200160405180910390f35b34156100a757600080fd5b610056600160a060020a036004351660243560ff60443516606435608435610103565b60005433600160a060020a03908116911614156100ef57600054600160a060020a0316ff5b565b60016020526000908152604090205481565b600160a060020a0385166000908152600160205260408120548190861161012957600080fd5b3087876040516c01000000000000000000000000600160a060020a03948516810282529290931690910260148301526028820152604801604051809103902091506001828686866040516000815260200160405260006040516020015260405193845260ff90921660208085019190915260408085019290925260608401929092526080909201915160208103908084039060008661646e5a03f115156101cf57600080fd5b505060206040510351600054600160a060020a039081169116146101f257600080fd5b50600160a060020a03808716600090815260016020526040902054860390301631811161026257600160a060020a0387166000818152600160205260409081902088905582156108fc0290839051600060405180830381858888f19350505050151561025d57600080fd5b6102b7565b6000547f2250e2993c15843b32621c89447cc589ee7a9f049c026986e545d3c2c0c6f97890600160a060020a0316604051600160a060020a03909116815260200160405180910390a186600160a060020a0316ff5b505050505050505600a165627a7a72305820533e856fc37e3d64d1706bcc7dfb6b1d490c8d566ea498d9d01ec08965a896ca0029`
|
const ChequebookBin = `0x606060405260008054600160a060020a033316600160a060020a03199091161790556102ec806100306000396000f3006060604052600436106100565763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166341c0e1b581146100585780637bf786f81461006b578063fbf788d61461009c575b005b341561006357600080fd5b6100566100ca565b341561007657600080fd5b61008a600160a060020a03600435166100f1565b60405190815260200160405180910390f35b34156100a757600080fd5b610056600160a060020a036004351660243560ff60443516606435608435610103565b60005433600160a060020a03908116911614156100ef57600054600160a060020a0316ff5b565b60016020526000908152604090205481565b600160a060020a0385166000908152600160205260408120548190861161012957600080fd5b3087876040516c01000000000000000000000000600160a060020a03948516810282529290931690910260148301526028820152604801604051809103902091506001828686866040516000815260200160405260006040516020015260405193845260ff90921660208085019190915260408085019290925260608401929092526080909201915160208103908084039060008661646e5a03f115156101cf57600080fd5b505060206040510351600054600160a060020a039081169116146101f257600080fd5b50600160a060020a03808716600090815260016020526040902054860390301631811161026257600160a060020a0387166000818152600160205260409081902088905582156108fc0290839051600060405180830381858888f19350505050151561025d57600080fd5b6102b7565b6000547f2250e2993c15843b32621c89447cc589ee7a9f049c026986e545d3c2c0c6f97890600160a060020a0316604051600160a060020a03909116815260200160405180910390a186600160a060020a0316ff5b505050505050505600a165627a7a72305820533e856fc37e3d64d1706bcc7dfb6b1d490c8d566ea498d9d01ec08965a896ca0029`
|
||||||
|
|
||||||
// DeployChequebook deploys a new Ethereum contract, binding an instance of Chequebook to it.
|
// DeployChequebook deploys a new Essentia contract, binding an instance of Chequebook to it.
|
||||||
func DeployChequebook(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *Chequebook, error) {
|
func DeployChequebook(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *Chequebook, error) {
|
||||||
parsed, err := abi.JSON(strings.NewReader(ChequebookABI))
|
parsed, err := abi.JSON(strings.NewReader(ChequebookABI))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
@ -34,29 +34,29 @@ func DeployChequebook(auth *bind.TransactOpts, backend bind.ContractBackend) (co
|
||||||
return address, tx, &Chequebook{ChequebookCaller: ChequebookCaller{contract: contract}, ChequebookTransactor: ChequebookTransactor{contract: contract}, ChequebookFilterer: ChequebookFilterer{contract: contract}}, nil
|
return address, tx, &Chequebook{ChequebookCaller: ChequebookCaller{contract: contract}, ChequebookTransactor: ChequebookTransactor{contract: contract}, ChequebookFilterer: ChequebookFilterer{contract: contract}}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Chequebook is an auto generated Go binding around an Ethereum contract.
|
// Chequebook is an auto generated Go binding around an Essentia contract.
|
||||||
type Chequebook struct {
|
type Chequebook struct {
|
||||||
ChequebookCaller // Read-only binding to the contract
|
ChequebookCaller // Read-only binding to the contract
|
||||||
ChequebookTransactor // Write-only binding to the contract
|
ChequebookTransactor // Write-only binding to the contract
|
||||||
ChequebookFilterer // Log filterer for contract events
|
ChequebookFilterer // Log filterer for contract events
|
||||||
}
|
}
|
||||||
|
|
||||||
// ChequebookCaller is an auto generated read-only Go binding around an Ethereum contract.
|
// ChequebookCaller is an auto generated read-only Go binding around an Essentia contract.
|
||||||
type ChequebookCaller struct {
|
type ChequebookCaller struct {
|
||||||
contract *bind.BoundContract // Generic contract wrapper for the low level calls
|
contract *bind.BoundContract // Generic contract wrapper for the low level calls
|
||||||
}
|
}
|
||||||
|
|
||||||
// ChequebookTransactor is an auto generated write-only Go binding around an Ethereum contract.
|
// ChequebookTransactor is an auto generated write-only Go binding around an Essentia contract.
|
||||||
type ChequebookTransactor struct {
|
type ChequebookTransactor struct {
|
||||||
contract *bind.BoundContract // Generic contract wrapper for the low level calls
|
contract *bind.BoundContract // Generic contract wrapper for the low level calls
|
||||||
}
|
}
|
||||||
|
|
||||||
// ChequebookFilterer is an auto generated log filtering Go binding around an Ethereum contract events.
|
// ChequebookFilterer is an auto generated log filtering Go binding around an Essentia contract events.
|
||||||
type ChequebookFilterer struct {
|
type ChequebookFilterer struct {
|
||||||
contract *bind.BoundContract // Generic contract wrapper for the low level calls
|
contract *bind.BoundContract // Generic contract wrapper for the low level calls
|
||||||
}
|
}
|
||||||
|
|
||||||
// ChequebookSession is an auto generated Go binding around an Ethereum contract,
|
// ChequebookSession is an auto generated Go binding around an Essentia contract,
|
||||||
// with pre-set call and transact options.
|
// with pre-set call and transact options.
|
||||||
type ChequebookSession struct {
|
type ChequebookSession struct {
|
||||||
Contract *Chequebook // Generic contract binding to set the session for
|
Contract *Chequebook // Generic contract binding to set the session for
|
||||||
|
|
@ -64,31 +64,31 @@ type ChequebookSession struct {
|
||||||
TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session
|
TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session
|
||||||
}
|
}
|
||||||
|
|
||||||
// ChequebookCallerSession is an auto generated read-only Go binding around an Ethereum contract,
|
// ChequebookCallerSession is an auto generated read-only Go binding around an Essentia contract,
|
||||||
// with pre-set call options.
|
// with pre-set call options.
|
||||||
type ChequebookCallerSession struct {
|
type ChequebookCallerSession struct {
|
||||||
Contract *ChequebookCaller // Generic contract caller binding to set the session for
|
Contract *ChequebookCaller // Generic contract caller binding to set the session for
|
||||||
CallOpts bind.CallOpts // Call options to use throughout this session
|
CallOpts bind.CallOpts // Call options to use throughout this session
|
||||||
}
|
}
|
||||||
|
|
||||||
// ChequebookTransactorSession is an auto generated write-only Go binding around an Ethereum contract,
|
// ChequebookTransactorSession is an auto generated write-only Go binding around an Essentia contract,
|
||||||
// with pre-set transact options.
|
// with pre-set transact options.
|
||||||
type ChequebookTransactorSession struct {
|
type ChequebookTransactorSession struct {
|
||||||
Contract *ChequebookTransactor // Generic contract transactor binding to set the session for
|
Contract *ChequebookTransactor // Generic contract transactor binding to set the session for
|
||||||
TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session
|
TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session
|
||||||
}
|
}
|
||||||
|
|
||||||
// ChequebookRaw is an auto generated low-level Go binding around an Ethereum contract.
|
// ChequebookRaw is an auto generated low-level Go binding around an Essentia contract.
|
||||||
type ChequebookRaw struct {
|
type ChequebookRaw struct {
|
||||||
Contract *Chequebook // Generic contract binding to access the raw methods on
|
Contract *Chequebook // Generic contract binding to access the raw methods on
|
||||||
}
|
}
|
||||||
|
|
||||||
// ChequebookCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract.
|
// ChequebookCallerRaw is an auto generated low-level read-only Go binding around an Essentia contract.
|
||||||
type ChequebookCallerRaw struct {
|
type ChequebookCallerRaw struct {
|
||||||
Contract *ChequebookCaller // Generic read-only contract binding to access the raw methods on
|
Contract *ChequebookCaller // Generic read-only contract binding to access the raw methods on
|
||||||
}
|
}
|
||||||
|
|
||||||
// ChequebookTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract.
|
// ChequebookTransactorRaw is an auto generated low-level write-only Go binding around an Essentia contract.
|
||||||
type ChequebookTransactorRaw struct {
|
type ChequebookTransactorRaw struct {
|
||||||
Contract *ChequebookTransactor // Generic write-only contract binding to access the raw methods on
|
Contract *ChequebookTransactor // Generic write-only contract binding to access the raw methods on
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ pragma solidity ^0.4.18;
|
||||||
|
|
||||||
import "./mortal.sol";
|
import "./mortal.sol";
|
||||||
|
|
||||||
/// @title Chequebook for Ethereum micropayments
|
/// @title Chequebook for Essentia micropayments
|
||||||
/// @author Daniel A. Nagy <daniel@ethereum.org>
|
/// @author Daniel A. Nagy <daniel@ethereum.org>
|
||||||
contract chequebook is mortal {
|
contract chequebook is mortal {
|
||||||
// Cumulative paid amount in wei to each beneficiary
|
// Cumulative paid amount in wei to each beneficiary
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
Full documentation for the Ethereum Name Service [can be found as EIP 137](https://github.com/ethereum/EIPs/issues/137).
|
Full documentation for the Essentia Name Service [can be found as EIP 137](https://github.com/ethereum/EIPs/issues/137).
|
||||||
This package offers a simple binding that streamlines the registration of arbitrary UTF8 domain names to swarm content hashes.
|
This package offers a simple binding that streamlines the registration of arbitrary UTF8 domain names to swarm content hashes.
|
||||||
|
|
||||||
## Development
|
## Development
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ const ENSABI = "[{\"constant\":true,\"inputs\":[{\"name\":\"node\",\"type\":\"by
|
||||||
// ENSBin is the compiled bytecode used for deploying new contracts.
|
// ENSBin is the compiled bytecode used for deploying new contracts.
|
||||||
const ENSBin = `0x6060604052341561000f57600080fd5b60008080526020527fad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb58054600160a060020a033316600160a060020a0319909116179055610503806100626000396000f3006060604052600436106100825763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630178b8bf811461008757806302571be3146100b957806306ab5923146100cf57806314ab9038146100f657806316a25cbd146101195780631896f70a1461014c5780635b0fc9c31461016e575b600080fd5b341561009257600080fd5b61009d600435610190565b604051600160a060020a03909116815260200160405180910390f35b34156100c457600080fd5b61009d6004356101ae565b34156100da57600080fd5b6100f4600435602435600160a060020a03604435166101c9565b005b341561010157600080fd5b6100f460043567ffffffffffffffff6024351661028b565b341561012457600080fd5b61012f600435610357565b60405167ffffffffffffffff909116815260200160405180910390f35b341561015757600080fd5b6100f4600435600160a060020a036024351661038e565b341561017957600080fd5b6100f4600435600160a060020a0360243516610434565b600090815260208190526040902060010154600160a060020a031690565b600090815260208190526040902054600160a060020a031690565b600083815260208190526040812054849033600160a060020a039081169116146101f257600080fd5b8484604051918252602082015260409081019051908190039020915083857fce0457fe73731f824cc272376169235128c118b49d344817417c6d108d155e8285604051600160a060020a03909116815260200160405180910390a3506000908152602081905260409020805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03929092169190911790555050565b600082815260208190526040902054829033600160a060020a039081169116146102b457600080fd5b827f1d4f9bbfc9cab89d66e1a1562f2233ccbf1308cb4f63de2ead5787adddb8fa688360405167ffffffffffffffff909116815260200160405180910390a250600091825260208290526040909120600101805467ffffffffffffffff90921674010000000000000000000000000000000000000000027fffffffff0000000000000000ffffffffffffffffffffffffffffffffffffffff909216919091179055565b60009081526020819052604090206001015474010000000000000000000000000000000000000000900467ffffffffffffffff1690565b600082815260208190526040902054829033600160a060020a039081169116146103b757600080fd5b827f335721b01866dc23fbee8b6b2c7b1e14d6f05c28cd35a2c934239f94095602a083604051600160a060020a03909116815260200160405180910390a250600091825260208290526040909120600101805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03909216919091179055565b600082815260208190526040902054829033600160a060020a0390811691161461045d57600080fd5b827fd4735d920b0f87494915f556dd9b54c8f309026070caea5c737245152564d26683604051600160a060020a03909116815260200160405180910390a250600091825260208290526040909120805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039092169190911790555600a165627a7a72305820f4c798d4c84c9912f389f64631e85e8d16c3e6644f8c2e1579936015c7d5f6660029`
|
const ENSBin = `0x6060604052341561000f57600080fd5b60008080526020527fad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb58054600160a060020a033316600160a060020a0319909116179055610503806100626000396000f3006060604052600436106100825763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630178b8bf811461008757806302571be3146100b957806306ab5923146100cf57806314ab9038146100f657806316a25cbd146101195780631896f70a1461014c5780635b0fc9c31461016e575b600080fd5b341561009257600080fd5b61009d600435610190565b604051600160a060020a03909116815260200160405180910390f35b34156100c457600080fd5b61009d6004356101ae565b34156100da57600080fd5b6100f4600435602435600160a060020a03604435166101c9565b005b341561010157600080fd5b6100f460043567ffffffffffffffff6024351661028b565b341561012457600080fd5b61012f600435610357565b60405167ffffffffffffffff909116815260200160405180910390f35b341561015757600080fd5b6100f4600435600160a060020a036024351661038e565b341561017957600080fd5b6100f4600435600160a060020a0360243516610434565b600090815260208190526040902060010154600160a060020a031690565b600090815260208190526040902054600160a060020a031690565b600083815260208190526040812054849033600160a060020a039081169116146101f257600080fd5b8484604051918252602082015260409081019051908190039020915083857fce0457fe73731f824cc272376169235128c118b49d344817417c6d108d155e8285604051600160a060020a03909116815260200160405180910390a3506000908152602081905260409020805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03929092169190911790555050565b600082815260208190526040902054829033600160a060020a039081169116146102b457600080fd5b827f1d4f9bbfc9cab89d66e1a1562f2233ccbf1308cb4f63de2ead5787adddb8fa688360405167ffffffffffffffff909116815260200160405180910390a250600091825260208290526040909120600101805467ffffffffffffffff90921674010000000000000000000000000000000000000000027fffffffff0000000000000000ffffffffffffffffffffffffffffffffffffffff909216919091179055565b60009081526020819052604090206001015474010000000000000000000000000000000000000000900467ffffffffffffffff1690565b600082815260208190526040902054829033600160a060020a039081169116146103b757600080fd5b827f335721b01866dc23fbee8b6b2c7b1e14d6f05c28cd35a2c934239f94095602a083604051600160a060020a03909116815260200160405180910390a250600091825260208290526040909120600101805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03909216919091179055565b600082815260208190526040902054829033600160a060020a0390811691161461045d57600080fd5b827fd4735d920b0f87494915f556dd9b54c8f309026070caea5c737245152564d26683604051600160a060020a03909116815260200160405180910390a250600091825260208290526040909120805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039092169190911790555600a165627a7a72305820f4c798d4c84c9912f389f64631e85e8d16c3e6644f8c2e1579936015c7d5f6660029`
|
||||||
|
|
||||||
// DeployENS deploys a new Ethereum contract, binding an instance of ENS to it.
|
// DeployENS deploys a new Essentia contract, binding an instance of ENS to it.
|
||||||
func DeployENS(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *ENS, error) {
|
func DeployENS(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *ENS, error) {
|
||||||
parsed, err := abi.JSON(strings.NewReader(ENSABI))
|
parsed, err := abi.JSON(strings.NewReader(ENSABI))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
@ -33,29 +33,29 @@ func DeployENS(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Ad
|
||||||
return address, tx, &ENS{ENSCaller: ENSCaller{contract: contract}, ENSTransactor: ENSTransactor{contract: contract}, ENSFilterer: ENSFilterer{contract: contract}}, nil
|
return address, tx, &ENS{ENSCaller: ENSCaller{contract: contract}, ENSTransactor: ENSTransactor{contract: contract}, ENSFilterer: ENSFilterer{contract: contract}}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// ENS is an auto generated Go binding around an Ethereum contract.
|
// ENS is an auto generated Go binding around an Essentia contract.
|
||||||
type ENS struct {
|
type ENS struct {
|
||||||
ENSCaller // Read-only binding to the contract
|
ENSCaller // Read-only binding to the contract
|
||||||
ENSTransactor // Write-only binding to the contract
|
ENSTransactor // Write-only binding to the contract
|
||||||
ENSFilterer // Log filterer for contract events
|
ENSFilterer // Log filterer for contract events
|
||||||
}
|
}
|
||||||
|
|
||||||
// ENSCaller is an auto generated read-only Go binding around an Ethereum contract.
|
// ENSCaller is an auto generated read-only Go binding around an Essentia contract.
|
||||||
type ENSCaller struct {
|
type ENSCaller struct {
|
||||||
contract *bind.BoundContract // Generic contract wrapper for the low level calls
|
contract *bind.BoundContract // Generic contract wrapper for the low level calls
|
||||||
}
|
}
|
||||||
|
|
||||||
// ENSTransactor is an auto generated write-only Go binding around an Ethereum contract.
|
// ENSTransactor is an auto generated write-only Go binding around an Essentia contract.
|
||||||
type ENSTransactor struct {
|
type ENSTransactor struct {
|
||||||
contract *bind.BoundContract // Generic contract wrapper for the low level calls
|
contract *bind.BoundContract // Generic contract wrapper for the low level calls
|
||||||
}
|
}
|
||||||
|
|
||||||
// ENSFilterer is an auto generated log filtering Go binding around an Ethereum contract events.
|
// ENSFilterer is an auto generated log filtering Go binding around an Essentia contract events.
|
||||||
type ENSFilterer struct {
|
type ENSFilterer struct {
|
||||||
contract *bind.BoundContract // Generic contract wrapper for the low level calls
|
contract *bind.BoundContract // Generic contract wrapper for the low level calls
|
||||||
}
|
}
|
||||||
|
|
||||||
// ENSSession is an auto generated Go binding around an Ethereum contract,
|
// ENSSession is an auto generated Go binding around an Essentia contract,
|
||||||
// with pre-set call and transact options.
|
// with pre-set call and transact options.
|
||||||
type ENSSession struct {
|
type ENSSession struct {
|
||||||
Contract *ENS // Generic contract binding to set the session for
|
Contract *ENS // Generic contract binding to set the session for
|
||||||
|
|
@ -63,31 +63,31 @@ type ENSSession struct {
|
||||||
TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session
|
TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session
|
||||||
}
|
}
|
||||||
|
|
||||||
// ENSCallerSession is an auto generated read-only Go binding around an Ethereum contract,
|
// ENSCallerSession is an auto generated read-only Go binding around an Essentia contract,
|
||||||
// with pre-set call options.
|
// with pre-set call options.
|
||||||
type ENSCallerSession struct {
|
type ENSCallerSession struct {
|
||||||
Contract *ENSCaller // Generic contract caller binding to set the session for
|
Contract *ENSCaller // Generic contract caller binding to set the session for
|
||||||
CallOpts bind.CallOpts // Call options to use throughout this session
|
CallOpts bind.CallOpts // Call options to use throughout this session
|
||||||
}
|
}
|
||||||
|
|
||||||
// ENSTransactorSession is an auto generated write-only Go binding around an Ethereum contract,
|
// ENSTransactorSession is an auto generated write-only Go binding around an Essentia contract,
|
||||||
// with pre-set transact options.
|
// with pre-set transact options.
|
||||||
type ENSTransactorSession struct {
|
type ENSTransactorSession struct {
|
||||||
Contract *ENSTransactor // Generic contract transactor binding to set the session for
|
Contract *ENSTransactor // Generic contract transactor binding to set the session for
|
||||||
TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session
|
TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session
|
||||||
}
|
}
|
||||||
|
|
||||||
// ENSRaw is an auto generated low-level Go binding around an Ethereum contract.
|
// ENSRaw is an auto generated low-level Go binding around an Essentia contract.
|
||||||
type ENSRaw struct {
|
type ENSRaw struct {
|
||||||
Contract *ENS // Generic contract binding to access the raw methods on
|
Contract *ENS // Generic contract binding to access the raw methods on
|
||||||
}
|
}
|
||||||
|
|
||||||
// ENSCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract.
|
// ENSCallerRaw is an auto generated low-level read-only Go binding around an Essentia contract.
|
||||||
type ENSCallerRaw struct {
|
type ENSCallerRaw struct {
|
||||||
Contract *ENSCaller // Generic read-only contract binding to access the raw methods on
|
Contract *ENSCaller // Generic read-only contract binding to access the raw methods on
|
||||||
}
|
}
|
||||||
|
|
||||||
// ENSTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract.
|
// ENSTransactorRaw is an auto generated low-level write-only Go binding around an Essentia contract.
|
||||||
type ENSTransactorRaw struct {
|
type ENSTransactorRaw struct {
|
||||||
Contract *ENSTransactor // Generic write-only contract binding to access the raw methods on
|
Contract *ENSTransactor // Generic write-only contract binding to access the raw methods on
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ const FIFSRegistrarABI = "[{\"constant\":false,\"inputs\":[{\"name\":\"subnode\"
|
||||||
// FIFSRegistrarBin is the compiled bytecode used for deploying new contracts.
|
// FIFSRegistrarBin is the compiled bytecode used for deploying new contracts.
|
||||||
const FIFSRegistrarBin = `0x6060604052341561000f57600080fd5b604051604080610224833981016040528080519190602001805160008054600160a060020a03909516600160a060020a03199095169490941790935550506001556101c58061005f6000396000f3006060604052600436106100275763ffffffff60e060020a600035041663d22057a9811461002c575b600080fd5b341561003757600080fd5b61004e600435600160a060020a0360243516610050565b005b816000806001548360405191825260208201526040908101905190819003902060008054919350600160a060020a03909116906302571be39084906040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b15156100c857600080fd5b6102c65a03f115156100d957600080fd5b5050506040518051915050600160a060020a0381161580159061010e575033600160a060020a031681600160a060020a031614155b1561011857600080fd5b600054600154600160a060020a03909116906306ab592390878760405160e060020a63ffffffff861602815260048101939093526024830191909152600160a060020a03166044820152606401600060405180830381600087803b151561017e57600080fd5b6102c65a03f1151561018f57600080fd5b50505050505050505600a165627a7a723058206fb963cb168d5e3a51af12cd6bb23e324dbd32dd4954f43653ba27e66b68ea650029`
|
const FIFSRegistrarBin = `0x6060604052341561000f57600080fd5b604051604080610224833981016040528080519190602001805160008054600160a060020a03909516600160a060020a03199095169490941790935550506001556101c58061005f6000396000f3006060604052600436106100275763ffffffff60e060020a600035041663d22057a9811461002c575b600080fd5b341561003757600080fd5b61004e600435600160a060020a0360243516610050565b005b816000806001548360405191825260208201526040908101905190819003902060008054919350600160a060020a03909116906302571be39084906040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b15156100c857600080fd5b6102c65a03f115156100d957600080fd5b5050506040518051915050600160a060020a0381161580159061010e575033600160a060020a031681600160a060020a031614155b1561011857600080fd5b600054600154600160a060020a03909116906306ab592390878760405160e060020a63ffffffff861602815260048101939093526024830191909152600160a060020a03166044820152606401600060405180830381600087803b151561017e57600080fd5b6102c65a03f1151561018f57600080fd5b50505050505050505600a165627a7a723058206fb963cb168d5e3a51af12cd6bb23e324dbd32dd4954f43653ba27e66b68ea650029`
|
||||||
|
|
||||||
// DeployFIFSRegistrar deploys a new Ethereum contract, binding an instance of FIFSRegistrar to it.
|
// DeployFIFSRegistrar deploys a new Essentia contract, binding an instance of FIFSRegistrar to it.
|
||||||
func DeployFIFSRegistrar(auth *bind.TransactOpts, backend bind.ContractBackend, ensAddr common.Address, node [32]byte) (common.Address, *types.Transaction, *FIFSRegistrar, error) {
|
func DeployFIFSRegistrar(auth *bind.TransactOpts, backend bind.ContractBackend, ensAddr common.Address, node [32]byte) (common.Address, *types.Transaction, *FIFSRegistrar, error) {
|
||||||
parsed, err := abi.JSON(strings.NewReader(FIFSRegistrarABI))
|
parsed, err := abi.JSON(strings.NewReader(FIFSRegistrarABI))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
@ -31,29 +31,29 @@ func DeployFIFSRegistrar(auth *bind.TransactOpts, backend bind.ContractBackend,
|
||||||
return address, tx, &FIFSRegistrar{FIFSRegistrarCaller: FIFSRegistrarCaller{contract: contract}, FIFSRegistrarTransactor: FIFSRegistrarTransactor{contract: contract}, FIFSRegistrarFilterer: FIFSRegistrarFilterer{contract: contract}}, nil
|
return address, tx, &FIFSRegistrar{FIFSRegistrarCaller: FIFSRegistrarCaller{contract: contract}, FIFSRegistrarTransactor: FIFSRegistrarTransactor{contract: contract}, FIFSRegistrarFilterer: FIFSRegistrarFilterer{contract: contract}}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIFSRegistrar is an auto generated Go binding around an Ethereum contract.
|
// FIFSRegistrar is an auto generated Go binding around an Essentia contract.
|
||||||
type FIFSRegistrar struct {
|
type FIFSRegistrar struct {
|
||||||
FIFSRegistrarCaller // Read-only binding to the contract
|
FIFSRegistrarCaller // Read-only binding to the contract
|
||||||
FIFSRegistrarTransactor // Write-only binding to the contract
|
FIFSRegistrarTransactor // Write-only binding to the contract
|
||||||
FIFSRegistrarFilterer // Log filterer for contract events
|
FIFSRegistrarFilterer // Log filterer for contract events
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIFSRegistrarCaller is an auto generated read-only Go binding around an Ethereum contract.
|
// FIFSRegistrarCaller is an auto generated read-only Go binding around an Essentia contract.
|
||||||
type FIFSRegistrarCaller struct {
|
type FIFSRegistrarCaller struct {
|
||||||
contract *bind.BoundContract // Generic contract wrapper for the low level calls
|
contract *bind.BoundContract // Generic contract wrapper for the low level calls
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIFSRegistrarTransactor is an auto generated write-only Go binding around an Ethereum contract.
|
// FIFSRegistrarTransactor is an auto generated write-only Go binding around an Essentia contract.
|
||||||
type FIFSRegistrarTransactor struct {
|
type FIFSRegistrarTransactor struct {
|
||||||
contract *bind.BoundContract // Generic contract wrapper for the low level calls
|
contract *bind.BoundContract // Generic contract wrapper for the low level calls
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIFSRegistrarFilterer is an auto generated log filtering Go binding around an Ethereum contract events.
|
// FIFSRegistrarFilterer is an auto generated log filtering Go binding around an Essentia contract events.
|
||||||
type FIFSRegistrarFilterer struct {
|
type FIFSRegistrarFilterer struct {
|
||||||
contract *bind.BoundContract // Generic contract wrapper for the low level calls
|
contract *bind.BoundContract // Generic contract wrapper for the low level calls
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIFSRegistrarSession is an auto generated Go binding around an Ethereum contract,
|
// FIFSRegistrarSession is an auto generated Go binding around an Essentia contract,
|
||||||
// with pre-set call and transact options.
|
// with pre-set call and transact options.
|
||||||
type FIFSRegistrarSession struct {
|
type FIFSRegistrarSession struct {
|
||||||
Contract *FIFSRegistrar // Generic contract binding to set the session for
|
Contract *FIFSRegistrar // Generic contract binding to set the session for
|
||||||
|
|
@ -61,31 +61,31 @@ type FIFSRegistrarSession struct {
|
||||||
TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session
|
TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIFSRegistrarCallerSession is an auto generated read-only Go binding around an Ethereum contract,
|
// FIFSRegistrarCallerSession is an auto generated read-only Go binding around an Essentia contract,
|
||||||
// with pre-set call options.
|
// with pre-set call options.
|
||||||
type FIFSRegistrarCallerSession struct {
|
type FIFSRegistrarCallerSession struct {
|
||||||
Contract *FIFSRegistrarCaller // Generic contract caller binding to set the session for
|
Contract *FIFSRegistrarCaller // Generic contract caller binding to set the session for
|
||||||
CallOpts bind.CallOpts // Call options to use throughout this session
|
CallOpts bind.CallOpts // Call options to use throughout this session
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIFSRegistrarTransactorSession is an auto generated write-only Go binding around an Ethereum contract,
|
// FIFSRegistrarTransactorSession is an auto generated write-only Go binding around an Essentia contract,
|
||||||
// with pre-set transact options.
|
// with pre-set transact options.
|
||||||
type FIFSRegistrarTransactorSession struct {
|
type FIFSRegistrarTransactorSession struct {
|
||||||
Contract *FIFSRegistrarTransactor // Generic contract transactor binding to set the session for
|
Contract *FIFSRegistrarTransactor // Generic contract transactor binding to set the session for
|
||||||
TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session
|
TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIFSRegistrarRaw is an auto generated low-level Go binding around an Ethereum contract.
|
// FIFSRegistrarRaw is an auto generated low-level Go binding around an Essentia contract.
|
||||||
type FIFSRegistrarRaw struct {
|
type FIFSRegistrarRaw struct {
|
||||||
Contract *FIFSRegistrar // Generic contract binding to access the raw methods on
|
Contract *FIFSRegistrar // Generic contract binding to access the raw methods on
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIFSRegistrarCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract.
|
// FIFSRegistrarCallerRaw is an auto generated low-level read-only Go binding around an Essentia contract.
|
||||||
type FIFSRegistrarCallerRaw struct {
|
type FIFSRegistrarCallerRaw struct {
|
||||||
Contract *FIFSRegistrarCaller // Generic read-only contract binding to access the raw methods on
|
Contract *FIFSRegistrarCaller // Generic read-only contract binding to access the raw methods on
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIFSRegistrarTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract.
|
// FIFSRegistrarTransactorRaw is an auto generated low-level write-only Go binding around an Essentia contract.
|
||||||
type FIFSRegistrarTransactorRaw struct {
|
type FIFSRegistrarTransactorRaw struct {
|
||||||
Contract *FIFSRegistrarTransactor // Generic write-only contract binding to access the raw methods on
|
Contract *FIFSRegistrarTransactor // Generic write-only contract binding to access the raw methods on
|
||||||
}
|
}
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -42,7 +42,7 @@ type ENS struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewENS creates a struct exposing convenient high-level operations for interacting with
|
// NewENS creates a struct exposing convenient high-level operations for interacting with
|
||||||
// the Ethereum Name Service.
|
// the Essentia Name Service.
|
||||||
func NewENS(transactOpts *bind.TransactOpts, contractAddr common.Address, contractBackend bind.ContractBackend) (*ENS, error) {
|
func NewENS(transactOpts *bind.TransactOpts, contractAddr common.Address, contractBackend bind.ContractBackend) (*ENS, error) {
|
||||||
ens, err := contract.NewENS(contractAddr, contractBackend)
|
ens, err := contract.NewENS(contractAddr, contractBackend)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
||||||
|
|
@ -151,7 +151,7 @@ func benchInsertChain(b *testing.B, disk bool, gen func(int, *BlockGen)) {
|
||||||
if !disk {
|
if !disk {
|
||||||
db = ethdb.NewMemDatabase()
|
db = ethdb.NewMemDatabase()
|
||||||
} else {
|
} else {
|
||||||
dir, err := ioutil.TempDir("", "eth-core-bench")
|
dir, err := ioutil.TempDir("", "ess-core-bench")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
b.Fatalf("cannot create temporary directory: %v", err)
|
b.Fatalf("cannot create temporary directory: %v", err)
|
||||||
}
|
}
|
||||||
|
|
@ -250,7 +250,7 @@ func makeChainForBench(db ethdb.Database, full bool, count uint64) {
|
||||||
|
|
||||||
func benchWriteChain(b *testing.B, full bool, count uint64) {
|
func benchWriteChain(b *testing.B, full bool, count uint64) {
|
||||||
for i := 0; i < b.N; i++ {
|
for i := 0; i < b.N; i++ {
|
||||||
dir, err := ioutil.TempDir("", "eth-chain-bench")
|
dir, err := ioutil.TempDir("", "ess-chain-bench")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
b.Fatalf("cannot create temporary directory: %v", err)
|
b.Fatalf("cannot create temporary directory: %v", err)
|
||||||
}
|
}
|
||||||
|
|
@ -265,7 +265,7 @@ func benchWriteChain(b *testing.B, full bool, count uint64) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func benchReadChain(b *testing.B, full bool, count uint64) {
|
func benchReadChain(b *testing.B, full bool, count uint64) {
|
||||||
dir, err := ioutil.TempDir("", "eth-chain-bench")
|
dir, err := ioutil.TempDir("", "ess-chain-bench")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
b.Fatalf("cannot create temporary directory: %v", err)
|
b.Fatalf("cannot create temporary directory: %v", err)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@
|
||||||
// You should have received a copy of the GNU Lesser General Public License
|
// 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-ethereum library. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
// Package core implements the Ethereum consensus protocol.
|
// Package core implements the Essentia consensus protocol.
|
||||||
package core
|
package core
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|
@ -132,7 +132,7 @@ type BlockChain struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewBlockChain returns a fully initialised block chain using information
|
// NewBlockChain returns a fully initialised block chain using information
|
||||||
// available in the database. It initialises the default Ethereum Validator and
|
// available in the database. It initialises the default Essentia Validator and
|
||||||
// Processor.
|
// Processor.
|
||||||
func NewBlockChain(db ethdb.Database, cacheConfig *CacheConfig, chainConfig *params.ChainConfig, engine consensus.Engine, vmConfig vm.Config) (*BlockChain, error) {
|
func NewBlockChain(db ethdb.Database, cacheConfig *CacheConfig, chainConfig *params.ChainConfig, engine consensus.Engine, vmConfig vm.Config) (*BlockChain, error) {
|
||||||
if cacheConfig == nil {
|
if cacheConfig == nil {
|
||||||
|
|
@ -605,7 +605,7 @@ func (bc *BlockChain) GetReceiptsByHash(hash common.Hash) types.Receipts {
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetBlocksFromHash returns the block corresponding to hash and up to n-1 ancestors.
|
// GetBlocksFromHash returns the block corresponding to hash and up to n-1 ancestors.
|
||||||
// [deprecated by eth/62]
|
// [deprecated by ess/62]
|
||||||
func (bc *BlockChain) GetBlocksFromHash(hash common.Hash, n int) (blocks []*types.Block) {
|
func (bc *BlockChain) GetBlocksFromHash(hash common.Hash, n int) (blocks []*types.Block) {
|
||||||
number := bc.hc.GetBlockNumber(hash)
|
number := bc.hc.GetBlockNumber(hash)
|
||||||
if number == nil {
|
if number == nil {
|
||||||
|
|
|
||||||
|
|
@ -297,7 +297,7 @@ func GenesisBlockForTesting(db ethdb.Database, addr common.Address, balance *big
|
||||||
return g.MustCommit(db)
|
return g.MustCommit(db)
|
||||||
}
|
}
|
||||||
|
|
||||||
// DefaultGenesisBlock returns the Ethereum main net genesis block.
|
// DefaultGenesisBlock returns the Essentia main net genesis block.
|
||||||
func DefaultGenesisBlock() *Genesis {
|
func DefaultGenesisBlock() *Genesis {
|
||||||
return &Genesis{
|
return &Genesis{
|
||||||
Config: params.MainnetChainConfig,
|
Config: params.MainnetChainConfig,
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@ type Database interface {
|
||||||
TrieDB() *trie.Database
|
TrieDB() *trie.Database
|
||||||
}
|
}
|
||||||
|
|
||||||
// Trie is a Ethereum Merkle Trie.
|
// Trie is a Essentia Merkle Trie.
|
||||||
type Trie interface {
|
type Trie interface {
|
||||||
TryGet(key []byte) ([]byte, error)
|
TryGet(key []byte) ([]byte, error)
|
||||||
TryUpdate(key, value []byte) error
|
TryUpdate(key, value []byte) error
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ type journalEntry interface {
|
||||||
// revert undoes the changes introduced by this journal entry.
|
// revert undoes the changes introduced by this journal entry.
|
||||||
revert(*StateDB)
|
revert(*StateDB)
|
||||||
|
|
||||||
// dirtied returns the Ethereum address modified by this journal entry.
|
// dirtied returns the Essentia address modified by this journal entry.
|
||||||
dirtied() *common.Address
|
dirtied() *common.Address
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ func (self Storage) Copy() Storage {
|
||||||
return cpy
|
return cpy
|
||||||
}
|
}
|
||||||
|
|
||||||
// stateObject represents an Ethereum account which is being modified.
|
// stateObject represents an Essentia account which is being modified.
|
||||||
//
|
//
|
||||||
// The usage pattern is as follows:
|
// The usage pattern is as follows:
|
||||||
// First you need to obtain a state object.
|
// First you need to obtain a state object.
|
||||||
|
|
@ -93,7 +93,7 @@ func (s *stateObject) empty() bool {
|
||||||
return s.data.Nonce == 0 && s.data.Balance.Sign() == 0 && bytes.Equal(s.data.CodeHash, emptyCodeHash)
|
return s.data.Nonce == 0 && s.data.Balance.Sign() == 0 && bytes.Equal(s.data.CodeHash, emptyCodeHash)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Account is the Ethereum consensus representation of accounts.
|
// Account is the Essentia consensus representation of accounts.
|
||||||
// These objects are stored in the main account trie.
|
// These objects are stored in the main account trie.
|
||||||
type Account struct {
|
type Account struct {
|
||||||
Nonce uint64
|
Nonce uint64
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@
|
||||||
// You should have received a copy of the GNU Lesser General Public License
|
// 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-ethereum library. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
// Package state provides a caching layer atop the Ethereum state trie.
|
// Package state provides a caching layer atop the Essentia state trie.
|
||||||
package state
|
package state
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ func NewStateProcessor(config *params.ChainConfig, bc *BlockChain, engine consen
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Process processes the state changes according to the Ethereum rules by running
|
// Process processes the state changes according to the Essentia rules by running
|
||||||
// the transaction messages using the statedb and applying any rewards to both
|
// the transaction messages using the statedb and applying any rewards to both
|
||||||
// the processor (coinbase) and any included uncles.
|
// the processor (coinbase) and any included uncles.
|
||||||
//
|
//
|
||||||
|
|
|
||||||
|
|
@ -235,7 +235,7 @@ func (st *StateTransition) refundGas() {
|
||||||
}
|
}
|
||||||
st.gas += refund
|
st.gas += refund
|
||||||
|
|
||||||
// Return ETH for remaining gas, exchanged at the original rate.
|
// Return ESS for remaining gas, exchanged at the original rate.
|
||||||
remaining := new(big.Int).Mul(new(big.Int).SetUint64(st.gas), st.gasPrice)
|
remaining := new(big.Int).Mul(new(big.Int).SetUint64(st.gas), st.gasPrice)
|
||||||
st.state.AddBalance(st.msg.From(), remaining)
|
st.state.AddBalance(st.msg.From(), remaining)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@
|
||||||
// You should have received a copy of the GNU Lesser General Public License
|
// 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-ethereum library. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
// Package types contains data types related to Ethereum consensus.
|
// Package types contains data types related to Essentia consensus.
|
||||||
package types
|
package types
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|
@ -66,7 +66,7 @@ func (n *BlockNonce) UnmarshalText(input []byte) error {
|
||||||
|
|
||||||
//go:generate gencodec -type Header -field-override headerMarshaling -out gen_header_json.go
|
//go:generate gencodec -type Header -field-override headerMarshaling -out gen_header_json.go
|
||||||
|
|
||||||
// Header represents a block header in the Ethereum blockchain.
|
// Header represents a block header in the Essentia blockchain.
|
||||||
type Header struct {
|
type Header struct {
|
||||||
ParentHash common.Hash `json:"parentHash" gencodec:"required"`
|
ParentHash common.Hash `json:"parentHash" gencodec:"required"`
|
||||||
UncleHash common.Hash `json:"sha3Uncles" gencodec:"required"`
|
UncleHash common.Hash `json:"sha3Uncles" gencodec:"required"`
|
||||||
|
|
@ -141,7 +141,7 @@ type Body struct {
|
||||||
Uncles []*Header
|
Uncles []*Header
|
||||||
}
|
}
|
||||||
|
|
||||||
// Block represents an entire block in the Ethereum blockchain.
|
// Block represents an entire block in the Essentia blockchain.
|
||||||
type Block struct {
|
type Block struct {
|
||||||
header *Header
|
header *Header
|
||||||
uncles []*Header
|
uncles []*Header
|
||||||
|
|
@ -155,7 +155,7 @@ type Block struct {
|
||||||
// of the chain up to and including the block.
|
// of the chain up to and including the block.
|
||||||
td *big.Int
|
td *big.Int
|
||||||
|
|
||||||
// These fields are used by package eth to track
|
// These fields are used by package ess to track
|
||||||
// inter-peer block relay.
|
// inter-peer block relay.
|
||||||
ReceivedAt time.Time
|
ReceivedAt time.Time
|
||||||
ReceivedFrom interface{}
|
ReceivedFrom interface{}
|
||||||
|
|
@ -168,20 +168,20 @@ func (b *Block) DeprecatedTd() *big.Int {
|
||||||
return b.td
|
return b.td
|
||||||
}
|
}
|
||||||
|
|
||||||
// [deprecated by eth/63]
|
// [deprecated by ess/63]
|
||||||
// StorageBlock defines the RLP encoding of a Block stored in the
|
// StorageBlock defines the RLP encoding of a Block stored in the
|
||||||
// state database. The StorageBlock encoding contains fields that
|
// state database. The StorageBlock encoding contains fields that
|
||||||
// would otherwise need to be recomputed.
|
// would otherwise need to be recomputed.
|
||||||
type StorageBlock Block
|
type StorageBlock Block
|
||||||
|
|
||||||
// "external" block encoding. used for eth protocol, etc.
|
// "external" block encoding. used for ess protocol, etc.
|
||||||
type extblock struct {
|
type extblock struct {
|
||||||
Header *Header
|
Header *Header
|
||||||
Txs []*Transaction
|
Txs []*Transaction
|
||||||
Uncles []*Header
|
Uncles []*Header
|
||||||
}
|
}
|
||||||
|
|
||||||
// [deprecated by eth/63]
|
// [deprecated by ess/63]
|
||||||
// "storage" block encoding. used for database.
|
// "storage" block encoding. used for database.
|
||||||
type storageblock struct {
|
type storageblock struct {
|
||||||
Header *Header
|
Header *Header
|
||||||
|
|
@ -256,7 +256,7 @@ func CopyHeader(h *Header) *Header {
|
||||||
return &cpy
|
return &cpy
|
||||||
}
|
}
|
||||||
|
|
||||||
// DecodeRLP decodes the Ethereum
|
// DecodeRLP decodes the Essentia
|
||||||
func (b *Block) DecodeRLP(s *rlp.Stream) error {
|
func (b *Block) DecodeRLP(s *rlp.Stream) error {
|
||||||
var eb extblock
|
var eb extblock
|
||||||
_, size, _ := s.Kind()
|
_, size, _ := s.Kind()
|
||||||
|
|
@ -268,7 +268,7 @@ func (b *Block) DecodeRLP(s *rlp.Stream) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// EncodeRLP serializes b into the Ethereum RLP block format.
|
// EncodeRLP serializes b into the Essentia RLP block format.
|
||||||
func (b *Block) EncodeRLP(w io.Writer) error {
|
func (b *Block) EncodeRLP(w io.Writer) error {
|
||||||
return rlp.Encode(w, extblock{
|
return rlp.Encode(w, extblock{
|
||||||
Header: b.header,
|
Header: b.header,
|
||||||
|
|
@ -277,7 +277,7 @@ func (b *Block) EncodeRLP(w io.Writer) error {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// [deprecated by eth/63]
|
// [deprecated by ess/63]
|
||||||
func (b *StorageBlock) DecodeRLP(s *rlp.Stream) error {
|
func (b *StorageBlock) DecodeRLP(s *rlp.Stream) error {
|
||||||
var sb storageblock
|
var sb storageblock
|
||||||
if err := s.Decode(&sb); err != nil {
|
if err := s.Decode(&sb); err != nil {
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ type PrecompiledContract interface {
|
||||||
Run(input []byte) ([]byte, error) // Run runs the precompiled contract
|
Run(input []byte) ([]byte, error) // Run runs the precompiled contract
|
||||||
}
|
}
|
||||||
|
|
||||||
// PrecompiledContractsHomestead contains the default set of pre-compiled Ethereum
|
// PrecompiledContractsHomestead contains the default set of pre-compiled Essentia
|
||||||
// contracts used in the Frontier and Homestead releases.
|
// contracts used in the Frontier and Homestead releases.
|
||||||
var PrecompiledContractsHomestead = map[common.Address]PrecompiledContract{
|
var PrecompiledContractsHomestead = map[common.Address]PrecompiledContract{
|
||||||
common.BytesToAddress([]byte{1}): &ecrecover{},
|
common.BytesToAddress([]byte{1}): &ecrecover{},
|
||||||
|
|
@ -46,7 +46,7 @@ var PrecompiledContractsHomestead = map[common.Address]PrecompiledContract{
|
||||||
common.BytesToAddress([]byte{4}): &dataCopy{},
|
common.BytesToAddress([]byte{4}): &dataCopy{},
|
||||||
}
|
}
|
||||||
|
|
||||||
// PrecompiledContractsByzantium contains the default set of pre-compiled Ethereum
|
// PrecompiledContractsByzantium contains the default set of pre-compiled Essentia
|
||||||
// contracts used in the Byzantium release.
|
// contracts used in the Byzantium release.
|
||||||
var PrecompiledContractsByzantium = map[common.Address]PrecompiledContract{
|
var PrecompiledContractsByzantium = map[common.Address]PrecompiledContract{
|
||||||
common.BytesToAddress([]byte{1}): &ecrecover{},
|
common.BytesToAddress([]byte{1}): &ecrecover{},
|
||||||
|
|
|
||||||
|
|
@ -15,10 +15,10 @@
|
||||||
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
|
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Package vm implements the Ethereum Virtual Machine.
|
Package vm implements the Essentia Virtual Machine.
|
||||||
|
|
||||||
The vm package implements one EVM, a byte code VM. The BC (Byte Code) VM loops
|
The vm package implements one EVM, a byte code VM. The BC (Byte Code) VM loops
|
||||||
over a set of bytes and executes them according to the set of rules defined
|
over a set of bytes and executes them according to the set of rules defined
|
||||||
in the Ethereum yellow paper.
|
in the Essentia yellow paper.
|
||||||
*/
|
*/
|
||||||
package vm
|
package vm
|
||||||
|
|
|
||||||
|
|
@ -77,7 +77,7 @@ type Context struct {
|
||||||
Difficulty *big.Int // Provides information for DIFFICULTY
|
Difficulty *big.Int // Provides information for DIFFICULTY
|
||||||
}
|
}
|
||||||
|
|
||||||
// EVM is the Ethereum Virtual Machine base object and provides
|
// EVM is the Essentia Virtual Machine base object and provides
|
||||||
// the necessary tools to run a contract on the given state with
|
// the necessary tools to run a contract on the given state with
|
||||||
// the provided context. It should be noted that any error
|
// the provided context. It should be noted that any error
|
||||||
// generated through any of the calls should be considered a
|
// generated through any of the calls should be considered a
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ type Config struct {
|
||||||
JumpTable [256]operation
|
JumpTable [256]operation
|
||||||
}
|
}
|
||||||
|
|
||||||
// Interpreter is used to run Ethereum based contracts and will utilise the
|
// Interpreter is used to run Essentia based contracts and will utilise the
|
||||||
// passed environment to query external sources for state information.
|
// passed environment to query external sources for state information.
|
||||||
// The Interpreter will run the byte code VM based on the passed
|
// The Interpreter will run the byte code VM based on the passed
|
||||||
// configuration.
|
// configuration.
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@ func Sign(hash []byte, prv *ecdsa.PrivateKey) ([]byte, error) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
// Convert to Ethereum signature format with 'recovery id' v at the end.
|
// Convert to Essentia signature format with 'recovery id' v at the end.
|
||||||
v := sig[0] - 27
|
v := sig[0] - 27
|
||||||
copy(sig, sig[1:])
|
copy(sig, sig[1:])
|
||||||
sig[64] = v
|
sig[64] = v
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
## Go Ethereum Dashboard
|
## Go Essentia Dashboard
|
||||||
|
|
||||||
The dashboard is a data visualizer integrated into geth, intended to collect and visualize useful information of an Ethereum node. It consists of two parts:
|
The dashboard is a data visualizer integrated into geth, intended to collect and visualize useful information of an Essentia node. It consists of two parts:
|
||||||
|
|
||||||
* The client visualizes the collected data.
|
* The client visualizes the collected data.
|
||||||
* The server collects the data, and updates the clients.
|
* The server collects the data, and updates the clients.
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@ var _indexHtml = []byte(`<!DOCTYPE html>
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
|
||||||
<title>Go Ethereum Dashboard</title>
|
<title>Go Essentia Dashboard</title>
|
||||||
<link rel="shortcut icon" type="image/ico" href="https://ethereum.org/favicon.ico" />
|
<link rel="shortcut icon" type="image/ico" href="https://ethereum.org/favicon.ico" />
|
||||||
<style>
|
<style>
|
||||||
::-webkit-scrollbar {
|
::-webkit-scrollbar {
|
||||||
|
|
@ -29962,7 +29962,7 @@ var _bundleJs = []byte((((((((((`!function(modules) {
|
||||||
color: "inherit",
|
color: "inherit",
|
||||||
noWrap: !0,
|
noWrap: !0,
|
||||||
className: classes.title
|
className: classes.title
|
||||||
}, "Go Ethereum Dashboard")));
|
}, "Go Essentia Dashboard")));
|
||||||
}
|
}
|
||||||
} ]), Header;
|
} ]), Header;
|
||||||
}(_react.Component);
|
}(_react.Component);
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,7 @@ class Header extends Component<Props> {
|
||||||
</Icon>
|
</Icon>
|
||||||
</IconButton>
|
</IconButton>
|
||||||
<Typography type='title' color='inherit' noWrap className={classes.title}>
|
<Typography type='title' color='inherit' noWrap className={classes.title}>
|
||||||
Go Ethereum Dashboard
|
Go Essentia Dashboard
|
||||||
</Typography>
|
</Typography>
|
||||||
</Toolbar>
|
</Toolbar>
|
||||||
</AppBar>
|
</AppBar>
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
|
||||||
<title>Go Ethereum Dashboard</title>
|
<title>Go Essentia Dashboard</title>
|
||||||
<link rel="shortcut icon" type="image/ico" href="https://ethereum.org/favicon.ico" />
|
<link rel="shortcut icon" type="image/ico" href="https://ethereum.org/favicon.ico" />
|
||||||
<style>
|
<style>
|
||||||
::-webkit-scrollbar {
|
::-webkit-scrollbar {
|
||||||
|
|
|
||||||
|
|
@ -283,8 +283,8 @@ func (db *Dashboard) collectData() {
|
||||||
|
|
||||||
collectNetworkIngress = meterCollector("p2p/InboundTraffic")
|
collectNetworkIngress = meterCollector("p2p/InboundTraffic")
|
||||||
collectNetworkEgress = meterCollector("p2p/OutboundTraffic")
|
collectNetworkEgress = meterCollector("p2p/OutboundTraffic")
|
||||||
collectDiskRead = meterCollector("eth/db/chaindata/disk/read")
|
collectDiskRead = meterCollector("ess/db/chaindata/disk/read")
|
||||||
collectDiskWrite = meterCollector("eth/db/chaindata/disk/write")
|
collectDiskWrite = meterCollector("ess/db/chaindata/disk/write")
|
||||||
|
|
||||||
prevNetworkIngress = collectNetworkIngress()
|
prevNetworkIngress = collectNetworkIngress()
|
||||||
prevNetworkEgress = collectNetworkEgress()
|
prevNetworkEgress = collectNetworkEgress()
|
||||||
|
|
|
||||||
82
eth/api.go
82
eth/api.go
|
|
@ -14,7 +14,7 @@
|
||||||
// You should have received a copy of the GNU Lesser General Public License
|
// 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-ethereum library. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
package eth
|
package ess
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"compress/gzip"
|
"compress/gzip"
|
||||||
|
|
@ -41,14 +41,14 @@ import (
|
||||||
"github.com/orangeAndSuns/go-ethereum/trie"
|
"github.com/orangeAndSuns/go-ethereum/trie"
|
||||||
)
|
)
|
||||||
|
|
||||||
// PublicEthereumAPI provides an API to access Ethereum full node-related
|
// PublicEthereumAPI provides an API to access Essentia full node-related
|
||||||
// information.
|
// information.
|
||||||
type PublicEthereumAPI struct {
|
type PublicEthereumAPI struct {
|
||||||
e *Ethereum
|
e *Essentia
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewPublicEthereumAPI creates a new Ethereum protocol API for full nodes.
|
// NewPublicEthereumAPI creates a new Essentia protocol API for full nodes.
|
||||||
func NewPublicEthereumAPI(e *Ethereum) *PublicEthereumAPI {
|
func NewPublicEthereumAPI(e *Essentia) *PublicEthereumAPI {
|
||||||
return &PublicEthereumAPI{e}
|
return &PublicEthereumAPI{e}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -70,12 +70,12 @@ func (api *PublicEthereumAPI) Hashrate() hexutil.Uint64 {
|
||||||
// PublicMinerAPI provides an API to control the miner.
|
// 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.
|
// It offers only methods that operate on data that pose no security risk when it is publicly accessible.
|
||||||
type PublicMinerAPI struct {
|
type PublicMinerAPI struct {
|
||||||
e *Ethereum
|
e *Essentia
|
||||||
agent *miner.RemoteAgent
|
agent *miner.RemoteAgent
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewPublicMinerAPI create a new PublicMinerAPI instance.
|
// NewPublicMinerAPI create a new PublicMinerAPI instance.
|
||||||
func NewPublicMinerAPI(e *Ethereum) *PublicMinerAPI {
|
func NewPublicMinerAPI(e *Essentia) *PublicMinerAPI {
|
||||||
agent := miner.NewRemoteAgent(e.BlockChain(), e.Engine())
|
agent := miner.NewRemoteAgent(e.BlockChain(), e.Engine())
|
||||||
e.Miner().Register(agent)
|
e.Miner().Register(agent)
|
||||||
|
|
||||||
|
|
@ -121,11 +121,11 @@ func (api *PublicMinerAPI) SubmitHashrate(hashrate hexutil.Uint64, id common.Has
|
||||||
// PrivateMinerAPI provides private RPC methods to control the miner.
|
// 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.
|
// These methods can be abused by external users and must be considered insecure for use by untrusted users.
|
||||||
type PrivateMinerAPI struct {
|
type PrivateMinerAPI struct {
|
||||||
e *Ethereum
|
e *Essentia
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewPrivateMinerAPI create a new RPC service which controls the miner of this node.
|
// NewPrivateMinerAPI create a new RPC service which controls the miner of this node.
|
||||||
func NewPrivateMinerAPI(e *Ethereum) *PrivateMinerAPI {
|
func NewPrivateMinerAPI(e *Essentia) *PrivateMinerAPI {
|
||||||
return &PrivateMinerAPI{e: e}
|
return &PrivateMinerAPI{e: e}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -201,16 +201,16 @@ func (api *PrivateMinerAPI) GetHashrate() uint64 {
|
||||||
return uint64(api.e.miner.HashRate())
|
return uint64(api.e.miner.HashRate())
|
||||||
}
|
}
|
||||||
|
|
||||||
// PrivateAdminAPI is the collection of Ethereum full node-related APIs
|
// PrivateAdminAPI is the collection of Essentia full node-related APIs
|
||||||
// exposed over the private admin endpoint.
|
// exposed over the private admin endpoint.
|
||||||
type PrivateAdminAPI struct {
|
type PrivateAdminAPI struct {
|
||||||
eth *Ethereum
|
ess *Essentia
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewPrivateAdminAPI creates a new API definition for the full node private
|
// NewPrivateAdminAPI creates a new API definition for the full node private
|
||||||
// admin methods of the Ethereum service.
|
// admin methods of the Essentia service.
|
||||||
func NewPrivateAdminAPI(eth *Ethereum) *PrivateAdminAPI {
|
func NewPrivateAdminAPI(ess *Essentia) *PrivateAdminAPI {
|
||||||
return &PrivateAdminAPI{eth: eth}
|
return &PrivateAdminAPI{ess: ess}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ExportChain exports the current blockchain into a local file.
|
// ExportChain exports the current blockchain into a local file.
|
||||||
|
|
@ -229,7 +229,7 @@ func (api *PrivateAdminAPI) ExportChain(file string) (bool, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Export the blockchain
|
// Export the blockchain
|
||||||
if err := api.eth.BlockChain().Export(writer); err != nil {
|
if err := api.ess.BlockChain().Export(writer); err != nil {
|
||||||
return false, err
|
return false, err
|
||||||
}
|
}
|
||||||
return true, nil
|
return true, nil
|
||||||
|
|
@ -281,12 +281,12 @@ func (api *PrivateAdminAPI) ImportChain(file string) (bool, error) {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
if hasAllBlocks(api.eth.BlockChain(), blocks) {
|
if hasAllBlocks(api.ess.BlockChain(), blocks) {
|
||||||
blocks = blocks[:0]
|
blocks = blocks[:0]
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
// Import the batch and reset the buffer
|
// Import the batch and reset the buffer
|
||||||
if _, err := api.eth.BlockChain().InsertChain(blocks); err != nil {
|
if _, err := api.ess.BlockChain().InsertChain(blocks); err != nil {
|
||||||
return false, fmt.Errorf("batch %d: failed to insert: %v", batch, err)
|
return false, fmt.Errorf("batch %d: failed to insert: %v", batch, err)
|
||||||
}
|
}
|
||||||
blocks = blocks[:0]
|
blocks = blocks[:0]
|
||||||
|
|
@ -294,16 +294,16 @@ func (api *PrivateAdminAPI) ImportChain(file string) (bool, error) {
|
||||||
return true, nil
|
return true, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// PublicDebugAPI is the collection of Ethereum full node APIs exposed
|
// PublicDebugAPI is the collection of Essentia full node APIs exposed
|
||||||
// over the public debugging endpoint.
|
// over the public debugging endpoint.
|
||||||
type PublicDebugAPI struct {
|
type PublicDebugAPI struct {
|
||||||
eth *Ethereum
|
ess *Essentia
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewPublicDebugAPI creates a new API definition for the full node-
|
// NewPublicDebugAPI creates a new API definition for the full node-
|
||||||
// related public debug methods of the Ethereum service.
|
// related public debug methods of the Essentia service.
|
||||||
func NewPublicDebugAPI(eth *Ethereum) *PublicDebugAPI {
|
func NewPublicDebugAPI(ess *Essentia) *PublicDebugAPI {
|
||||||
return &PublicDebugAPI{eth: eth}
|
return &PublicDebugAPI{ess: ess}
|
||||||
}
|
}
|
||||||
|
|
||||||
// DumpBlock retrieves the entire state of the database at a given block.
|
// DumpBlock retrieves the entire state of the database at a given block.
|
||||||
|
|
@ -312,41 +312,41 @@ func (api *PublicDebugAPI) DumpBlock(blockNr rpc.BlockNumber) (state.Dump, error
|
||||||
// If we're dumping the pending state, we need to request
|
// If we're dumping the pending state, we need to request
|
||||||
// both the pending block as well as the pending state from
|
// both the pending block as well as the pending state from
|
||||||
// the miner and operate on those
|
// the miner and operate on those
|
||||||
_, stateDb := api.eth.miner.Pending()
|
_, stateDb := api.ess.miner.Pending()
|
||||||
return stateDb.RawDump(), nil
|
return stateDb.RawDump(), nil
|
||||||
}
|
}
|
||||||
var block *types.Block
|
var block *types.Block
|
||||||
if blockNr == rpc.LatestBlockNumber {
|
if blockNr == rpc.LatestBlockNumber {
|
||||||
block = api.eth.blockchain.CurrentBlock()
|
block = api.ess.blockchain.CurrentBlock()
|
||||||
} else {
|
} else {
|
||||||
block = api.eth.blockchain.GetBlockByNumber(uint64(blockNr))
|
block = api.ess.blockchain.GetBlockByNumber(uint64(blockNr))
|
||||||
}
|
}
|
||||||
if block == nil {
|
if block == nil {
|
||||||
return state.Dump{}, fmt.Errorf("block #%d not found", blockNr)
|
return state.Dump{}, fmt.Errorf("block #%d not found", blockNr)
|
||||||
}
|
}
|
||||||
stateDb, err := api.eth.BlockChain().StateAt(block.Root())
|
stateDb, err := api.ess.BlockChain().StateAt(block.Root())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return state.Dump{}, err
|
return state.Dump{}, err
|
||||||
}
|
}
|
||||||
return stateDb.RawDump(), nil
|
return stateDb.RawDump(), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// PrivateDebugAPI is the collection of Ethereum full node APIs exposed over
|
// PrivateDebugAPI is the collection of Essentia full node APIs exposed over
|
||||||
// the private debugging endpoint.
|
// the private debugging endpoint.
|
||||||
type PrivateDebugAPI struct {
|
type PrivateDebugAPI struct {
|
||||||
config *params.ChainConfig
|
config *params.ChainConfig
|
||||||
eth *Ethereum
|
ess *Essentia
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewPrivateDebugAPI creates a new API definition for the full node-related
|
// NewPrivateDebugAPI creates a new API definition for the full node-related
|
||||||
// private debug methods of the Ethereum service.
|
// private debug methods of the Essentia service.
|
||||||
func NewPrivateDebugAPI(config *params.ChainConfig, eth *Ethereum) *PrivateDebugAPI {
|
func NewPrivateDebugAPI(config *params.ChainConfig, ess *Essentia) *PrivateDebugAPI {
|
||||||
return &PrivateDebugAPI{config: config, eth: eth}
|
return &PrivateDebugAPI{config: config, ess: ess}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Preimage is a debug API function that returns the preimage for a sha3 hash, if known.
|
// 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) {
|
func (api *PrivateDebugAPI) Preimage(ctx context.Context, hash common.Hash) (hexutil.Bytes, error) {
|
||||||
if preimage := rawdb.ReadPreimage(api.eth.ChainDb(), hash); preimage != nil {
|
if preimage := rawdb.ReadPreimage(api.ess.ChainDb(), hash); preimage != nil {
|
||||||
return preimage, nil
|
return preimage, nil
|
||||||
}
|
}
|
||||||
return nil, errors.New("unknown preimage")
|
return nil, errors.New("unknown preimage")
|
||||||
|
|
@ -362,7 +362,7 @@ type BadBlockArgs struct {
|
||||||
// GetBadBlocks returns a list of the last 'bad blocks' that the client has seen on the network
|
// 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
|
// and returns them as a JSON list of block-hashes
|
||||||
func (api *PrivateDebugAPI) GetBadBlocks(ctx context.Context) ([]*BadBlockArgs, error) {
|
func (api *PrivateDebugAPI) GetBadBlocks(ctx context.Context) ([]*BadBlockArgs, error) {
|
||||||
blocks := api.eth.BlockChain().BadBlocks()
|
blocks := api.ess.BlockChain().BadBlocks()
|
||||||
results := make([]*BadBlockArgs, len(blocks))
|
results := make([]*BadBlockArgs, len(blocks))
|
||||||
|
|
||||||
var err error
|
var err error
|
||||||
|
|
@ -439,19 +439,19 @@ func storageRangeAt(st state.Trie, start []byte, maxResult int) (StorageRangeRes
|
||||||
func (api *PrivateDebugAPI) GetModifiedAccountsByNumber(startNum uint64, endNum *uint64) ([]common.Address, error) {
|
func (api *PrivateDebugAPI) GetModifiedAccountsByNumber(startNum uint64, endNum *uint64) ([]common.Address, error) {
|
||||||
var startBlock, endBlock *types.Block
|
var startBlock, endBlock *types.Block
|
||||||
|
|
||||||
startBlock = api.eth.blockchain.GetBlockByNumber(startNum)
|
startBlock = api.ess.blockchain.GetBlockByNumber(startNum)
|
||||||
if startBlock == nil {
|
if startBlock == nil {
|
||||||
return nil, fmt.Errorf("start block %x not found", startNum)
|
return nil, fmt.Errorf("start block %x not found", startNum)
|
||||||
}
|
}
|
||||||
|
|
||||||
if endNum == nil {
|
if endNum == nil {
|
||||||
endBlock = startBlock
|
endBlock = startBlock
|
||||||
startBlock = api.eth.blockchain.GetBlockByHash(startBlock.ParentHash())
|
startBlock = api.ess.blockchain.GetBlockByHash(startBlock.ParentHash())
|
||||||
if startBlock == nil {
|
if startBlock == nil {
|
||||||
return nil, fmt.Errorf("block %x has no parent", endBlock.Number())
|
return nil, fmt.Errorf("block %x has no parent", endBlock.Number())
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
endBlock = api.eth.blockchain.GetBlockByNumber(*endNum)
|
endBlock = api.ess.blockchain.GetBlockByNumber(*endNum)
|
||||||
if endBlock == nil {
|
if endBlock == nil {
|
||||||
return nil, fmt.Errorf("end block %d not found", *endNum)
|
return nil, fmt.Errorf("end block %d not found", *endNum)
|
||||||
}
|
}
|
||||||
|
|
@ -466,19 +466,19 @@ func (api *PrivateDebugAPI) GetModifiedAccountsByNumber(startNum uint64, endNum
|
||||||
// With one parameter, returns the list of accounts modified in the specified block.
|
// With one parameter, returns the list of accounts modified in the specified block.
|
||||||
func (api *PrivateDebugAPI) GetModifiedAccountsByHash(startHash common.Hash, endHash *common.Hash) ([]common.Address, error) {
|
func (api *PrivateDebugAPI) GetModifiedAccountsByHash(startHash common.Hash, endHash *common.Hash) ([]common.Address, error) {
|
||||||
var startBlock, endBlock *types.Block
|
var startBlock, endBlock *types.Block
|
||||||
startBlock = api.eth.blockchain.GetBlockByHash(startHash)
|
startBlock = api.ess.blockchain.GetBlockByHash(startHash)
|
||||||
if startBlock == nil {
|
if startBlock == nil {
|
||||||
return nil, fmt.Errorf("start block %x not found", startHash)
|
return nil, fmt.Errorf("start block %x not found", startHash)
|
||||||
}
|
}
|
||||||
|
|
||||||
if endHash == nil {
|
if endHash == nil {
|
||||||
endBlock = startBlock
|
endBlock = startBlock
|
||||||
startBlock = api.eth.blockchain.GetBlockByHash(startBlock.ParentHash())
|
startBlock = api.ess.blockchain.GetBlockByHash(startBlock.ParentHash())
|
||||||
if startBlock == nil {
|
if startBlock == nil {
|
||||||
return nil, fmt.Errorf("block %x has no parent", endBlock.Number())
|
return nil, fmt.Errorf("block %x has no parent", endBlock.Number())
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
endBlock = api.eth.blockchain.GetBlockByHash(*endHash)
|
endBlock = api.ess.blockchain.GetBlockByHash(*endHash)
|
||||||
if endBlock == nil {
|
if endBlock == nil {
|
||||||
return nil, fmt.Errorf("end block %x not found", *endHash)
|
return nil, fmt.Errorf("end block %x not found", *endHash)
|
||||||
}
|
}
|
||||||
|
|
@ -491,11 +491,11 @@ func (api *PrivateDebugAPI) getModifiedAccounts(startBlock, endBlock *types.Bloc
|
||||||
return nil, fmt.Errorf("start block height (%d) must be less than end block height (%d)", startBlock.Number().Uint64(), endBlock.Number().Uint64())
|
return nil, fmt.Errorf("start block height (%d) must be less than end block height (%d)", startBlock.Number().Uint64(), endBlock.Number().Uint64())
|
||||||
}
|
}
|
||||||
|
|
||||||
oldTrie, err := trie.NewSecure(startBlock.Root(), trie.NewDatabase(api.eth.chainDb), 0)
|
oldTrie, err := trie.NewSecure(startBlock.Root(), trie.NewDatabase(api.ess.chainDb), 0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
newTrie, err := trie.NewSecure(endBlock.Root(), trie.NewDatabase(api.eth.chainDb), 0)
|
newTrie, err := trie.NewSecure(endBlock.Root(), trie.NewDatabase(api.ess.chainDb), 0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@
|
||||||
// You should have received a copy of the GNU Lesser General Public License
|
// 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-ethereum library. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
package eth
|
package ess
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
@ -39,58 +39,58 @@ import (
|
||||||
|
|
||||||
// EthAPIBackend implements ethapi.Backend for full nodes
|
// EthAPIBackend implements ethapi.Backend for full nodes
|
||||||
type EthAPIBackend struct {
|
type EthAPIBackend struct {
|
||||||
eth *Ethereum
|
ess *Essentia
|
||||||
gpo *gasprice.Oracle
|
gpo *gasprice.Oracle
|
||||||
}
|
}
|
||||||
|
|
||||||
// ChainConfig returns the active chain configuration.
|
// ChainConfig returns the active chain configuration.
|
||||||
func (b *EthAPIBackend) ChainConfig() *params.ChainConfig {
|
func (b *EthAPIBackend) ChainConfig() *params.ChainConfig {
|
||||||
return b.eth.chainConfig
|
return b.ess.chainConfig
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *EthAPIBackend) CurrentBlock() *types.Block {
|
func (b *EthAPIBackend) CurrentBlock() *types.Block {
|
||||||
return b.eth.blockchain.CurrentBlock()
|
return b.ess.blockchain.CurrentBlock()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *EthAPIBackend) SetHead(number uint64) {
|
func (b *EthAPIBackend) SetHead(number uint64) {
|
||||||
b.eth.protocolManager.downloader.Cancel()
|
b.ess.protocolManager.downloader.Cancel()
|
||||||
b.eth.blockchain.SetHead(number)
|
b.ess.blockchain.SetHead(number)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *EthAPIBackend) HeaderByNumber(ctx context.Context, blockNr rpc.BlockNumber) (*types.Header, error) {
|
func (b *EthAPIBackend) HeaderByNumber(ctx context.Context, blockNr rpc.BlockNumber) (*types.Header, error) {
|
||||||
// Pending block is only known by the miner
|
// Pending block is only known by the miner
|
||||||
if blockNr == rpc.PendingBlockNumber {
|
if blockNr == rpc.PendingBlockNumber {
|
||||||
block := b.eth.miner.PendingBlock()
|
block := b.ess.miner.PendingBlock()
|
||||||
return block.Header(), nil
|
return block.Header(), nil
|
||||||
}
|
}
|
||||||
// Otherwise resolve and return the block
|
// Otherwise resolve and return the block
|
||||||
if blockNr == rpc.LatestBlockNumber {
|
if blockNr == rpc.LatestBlockNumber {
|
||||||
return b.eth.blockchain.CurrentBlock().Header(), nil
|
return b.ess.blockchain.CurrentBlock().Header(), nil
|
||||||
}
|
}
|
||||||
return b.eth.blockchain.GetHeaderByNumber(uint64(blockNr)), nil
|
return b.ess.blockchain.GetHeaderByNumber(uint64(blockNr)), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *EthAPIBackend) HeaderByHash(ctx context.Context, hash common.Hash) (*types.Header, error) {
|
func (b *EthAPIBackend) HeaderByHash(ctx context.Context, hash common.Hash) (*types.Header, error) {
|
||||||
return b.eth.blockchain.GetHeaderByHash(hash), nil
|
return b.ess.blockchain.GetHeaderByHash(hash), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *EthAPIBackend) BlockByNumber(ctx context.Context, blockNr rpc.BlockNumber) (*types.Block, error) {
|
func (b *EthAPIBackend) BlockByNumber(ctx context.Context, blockNr rpc.BlockNumber) (*types.Block, error) {
|
||||||
// Pending block is only known by the miner
|
// Pending block is only known by the miner
|
||||||
if blockNr == rpc.PendingBlockNumber {
|
if blockNr == rpc.PendingBlockNumber {
|
||||||
block := b.eth.miner.PendingBlock()
|
block := b.ess.miner.PendingBlock()
|
||||||
return block, nil
|
return block, nil
|
||||||
}
|
}
|
||||||
// Otherwise resolve and return the block
|
// Otherwise resolve and return the block
|
||||||
if blockNr == rpc.LatestBlockNumber {
|
if blockNr == rpc.LatestBlockNumber {
|
||||||
return b.eth.blockchain.CurrentBlock(), nil
|
return b.ess.blockchain.CurrentBlock(), nil
|
||||||
}
|
}
|
||||||
return b.eth.blockchain.GetBlockByNumber(uint64(blockNr)), nil
|
return b.ess.blockchain.GetBlockByNumber(uint64(blockNr)), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *EthAPIBackend) StateAndHeaderByNumber(ctx context.Context, blockNr rpc.BlockNumber) (*state.StateDB, *types.Header, error) {
|
func (b *EthAPIBackend) StateAndHeaderByNumber(ctx context.Context, blockNr rpc.BlockNumber) (*state.StateDB, *types.Header, error) {
|
||||||
// Pending state is only known by the miner
|
// Pending state is only known by the miner
|
||||||
if blockNr == rpc.PendingBlockNumber {
|
if blockNr == rpc.PendingBlockNumber {
|
||||||
block, state := b.eth.miner.Pending()
|
block, state := b.ess.miner.Pending()
|
||||||
return state, block.Header(), nil
|
return state, block.Header(), nil
|
||||||
}
|
}
|
||||||
// Otherwise resolve the block number and return its state
|
// Otherwise resolve the block number and return its state
|
||||||
|
|
@ -98,27 +98,27 @@ func (b *EthAPIBackend) StateAndHeaderByNumber(ctx context.Context, blockNr rpc.
|
||||||
if header == nil || err != nil {
|
if header == nil || err != nil {
|
||||||
return nil, nil, err
|
return nil, nil, err
|
||||||
}
|
}
|
||||||
stateDb, err := b.eth.BlockChain().StateAt(header.Root)
|
stateDb, err := b.ess.BlockChain().StateAt(header.Root)
|
||||||
return stateDb, header, err
|
return stateDb, header, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *EthAPIBackend) GetBlock(ctx context.Context, hash common.Hash) (*types.Block, error) {
|
func (b *EthAPIBackend) GetBlock(ctx context.Context, hash common.Hash) (*types.Block, error) {
|
||||||
return b.eth.blockchain.GetBlockByHash(hash), nil
|
return b.ess.blockchain.GetBlockByHash(hash), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *EthAPIBackend) GetReceipts(ctx context.Context, hash common.Hash) (types.Receipts, error) {
|
func (b *EthAPIBackend) GetReceipts(ctx context.Context, hash common.Hash) (types.Receipts, error) {
|
||||||
if number := rawdb.ReadHeaderNumber(b.eth.chainDb, hash); number != nil {
|
if number := rawdb.ReadHeaderNumber(b.ess.chainDb, hash); number != nil {
|
||||||
return rawdb.ReadReceipts(b.eth.chainDb, hash, *number), nil
|
return rawdb.ReadReceipts(b.ess.chainDb, hash, *number), nil
|
||||||
}
|
}
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *EthAPIBackend) GetLogs(ctx context.Context, hash common.Hash) ([][]*types.Log, error) {
|
func (b *EthAPIBackend) GetLogs(ctx context.Context, hash common.Hash) ([][]*types.Log, error) {
|
||||||
number := rawdb.ReadHeaderNumber(b.eth.chainDb, hash)
|
number := rawdb.ReadHeaderNumber(b.ess.chainDb, hash)
|
||||||
if number == nil {
|
if number == nil {
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
receipts := rawdb.ReadReceipts(b.eth.chainDb, hash, *number)
|
receipts := rawdb.ReadReceipts(b.ess.chainDb, hash, *number)
|
||||||
if receipts == nil {
|
if receipts == nil {
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
@ -130,43 +130,43 @@ func (b *EthAPIBackend) GetLogs(ctx context.Context, hash common.Hash) ([][]*typ
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *EthAPIBackend) GetTd(blockHash common.Hash) *big.Int {
|
func (b *EthAPIBackend) GetTd(blockHash common.Hash) *big.Int {
|
||||||
return b.eth.blockchain.GetTdByHash(blockHash)
|
return b.ess.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) {
|
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)
|
state.SetBalance(msg.From(), math.MaxBig256)
|
||||||
vmError := func() error { return nil }
|
vmError := func() error { return nil }
|
||||||
|
|
||||||
context := core.NewEVMContext(msg, header, b.eth.BlockChain(), nil)
|
context := core.NewEVMContext(msg, header, b.ess.BlockChain(), nil)
|
||||||
return vm.NewEVM(context, state, b.eth.chainConfig, vmCfg), vmError, nil
|
return vm.NewEVM(context, state, b.ess.chainConfig, vmCfg), vmError, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *EthAPIBackend) SubscribeRemovedLogsEvent(ch chan<- core.RemovedLogsEvent) event.Subscription {
|
func (b *EthAPIBackend) SubscribeRemovedLogsEvent(ch chan<- core.RemovedLogsEvent) event.Subscription {
|
||||||
return b.eth.BlockChain().SubscribeRemovedLogsEvent(ch)
|
return b.ess.BlockChain().SubscribeRemovedLogsEvent(ch)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *EthAPIBackend) SubscribeChainEvent(ch chan<- core.ChainEvent) event.Subscription {
|
func (b *EthAPIBackend) SubscribeChainEvent(ch chan<- core.ChainEvent) event.Subscription {
|
||||||
return b.eth.BlockChain().SubscribeChainEvent(ch)
|
return b.ess.BlockChain().SubscribeChainEvent(ch)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *EthAPIBackend) SubscribeChainHeadEvent(ch chan<- core.ChainHeadEvent) event.Subscription {
|
func (b *EthAPIBackend) SubscribeChainHeadEvent(ch chan<- core.ChainHeadEvent) event.Subscription {
|
||||||
return b.eth.BlockChain().SubscribeChainHeadEvent(ch)
|
return b.ess.BlockChain().SubscribeChainHeadEvent(ch)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *EthAPIBackend) SubscribeChainSideEvent(ch chan<- core.ChainSideEvent) event.Subscription {
|
func (b *EthAPIBackend) SubscribeChainSideEvent(ch chan<- core.ChainSideEvent) event.Subscription {
|
||||||
return b.eth.BlockChain().SubscribeChainSideEvent(ch)
|
return b.ess.BlockChain().SubscribeChainSideEvent(ch)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *EthAPIBackend) SubscribeLogsEvent(ch chan<- []*types.Log) event.Subscription {
|
func (b *EthAPIBackend) SubscribeLogsEvent(ch chan<- []*types.Log) event.Subscription {
|
||||||
return b.eth.BlockChain().SubscribeLogsEvent(ch)
|
return b.ess.BlockChain().SubscribeLogsEvent(ch)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *EthAPIBackend) SendTx(ctx context.Context, signedTx *types.Transaction) error {
|
func (b *EthAPIBackend) SendTx(ctx context.Context, signedTx *types.Transaction) error {
|
||||||
return b.eth.txPool.AddLocal(signedTx)
|
return b.ess.txPool.AddLocal(signedTx)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *EthAPIBackend) GetPoolTransactions() (types.Transactions, error) {
|
func (b *EthAPIBackend) GetPoolTransactions() (types.Transactions, error) {
|
||||||
pending, err := b.eth.txPool.Pending()
|
pending, err := b.ess.txPool.Pending()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
@ -178,31 +178,31 @@ func (b *EthAPIBackend) GetPoolTransactions() (types.Transactions, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *EthAPIBackend) GetPoolTransaction(hash common.Hash) *types.Transaction {
|
func (b *EthAPIBackend) GetPoolTransaction(hash common.Hash) *types.Transaction {
|
||||||
return b.eth.txPool.Get(hash)
|
return b.ess.txPool.Get(hash)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *EthAPIBackend) GetPoolNonce(ctx context.Context, addr common.Address) (uint64, error) {
|
func (b *EthAPIBackend) GetPoolNonce(ctx context.Context, addr common.Address) (uint64, error) {
|
||||||
return b.eth.txPool.State().GetNonce(addr), nil
|
return b.ess.txPool.State().GetNonce(addr), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *EthAPIBackend) Stats() (pending int, queued int) {
|
func (b *EthAPIBackend) Stats() (pending int, queued int) {
|
||||||
return b.eth.txPool.Stats()
|
return b.ess.txPool.Stats()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *EthAPIBackend) TxPoolContent() (map[common.Address]types.Transactions, map[common.Address]types.Transactions) {
|
func (b *EthAPIBackend) TxPoolContent() (map[common.Address]types.Transactions, map[common.Address]types.Transactions) {
|
||||||
return b.eth.TxPool().Content()
|
return b.ess.TxPool().Content()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *EthAPIBackend) SubscribeNewTxsEvent(ch chan<- core.NewTxsEvent) event.Subscription {
|
func (b *EthAPIBackend) SubscribeNewTxsEvent(ch chan<- core.NewTxsEvent) event.Subscription {
|
||||||
return b.eth.TxPool().SubscribeNewTxsEvent(ch)
|
return b.ess.TxPool().SubscribeNewTxsEvent(ch)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *EthAPIBackend) Downloader() *downloader.Downloader {
|
func (b *EthAPIBackend) Downloader() *downloader.Downloader {
|
||||||
return b.eth.Downloader()
|
return b.ess.Downloader()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *EthAPIBackend) ProtocolVersion() int {
|
func (b *EthAPIBackend) ProtocolVersion() int {
|
||||||
return b.eth.EthVersion()
|
return b.ess.EthVersion()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *EthAPIBackend) SuggestPrice(ctx context.Context) (*big.Int, error) {
|
func (b *EthAPIBackend) SuggestPrice(ctx context.Context) (*big.Int, error) {
|
||||||
|
|
@ -210,24 +210,24 @@ func (b *EthAPIBackend) SuggestPrice(ctx context.Context) (*big.Int, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *EthAPIBackend) ChainDb() ethdb.Database {
|
func (b *EthAPIBackend) ChainDb() ethdb.Database {
|
||||||
return b.eth.ChainDb()
|
return b.ess.ChainDb()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *EthAPIBackend) EventMux() *event.TypeMux {
|
func (b *EthAPIBackend) EventMux() *event.TypeMux {
|
||||||
return b.eth.EventMux()
|
return b.ess.EventMux()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *EthAPIBackend) AccountManager() *accounts.Manager {
|
func (b *EthAPIBackend) AccountManager() *accounts.Manager {
|
||||||
return b.eth.AccountManager()
|
return b.ess.AccountManager()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *EthAPIBackend) BloomStatus() (uint64, uint64) {
|
func (b *EthAPIBackend) BloomStatus() (uint64, uint64) {
|
||||||
sections, _, _ := b.eth.bloomIndexer.Sections()
|
sections, _, _ := b.ess.bloomIndexer.Sections()
|
||||||
return params.BloomBitsBlocks, sections
|
return params.BloomBitsBlocks, sections
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *EthAPIBackend) ServiceFilter(ctx context.Context, session *bloombits.MatcherSession) {
|
func (b *EthAPIBackend) ServiceFilter(ctx context.Context, session *bloombits.MatcherSession) {
|
||||||
for i := 0; i < bloomFilterThreads; i++ {
|
for i := 0; i < bloomFilterThreads; i++ {
|
||||||
go session.Multiplex(bloomRetrievalBatch, bloomRetrievalWait, b.eth.bloomRequests)
|
go session.Multiplex(bloomRetrievalBatch, bloomRetrievalWait, b.ess.bloomRequests)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@
|
||||||
// You should have received a copy of the GNU Lesser General Public License
|
// 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-ethereum library. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
package eth
|
package ess
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"reflect"
|
"reflect"
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@
|
||||||
// You should have received a copy of the GNU Lesser General Public License
|
// 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-ethereum library. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
package eth
|
package ess
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
|
|
@ -98,19 +98,19 @@ func (api *PrivateDebugAPI) TraceChain(ctx context.Context, start, end rpc.Block
|
||||||
|
|
||||||
switch start {
|
switch start {
|
||||||
case rpc.PendingBlockNumber:
|
case rpc.PendingBlockNumber:
|
||||||
from = api.eth.miner.PendingBlock()
|
from = api.ess.miner.PendingBlock()
|
||||||
case rpc.LatestBlockNumber:
|
case rpc.LatestBlockNumber:
|
||||||
from = api.eth.blockchain.CurrentBlock()
|
from = api.ess.blockchain.CurrentBlock()
|
||||||
default:
|
default:
|
||||||
from = api.eth.blockchain.GetBlockByNumber(uint64(start))
|
from = api.ess.blockchain.GetBlockByNumber(uint64(start))
|
||||||
}
|
}
|
||||||
switch end {
|
switch end {
|
||||||
case rpc.PendingBlockNumber:
|
case rpc.PendingBlockNumber:
|
||||||
to = api.eth.miner.PendingBlock()
|
to = api.ess.miner.PendingBlock()
|
||||||
case rpc.LatestBlockNumber:
|
case rpc.LatestBlockNumber:
|
||||||
to = api.eth.blockchain.CurrentBlock()
|
to = api.ess.blockchain.CurrentBlock()
|
||||||
default:
|
default:
|
||||||
to = api.eth.blockchain.GetBlockByNumber(uint64(end))
|
to = api.ess.blockchain.GetBlockByNumber(uint64(end))
|
||||||
}
|
}
|
||||||
// Trace the chain if we've found all our blocks
|
// Trace the chain if we've found all our blocks
|
||||||
if from == nil {
|
if from == nil {
|
||||||
|
|
@ -135,10 +135,10 @@ func (api *PrivateDebugAPI) traceChain(ctx context.Context, start, end *types.Bl
|
||||||
|
|
||||||
// Ensure we have a valid starting state before doing any work
|
// Ensure we have a valid starting state before doing any work
|
||||||
origin := start.NumberU64()
|
origin := start.NumberU64()
|
||||||
database := state.NewDatabase(api.eth.ChainDb())
|
database := state.NewDatabase(api.ess.ChainDb())
|
||||||
|
|
||||||
if number := start.NumberU64(); number > 0 {
|
if number := start.NumberU64(); number > 0 {
|
||||||
start = api.eth.blockchain.GetBlock(start.ParentHash(), start.NumberU64()-1)
|
start = api.ess.blockchain.GetBlock(start.ParentHash(), start.NumberU64()-1)
|
||||||
if start == nil {
|
if start == nil {
|
||||||
return nil, fmt.Errorf("parent block #%d not found", number-1)
|
return nil, fmt.Errorf("parent block #%d not found", number-1)
|
||||||
}
|
}
|
||||||
|
|
@ -152,7 +152,7 @@ func (api *PrivateDebugAPI) traceChain(ctx context.Context, start, end *types.Bl
|
||||||
}
|
}
|
||||||
// Find the most recent block that has the state available
|
// Find the most recent block that has the state available
|
||||||
for i := uint64(0); i < reexec; i++ {
|
for i := uint64(0); i < reexec; i++ {
|
||||||
start = api.eth.blockchain.GetBlock(start.ParentHash(), start.NumberU64()-1)
|
start = api.ess.blockchain.GetBlock(start.ParentHash(), start.NumberU64()-1)
|
||||||
if start == nil {
|
if start == nil {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
@ -194,7 +194,7 @@ func (api *PrivateDebugAPI) traceChain(ctx context.Context, start, end *types.Bl
|
||||||
// Trace all the transactions contained within
|
// Trace all the transactions contained within
|
||||||
for i, tx := range task.block.Transactions() {
|
for i, tx := range task.block.Transactions() {
|
||||||
msg, _ := tx.AsMessage(signer)
|
msg, _ := tx.AsMessage(signer)
|
||||||
vmctx := core.NewEVMContext(msg, task.block.Header(), api.eth.blockchain, nil)
|
vmctx := core.NewEVMContext(msg, task.block.Header(), api.ess.blockchain, nil)
|
||||||
|
|
||||||
res, err := api.traceTx(ctx, msg, vmctx, task.statedb, config)
|
res, err := api.traceTx(ctx, msg, vmctx, task.statedb, config)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
@ -259,7 +259,7 @@ func (api *PrivateDebugAPI) traceChain(ctx context.Context, start, end *types.Bl
|
||||||
logged = time.Now()
|
logged = time.Now()
|
||||||
}
|
}
|
||||||
// Retrieve the next block to trace
|
// Retrieve the next block to trace
|
||||||
block := api.eth.blockchain.GetBlockByNumber(number)
|
block := api.ess.blockchain.GetBlockByNumber(number)
|
||||||
if block == nil {
|
if block == nil {
|
||||||
failed = fmt.Errorf("block #%d not found", number)
|
failed = fmt.Errorf("block #%d not found", number)
|
||||||
break
|
break
|
||||||
|
|
@ -276,7 +276,7 @@ func (api *PrivateDebugAPI) traceChain(ctx context.Context, start, end *types.Bl
|
||||||
traced += uint64(len(txs))
|
traced += uint64(len(txs))
|
||||||
}
|
}
|
||||||
// Generate the next state snapshot fast without tracing
|
// Generate the next state snapshot fast without tracing
|
||||||
_, _, _, err := api.eth.blockchain.Processor().Process(block, statedb, vm.Config{})
|
_, _, _, err := api.ess.blockchain.Processor().Process(block, statedb, vm.Config{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
failed = err
|
failed = err
|
||||||
break
|
break
|
||||||
|
|
@ -343,11 +343,11 @@ func (api *PrivateDebugAPI) TraceBlockByNumber(ctx context.Context, number rpc.B
|
||||||
|
|
||||||
switch number {
|
switch number {
|
||||||
case rpc.PendingBlockNumber:
|
case rpc.PendingBlockNumber:
|
||||||
block = api.eth.miner.PendingBlock()
|
block = api.ess.miner.PendingBlock()
|
||||||
case rpc.LatestBlockNumber:
|
case rpc.LatestBlockNumber:
|
||||||
block = api.eth.blockchain.CurrentBlock()
|
block = api.ess.blockchain.CurrentBlock()
|
||||||
default:
|
default:
|
||||||
block = api.eth.blockchain.GetBlockByNumber(uint64(number))
|
block = api.ess.blockchain.GetBlockByNumber(uint64(number))
|
||||||
}
|
}
|
||||||
// Trace the block if it was found
|
// Trace the block if it was found
|
||||||
if block == nil {
|
if block == nil {
|
||||||
|
|
@ -359,7 +359,7 @@ func (api *PrivateDebugAPI) TraceBlockByNumber(ctx context.Context, number rpc.B
|
||||||
// TraceBlockByHash returns the structured logs created during the execution of
|
// TraceBlockByHash returns the structured logs created during the execution of
|
||||||
// EVM and returns them as a JSON object.
|
// EVM and returns them as a JSON object.
|
||||||
func (api *PrivateDebugAPI) TraceBlockByHash(ctx context.Context, hash common.Hash, config *TraceConfig) ([]*txTraceResult, error) {
|
func (api *PrivateDebugAPI) TraceBlockByHash(ctx context.Context, hash common.Hash, config *TraceConfig) ([]*txTraceResult, error) {
|
||||||
block := api.eth.blockchain.GetBlockByHash(hash)
|
block := api.ess.blockchain.GetBlockByHash(hash)
|
||||||
if block == nil {
|
if block == nil {
|
||||||
return nil, fmt.Errorf("block #%x not found", hash)
|
return nil, fmt.Errorf("block #%x not found", hash)
|
||||||
}
|
}
|
||||||
|
|
@ -391,10 +391,10 @@ func (api *PrivateDebugAPI) TraceBlockFromFile(ctx context.Context, file string,
|
||||||
// per transaction, dependent on the requestd tracer.
|
// per transaction, dependent on the requestd tracer.
|
||||||
func (api *PrivateDebugAPI) traceBlock(ctx context.Context, block *types.Block, config *TraceConfig) ([]*txTraceResult, error) {
|
func (api *PrivateDebugAPI) traceBlock(ctx context.Context, block *types.Block, config *TraceConfig) ([]*txTraceResult, error) {
|
||||||
// Create the parent state database
|
// Create the parent state database
|
||||||
if err := api.eth.engine.VerifyHeader(api.eth.blockchain, block.Header(), true); err != nil {
|
if err := api.ess.engine.VerifyHeader(api.ess.blockchain, block.Header(), true); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
parent := api.eth.blockchain.GetBlock(block.ParentHash(), block.NumberU64()-1)
|
parent := api.ess.blockchain.GetBlock(block.ParentHash(), block.NumberU64()-1)
|
||||||
if parent == nil {
|
if parent == nil {
|
||||||
return nil, fmt.Errorf("parent %x not found", block.ParentHash())
|
return nil, fmt.Errorf("parent %x not found", block.ParentHash())
|
||||||
}
|
}
|
||||||
|
|
@ -428,7 +428,7 @@ func (api *PrivateDebugAPI) traceBlock(ctx context.Context, block *types.Block,
|
||||||
// Fetch and execute the next transaction trace tasks
|
// Fetch and execute the next transaction trace tasks
|
||||||
for task := range jobs {
|
for task := range jobs {
|
||||||
msg, _ := txs[task.index].AsMessage(signer)
|
msg, _ := txs[task.index].AsMessage(signer)
|
||||||
vmctx := core.NewEVMContext(msg, block.Header(), api.eth.blockchain, nil)
|
vmctx := core.NewEVMContext(msg, block.Header(), api.ess.blockchain, nil)
|
||||||
|
|
||||||
res, err := api.traceTx(ctx, msg, vmctx, task.statedb, config)
|
res, err := api.traceTx(ctx, msg, vmctx, task.statedb, config)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
@ -447,7 +447,7 @@ func (api *PrivateDebugAPI) traceBlock(ctx context.Context, block *types.Block,
|
||||||
|
|
||||||
// Generate the next state snapshot fast without tracing
|
// Generate the next state snapshot fast without tracing
|
||||||
msg, _ := tx.AsMessage(signer)
|
msg, _ := tx.AsMessage(signer)
|
||||||
vmctx := core.NewEVMContext(msg, block.Header(), api.eth.blockchain, nil)
|
vmctx := core.NewEVMContext(msg, block.Header(), api.ess.blockchain, nil)
|
||||||
|
|
||||||
vmenv := vm.NewEVM(vmctx, statedb, api.config, vm.Config{})
|
vmenv := vm.NewEVM(vmctx, statedb, api.config, vm.Config{})
|
||||||
if _, _, _, err := core.ApplyMessage(vmenv, msg, new(core.GasPool).AddGas(msg.Gas())); err != nil {
|
if _, _, _, err := core.ApplyMessage(vmenv, msg, new(core.GasPool).AddGas(msg.Gas())); err != nil {
|
||||||
|
|
@ -472,16 +472,16 @@ func (api *PrivateDebugAPI) traceBlock(ctx context.Context, block *types.Block,
|
||||||
// attempted to be reexecuted to generate the desired state.
|
// attempted to be reexecuted to generate the desired state.
|
||||||
func (api *PrivateDebugAPI) computeStateDB(block *types.Block, reexec uint64) (*state.StateDB, error) {
|
func (api *PrivateDebugAPI) computeStateDB(block *types.Block, reexec uint64) (*state.StateDB, error) {
|
||||||
// If we have the state fully available, use that
|
// If we have the state fully available, use that
|
||||||
statedb, err := api.eth.blockchain.StateAt(block.Root())
|
statedb, err := api.ess.blockchain.StateAt(block.Root())
|
||||||
if err == nil {
|
if err == nil {
|
||||||
return statedb, nil
|
return statedb, nil
|
||||||
}
|
}
|
||||||
// Otherwise try to reexec blocks until we find a state or reach our limit
|
// Otherwise try to reexec blocks until we find a state or reach our limit
|
||||||
origin := block.NumberU64()
|
origin := block.NumberU64()
|
||||||
database := state.NewDatabase(api.eth.ChainDb())
|
database := state.NewDatabase(api.ess.ChainDb())
|
||||||
|
|
||||||
for i := uint64(0); i < reexec; i++ {
|
for i := uint64(0); i < reexec; i++ {
|
||||||
block = api.eth.blockchain.GetBlock(block.ParentHash(), block.NumberU64()-1)
|
block = api.ess.blockchain.GetBlock(block.ParentHash(), block.NumberU64()-1)
|
||||||
if block == nil {
|
if block == nil {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
@ -510,10 +510,10 @@ func (api *PrivateDebugAPI) computeStateDB(block *types.Block, reexec uint64) (*
|
||||||
logged = time.Now()
|
logged = time.Now()
|
||||||
}
|
}
|
||||||
// Retrieve the next block to regenerate and process it
|
// Retrieve the next block to regenerate and process it
|
||||||
if block = api.eth.blockchain.GetBlockByNumber(block.NumberU64() + 1); block == nil {
|
if block = api.ess.blockchain.GetBlockByNumber(block.NumberU64() + 1); block == nil {
|
||||||
return nil, fmt.Errorf("block #%d not found", block.NumberU64()+1)
|
return nil, fmt.Errorf("block #%d not found", block.NumberU64()+1)
|
||||||
}
|
}
|
||||||
_, _, _, err := api.eth.blockchain.Processor().Process(block, statedb, vm.Config{})
|
_, _, _, err := api.ess.blockchain.Processor().Process(block, statedb, vm.Config{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
@ -538,7 +538,7 @@ func (api *PrivateDebugAPI) computeStateDB(block *types.Block, reexec uint64) (*
|
||||||
// and returns them as a JSON object.
|
// and returns them as a JSON object.
|
||||||
func (api *PrivateDebugAPI) TraceTransaction(ctx context.Context, hash common.Hash, config *TraceConfig) (interface{}, error) {
|
func (api *PrivateDebugAPI) TraceTransaction(ctx context.Context, hash common.Hash, config *TraceConfig) (interface{}, error) {
|
||||||
// Retrieve the transaction and assemble its EVM context
|
// Retrieve the transaction and assemble its EVM context
|
||||||
tx, blockHash, _, index := rawdb.ReadTransaction(api.eth.ChainDb(), hash)
|
tx, blockHash, _, index := rawdb.ReadTransaction(api.ess.ChainDb(), hash)
|
||||||
if tx == nil {
|
if tx == nil {
|
||||||
return nil, fmt.Errorf("transaction %x not found", hash)
|
return nil, fmt.Errorf("transaction %x not found", hash)
|
||||||
}
|
}
|
||||||
|
|
@ -618,11 +618,11 @@ func (api *PrivateDebugAPI) traceTx(ctx context.Context, message core.Message, v
|
||||||
// computeTxEnv returns the execution environment of a certain transaction.
|
// computeTxEnv returns the execution environment of a certain transaction.
|
||||||
func (api *PrivateDebugAPI) computeTxEnv(blockHash common.Hash, txIndex int, reexec uint64) (core.Message, vm.Context, *state.StateDB, error) {
|
func (api *PrivateDebugAPI) computeTxEnv(blockHash common.Hash, txIndex int, reexec uint64) (core.Message, vm.Context, *state.StateDB, error) {
|
||||||
// Create the parent state database
|
// Create the parent state database
|
||||||
block := api.eth.blockchain.GetBlockByHash(blockHash)
|
block := api.ess.blockchain.GetBlockByHash(blockHash)
|
||||||
if block == nil {
|
if block == nil {
|
||||||
return nil, vm.Context{}, nil, fmt.Errorf("block %x not found", blockHash)
|
return nil, vm.Context{}, nil, fmt.Errorf("block %x not found", blockHash)
|
||||||
}
|
}
|
||||||
parent := api.eth.blockchain.GetBlock(block.ParentHash(), block.NumberU64()-1)
|
parent := api.ess.blockchain.GetBlock(block.ParentHash(), block.NumberU64()-1)
|
||||||
if parent == nil {
|
if parent == nil {
|
||||||
return nil, vm.Context{}, nil, fmt.Errorf("parent %x not found", block.ParentHash())
|
return nil, vm.Context{}, nil, fmt.Errorf("parent %x not found", block.ParentHash())
|
||||||
}
|
}
|
||||||
|
|
@ -636,7 +636,7 @@ func (api *PrivateDebugAPI) computeTxEnv(blockHash common.Hash, txIndex int, ree
|
||||||
for idx, tx := range block.Transactions() {
|
for idx, tx := range block.Transactions() {
|
||||||
// Assemble the transaction call message and return if the requested offset
|
// Assemble the transaction call message and return if the requested offset
|
||||||
msg, _ := tx.AsMessage(signer)
|
msg, _ := tx.AsMessage(signer)
|
||||||
context := core.NewEVMContext(msg, block.Header(), api.eth.blockchain, nil)
|
context := core.NewEVMContext(msg, block.Header(), api.ess.blockchain, nil)
|
||||||
if idx == txIndex {
|
if idx == txIndex {
|
||||||
return msg, context, statedb, nil
|
return msg, context, statedb, nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
102
eth/backend.go
102
eth/backend.go
|
|
@ -14,8 +14,8 @@
|
||||||
// You should have received a copy of the GNU Lesser General Public License
|
// 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-ethereum library. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
// Package eth implements the Ethereum protocol.
|
// Package ess implements the Essentia protocol.
|
||||||
package eth
|
package ess
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
|
|
@ -58,13 +58,13 @@ type LesServer interface {
|
||||||
SetBloomBitsIndexer(bbIndexer *core.ChainIndexer)
|
SetBloomBitsIndexer(bbIndexer *core.ChainIndexer)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ethereum implements the Ethereum full node service.
|
// Essentia implements the Essentia full node service.
|
||||||
type Ethereum struct {
|
type Essentia struct {
|
||||||
config *Config
|
config *Config
|
||||||
chainConfig *params.ChainConfig
|
chainConfig *params.ChainConfig
|
||||||
|
|
||||||
// Channel for shutting down the service
|
// Channel for shutting down the service
|
||||||
shutdownChan chan bool // Channel for shutting down the Ethereum
|
shutdownChan chan bool // Channel for shutting down the Essentia
|
||||||
|
|
||||||
// Handlers
|
// Handlers
|
||||||
txPool *core.TxPool
|
txPool *core.TxPool
|
||||||
|
|
@ -94,16 +94,16 @@ type Ethereum struct {
|
||||||
lock sync.RWMutex // Protects the variadic fields (e.g. gas price and etherbase)
|
lock sync.RWMutex // Protects the variadic fields (e.g. gas price and etherbase)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Ethereum) AddLesServer(ls LesServer) {
|
func (s *Essentia) AddLesServer(ls LesServer) {
|
||||||
s.lesServer = ls
|
s.lesServer = ls
|
||||||
ls.SetBloomBitsIndexer(s.bloomIndexer)
|
ls.SetBloomBitsIndexer(s.bloomIndexer)
|
||||||
}
|
}
|
||||||
|
|
||||||
// New creates a new Ethereum object (including the
|
// New creates a new Essentia object (including the
|
||||||
// initialisation of the common Ethereum object)
|
// initialisation of the common Essentia object)
|
||||||
func New(ctx *node.ServiceContext, config *Config) (*Ethereum, error) {
|
func New(ctx *node.ServiceContext, config *Config) (*Essentia, error) {
|
||||||
if config.SyncMode == downloader.LightSync {
|
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 ess.Essentia in light sync mode, use les.LightEthereum")
|
||||||
}
|
}
|
||||||
if !config.SyncMode.IsValid() {
|
if !config.SyncMode.IsValid() {
|
||||||
return nil, fmt.Errorf("invalid sync mode %d", config.SyncMode)
|
return nil, fmt.Errorf("invalid sync mode %d", config.SyncMode)
|
||||||
|
|
@ -118,7 +118,7 @@ func New(ctx *node.ServiceContext, config *Config) (*Ethereum, error) {
|
||||||
}
|
}
|
||||||
log.Info("Initialised chain configuration", "config", chainConfig)
|
log.Info("Initialised chain configuration", "config", chainConfig)
|
||||||
|
|
||||||
eth := &Ethereum{
|
ess := &Essentia{
|
||||||
config: config,
|
config: config,
|
||||||
chainDb: chainDb,
|
chainDb: chainDb,
|
||||||
chainConfig: chainConfig,
|
chainConfig: chainConfig,
|
||||||
|
|
@ -133,7 +133,7 @@ func New(ctx *node.ServiceContext, config *Config) (*Ethereum, error) {
|
||||||
bloomIndexer: NewBloomIndexer(chainDb, params.BloomBitsBlocks),
|
bloomIndexer: NewBloomIndexer(chainDb, params.BloomBitsBlocks),
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Info("Initialising Ethereum protocol", "versions", ProtocolVersions, "network", config.NetworkId)
|
log.Info("Initialising Essentia protocol", "versions", ProtocolVersions, "network", config.NetworkId)
|
||||||
|
|
||||||
if !config.SkipBcVersionCheck {
|
if !config.SkipBcVersionCheck {
|
||||||
bcVersion := rawdb.ReadDatabaseVersion(chainDb)
|
bcVersion := rawdb.ReadDatabaseVersion(chainDb)
|
||||||
|
|
@ -146,37 +146,37 @@ func New(ctx *node.ServiceContext, config *Config) (*Ethereum, error) {
|
||||||
vmConfig = vm.Config{EnablePreimageRecording: config.EnablePreimageRecording}
|
vmConfig = vm.Config{EnablePreimageRecording: config.EnablePreimageRecording}
|
||||||
cacheConfig = &core.CacheConfig{Disabled: config.NoPruning, TrieNodeLimit: config.TrieCache, TrieTimeLimit: config.TrieTimeout}
|
cacheConfig = &core.CacheConfig{Disabled: config.NoPruning, TrieNodeLimit: config.TrieCache, TrieTimeLimit: config.TrieTimeout}
|
||||||
)
|
)
|
||||||
eth.blockchain, err = core.NewBlockChain(chainDb, cacheConfig, eth.chainConfig, eth.engine, vmConfig)
|
ess.blockchain, err = core.NewBlockChain(chainDb, cacheConfig, ess.chainConfig, ess.engine, vmConfig)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
// Rewind the chain in case of an incompatible config upgrade.
|
// Rewind the chain in case of an incompatible config upgrade.
|
||||||
if compat, ok := genesisErr.(*params.ConfigCompatError); ok {
|
if compat, ok := genesisErr.(*params.ConfigCompatError); ok {
|
||||||
log.Warn("Rewinding chain to upgrade configuration", "err", compat)
|
log.Warn("Rewinding chain to upgrade configuration", "err", compat)
|
||||||
eth.blockchain.SetHead(compat.RewindTo)
|
ess.blockchain.SetHead(compat.RewindTo)
|
||||||
rawdb.WriteChainConfig(chainDb, genesisHash, chainConfig)
|
rawdb.WriteChainConfig(chainDb, genesisHash, chainConfig)
|
||||||
}
|
}
|
||||||
eth.bloomIndexer.Start(eth.blockchain)
|
ess.bloomIndexer.Start(ess.blockchain)
|
||||||
|
|
||||||
if config.TxPool.Journal != "" {
|
if config.TxPool.Journal != "" {
|
||||||
config.TxPool.Journal = ctx.ResolvePath(config.TxPool.Journal)
|
config.TxPool.Journal = ctx.ResolvePath(config.TxPool.Journal)
|
||||||
}
|
}
|
||||||
eth.txPool = core.NewTxPool(config.TxPool, eth.chainConfig, eth.blockchain)
|
ess.txPool = core.NewTxPool(config.TxPool, ess.chainConfig, ess.blockchain)
|
||||||
|
|
||||||
if eth.protocolManager, err = NewProtocolManager(eth.chainConfig, config.SyncMode, config.NetworkId, eth.eventMux, eth.txPool, eth.engine, eth.blockchain, chainDb); err != nil {
|
if ess.protocolManager, err = NewProtocolManager(ess.chainConfig, config.SyncMode, config.NetworkId, ess.eventMux, ess.txPool, ess.engine, ess.blockchain, chainDb); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
eth.miner = miner.New(eth, eth.chainConfig, eth.EventMux(), eth.engine)
|
ess.miner = miner.New(ess, ess.chainConfig, ess.EventMux(), ess.engine)
|
||||||
eth.miner.SetExtra(makeExtraData(config.ExtraData))
|
ess.miner.SetExtra(makeExtraData(config.ExtraData))
|
||||||
|
|
||||||
eth.APIBackend = &EthAPIBackend{eth, nil}
|
ess.APIBackend = &EthAPIBackend{ess, nil}
|
||||||
gpoParams := config.GPO
|
gpoParams := config.GPO
|
||||||
if gpoParams.Default == nil {
|
if gpoParams.Default == nil {
|
||||||
gpoParams.Default = config.GasPrice
|
gpoParams.Default = config.GasPrice
|
||||||
}
|
}
|
||||||
eth.APIBackend.gpo = gasprice.NewOracle(eth.APIBackend, gpoParams)
|
ess.APIBackend.gpo = gasprice.NewOracle(ess.APIBackend, gpoParams)
|
||||||
|
|
||||||
return eth, nil
|
return ess, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func makeExtraData(extra []byte) []byte {
|
func makeExtraData(extra []byte) []byte {
|
||||||
|
|
@ -203,12 +203,12 @@ func CreateDB(ctx *node.ServiceContext, config *Config, name string) (ethdb.Data
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if db, ok := db.(*ethdb.LDBDatabase); ok {
|
if db, ok := db.(*ethdb.LDBDatabase); ok {
|
||||||
db.Meter("eth/db/chaindata/")
|
db.Meter("ess/db/chaindata/")
|
||||||
}
|
}
|
||||||
return db, nil
|
return db, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// CreateConsensusEngine creates the required type of consensus engine instance for an Ethereum service
|
// CreateConsensusEngine creates the required type of consensus engine instance for an Essentia service
|
||||||
func CreateConsensusEngine(ctx *node.ServiceContext, config *ethash.Config, chainConfig *params.ChainConfig, db ethdb.Database) consensus.Engine {
|
func CreateConsensusEngine(ctx *node.ServiceContext, config *ethash.Config, chainConfig *params.ChainConfig, db ethdb.Database) consensus.Engine {
|
||||||
// If proof-of-authority is requested, set it up
|
// If proof-of-authority is requested, set it up
|
||||||
if chainConfig.Clique != nil {
|
if chainConfig.Clique != nil {
|
||||||
|
|
@ -241,7 +241,7 @@ func CreateConsensusEngine(ctx *node.ServiceContext, config *ethash.Config, chai
|
||||||
|
|
||||||
// APIs return the collection of RPC services the ethereum package offers.
|
// APIs return the collection of RPC services the ethereum package offers.
|
||||||
// NOTE, some of these services probably need to be moved to somewhere else.
|
// NOTE, some of these services probably need to be moved to somewhere else.
|
||||||
func (s *Ethereum) APIs() []rpc.API {
|
func (s *Essentia) APIs() []rpc.API {
|
||||||
apis := ethapi.GetAPIs(s.APIBackend)
|
apis := ethapi.GetAPIs(s.APIBackend)
|
||||||
|
|
||||||
// Append any APIs exposed explicitly by the consensus engine
|
// Append any APIs exposed explicitly by the consensus engine
|
||||||
|
|
@ -250,17 +250,17 @@ func (s *Ethereum) APIs() []rpc.API {
|
||||||
// Append all the local APIs and return
|
// Append all the local APIs and return
|
||||||
return append(apis, []rpc.API{
|
return append(apis, []rpc.API{
|
||||||
{
|
{
|
||||||
Namespace: "eth",
|
Namespace: "ess",
|
||||||
Version: "1.0",
|
Version: "1.0",
|
||||||
Service: NewPublicEthereumAPI(s),
|
Service: NewPublicEthereumAPI(s),
|
||||||
Public: true,
|
Public: true,
|
||||||
}, {
|
}, {
|
||||||
Namespace: "eth",
|
Namespace: "ess",
|
||||||
Version: "1.0",
|
Version: "1.0",
|
||||||
Service: NewPublicMinerAPI(s),
|
Service: NewPublicMinerAPI(s),
|
||||||
Public: true,
|
Public: true,
|
||||||
}, {
|
}, {
|
||||||
Namespace: "eth",
|
Namespace: "ess",
|
||||||
Version: "1.0",
|
Version: "1.0",
|
||||||
Service: downloader.NewPublicDownloaderAPI(s.protocolManager.downloader, s.eventMux),
|
Service: downloader.NewPublicDownloaderAPI(s.protocolManager.downloader, s.eventMux),
|
||||||
Public: true,
|
Public: true,
|
||||||
|
|
@ -270,7 +270,7 @@ func (s *Ethereum) APIs() []rpc.API {
|
||||||
Service: NewPrivateMinerAPI(s),
|
Service: NewPrivateMinerAPI(s),
|
||||||
Public: false,
|
Public: false,
|
||||||
}, {
|
}, {
|
||||||
Namespace: "eth",
|
Namespace: "ess",
|
||||||
Version: "1.0",
|
Version: "1.0",
|
||||||
Service: filters.NewPublicFilterAPI(s.APIBackend, false),
|
Service: filters.NewPublicFilterAPI(s.APIBackend, false),
|
||||||
Public: true,
|
Public: true,
|
||||||
|
|
@ -296,11 +296,11 @@ func (s *Ethereum) APIs() []rpc.API {
|
||||||
}...)
|
}...)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Ethereum) ResetWithGenesisBlock(gb *types.Block) {
|
func (s *Essentia) ResetWithGenesisBlock(gb *types.Block) {
|
||||||
s.blockchain.ResetWithGenesisBlock(gb)
|
s.blockchain.ResetWithGenesisBlock(gb)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Ethereum) Etherbase() (eb common.Address, err error) {
|
func (s *Essentia) Etherbase() (eb common.Address, err error) {
|
||||||
s.lock.RLock()
|
s.lock.RLock()
|
||||||
etherbase := s.etherbase
|
etherbase := s.etherbase
|
||||||
s.lock.RUnlock()
|
s.lock.RUnlock()
|
||||||
|
|
@ -324,7 +324,7 @@ func (s *Ethereum) Etherbase() (eb common.Address, err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetEtherbase sets the mining reward address.
|
// SetEtherbase sets the mining reward address.
|
||||||
func (s *Ethereum) SetEtherbase(etherbase common.Address) {
|
func (s *Essentia) SetEtherbase(etherbase common.Address) {
|
||||||
s.lock.Lock()
|
s.lock.Lock()
|
||||||
s.etherbase = etherbase
|
s.etherbase = etherbase
|
||||||
s.lock.Unlock()
|
s.lock.Unlock()
|
||||||
|
|
@ -332,7 +332,7 @@ func (s *Ethereum) SetEtherbase(etherbase common.Address) {
|
||||||
s.miner.SetEtherbase(etherbase)
|
s.miner.SetEtherbase(etherbase)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Ethereum) StartMining(local bool) error {
|
func (s *Essentia) StartMining(local bool) error {
|
||||||
eb, err := s.Etherbase()
|
eb, err := s.Etherbase()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error("Cannot start mining without etherbase", "err", err)
|
log.Error("Cannot start mining without etherbase", "err", err)
|
||||||
|
|
@ -357,24 +357,24 @@ func (s *Ethereum) StartMining(local bool) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Ethereum) StopMining() { s.miner.Stop() }
|
func (s *Essentia) StopMining() { s.miner.Stop() }
|
||||||
func (s *Ethereum) IsMining() bool { return s.miner.Mining() }
|
func (s *Essentia) IsMining() bool { return s.miner.Mining() }
|
||||||
func (s *Ethereum) Miner() *miner.Miner { return s.miner }
|
func (s *Essentia) Miner() *miner.Miner { return s.miner }
|
||||||
|
|
||||||
func (s *Ethereum) AccountManager() *accounts.Manager { return s.accountManager }
|
func (s *Essentia) AccountManager() *accounts.Manager { return s.accountManager }
|
||||||
func (s *Ethereum) BlockChain() *core.BlockChain { return s.blockchain }
|
func (s *Essentia) BlockChain() *core.BlockChain { return s.blockchain }
|
||||||
func (s *Ethereum) TxPool() *core.TxPool { return s.txPool }
|
func (s *Essentia) TxPool() *core.TxPool { return s.txPool }
|
||||||
func (s *Ethereum) EventMux() *event.TypeMux { return s.eventMux }
|
func (s *Essentia) EventMux() *event.TypeMux { return s.eventMux }
|
||||||
func (s *Ethereum) Engine() consensus.Engine { return s.engine }
|
func (s *Essentia) Engine() consensus.Engine { return s.engine }
|
||||||
func (s *Ethereum) ChainDb() ethdb.Database { return s.chainDb }
|
func (s *Essentia) ChainDb() ethdb.Database { return s.chainDb }
|
||||||
func (s *Ethereum) IsListening() bool { return true } // Always listening
|
func (s *Essentia) IsListening() bool { return true } // Always listening
|
||||||
func (s *Ethereum) EthVersion() int { return int(s.protocolManager.SubProtocols[0].Version) }
|
func (s *Essentia) EthVersion() int { return int(s.protocolManager.SubProtocols[0].Version) }
|
||||||
func (s *Ethereum) NetVersion() uint64 { return s.networkID }
|
func (s *Essentia) NetVersion() uint64 { return s.networkID }
|
||||||
func (s *Ethereum) Downloader() *downloader.Downloader { return s.protocolManager.downloader }
|
func (s *Essentia) Downloader() *downloader.Downloader { return s.protocolManager.downloader }
|
||||||
|
|
||||||
// Protocols implements node.Service, returning all the currently configured
|
// Protocols implements node.Service, returning all the currently configured
|
||||||
// network protocols to start.
|
// network protocols to start.
|
||||||
func (s *Ethereum) Protocols() []p2p.Protocol {
|
func (s *Essentia) Protocols() []p2p.Protocol {
|
||||||
if s.lesServer == nil {
|
if s.lesServer == nil {
|
||||||
return s.protocolManager.SubProtocols
|
return s.protocolManager.SubProtocols
|
||||||
}
|
}
|
||||||
|
|
@ -382,8 +382,8 @@ func (s *Ethereum) Protocols() []p2p.Protocol {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Start implements node.Service, starting all internal goroutines needed by the
|
// Start implements node.Service, starting all internal goroutines needed by the
|
||||||
// Ethereum protocol implementation.
|
// Essentia protocol implementation.
|
||||||
func (s *Ethereum) Start(srvr *p2p.Server) error {
|
func (s *Essentia) Start(srvr *p2p.Server) error {
|
||||||
// Start the bloom bits servicing goroutines
|
// Start the bloom bits servicing goroutines
|
||||||
s.startBloomHandlers()
|
s.startBloomHandlers()
|
||||||
|
|
||||||
|
|
@ -407,8 +407,8 @@ func (s *Ethereum) Start(srvr *p2p.Server) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Stop implements node.Service, terminating all internal goroutines used by the
|
// Stop implements node.Service, terminating all internal goroutines used by the
|
||||||
// Ethereum protocol.
|
// Essentia protocol.
|
||||||
func (s *Ethereum) Stop() error {
|
func (s *Essentia) Stop() error {
|
||||||
s.bloomIndexer.Close()
|
s.bloomIndexer.Close()
|
||||||
s.blockchain.Stop()
|
s.blockchain.Stop()
|
||||||
s.protocolManager.Stop()
|
s.protocolManager.Stop()
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@
|
||||||
// You should have received a copy of the GNU Lesser General Public License
|
// 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-ethereum library. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
package eth
|
package ess
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"time"
|
"time"
|
||||||
|
|
@ -30,7 +30,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
// bloomServiceThreads is the number of goroutines used globally by an Ethereum
|
// bloomServiceThreads is the number of goroutines used globally by an Essentia
|
||||||
// instance to service bloombits lookups for all running filters.
|
// instance to service bloombits lookups for all running filters.
|
||||||
bloomServiceThreads = 16
|
bloomServiceThreads = 16
|
||||||
|
|
||||||
|
|
@ -49,20 +49,20 @@ const (
|
||||||
|
|
||||||
// startBloomHandlers starts a batch of goroutines to accept bloom bit database
|
// startBloomHandlers starts a batch of goroutines to accept bloom bit database
|
||||||
// retrievals from possibly a range of filters and serving the data to satisfy.
|
// retrievals from possibly a range of filters and serving the data to satisfy.
|
||||||
func (eth *Ethereum) startBloomHandlers() {
|
func (ess *Essentia) startBloomHandlers() {
|
||||||
for i := 0; i < bloomServiceThreads; i++ {
|
for i := 0; i < bloomServiceThreads; i++ {
|
||||||
go func() {
|
go func() {
|
||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
case <-eth.shutdownChan:
|
case <-ess.shutdownChan:
|
||||||
return
|
return
|
||||||
|
|
||||||
case request := <-eth.bloomRequests:
|
case request := <-ess.bloomRequests:
|
||||||
task := <-request
|
task := <-request
|
||||||
task.Bitsets = make([][]byte, len(task.Sections))
|
task.Bitsets = make([][]byte, len(task.Sections))
|
||||||
for i, section := range task.Sections {
|
for i, section := range task.Sections {
|
||||||
head := rawdb.ReadCanonicalHash(eth.chainDb, (section+1)*params.BloomBitsBlocks-1)
|
head := rawdb.ReadCanonicalHash(ess.chainDb, (section+1)*params.BloomBitsBlocks-1)
|
||||||
if compVector, err := rawdb.ReadBloomBits(eth.chainDb, task.Bit, section, head); err == nil {
|
if compVector, err := rawdb.ReadBloomBits(ess.chainDb, task.Bit, section, head); err == nil {
|
||||||
if blob, err := bitutil.DecompressBytes(compVector, int(params.BloomBitsBlocks)/8); err == nil {
|
if blob, err := bitutil.DecompressBytes(compVector, int(params.BloomBitsBlocks)/8); err == nil {
|
||||||
task.Bitsets[i] = blob
|
task.Bitsets[i] = blob
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -90,7 +90,7 @@ const (
|
||||||
)
|
)
|
||||||
|
|
||||||
// BloomIndexer implements a core.ChainIndexer, building up a rotated bloom bits index
|
// BloomIndexer implements a core.ChainIndexer, building up a rotated bloom bits index
|
||||||
// for the Ethereum header bloom filters, permitting blazing fast filtering.
|
// for the Essentia header bloom filters, permitting blazing fast filtering.
|
||||||
type BloomIndexer struct {
|
type BloomIndexer struct {
|
||||||
size uint64 // section size to generate bloombits for
|
size uint64 // section size to generate bloombits for
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@
|
||||||
// You should have received a copy of the GNU Lesser General Public License
|
// 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-ethereum library. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
package eth
|
package ess
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"math/big"
|
"math/big"
|
||||||
|
|
@ -33,7 +33,7 @@ import (
|
||||||
"github.com/orangeAndSuns/go-ethereum/params"
|
"github.com/orangeAndSuns/go-ethereum/params"
|
||||||
)
|
)
|
||||||
|
|
||||||
// DefaultConfig contains default settings for use on the Ethereum main net.
|
// DefaultConfig contains default settings for use on the Essentia main net.
|
||||||
var DefaultConfig = Config{
|
var DefaultConfig = Config{
|
||||||
SyncMode: downloader.FastSync,
|
SyncMode: downloader.FastSync,
|
||||||
Ethash: ethash.Config{
|
Ethash: ethash.Config{
|
||||||
|
|
@ -75,7 +75,7 @@ func init() {
|
||||||
|
|
||||||
type Config struct {
|
type Config struct {
|
||||||
// The genesis block, which is inserted if the database is empty.
|
// The genesis block, which is inserted if the database is empty.
|
||||||
// If nil, the Ethereum main net block is used.
|
// If nil, the Essentia main net block is used.
|
||||||
Genesis *core.Genesis `toml:",omitempty"`
|
Genesis *core.Genesis `toml:",omitempty"`
|
||||||
|
|
||||||
// Protocol options
|
// Protocol options
|
||||||
|
|
|
||||||
|
|
@ -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 Essentia network and when it's finished.
|
||||||
func (api *PublicDownloaderAPI) Syncing(ctx context.Context) (*rpc.Subscription, error) {
|
func (api *PublicDownloaderAPI) Syncing(ctx context.Context) (*rpc.Subscription, error) {
|
||||||
notifier, supported := rpc.NotifierFromContext(ctx)
|
notifier, supported := rpc.NotifierFromContext(ctx)
|
||||||
if !supported {
|
if !supported {
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ var (
|
||||||
qosConfidenceCap = 10 // Number of peers above which not to modify RTT confidence
|
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
|
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 // [ess/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
|
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
|
maxResultsProcess = 2048 // Number of content download results to import at once into the chain
|
||||||
|
|
||||||
|
|
@ -122,17 +122,17 @@ type Downloader struct {
|
||||||
committed int32
|
committed int32
|
||||||
|
|
||||||
// Channels
|
// Channels
|
||||||
headerCh chan dataPack // [eth/62] Channel receiving inbound block headers
|
headerCh chan dataPack // [ess/62] Channel receiving inbound block headers
|
||||||
bodyCh chan dataPack // [eth/62] Channel receiving inbound block bodies
|
bodyCh chan dataPack // [ess/62] Channel receiving inbound block bodies
|
||||||
receiptCh chan dataPack // [eth/63] Channel receiving inbound receipts
|
receiptCh chan dataPack // [ess/63] Channel receiving inbound receipts
|
||||||
bodyWakeCh chan bool // [eth/62] Channel to signal the block body fetcher of new tasks
|
bodyWakeCh chan bool // [ess/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
|
receiptWakeCh chan bool // [ess/63] Channel to signal the receipt fetcher of new tasks
|
||||||
headerProcCh chan []*types.Header // [eth/62] Channel to feed the header processor new tasks
|
headerProcCh chan []*types.Header // [ess/62] Channel to feed the header processor new tasks
|
||||||
|
|
||||||
// for stateFetcher
|
// for stateFetcher
|
||||||
stateSyncStart chan *stateSync
|
stateSyncStart chan *stateSync
|
||||||
trackStateReq chan *stateReq
|
trackStateReq chan *stateReq
|
||||||
stateCh chan dataPack // [eth/63] Channel receiving inbound node state data
|
stateCh chan dataPack // [ess/63] Channel receiving inbound node state data
|
||||||
|
|
||||||
// Cancellation and termination
|
// Cancellation and termination
|
||||||
cancelPeer string // Identifier of the peer currently being used as the master (cancel on drop)
|
cancelPeer string // Identifier of the peer currently being used as the master (cancel on drop)
|
||||||
|
|
@ -415,7 +415,7 @@ func (d *Downloader) syncWithPeer(p *peerConnection, hash common.Hash, td *big.I
|
||||||
return errTooOld
|
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, "ess", p.version, "head", hash, "td", td, "mode", d.mode)
|
||||||
defer func(start time.Time) {
|
defer func(start time.Time) {
|
||||||
log.Debug("Synchronisation terminated", "elapsed", time.Since(start))
|
log.Debug("Synchronisation terminated", "elapsed", time.Since(start))
|
||||||
}(time.Now())
|
}(time.Now())
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue