EOS Local provides a quick way to setup an EOS local network for development.
The primary benefits of containers are consistency across different environments and deployment ease.
This project works along with a full-stack-boilerplate to help you build your EOS dApp.
Having a local environment provides a series of benefits that you cannot in a public network, for example, with EOS Mainnet locally, transaction costs are avoided since they are carried out in a development environment and not in production, also, they are accessed to system contracts to modify them as appropriate.
In a Blockchain network every transaction creates an immutable record and everything that is modified can affect both positively and negatively the users within it, it is for this reason that it is essential to have an environment premises where functionality tests, performance tests, stress tests, among others, can be carried out without the risk of producing a failure that affects users.
Finally, a factor to consider is the time that is reduced in the initial configuration of any network, this image allows directly, with only two commands to have the network installed and ready to perform functionality tests as necessary.
The EOSIO image is based on the eosio.system
, eosio.token
and eosio.msig
contracts for its configuration. Your code can be found at this link.
- eosio.system: Defines the structures and actions needed for blockchain's core functionality.
- eosio.token: Defines the structures and actions that allow users to create, issue, and manage tokens for EOSIO-based blockchains.
- eosio.msig: Allows the creation of proposed transactions that require authorization from a list of accounts.
As EOS Mainnet Local Network is based on EOSIO protocol, some already smart contract production projects can be deployed on our local network due to the local dev environment setup. Some of them are:
- Eden: Take a look at the smart contract code here.
- simpleassets: A simple standard for digital assets on EOSIO blockchains: Non-Fungible Tokens (NFTs), Fungible Tokens (FTs), and Non-Transferable Tokens (NTTs). Take a look at the smart contract code here.
- atomicassets: AtomicAssets is a Non Fungible Token (NFT) standard for eosio blockchains developed by pink.network. Take a look at the smart contract code here.
- dgoods: dGoods is an open source and free standard for handling the virtual representation of items, both digital and physical, on the EOS blockchain led by Mythical Games. Take a look at the smart contract code here.
The preconfigured key to setup our genesis node is passed throw Dockerfile using the --build-arg option, so make sure to create a start key and save it to continue using the local dev environment with full access.
To create a key, you can use cleos create key --to-console
or cleos create key --file <file_name>.key
depending on your preference:
Private key: 5Jkvw1DbsGx7W8vSnrHtXSYxM9bfKoJvwEnH51KJYQGv6D5LZyA
Public key: EOS5FCRb5XtkMKFTow2dfPQDQ11ZbfYrmhP4rxWPzZn6pzp1nugpz
- Download the Docker image
docker pull eoscostarica506/eos-local
- Run the Docker image
docker run -dp 8888:8888 eoscostarica506/eos-local
- Run the command
cleos get info
or check the link in the browserhttp://127.0.0.1:8888/v1/chain/get_info
If you run the command cleos get info
or go to http://127.0.0.1:8888/v1/chain/get_info
and get information like the following it is because you already have the environment ready to work.
{"server_version":"e57a1eab","chain_id":"981453d176ddca32aa278ff7b8af9bf4632de00ab49db273db03115705d90c5a","head_block_num":66,"last_irreversible_block_num":65,"last_irreversible_block_id":"00000041fcc36403c71cebfc95810f610412b474f60735639fcaa2d241fe5ffa","head_block_id":"00000042a08478812c642d311f5ff22b9212559eeb9ee1042925742d8b46dd7f","head_block_time":"2021-07-08T05:48:45.500","head_block_producer":"eosio","virtual_block_cpu_limit":213407,"virtual_block_net_limit":1118998,"block_cpu_limit":199900,"block_net_limit":1048576,"server_version_string":"v2.0.12","fork_db_head_block_num":66,"fork_db_head_block_id":"00000042a08478812c642d311f5ff22b9212559eeb9ee1042925742d8b46dd7f","server_full_version_string":"v2.0.12-e57a1eab619edffc25afa7eceb05a01ab575c34a"}
Note: As the docker image were pulled from eoscostarica506
, the eosio keys are:
Private key: 5JV5XER5ouVYfghE6AEgDeViqkH4VNAJaxwB6wVe4Mk2JHZywPQ
Public key: EOS5hyZZRePAFyKVTEReHLErXviH6chc3w84pQcwtHnsNJWCWj3Jp
To create the Docker image locally, you must run the following commands:
- Clone the local Eos repository
https://github.com/eoscostarica/eos-local
- Enter to the cloned repository folder
cd <path/eos-local>
- Copy the example env file .env.example with
cp .env.example .env
and fill it with your keys - Build the Dockerfile image with env variables
make build-docker
ordocker build -t eos-local --build-arg testnet_eosio_public_key="<public_key>" --build-arg testnet_eosio_private_key="<private_key>" .
- Run the Dockerfile image
make run
ordocker run -dp 8888:8888 eos-local
- Run the command
cleos get info
or check the link in the browserhttp://127.0.0.1:8888/v1/chain/get_info
By this point, you already have the EOS Mainnet Local Network image running locally.
/
βββ .github
β βββ workflows
β βββ publish-docker-image.yml
βββ docs ..................... Some media content for README
βββ config.ini ............... Nodeos configuration file
βββ Dockerfile ............... Contains instructions for building the EOS Mainnet Local Network image
βββ genesis.json ............. Specifies the network genesis node parameters
βββ LICENSE .................. Terms and Conditions
βββ README.md ................ Repository specification
βββ start.sh ................. Instructions for configuring contracts and usage characteristics
MIT Β© EOS Costa Rica
If you want to contribute to this repository, please follow the steps below:
- Fork the project
- Create a new branch (
git checkout -b feat/sometodo
) - Commit changes (
git commit -m '<type>(<scope>): <subject>'
) - Push the commit (
git push origin feat/sometodo
) - Open a Pull Request
Read the EOS Costa Rica open source contribution guidelines for more information on scheduling conventions.
If you find any bugs, please report them by opening an issue at this link.
EOSIO is a highly performant open-source blockchain platform, built to support and operate safe, compliant, and predictable digital infrastructures.
EOS Costa Rica is an independently-owned, self-funded, bare-metal Genesis block producer that provides stable and secure infrastructure for EOSIO blockchains. We support open source software for our community while offering enterprise solutions and custom smart contract development for our clients.