Libre Local provides a quick way to setup a Local Testnet network for development. The primary benefits of containers are consistency across different environments and deployment ease.
A local environment provides a series of benefits that you cannot in a public network, for example, with Libre Local, transaction costs are avoided since they are carried out in a development environment and not in production, also, they are access 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, for this reason 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 failures that can affects users.
Finally, a factor to consider is the initial reduced time in 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 AntelopeIO image is based on the eosio.system
, eosio.token
and eosio.msig
contracts for its configuration. The 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 AntelopeIO-based blockchains.
- eosio.msig: Allows the creation of proposed transactions that require authorization from a list of accounts.
- Create you
.env
by runningcp .env.example .env
- Start the network with
make pull-docker-images && source run.sh create_wallet && source run.sh genesis && source run.sh start_network bp 3
. This will download the images if you don't have them and start the network - 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 if the information you received is like the following then you are ready to go.
{
"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 it is a quick start, you can use the .env.example
file with the key there provided.
Don't use these keys in production environments, since they are public and it's just to start easily. Also consider that you will need to import your
own keys
to your wallet or the one provided in the.env.example
file.
To create the Docker image locally, you must run the following commands:
- Clone the local Eos repository
https://github.com/edenia/libre-local
- Enter to the cloned repository folder
cd <path/libre-local>
- Create your
.env
filecp .env.example .env
- Run the Dockerfile image
make build-docker-images && source run.sh create_wallet && source run.sh genesis && source run.sh start_network bp 3
, this will use the Dockerfiles to build the images and start the network according to the information in the nodes directory. - Run the command
cleos get info
or check the link in the browserhttp://127.0.0.1:8888/v1/chain/get_info
In this point, you already have the Libre Local Network image running locally.
If you wish to use the Smart Contracts currently running on Libre Mainnet or Libre Testnet, you can use the following command in the root folder of the repository to set them up:
./scripts/contracts.sh
Note: To run a modified version of the contracts, you can update them, get the wasm and put them in the
./wasm
folder with their respective contract name, reset the network and run the previous command.
- Create a working wallet
source run.sh create_wallet
- Create a docker network for the containers
source run.sh create_network
- Unlock the working wallet
source run.sh unlock_wallet
- Start genesis node
source run.sh genesis
- Start peering nodes
source run.sh start_network <bp_label> <total_bps>
source run.sh start_network bp 5
- Setup the network witht the current official Libre Contracts
./scripts/contracts.sh
- Start Hyperion
source run.sh start_api_history
/
.
βββ CODE_OF_CONDUCT.md
βββ CONTRIBUTING.md
βββ LICENSE
βββ README.md
βββ approve.json
βββ makefile
βββ nodes
β βββ bp
β βββ genesis
βββ run.sh
βββ scripts
β βββ contracts.sh
β βββ optional.sh
βββ wasm
βββ dao-contract
βββ inscription-contract
βββ libre-referrals
βββ ordinals-contract
βββ staking-contract
βββ swap-contract
βββ system-contracts
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.
AntelopeIO is a highly performant open-source blockchain platform, built to support and operate safe, compliant, and predictable digital infrastructures.
Edenia runs independent blockchain infrastructure and develops web3 solutions. Our team of technology-agnostic builders has been operating since 1987, leveraging the newest technologies to make the internet safer, more efficient, and more transparent.