matter-labs-archive / PlasmaManager

Manages interaction with a block producer and the smart-contract
2 stars 4 forks source link

Getting block fails #3

Open techraed opened 5 years ago

techraed commented 5 years ago

System discription: Microsoft Windows 10 version: 10.0.17134 Н/Д построение 17134 sys model: G550JK sys type: x64-based PC BIOS: American Megatrends Inc. G550JK.203, 20.03.2014 C:\WINDOWS C:\WINDOWS\system32 boot device: \Device\HarddiskVolume1 Paging file location: C:\pagefile.sys

Tried:

const storage = require('./blockstorage/digitalOceanStorage');
async function main() {
    return await storage.getBlock(1);
}
main()

Returns

throw new Error('Invalid endpoint: ' + endpoint); ^

Error: Invalid endpoint: undefined at new Endpoint (C:\Users\Сабаун\Documents\PlasmaManager-master\node_modules\aws-sdk\lib\http.js:47:13) at Object. (C:\Users\Сабаун\Documents\PlasmaManager-master\blockstorage\digitalOceanStorage.js:3:34) at Module._compile (internal/modules/cjs/loader.js:654:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:665:10) at Module.load (internal/modules/cjs/loader.js:566:32) at tryModuleLoad (internal/modules/cjs/loader.js:506:12) at Function.Module._load (internal/modules/cjs/loader.js:498:3) at Module.require (internal/modules/cjs/loader.js:598:17) at require (internal/modules/cjs/helpers.js:11:18) at Object. (C:\Users\Сабаун\Documents\PlasmaManager-master\ttt.js:21:17)

Should be: A serialized form of the block. Available on: https://plasma-testnet.ams3.digitaloceanspaces.com/plasma/1 I do understant that I should make a request using this method. So it's like a back for API interactions. But as I saw in tests directory, there aren't any calls with defined endpoint, therefore I tried that upper script.

So, how should I deal with this method? What are the ways of using it.

techraed commented 5 years ago

I should add that we can use httpRequest methods to get the binary from https://plasma-testnet.ams3.digitaloceanspaces.com/plasma/1 and do with it whatever you want (parse it, rationally), but storage.getblock(blockNum) seems like more important way to the project.