npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@zjb0807/eth-rpc-adapter

v2.4.7

Published

A node service that allows existing Ethereum dApp to be able to interact with [Acala EVM](https://github.com/AcalaNetwork/Acala/tree/master/modules/evm).

Downloads

1

Readme

@acala-network/eth-rpc-adapter

A node service that allows existing Ethereum dApp to be able to interact with Acala EVM.

Run

from npm version

  • run the server (should automagically install it)
LOCAL_MODE=1 npx @acala-network/eth-rpc-adapter

from local build

  • build it locally
rush update
rush build @acala-network/eth-rpc-adapter
  • run the dev server:
LOCAL_MODE=1 yarn dev

with docker

docker compose up

note that docker image might not be most up-to-date. Latest image can be found here

Options

  • available ENV options:
    • ENDPOINT_URL: acala node WS url
    • SUBQL_URL: subquery service url
    • HTTP_PORT: HTTP port for requests
    • WS_PORT: WS port for requests
    • MAX_CACHE_SIZE: max number of blocks that lives in the cache more info
    • SAFE_MODE: if enabled, TX and logs can only be found after they are finalized
    • LOCAL_MODE: enable this mode when testing with locally running mandala

for example checkout .env.sample:

ENDPOINT_URL=ws://localhost:9944 # default WS port that acala node exposes
SUBQL_URL=http://localhost:3001  # default http port that subquery exposes (default is undefined in RPC adaptor if we don't specify SUBQL_URL explicitly)
HTTP_PORT=8545                   # default http port for ETH RPC methods
WS_PORT=3331                    
MAX_CACHE_SIZE=200               
SAFE_MODE=0                      # disabled by default
LOCAL_MODE=0                     # disabled by default

Usage

Now that the adaptor service is running and listening to HTTP_PORT, we can send EVM related requests to this port.

For example

### request
GET http://localhost:8545
{
    "jsonrpc": "2.0",
    "method": "eth_chainId",
    "params": [],
    "id": 1
}

### response
{
    "id": 1,
    "jsonrpc": "2.0",
    "result": "0x253"
}

Test

yarn test     # unit tests
yarn test:dev # all tests

Metamask Integration

  • start the RPC server: yarn dev
  • add a custom network on Metamask:
    • Network Name: Local Mandala
    • New RPC URL: http://localhost:8545 (should be the same as the HTTP_PORT value in your .env, defaults to 8545)
    • Chain ID: 595
    • Currency Symbol: ACA
  • import dev address:
    • by nmemonic: fox sight canyon orphan hotel grow hedgehog build bless august weather swarm
    • or by private key: 0xa872f6cbd25a0e04a08b1e21098017a9e6194d101d75e13111f71410c59cd57f
  • before sending any transaction:
    • don't change the default GasLimit and Max Fee
    • can change Max Priority Fee, manually setting this a small value (such as 0.000001) will significanlty lower the tx gas cost.