{"activeVersionTag":"latest","latestAvailableVersionTag":"latest","collection":{"info":{"_postman_id":"3660f864-77ce-47e8-946d-ece65a93ce26","name":"Roller RPC-API","description":"# Introduction\n\nThe Roller is a hoon app which accepts L2 transactions and sends them as a batch from time to time to an Ethereum node. It has a public RPC-API, where anybody (or a whitelist, or other access control mechanism) can submit L2 transactions, together with other RPCs to read information out of the Roller, such as retrieving all the L2 transactions that belong to a specific Ethereum address.\n\nAll RPCs that deal with L2 transactions should have four parameters: sig, from, data, and address.\n```\n{ \"sig\": \"0x1234abcd\",         // Signed message\n  \"from\": {\n    \"ship\": \"~marzod\",         // Ship that signs the L2 Tx (also correct like \"ship\": 256)\n    \"proxy\": \"own\"             // Type of proxy\n   },\n   \"data\": {                   // Specific for each L2 Tx\n     \"address\": \"0x1234abcd\",\n     \"ship\": \"~norsyr-torryn\"\n   },\n   \"address\": \"0x1234abcd\"     // Signing address\n}\n```\n`from` is the ship, and its corresponding ethereum address type that issues the L2 transaction.\n\n(Note: all ship arguments in from or data can be also encoded as numbers, e.g: `\"ship\": 256`)\n\n`address` is the Ethereum signing address\n\n`sig` is a signed message, using the ECDSA algorithm. The message is hashed with Keccak256 and follows the format: `\\19Ethereum Signed Message:\\0a + len + 'UrbitIDV1Chain' + chain-id + nonce + raw` where:\n\n- `len` is the length in bytes of 'UrbitIDV1Chain' + chain-id + nonce + raw`\n- `chain-id` is a number for the ethereum network used (mainnet=1 ropsten=3 local=1337)\n- `nonce` is a number that is retrieved from the data received upon logging in on Bridge, using the type of proxy-address the user logs into (could be %own, %spawn, %manage, %vote, and %transfer)—see get-point for more information of the type of data sent to Bridge.\n\n- `raw` is the serialized L2 transaction (that can be obtained by calling the RPC `hashTransaction`)\n\nFor example, setting ~ravnum-mitbus spawn proxy to 0xb026b0aa6e686f2386051b31a03e5fb95513e1c using the ownership proxy address would look like this in pseudocode:\n\n```\n::  setSpawnProxy(from, proxy, address, ship)\n::\nsetSpawnProxy('~ravnum-mitbus', 'own', '0xb026b0aa6e686f2386051b31a03e5fb95513e1, '~ravnum-mitbus')\n``` \n\nwould be encoded as: `0xb026b0aa6e686f2386051b31a03e5fb95513e1c092d301b60992d301b600`\n\n```\n::  (0xtx-data.opcode.from-ship.from-proxy)\n0x\nb026b0aa6e686f2386051b31a03e5fb95513e1c  :: proxy address\n092d301b6                                :: for ~ravmun-mitbus (2463302070 hex encoded)\n09                                       :: using opcode 9 (set-spawn-proxy)\n92d301b6                                 :: from ~ravmun-mitbus (2463302070 hex encoded) \n00                                       :: ownership proxy\n```\nThe opcodes are:\n\n- 00: transfer-point\n- 01: spawn\n- 02: configure-keys\n- 03: escape\n- 04: cancel-escape\n- 05: adopt\n- 06: reject\n- 07: detach\n- 08: set-management-proxy\n- 09: set-spawn-proxy\n- 10: set-transfer-proxy\n\nThe proxies are:\n\n- 00: own\n- 01: spawn\n- 02: manage\n- 03: vote\n- 04: transfer\n\n# Overview\nCurrently, the API will return a successful response if the arguments parse correctly. The transaction itself could fail due to other reasons related to the state of the Roller, therefore it's advised to use polling for getting the updated status of the submitted transactions.\n\nThe submitted L2 transactions are accumulated in a queue, and every five minutes, applied to the Roller state to validate if they are still valid. Non valid transactions will be dropped from the queue, and its state updated to \"failed\", so clients can be notified when requesting information for the transaction.\n\n# Authentication\nCurrently the Roller RPC-API does not require authentication\n\n# Error Codes\nCurrently supported error codes:\n\n- `[%error id '-32700' 'Failed to parsed']`\n- `[%error id '-32600' 'Invalid Request']`\n- `[%error id '-32601' 'Method not found']`\n- `[%error id '-32602' 'Invalid params']`\n- `[%error id '-32603' 'Internal error']`\n- `[%error id '-32000' 'Resource not found']`\n- `[%error id '-32001' 'Method not implemented']`\n\n# Rate limit\nCurrently there are no rate limits\n\n# Development Urbit backend\n\nIn order to set up a development ship, you need to clone from [naive/aggregator](https://github.com/urbit/urbit/tree/naive/roller)—this branch holds the latest version of the Roller RPC-API. The urbit binary needs to be built using the code from this branch (see [here](https://github.com/urbit/urbit/blob/master/README.md) some instructions) \n\nYou can start a fake zod from the cloned repo like this:\n```\n> urbit -F zod -A ./pkg/arvo -B ./bin/solid.pill -c zod\n```\n\nWhile the fakezod is booting up, you can set up a Ganache node to run a local Ethereum chain.\n\nFirst, to install ganache globally run : `npm install -g ganache-cli`\n\nTo start:\n\n```\nganache-cli --host '0.0.0.0' -m 'benefit crew supreme gesture quantum web media hazard theory mercy wing kitten'\n```\n\nThis will populate the following accounts with 100 ETH\n\n```\n(0) 0x6DEfFb0caFDB11D175F123F6891AA64F01c24F7d (100 ETH)\n(1) 0xD53208cf45fC9bd7938B200BFf8814A26146688f (100 ETH)\n(2) 0x7b2A2d51E4D8fAC602e20a5F6907ff9fBD88e1fD (100 ETH)\n(3) 0xf48062Ae8BAfD6Ef19CD6cb89db93A0d0ca6ce26 (100 ETH)\n(4) 0xf84a77Aeb351C49dFA87e805A659d2daDdff7606 (100 ETH)\n(5) 0x167e357cf8b845370D0d408F9b389b66185B7B5b (100 ETH)\n(6) 0xCbEcF3ABc9878f07AFC851AEAD2d8f1c436cC71D (100 ETH)\n(7) 0x0AFC0C3f4eeeA500871f464ca71EeF5e54a9Af36 (100 ETH)\n(8) 0x6d654EF2489674D21AeD428e8a4ad8CA4820F125 (100 ETH)\n(9) 0x218f6F87683Db546aD47A5dc8B480E5A9b694866 (100 ETH)\n```\n\nWith its corresponding private keys:\n\n```\nPrivate Keys\n==================\n(0) 0xa44de2416ee6beb2f323fab48b432925c9785808d33a6ca6d7ba00b45e9370c3\n(1) 0x420b20f3538f7ddf4527770acbd33ed8aa858ba24eec5038bd22158f23a8a002\n(2) 0x655eae6e301ebe9da6384f717f774f6addb165606a6990ce13e86ead710fff8b\n(3) 0x2480c5256d843c73cba67cc966a11a647c943a41db2fa138de4e4f16d0861a6b\n(4) 0xd6abd8fbab1db8714f1e284c11b8621cf95d0e319b4f38c54de4247f2150f1ba\n(5) 0x95f48754f44e6930473367a0802bdac7389e7749df2b3a6dd6e87bcbe0d0e0bc\n(6) 0x92596e42f9ee7a47e0d8c48291c768945fede98874cc250202a1f19f12c97be3\n(7) 0xa0ae1d77d89854a55a4abdc1300e989b1981728e8e669cfb4b4179f0af1ac389\n(8) 0x7aec9f8027edaa2408ac5ca74b5ed929e271570a0eeed848f47bcee842902c16\n(9) 0x58d62eb79797502bc0f66cd3e7a49d00287bff53a2734b799ef09cb746340ed0\n```\n\nThis is useful for logging in on Bridge, or signing test transactions.\n\nFor deploying Azimuth's L2 contract, you can do it following the same instructions as [Bridge](https://github.com/urbit/bridge/) where a contract [deployment script], instead of running the ganache node manually, (https://github.com/urbit/bridge/blob/roller/migrations/1_migration.js) can be run with `npm run pilot-l2`\n\nThis will instantiate ~zod, ~marzod, ~wicdev-wisryt, ~panret-tocsel, and ~binpen on L1, ~wanzod with spawn-proxy on L2, and ~norsyr-torryn on L2.\n\nAll these points are controlled by `0x6DEfFb0caFDB11D175F123F6891AA64F01c24F7d`.\n\nIf you want to use a separate ganache private chain, you can replace the migration script in the [Azimuth repo](https://github.com/urbit/azimuth/) with the previous deployment script and from the root of the azimuth repo run:\n\n```\n> npm install -g truffle\n> truffle migrate with-state --reset --compile-all\n```\n\nOnce inside the dojo, the first thing is to start retrieving data from the Ethereum node, and populating the Azimuth State with the following command: `> :azimuth|watch 'http://0.0.0.0:8545' %local`\n\nNow we are ready to start the Roller and the RPC-API using:\n\n```\n> |start %roller\n> |start %roller-rpc\n```\n\nNow, there will be an endpoint at `http://localhost:8080/v1/roller` ready to receiving commands.\n\nTo connect the roller to the local ganache node and retrieve the latest nonce, run:\n\n```\n> :roller|endpoint\n> :roller|setkey\n```\n\nOnce the Roller has pending transactions, they will be sent to the node every hour. For manual submission, you can run `:roller|commit`\n\nDEPRECATED\n--------------------\nNote: This only allows for \"read\" commands—sending L2 Tx requires the roller to have a private key to sign transactions. [These generators](https://gist.github.com/yosoyubik/77cefb24ce94363dc027da2645816564) can be used to config the Roller and submit the L2 transactions.\n\nIn order to send signed transactions, a branch that does the signing in the backend has been set up [here](https://github.com/urbit/urbit/tree/naive/fake-txs). The branch assumes that some of the Ethereum addresses created by Ganache will be used, and that the ID of the RPC contains the expected nonce for the transaction. Examples of how this behavior is done can be found in the collections \"L2 Invite Flow A/B\"","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","isPublicCollection":false,"owner":"16338962","team":2092648,"collectionId":"3660f864-77ce-47e8-946d-ece65a93ce26","publishedId":"Tzm3nx7x","public":true,"publicUrl":"https://documenter-api.postman.tech/view/16338962/Tzm3nx7x","privateUrl":"https://go.postman.co/documentation/16338962-3660f864-77ce-47e8-946d-ece65a93ce26","customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"documentationLayout":"classic-double-column","customisation":null,"version":"8.11.4","publishDate":"2021-07-06T07:20:15.000Z","activeVersionTag":"latest","documentationTheme":"light","metaTags":{},"logos":{}},"statusCode":200},"environments":[],"user":{"authenticated":false,"permissions":{"publish":false}},"run":{"button":{"js":"https://run.pstmn.io/button.js","css":"https://run.pstmn.io/button.css"}},"web":"https://www.getpostman.com/","team":{"logo":"https://res.cloudinary.com/postman/image/upload/t_team_logo_pubdoc/v1/team/359bd9f578d7f174ede56aac93a0f5902d88a3384f20938e6418c0bf55d469bf","favicon":""},"isEnvFetchError":false,"languages":"[{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"HttpClient\"},{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"RestSharp\"},{\"key\":\"curl\",\"label\":\"cURL\",\"variant\":\"cURL\"},{\"key\":\"dart\",\"label\":\"Dart\",\"variant\":\"http\"},{\"key\":\"go\",\"label\":\"Go\",\"variant\":\"Native\"},{\"key\":\"http\",\"label\":\"HTTP\",\"variant\":\"HTTP\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"OkHttp\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"Unirest\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"Fetch\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"jQuery\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"XHR\"},{\"key\":\"c\",\"label\":\"C\",\"variant\":\"libcurl\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Axios\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Native\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Request\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Unirest\"},{\"key\":\"objective-c\",\"label\":\"Objective-C\",\"variant\":\"NSURLSession\"},{\"key\":\"ocaml\",\"label\":\"OCaml\",\"variant\":\"Cohttp\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"cURL\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"Guzzle\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"HTTP_Request2\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"pecl_http\"},{\"key\":\"powershell\",\"label\":\"PowerShell\",\"variant\":\"RestMethod\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"http.client\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"Requests\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"httr\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"RCurl\"},{\"key\":\"ruby\",\"label\":\"Ruby\",\"variant\":\"Net::HTTP\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"Httpie\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"wget\"},{\"key\":\"swift\",\"label\":\"Swift\",\"variant\":\"URLSession\"}]","languageSettings":[{"key":"csharp","label":"C#","variant":"HttpClient"},{"key":"csharp","label":"C#","variant":"RestSharp"},{"key":"curl","label":"cURL","variant":"cURL"},{"key":"dart","label":"Dart","variant":"http"},{"key":"go","label":"Go","variant":"Native"},{"key":"http","label":"HTTP","variant":"HTTP"},{"key":"java","label":"Java","variant":"OkHttp"},{"key":"java","label":"Java","variant":"Unirest"},{"key":"javascript","label":"JavaScript","variant":"Fetch"},{"key":"javascript","label":"JavaScript","variant":"jQuery"},{"key":"javascript","label":"JavaScript","variant":"XHR"},{"key":"c","label":"C","variant":"libcurl"},{"key":"nodejs","label":"NodeJs","variant":"Axios"},{"key":"nodejs","label":"NodeJs","variant":"Native"},{"key":"nodejs","label":"NodeJs","variant":"Request"},{"key":"nodejs","label":"NodeJs","variant":"Unirest"},{"key":"objective-c","label":"Objective-C","variant":"NSURLSession"},{"key":"ocaml","label":"OCaml","variant":"Cohttp"},{"key":"php","label":"PHP","variant":"cURL"},{"key":"php","label":"PHP","variant":"Guzzle"},{"key":"php","label":"PHP","variant":"HTTP_Request2"},{"key":"php","label":"PHP","variant":"pecl_http"},{"key":"powershell","label":"PowerShell","variant":"RestMethod"},{"key":"python","label":"Python","variant":"http.client"},{"key":"python","label":"Python","variant":"Requests"},{"key":"r","label":"R","variant":"httr"},{"key":"r","label":"R","variant":"RCurl"},{"key":"ruby","label":"Ruby","variant":"Net::HTTP"},{"key":"shell","label":"Shell","variant":"Httpie"},{"key":"shell","label":"Shell","variant":"wget"},{"key":"swift","label":"Swift","variant":"URLSession"}],"languageOptions":[{"label":"C# - HttpClient","value":"csharp - HttpClient - C#"},{"label":"C# - RestSharp","value":"csharp - RestSharp - C#"},{"label":"cURL - cURL","value":"curl - cURL - cURL"},{"label":"Dart - http","value":"dart - http - Dart"},{"label":"Go - Native","value":"go - Native - Go"},{"label":"HTTP - HTTP","value":"http - HTTP - HTTP"},{"label":"Java - OkHttp","value":"java - OkHttp - Java"},{"label":"Java - Unirest","value":"java - Unirest - Java"},{"label":"JavaScript - Fetch","value":"javascript - Fetch - JavaScript"},{"label":"JavaScript - jQuery","value":"javascript - jQuery - JavaScript"},{"label":"JavaScript - XHR","value":"javascript - XHR - JavaScript"},{"label":"C - libcurl","value":"c - libcurl - C"},{"label":"NodeJs - Axios","value":"nodejs - Axios - NodeJs"},{"label":"NodeJs - Native","value":"nodejs - Native - NodeJs"},{"label":"NodeJs - Request","value":"nodejs - Request - NodeJs"},{"label":"NodeJs - Unirest","value":"nodejs - Unirest - NodeJs"},{"label":"Objective-C - NSURLSession","value":"objective-c - NSURLSession - Objective-C"},{"label":"OCaml - Cohttp","value":"ocaml - Cohttp - OCaml"},{"label":"PHP - cURL","value":"php - cURL - PHP"},{"label":"PHP - Guzzle","value":"php - Guzzle - PHP"},{"label":"PHP - HTTP_Request2","value":"php - HTTP_Request2 - PHP"},{"label":"PHP - pecl_http","value":"php - pecl_http - PHP"},{"label":"PowerShell - RestMethod","value":"powershell - RestMethod - PowerShell"},{"label":"Python - http.client","value":"python - http.client - Python"},{"label":"Python - Requests","value":"python - Requests - Python"},{"label":"R - httr","value":"r - httr - R"},{"label":"R - RCurl","value":"r - RCurl - R"},{"label":"Ruby - Net::HTTP","value":"ruby - Net::HTTP - Ruby"},{"label":"Shell - Httpie","value":"shell - Httpie - Shell"},{"label":"Shell - wget","value":"shell - wget - Shell"},{"label":"Swift - URLSession","value":"swift - URLSession - Swift"}],"layoutOptions":[{"value":"classic-single-column","label":"Single Column"},{"value":"classic-double-column","label":"Double Column"}],"versionOptions":[],"environmentOptions":[{"value":"0","label":"No Environment"}],"canonicalUrl":"https://documenter.gw.postman.com/view/metadata/Tzm3nx7x"}