Act

blockchaincryptomoney/bitcoins

  • Builds
  • latest 0.0.2 / 2017-10-13
  • Created 2017-10-13
  • Last modified 2017-10-13
  • grade 3

Description

Where is the Blockchain stored on my hard drive? Stored in the public blockchain (held on every computer running the Bitcoin client) is the record of every transaction ever made, including any transactions that sent you coins. How does the Blockchain work? The transactions are collected in blocks, which are found approximately every ten minutes in a random process called mining. As transactions transfer ownership of Bitcoin balances, each of these blocks represents an update of the user's balances on the network. the blockchain is a log of all transactions that were ever verified on the Bitcoin network. The transactions are collected in blocks, which are found approximately every ten minutes in a random process called mining. As transactions transfer ownership of Bitcoin balances, each of these blocks represents an update of the user's balances on the network. By following the blockchain from the Genesis Block and applying all transactions that were validated in each block in the correct order, you arrive at the current status quo.


API

To run the act, send a HTTP POST request to:

https://api.apify.com/v2/acts/blockchaincryptomoney~bitcoins/runs?token=<YOUR_API_TOKEN>

The POST payload will be passed as input for the act. For more information, read the docs.


Example input

Content type: application/json; charset=utf-8

{ "Bitcoins": 5600 }

Source code

Based on the apify/actor-node-basic Docker image (see docs).

const Apify = require('apify');
const request = require('request-promise');

Apify.main(async () => {
    // Get input of your act
    const input = await Apify.getValue('INPUT');
    console.log('My input:');
    console.dir(input);

    // Do something useful here
    const html = await request('http://www.example.com');

    // And then save output
    const output = {
        html,
        crawledAt: new Date(),
    };
    console.log('My output:');
    console.dir(output);
    await Apify.setValue('OUTPUT', output);
});