mirror of
https://github.com/status-im/nimbus-eth2.git
synced 2025-01-23 04:50:59 +00:00
Simple RPC for modifying the Graffiti bytes
This commit is contained in:
parent
74732a23fe
commit
1af07ad124
@ -1,6 +1,10 @@
|
||||
TBD
|
||||
==================
|
||||
|
||||
**New features:**
|
||||
|
||||
* Added the `setGraffiti` RPC (POST /api/nimbus/v1/graffiti in the REST API)
|
||||
|
||||
**Breaking changes:**
|
||||
|
||||
* Renamed some semi-internal debug rpc to be more explicit about their nature:
|
||||
|
@ -87,6 +87,10 @@ proc installNimbusApiHandlers*(rpcServer: RpcServer, node: BeaconNode) {.
|
||||
updateLogLevel(level)
|
||||
return true
|
||||
|
||||
rpcServer.rpc("setGraffiti") do (graffiti: string) -> bool:
|
||||
node.graffitiBytes = GraffitiBytes.init(graffiti)
|
||||
return true
|
||||
|
||||
rpcServer.rpc("getEth1Chain") do () -> seq[Eth1Block]:
|
||||
result = if node.eth1Monitor != nil:
|
||||
mapIt(node.eth1Monitor.blocks, it)
|
||||
@ -154,7 +158,6 @@ proc installNimbusApiHandlers*(rpcServer: RpcServer, node: BeaconNode) {.
|
||||
for peer in v:
|
||||
peers.add(peer.toNode(backOff.getOrDefault(peer.peerId)))
|
||||
|
||||
|
||||
gossipsub.add(topic, peers)
|
||||
|
||||
res.add("gossipsub", gossipsub)
|
||||
|
@ -333,6 +333,15 @@ Set the current logging level dynamically: TRACE, DEBUG, INFO, NOTICE, WARN, ERR
|
||||
curl -d '{"jsonrpc":"2.0","id":"id","method":"setLogLevel","params":["DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none"] }' -H 'Content-Type: application/json' localhost:9190 -s | jq
|
||||
```
|
||||
|
||||
### setGraffiti
|
||||
|
||||
Set the graffiti bytes that will be included in proposed blocks. The graffiti bytes can be
|
||||
specified as an UTF-8 encoded string or as an 0x-prefixed hex string specifying raw bytes.
|
||||
|
||||
```
|
||||
curl -d '{"jsonrpc":"2.0","id":"id","method":"setGraffiti","params":["Mr F was here"] }' -H 'Content-Type: application/json' localhost:9190 -s | jq
|
||||
```
|
||||
|
||||
### getEth1Chain
|
||||
|
||||
Get the list of Eth1 blocks that the beacon node is currently storing in memory.
|
||||
|
Loading…
x
Reference in New Issue
Block a user