ipld-eth-server/README.md

108 lines
3.3 KiB
Markdown
Raw Normal View History

2020-08-31 15:52:47 +00:00
# ipld-eth-server
2018-01-25 23:19:15 +00:00
2020-08-31 15:52:47 +00:00
[![Go Report Card](https://goreportcard.com/badge/github.com/vulcanize/ipld-eth-server)](https://goreportcard.com/report/github.com/vulcanize/ipld-eth-server)
2019-04-05 15:10:34 +00:00
2020-09-01 21:14:37 +00:00
> ipld-eth-server is the server backend for indexed ETH IPLD objects
2019-04-05 15:10:34 +00:00
## Table of Contents
1. [Background](#background)
1. [Install](#install)
1. [Usage](#usage)
1. [Contributing](#contributing)
1. [License](#license)
2019-04-05 15:10:34 +00:00
## Background
2020-09-01 21:14:37 +00:00
NOTE: WIP
2020-09-01 21:14:37 +00:00
ipld-eth-server is used to service queries against the indexed Ethereum IPLD objects indexed by [ipld-eth-indexer](https://github.com/vulcanize/ipld-eth-indexer).
It exposes standard Ethereum JSON RPC endpoints on top of the database, in some cases these endpoints can leverage the unique indexes to improve query performance.
Additional, unique endpoints are exposed which utilize the new indexes and state diff data objects.
2019-05-08 16:44:04 +00:00
2020-08-06 20:00:41 +00:00
## Dependencies
Minimal build dependencies
* Go (1.13)
* Git
* GCC compiler
* This repository
2020-09-01 21:14:37 +00:00
External dependency
* Postgres database populated by [ipld-eth-indexer](https://github.com/vulcanize/ipld-eth-indexer)
2020-08-06 20:00:41 +00:00
## Install
2020-08-31 15:52:47 +00:00
Start by downloading ipld-eth-server and moving into the repo:
2020-08-31 15:52:47 +00:00
`GO111MODULE=off go get -d github.com/vulcanize/ipld-eth-server`
2020-08-31 15:52:47 +00:00
`cd $GOPATH/src/github.com/vulcanize/ipld-eth-server`
Then, build the binary:
`make build`
## Usage
After building the binary, run as
2020-09-01 21:14:37 +00:00
`./ipld-eth-server serve --config=<the name of your config file.toml>`
### Configuration
2020-09-01 21:14:37 +00:00
Below is the set of parameters for the ipld-eth-server command, in .toml form, with the respective environmental variables commented to the side.
The corresponding CLI flags can be found with the `./ipld-eth-server serve --help` command.
```toml
[database]
name = "vulcanize_public" # $DATABASE_NAME
hostname = "localhost" # $DATABASE_HOSTNAME
port = 5432 # $DATABASE_PORT
2020-09-01 21:14:37 +00:00
user = "postgres" # $DATABASE_USER
password = "" # $DATABASE_PASSWORD
2020-09-01 21:14:37 +00:00
[log]
level = "info" # $LOGRUS_LEVEL
[server]
ipcPath = "~/.vulcanize/vulcanize.ipc" # $SERVER_IPC_PATH
wsPath = "127.0.0.1:8081" # $SERVER_WS_PATH
httpPath = "127.0.0.1:8082" # $SERVER_HTTP_PATH
[ethereum]
chainID = "1" # $ETH_CHAIN_ID
defaultSender = "" # $ETH_DEFAULT_SENDER_ADDR
```
2020-09-01 21:14:37 +00:00
The `database` fields are for connecting to a Postgres database that has been/is being populated by [ipld-eth-indexer](https://github.com/vulcanize/ipld-eth-indexer).
The `server` fields set the paths for exposing the ipld-eth-server endpoints
The `ethereum` fields set the chainID and default sender address to use for EVM simulation
2020-09-01 21:14:37 +00:00
### Endpoints
#### IPLD subscription
TODO: Port the IPLD RPC subscription endpoints after the decoupling
2020-09-01 21:14:37 +00:00
#### Ethereum JSON-RPC
ipld-eth-server currently recapitulates portions of the Ethereum JSON-RPC api standard.
The currently supported standard endpoints are:
`eth_blockNumber`
`eth_getLogs`
`eth_getHeaderByNumber`
`eth_getBlockByNumber`
`eth_getBlockByHash`
`eth_getTransactionByHash`
2020-09-01 21:14:37 +00:00
TODO: Add the rest of the standard endpoints add unique endpoints (e.g. getSlice)
### Testing
`make test` will run the unit tests
`make test` setups a clean `vulcanize_testing` db
2019-04-05 15:10:34 +00:00
## Contributing
2019-05-08 18:19:32 +00:00
Contributions are welcome!
2019-04-05 15:10:34 +00:00
2019-05-10 15:07:25 +00:00
VulcanizeDB follows the [Contributor Covenant Code of Conduct](https://www.contributor-covenant.org/version/1/4/code-of-conduct).
2019-04-05 15:10:34 +00:00
## License
2020-08-09 15:10:39 +00:00
[AGPL-3.0](LICENSE) © Vulcanize Inc