<p>If you use Nix or NixOs, it is rather straightforward: <a href="https://docs.cardano.org/projects/cardano-node/en/latest/getting-started/building-the-node-using-nix.html" rel="noreferrer">Build the code for a cardano node using nix</a> (link to current documentation)</p>
<p>Duplicating the official documentation:</p>
<pre><code>git clone https://github.com/input-output-hk/cardano-node
cd cardano-node
nix-build -A scripts.mainnet.node -o mainnet-node-local
./mainnet-node-local
</code></pre>
<p>This will run a cardano node on the mainnet.</p>
<p>Then you can also build and use the CLI tool to interact with the cardano network.</p>
<hr>
<p>In the provided solution above, if you don't want to compile GHC which can take a long time, IOHK provides many binaries that are pre-compiled for you: lots of time gained ! So don't hesitate to use their nix binary cache</p>
<p>In NixOS, I currently set it this way:</p>
<pre><code># configuration.nix
{ config, pkgs, ... }:
{
  # ... all the rest of the configuration of the server

  # iohk binary caches
  nix = 
  {
    binaryCaches          = [ &quot;https://hydra.iohk.io&quot; &quot;https://iohk.cachix.org&quot; ];
    binaryCachePublicKeys = [ &quot;hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=&quot; &quot;iohk.cachix.org-1:DpRUyj7h7V830dp/i6Nti+NEO2/nhblbov/8MW7Rqoo=&quot; ];
  };
}
</code></pre>

CC BY-SA 4.0
2021-04-27T19:58:12.090Z
Running this command "./mainnet-node-local" will download the whole blockchain or not?
vs4vijay
CC BY-SA 4.0
2021-04-29T08:10:41.517Z
@vs4vijay when running this command, it creates a folder `state-node-mainnet/db-mainnet` which size increases overtime. I'm fairly confindent it is the state of the blockchain
Stephane Rolland
CC BY-SA 4.0
2021-04-30T04:03:28.987Z
This will get even nicer soon. It should become as simple as `nix run github:input-output-hk/cardano-node/1.28.0#something`. without even having to clone the repo locally. something isn't quite defined yet, but will be similar to the path building the script above.
Samuel Leathers
CC BY-SA 4.0
2021-04-27T15:20:24.987Z
2021-04-28T15:47:10.087Z
2021-04-28T15:47:10.087Z
Stephane Rolland
<p>Generally, there are several options you could pursue.</p>
<ul>
<li>Start a stake pool on test-net and then launch one on main-net.
<a href="https://www.coincashew.com/coins/overview-ada/guide-how-to-build-a-haskell-stakepool-node" rel="noreferrer">How to build a Cardano Stake Pool.</a></li>
<li>Get involved with project catalyst. Offer feedback and input to projects that interest you. Try to get involved with a team that has promising ideas. Offer your services where you can fit in.
<a href="https://cardano.ideascale.com/" rel="noreferrer">Project Catalyst Ideascale.</a></li>
<li>Try building smart contracts using Marlowe. <a href="https://alpha.marlowe.iohkdev.io/#/" rel="noreferrer">Marlowe Playground.</a></li>
<li>Mint your own native token on Cardano. <a href="https://cardano-ledger.readthedocs.io/en/latest/explanations/faq.html" rel="noreferrer">FAQ : Native Tokens (Cardano’s Multi-Asset Support Feature)</a></li>
<li>Follow along with the videos for the Plutus Pioneers Program and learn to write smart contracts in Cardano's on chain programming language. <a href="https://youtube.com/playlist?list=PLK8ah7DzglhhJzuiz7X33UCHSTYPB-8Jt" rel="noreferrer">Plutus Pioneers Program on YouTube</a></li>
<li>Figure out how to mint some NFTs...</li>
<li>Integration with Atala Prism for identity and certification. <a href="https://atalaprism.io/app" rel="noreferrer">Atala PRISM</a></li>
</ul>
<p>I'm sure there are lots of other possibilities that I haven't heard of or considered. There is no shortage of room to explore for a developer.</p>

CC BY-SA 4.0
2021-04-29T02:41:02.377Z
2021-04-30T14:16:48.800Z
2021-04-30T14:16:48.800Z
OakAndClay
<p>There are also ways to use services where you can make API requests to interact with the Cardano blockchain. (without the need to run your own cardano-node)</p>
<p>You could for example <a href="https://blockfrost.io/auth/signin" rel="noreferrer">sign in on Blockfrost</a> with your GitHub account. No registration required. Enter a project name and select Cardano mainnet or Cardano testnet, depending on your needs.</p>
<p>After generating your <code>API KEY</code> you can send your first request to get data for example about the latest epoch:</p>
<p><code>curl -H 'project_id: 1234567890' https://cardano-mainnet.blockfrost.io/api/v0/epochs/latest</code></p>
<p>And you will get a response in JSON format similar to this:</p>
<p><code>{ &quot;epoch&quot;: 225,   &quot;start_time&quot;: 1603403091, &quot;end_time&quot;: 1603835086, &quot;first_block_time&quot;: 1603403092, &quot;last_block_time&quot;: 1603835084, &quot;block_count&quot;: 21298, &quot;tx_count&quot;: 17856, &quot;output&quot;: &quot;7849943934049314&quot;, &quot;fees&quot;: &quot;4203312194&quot;, &quot;active_stake&quot;: &quot;784953934049314&quot; }</code></p>
<p>Visit <a href="https://docs.blockfrost.io" rel="noreferrer">docs.blockfrost.io</a> to see the complete API documentation.</p>

CC BY-SA 4.0
2021-04-28T09:48:46.113Z
2021-04-28T09:48:46.113Z
adatainment
<p>As a developer building an application, what are different way to access the Cardano network?</p>

<api><mainnet><testnet>
How can a developer access the Cardano network?
# How can a developer access the Cardano network?

(Asked by: username_0 on 2021-04-27)

As a developer building an application, what are different way to access the Cardano network?

**Tags:** api, mainnet, testnet

---

## 3 answers

### Answer by username_5 on 2021-04-28. Score: 13 | Accepted answer

There are also ways to use services where you can make API requests to interact with the Cardano blockchain. (without the need to run your own cardano-node)

You could for example [sign in on Blockfrost](https://blockfrost.io/auth/signin) with your GitHub account. No registration required. Enter a project name and select Cardano mainnet or Cardano testnet, depending on your needs.

After generating your `API KEY` you can send your first request to get data for example about the latest epoch:

`curl -H 'project_id: 1234567890' https://cardano-mainnet.blockfrost.io/api/v0/epochs/latest`

And you will get a response in JSON format similar to this:

`{ "epoch": 225, "start_time": 1603403091, "end_time": 1603835086, "first_block_time": 1603403092, "last_block_time": 1603835084, "block_count": 21298, "tx_count": 17856, "output": "7849943934049314", "fees": "4203312194", "active_stake": "784953934049314" }`

Visit [docs.blockfrost.io](https://docs.blockfrost.io) to see the complete API documentation.


---

### Answer by username_1 on 2021-04-27. Score: 22

If you use Nix or NixOs, it is rather straightforward: Build the code for a cardano node using nix (link to current documentation)
Duplicating the official documentation:
git clone https://github.com/input-output-hk/cardano-node
cd cardano-node
nix-build -A scripts.mainnet.node -o mainnet-node-local
./mainnet-node-local

This will run a cardano node on the mainnet.
Then you can also build and use the CLI tool to interact with the cardano network.

In the provided solution above, if you don't want to compile GHC which can take a long time, IOHK provides many binaries that are pre-compiled for you: lots of time gained ! So don't hesitate to use their nix binary cache
In NixOS, I currently set it this way:
# configuration.nix
{ config, pkgs, ... }:
{
  # ... all the rest of the configuration of the server

  # iohk binary caches
  nix = 
  {
    binaryCaches          = [ "https://hydra.iohk.io" "https://iohk.cachix.org" ];
    binaryCachePublicKeys = [ "hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=" "iohk.cachix.org-1:DpRUyj7h7V830dp/i6Nti+NEO2/nhblbov/8MW7Rqoo=" ];
  };
}

> **Comments:**
> **username_2**: Running this command "./mainnet-node-local" will download the whole blockchain or not?  
> **username_1**: @vs4vijay when running this command, it creates a folder `state-node-mainnet/db-mainnet` which size increases overtime. I'm fairly confindent it is the state of the blockchain  
> **username_3**: This will get even nicer soon. It should become as simple as `nix run github:input-output-hk/cardano-node/1.28.0#something`. without even having to clone the repo locally. something isn't quite defined yet, but will be similar to the path building the script above.  

---

### Answer by username_4 on 2021-04-29. Score: 10

Generally, there are several options you could pursue.

* Start a stake pool on test-net and then launch one on main-net.
  [How to build a Cardano Stake Pool.](https://www.coincashew.com/coins/overview-ada/guide-how-to-build-a-haskell-stakepool-node)
* Get involved with project catalyst. Offer feedback and input to projects that interest you. Try to get involved with a team that has promising ideas. Offer your services where you can fit in.
  [Project Catalyst Ideascale.](https://cardano.ideascale.com/)
* Try building smart contracts using Marlowe. [Marlowe Playground.](https://alpha.marlowe.iohkdev.io/#/)
* Mint your own native token on Cardano. [FAQ : Native Tokens (Cardano’s Multi-Asset Support Feature)](https://cardano-ledger.readthedocs.io/en/latest/explanations/faq.html)
* Follow along with the videos for the Plutus Pioneers Program and learn to write smart contracts in Cardano's on chain programming language. [Plutus Pioneers Program on YouTube](https://youtube.com/playlist?list=PLK8ah7DzglhhJzuiz7X33UCHSTYPB-8Jt)
* Figure out how to mint some NFTs...
* Integration with Atala Prism for identity and certification. [Atala PRISM](https://atalaprism.io/app)

I'm sure there are lots of other possibilities that I haven't heard of or considered. There is no shortage of room to explore for a developer.


---

