Use Rockside API

On this getting started guide, you'll get an overview of what Rockside provides, JSON RPC, identities, transactions sending without worrying about gas

1- Interact with Blockchain (JSON-RPC)

Rockside provides a fully compatible JSON-RPC endpoint. You can use it to request blockchain. The list of supported APIs is available in our Ethereum JSON RPC API documentation.

Let's start by getting the last block number.

Linux, osx
Windows
Linux, osx
curl -X POST \
https://api.rockside.io/ethereum/ropsten/jsonrpc \
-d '{"jsonrpc":"2.0","method":"eth_blockNumber", "params":[],"id":1}' \
-H 'Content-Type: application/json' -H 'apikey: YOUR_API_KEY'
Windows
curl -X POST https://api.rockside.io/ethereum/ropsten/jsonrpc -d "{\"jsonrpc\":\"2.0\",\"method\":\"eth_blockNumber\", \"params\":[],\"id\":1}" -H "apikey: YOUR_API_KEY"

Response:

{
"jsonrpc": "2.0",
"result": "0x19732",
"id": 1
}

2- Create an identity

Create an identity, you will use it to send transaction.

Linux, osx
Windows
Linux, osx
curl -X POST \
https://api.rockside.io/ethereum/ropsten/identities \
-H 'Content-Length: 0' \
-H 'Content-Type: application/json' -H 'apikey: YOUR_API_KEY'
Windows
curl -X POST https://api.rockside.io/ethereum/ropsten/identities -H "Content-Length: 0" -H "apikey: YOUR_API_KEY"

Response:

{
"address": "0x297634F1433Ef10162E2986760b7D4880c3F0247"
"transaction_hash":"0xa51fdb4b79c45fbe9bf6df5a822814f6ad47bf9dfad4bb2b59745b2968c1d38e"
}

This is your public blockchain address and the hash of the transaction you can use to follow the deployment of your identity .

3- Send transaction

Send your transaction with Rockside by using our API /ethereum/:network/transaction:

Linux, osx
Windows
Linux, osx
curl -X POST \
https://api.rockside.io/ethereum/ropsten/transaction \
-d '{"from":"YOUR_ADDRESS", "to":"DESTINATION_ADDRESS", "value":"0x0", "data":""}' \
-H 'Content-Type: application/json' -H 'apikey: YOUR_API_KEY'
Windows
curl -X POST https://api.rockside.io/ethereum/ropsten/transaction -d "{\"from\":\"YOUR_ADDRESS\", \"to\":\"DESTINATION_ADDRESS\", \"value\":\"0x0\"}" -H "apikey: YOUR_API_KEY"

Response:

{
"transaction_hash": "0xb317b54b42bcdcc2bcf8ae96e3dc9463142422175dff85ff9e3de211f83ff4a0"
}

You can both use EOA or Identities to send transaction. With identities you don't need to have gas on your account. If "from" address is an Identity managed by Rockside, a meta transaction is created.