**⚠ WARNING: This repository is deprecated. Please visit Aurora Relayer V2.
Implements a JSON-RPC server compatible with Ethereum's Web3 API for Aurora Engine instances deployed on the NEAR Protocol.
- Docker and Docker Compose
To run the relayer locally, execute:
NEAR_ENV=testnet docker-compose up
You can customize the configuration by copying config/testnet.yaml
to
config/local.yaml
and editing that file. (The configuration settings in
config/local.yaml
override the defaults from config/testnet.yaml
.)
npm i
- Install postgresql and create database, example of how to create database
- Go to indexer directory
cd util/indexer
- Compile
indexer
binary,go build
- Return to root directory of the project
- Run Node.js server
NEAR_ENV=testnet node lib/index.js
- Run indexer
sh -c util/indexer/indexer | NEAR_ENV=testnet node lib/indexer_backend.js
To see local changes without restarting the Node.js server, instead of step 6, execute:
NEAR_ENV=testnet npm run start
npm run build:watch
- Apply mocks to local database
sh test/fixtures/mocks_init.sh
- Run indexer
sh -c util/indexer/indexer | NEAR_ENV=testnet node lib/indexer_backend.js
- Run local specs
npm run test
To run the relayer locally, first start nearcore and then execute:
NEAR_ENV=localnet docker-compose up
You can customize the configuration by copying config/localnet.yaml
to
config/local.yaml
and editing that file. (The configuration settings in
config/local.yaml
override the defaults from config/localnet.yaml
.)
The relayer's HTTP endpoint is served up on the TCP port 8545 by default.
For example, you can send a Web3 JSON-RPC request to the endpoint using HTTPie, as follows:
http post http://localhost:8545 jsonrpc=2.0 id=1 method=eth_blockNumber params:='[]'
To customize configuration settings, create a config/local.yaml
file.
Configuration settings are loaded firstly from config/default.yaml
, then from
config/$NEAR_ENV.yaml
, and lastly from config/local.yaml
. Settings in
files loaded later override the same settings from files loaded earlier.
To be able to call eth_sendRawTransaction
, you must have a NEAR account and
signing key on the network you are relaying to, and said NEAR account must have
a sufficient Ⓝ balance to be able to send transactions.
To configure the signing account and private key, place the JSON key file
into the config/
directory and edit config/local.yaml
as follows:
signer: you.testnet
signerKey: config/you.testnet.json
If you're using the NEAR CLI, you will find your signing keys stored as JSON
key files under your $HOME/.near-credentials/
directory.
Legend: ❌ = not supported. 🚧 = work in progress. ✅ = supported.
- Clone the repo
- Create your branch
- Add your changes
- Run tests (
npm run test
, the local server must be running for the tests to pass). Fix if you broke something. Add your own tests - Format your code (
npm run format
) - Run linter (
npm run lint
) - Build changes (
npm run build
) - Commit your Changes (
git commit -m 'Resolved an issue'
) - Push to the Branch (
git push origin new_feature
) - Open a Pull Request