- OpenEthereum
- Setup OpenEthereum
- Beginner Introduction
- Frequently Asked Questions
- Usage and Config
- Technical Documentation
- Pluggable Consensus
- Aura - Authority Round
- Proof-of-Authority Chains
- Demo PoA-Tutorial
- Private Development Chain
- Transaction Queue
- Warp Sync (par)
- Warp Sync Snapshot Format
- Code flow
- Secret Store
- Permissioning
- WebAssembly (Deprecated)
- JSON RPC API
文章来源于网络收集而来,版权归原创者所有,如有侵权请及时联系!
The signer Module
JSON-RPC methods
- signer_confirmRequest
- signer_confirmRequestRaw
- signer_confirmRequestWithToken
- signer_generateAuthorizationToken
- signer_generateWebProxyAccessToken
- signer_rejectRequest
- signer_requestsToConfirm
- signer_subscribePending
- signer_unsubscribePending
JSON-RPC API Reference
signer_confirmRequest
Confirm a request in the signer queue
Parameters
Quantity
- The request id.Object
- Modify the transaction before confirmation.gasPrice
:Quantity
- (optional) Modify the gas price provided by the sender in Wei.gas
:Quantity
- (optional) Gas provided by the sender in Wei.condition
:Object
- (optional) Condition for scheduled transaction. Can be either an integer block number{ block: 1 }
or UTC timestamp (in seconds){ timestamp: 1491290692 }
.
String
- The account password
params: [
"0x1", // 1
{},
"hunter2"
]
Returns
Object
- The status of the confirmation, depending on the request type.
Example
Request
curl --data '{"method":"signer_confirmRequest","params":["0x1",{},"hunter2"],"id":1,"jsonrpc":"2.0"}' -H "Content-Type: application/json" -X POST localhost:8545
Response
{
"id": 1,
"jsonrpc": "2.0",
"result": {}
}
signer_confirmRequestRaw
Confirm a request in the signer queue providing signed request.
Parameters
Quantity
- Integer - The request idData
- Signed request (RLP encoded transaction)
params: [
"0x1", // 1
"0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"
]
Returns
Object
- The status of the confirmation, depending on the request type.
Example
Request
curl --data '{"method":"signer_confirmRequestRaw","params":["0x1","0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"],"id":1,"jsonrpc":"2.0"}' -H "Content-Type: application/json" -X POST localhost:8545
Response
{
"id": 1,
"jsonrpc": "2.0",
"result": {}
}
signer_confirmRequestWithToken
Confirm specific request with rolling token.
Parameters
Quantity
- The request id.Object
- Modify the transaction before confirmation.gasPrice
:Quantity
- (optional) Modify the gas price provided by the sender in Wei.gas
:Quantity
- (optional) Gas provided by the sender in Wei.condition
:Object
- (optional) Conditional submission of the transaction. Can be either an integer block number{ block: 1 }
or UTC timestamp (in seconds){ time: 1491290692 }
ornull
.
String
- Password (initially) or a token returned by the previous call.
params: [
"0x1", // 1
{},
"hunter2"
]
Returns
Object
- Status.result
:Object
- The status of the confirmation, depending on the request type.token
:String
- Token used to authenticate the next request.
Example
Request
curl --data '{"method":"signer_confirmRequestWithToken","params":["0x1",{},"hunter2"],"id":1,"jsonrpc":"2.0"}' -H "Content-Type: application/json" -X POST localhost:8545
Response
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"result": { ... },
"token": "cAF2w5LE7XUZ3v3N"
}
}
signer_generateAuthorizationToken
Generates a new authorization token.
Parameters
None
Returns
String
- The new authorization token.
Example
Request
curl --data '{"method":"signer_generateAuthorizationToken","params":[],"id":1,"jsonrpc":"2.0"}' -H "Content-Type: application/json" -X POST localhost:8545
Response
{
"id": 1,
"jsonrpc": "2.0",
"result": "bNGY-iIPB-j7zK-RSYZ"
}
signer_generateWebProxyAccessToken
Generates a new web proxy access token.
Parameters
String
- Domain for which the token is valid. Only requests to this domain will be allowed.
params: ["https://parity.io"]
Returns
String
- The new web proxy access token.
Example
Request
curl --data '{"method":"signer_generateWebProxyAccessToken","params":["https://parity.io"],"id":1,"jsonrpc":"2.0"}' -H "Content-Type: application/json" -X POST localhost:8545
Response
{
"id": 1,
"jsonrpc": "2.0",
"result": "MOWm0tEJjwthDiTU"
}
signer_rejectRequest
Rejects a request in the signer queue
Parameters
Quantity
- Integer - The request id
params: [
"0x1" // 1
]
Returns
Boolean
- The status of the rejection
Example
Request
curl --data '{"method":"signer_rejectRequest","params":["0x1"],"id":1,"jsonrpc":"2.0"}' -H "Content-Type: application/json" -X POST localhost:8545
Response
{
"id": 1,
"jsonrpc": "2.0",
"result": true
}
signer_requestsToConfirm
Returns a list of the transactions awaiting authorization.
Parameters
None
Returns
Array
- A list of the outstanding transactions.
Example
Request
curl --data '{"method":"signer_requestsToConfirm","params":[],"id":1,"jsonrpc":"2.0"}' -H "Content-Type: application/json" -X POST localhost:8545
Response
{
"id": 1,
"jsonrpc": "2.0",
"result": [ ... ]
}
signer_subscribePending
Starts a subscription for transactions in the confirmation queue.
Each event contains all transactions currently in the queue.
An example notification received by subscribing to this event:
```
{"jsonrpc":"2.0","method":"signer_pending","params":{"subscription":"0x416d77337e24399d","result":[]}}
```
You can unsubscribe using `signer_unsubscribePending` RPC method. Subscriptions are also tied to a transport
connection, disconnecting causes all subscriptions to be canceled.
Parameters
None
Returns
String
- Assigned subscription ID
Example
Request
wscat -c localhost:8546
>{"method":"signer_subscribePending","params":[],"id":1,"jsonrpc":"2.0"}
Response
{
"id": 1,
"jsonrpc": "2.0",
"result": "0x416d77337e24399d"
}
signer_unsubscribePending
Unsubscribes from pending transactions subscription.
Parameters
String
- Subscription ID
params: ["0x416d77337e24399d"]
Returns
Boolean
- whether the call was successful
Example
Request
wscat -c localhost:8546
>{"method":"signer_unsubscribePending","params":["0x416d77337e24399d"],"id":1,"jsonrpc":"2.0"}
Response
{
"id": 1,
"jsonrpc": "2.0",
"result": true
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论