Skip to main content

Connect to the JSON-RPC node proxy

This tutorial walks you through connecting to the JSON-RPC node proxy and signing an Ethereum transaction using Quorum Key Manager (QKM) as remote and secure storage for your wallets.

Prerequisites

Steps

  1. In the QKM manifest file, specify an Ethereum store to allocate your Ethereum wallets, and the RPC node to proxy your calls using QKM.

    Example manifest file
    - kind: Vault
    type: azure
    name: akv-europe
    specs:
    keystore: AzureKeys
    specs:
    vaultName: <AZURE-VAULT-ID>
    tenantID: <TENANT-ID>
    clientID: <CLIENT-ID>
    clientSecret: <SECRET>

    - kind: Store
    type: key
    name: akv-keys
    specs:
    vault: akv-europe

    - kind: Store
    type: ethereum
    name: eth-accounts
    specs:
    key_store: akv-keys

    - kind: Node
    name: quorum-node
    specs:
    rpc:
    addr: http://quorum1:8545
    tessera:
    addr: http://tessera1:9080
  2. Start QKM with the manifest file by using the --manifest-path option:

    key-manager run --manifest-path=<PATH-TO-MANIFEST-FILE>
  3. Create an Ethereum account:

    curl -X POST 'http://localhost:8080/stores/eth-accounts/ethereum'
  4. Sign a transaction using the Ethereum account and the RPC node proxy:

    curl -H "Content-Type: application/json" -X POST --data '{"jsonrpc":"2.0","method":"eth_sendTransaction","params":[{"from": "0xd8c88f28748367a11d3c6fc010eef7b670ac016f","to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567", "data":"0xafed"}], "id":1}' http://localhost:8080/nodes/quorum-node
  5. Fetch the transaction receipt using the RPC node proxy:

    curl -H "Content-Type: application/json" -X POST --data '{"jsonrpc":"2.0","method":"eth_getTransactionReceipt","params":["0x8c961ba2c3f51f9088e1a12a81bb1ad9c551ccfad75615f39e4fc95c3bb7086b"],"id":1}' http://localhost:8080/nodes/quorum-node