lotus/api
Fridrik Asmundsson f358160cd5 Add EIP-1898 support needed for The Graph compatibility
Fixes: #10814

This PR updates the following RPC methods according to EIP-1898
specs.

The following RPC methods are affected:

- eth_getBalance
- eth_getStorageAt
- eth_getTransactionCount
- eth_getCode
- eth_call

Note that eth_getBlockByNumber was not included in this list in
the spec although it seems it should be affected also?

Currently these methods all accept a blkParam string which can be
one of "latest", "earliest", "pending", or a block number (decimal
or hex). The spec enables caller to additionally specify a json
hash which can include the following fields:

- blockNumber EthUint64: A block number (decimal or hex) which is
  similar to the original use of the blkParam string
- blockHash EthHash: The block hash
- requireCanonical bool) If true we should make sure the block is
  in the canonical chain

Since the blkParam needs to support both being a number/string and
a json hash then this to properly work we need to introduce a new
struct with pointer fields to check if they exist. This is done
in the EthBlockParamByNumberOrHash struct which first tries to
unmarshal as a json hash (according to eip-1898) and then fallback
to unmarshal as string/number.
2023-06-20 09:38:00 +00:00
..
client gateway: eth_subscribe support 2023-01-31 10:28:12 +01:00
docgen Add EIP-1898 support needed for The Graph compatibility 2023-06-20 09:38:00 +00:00
docgen-openrpc chore: fix imports 2022-06-14 17:00:51 +02:00
mocks Add EIP-1898 support needed for The Graph compatibility 2023-06-20 09:38:00 +00:00
types feat: gateway: eth_ api support 2023-01-13 20:04:41 +01:00
v0api Merge branch 'more-methods' of github.com:protofire/lotus into protofire-more-methods 2023-05-30 17:01:52 +02:00
v1api Add uuid to mpool message sent to chain node from miner 2022-08-16 15:39:06 -04:00
api_common.go feat: Add node uptime rpc / output in info command 2022-10-11 10:11:09 +02:00
api_errors.go fix: itest: check for closed connection 2022-09-27 15:34:01 +00:00
api_full.go Add EIP-1898 support needed for The Graph compatibility 2023-06-20 09:38:00 +00:00
api_gateway.go Add EIP-1898 support needed for The Graph compatibility 2023-06-20 09:38:00 +00:00
api_net.go return all the public addresses in NatInfo 2023-05-10 11:54:48 +03:00
api_storage.go Add API and CLI to unseal sector (#10626) 2023-04-17 12:12:15 -04:00
api_test.go address magik supernit 2022-09-27 15:34:01 +00:00
api_wallet.go lotus-wallet: Support permissioned api 2021-05-31 13:56:35 +02:00
api_worker.go sealing: Split unsealed cleanup from Finalize 2022-11-23 18:57:16 +01:00
cbor_gen.go deprecate MarketListRetrievalDeals, make gen 2023-03-08 17:15:16 +01:00
checkstatuscode_string.go implement MessagePool.CheckMessages 2021-05-07 15:30:04 +02:00
eth_aliases.go feat: Add eth_syncing RPC method 2023-05-10 16:08:18 -04:00
miner_subsystems.go fix docs and nits. 2021-07-28 20:03:25 +01:00
permissioned.go api: Separate the Net interface from Common 2021-07-15 11:41:30 +02:00
proxy_gen.go Add EIP-1898 support needed for The Graph compatibility 2023-06-20 09:38:00 +00:00
proxy_util_test.go fix make gen 2022-08-29 16:25:30 +02:00
proxy_util.go api: Separate the Net interface from Common 2021-07-15 11:41:30 +02:00
README.md api: Add basic package readme 2021-03-25 18:00:29 +01:00
types.go opt: MinerInfo adds the PendingOwnerAddress field 2023-05-30 13:04:11 +08:00
utils.go Update to specs v0.9.6 2020-09-07 15:48:41 -04:00
version.go Unbump api version as its not necessary 2023-03-06 08:37:28 -07:00
wrap.go api: Fix Wrap for nested proxy structs 2021-06-28 19:00:37 +02:00

Lotus API

This package contains all lotus API definitions. Interfaces defined here are exposed as JsonRPC 2.0 endpoints by lotus programs.

Versions

File Alias File Interface Exposed by Version HTTP Endpoint Status Docs
api_common.go v0api/latest.go Common lotus; lotus-miner v0 /rpc/v0 Latest, Stable Methods
api_full.go v1api/latest.go FullNode lotus v1 /rpc/v1 Latest, Work in progress Methods
api_storage.go v0api/latest.go StorageMiner lotus-miner v0 /rpc/v0 Latest, Stable Methods
api_worker.go v0api/latest.go Worker lotus-worker v0 /rpc/v0 Latest, Stable Methods
v0api/full.go FullNode lotus v0 /rpc/v0 Stable Methods