Complete the exercise in index.js
in the folder Lab-DataRange-Exercise
by adding code and values as necessary.
The index.js
file contains Lumos code to deploy, create, and consume cells using the DataCap type script. Your task is to modify the functionality of this code to use the DataRange type script.
- Change the binary that is used from
datacap
todatarange
.- Note: The datarange binary has already been compiled and provided. Do not change this binary or it may cause the lab to fail.
- Update the
createCells()
function.- Create three cells that use the default lock with
address1
, and thedatarange
type script. - Each of these three cells should contain the following data size restrictions, in this specific order: (0, 10), (3, 12), (128, 256). These size pairs represent the minimum and maximum, respectively.
- Each of these three cells should contain any data of your choosing, that matches the given size ranges.
- Each one of these cells should contain only the minimum capacity necessary to hold the cell data.
- Create three cells that use the default lock with
- Update the
consumeCells()
function to consume the three cells that were created.- Hint: Modify the
CellCollector()
part of the code to locate the proper cells to add.
- Hint: Modify the
Run your code by opening a terminal to the Lab-DataRange-Exercise
folder and running node index.js
. If you get stuck you can find the solution in the Lab-DataRange-Solution
folder.
Once your code successfully executes, the resulting transaction ID will be printed on the screen.